1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
| <?php require_once('../../Connections/informatique.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
require_once('../../Connections/informatique.php');
if(isset($_POST['etape']) and $_POST['etape'] == 2){
for($i=0;$i<$_POST['liste_etudiant'];$i++){
$numero_inscription = $_POST['numero_inscription:'.$i];
$m_code = $_POST['m_code:'.$i];
$controle1 = $_POST['controle1:'.$i];
$controle2 = $_POST['controle2:'.$i];
$TD = $_POST['TD:'.$i];
$TP = $_POST['TP:'.$i];
$syntyse = $_POST['syntyse:'.$i];
$rattrapage = $_POST['rattrapage:'.$i];
$rapport = $_POST['rapport:'.$i];
$insertSQL = sprintf("INSERT INTO notes (numero_inscription, m_code, controle1, controle2, TD, TP, syntyse, rattrapage) VALUES ('%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s');",
$numero_inscription,
$m_code,
$controle1,
$controle2,
$TD,
$TP,
$syntyse,
$rattrapage);
mysql_select_db($database_informatique, $informatique);
$Result1 = mysql_query($insertSQL, $informatique) or die(mysql_error());
}
header('Location: ../reussite.html');
}
mysql_select_db($database_informatique, $informatique);
$query_rs_note = "SELECT * FROM notes";
$rs_note = mysql_query($query_rs_note, $informatique) or die(mysql_error());
$row_rs_note = mysql_fetch_assoc($rs_note);
$totalRows_rs_note = mysql_num_rows($rs_note);
?>
<?php
mysql_select_db($database_informatique, $informatique);
$query_rs_filiere = "SELECT * FROM filier";
$rs_filiere = mysql_query($query_rs_filiere, $informatique) or die(mysql_error());
$row_rs_filiere = mysql_fetch_assoc($rs_filiere);
$totalRows_rs_filiere = mysql_num_rows($rs_filiere);
?>
<?php
mysql_select_db($database_informatique, $informatique);
$query_rs_etudiant = "SELECT * FROM etudient";
$rs_etudiant = mysql_query($query_rs_etudiant, $informatique) or die(mysql_error());
$row_rs_etudiant = mysql_fetch_assoc($rs_etudiant);
$totalRows_rs_etudiant = mysql_num_rows($rs_etudiant);
?>
<?php
mysql_select_db($database_informatique, $informatique);
$query_rs_inscription = "SELECT * FROM inscription";
$rs_inscription = mysql_query($query_rs_inscription, $informatique) or die(mysql_error());
$row_rs_inscription = mysql_fetch_assoc($rs_inscription);
$totalRows_rs_inscription = mysql_num_rows($rs_inscription);
?>
<?php
mysql_select_db($database_informatique, $informatique);
$query_rs_module = "SELECT * FROM `module`";
$rs_module = mysql_query($query_rs_module, $informatique) or die(mysql_error());
$row_rs_module = mysql_fetch_assoc($rs_module);
$totalRows_rs_module = mysql_num_rows($rs_module);
?>
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<style type="text/css">
<!--
.Style5 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
-->
</style>
</head>
<body>
<?php if(!isset($_POST['etape'])) { ?>
<h3>Etape 1 :: Nombre des étudiant </h3>
<form action="" method="post" name="etudiant">
<input name="etape" type="hidden" value="1" />
<table width="407" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td width="199">Entrer le nombre des etudiant </td>
<td width="201"><input name="nombre" type="text" size="10" />
</td>
</tr>
<tr>
<td> </td>
<td><input name="suivant" type="submit" value="Suivant" /> </td>
</tr>
</table>
</form>
<?php } else { ?>
<h3>Etape 2 :: Saisie des données </h3>
<form action="" method="post" name="etudiant">
<input name="etape" type="hidden" value="2" />
<input name="liste_etudiant" type="hidden" value="<?php echo $_POST['nombre']; ?>" />
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="14%" bgcolor="#FFAD5B"><span class="Style5">Numero d'inscription</span></td>
<td width="10%" bgcolor="#FFAD5B"><span class="Style5">Nom de module</span></td>
<td width="11%" bgcolor="#FFAD5B"><span class="Style5">Controle1</span></td>
<td width="12%" bgcolor="#FFAD5B"><span class="Style5">Controle2</span></td>
<td width="10%" bgcolor="#FFAD5B"><span class="Style5">TD</span></td>
<td width="10%" bgcolor="#FFAD5B"><span class="Style5">TP</span></td>
<td width="12%" bgcolor="#FFAD5B"><span class="Style5">Syntyse</span></td>
<td width="11%" bgcolor="#FFAD5B"><span class="Style5">Rattrapage</span></td>
<td width="10%" bgcolor="#FFAD5B"><span class="Style5">Rapport</span></td>
</tr>
<?php for($i=0;$i<$_POST['count(rs_new)'];$i++){ ?>
<tr>
<td bgcolor="#FFF4EA"><input type="text" name="numero_inscription:<?php echo $i; ?>" value="" size="10" /></td>
<td bgcolor="#FFF4EA"><select name="m_code:<?php echo $i; ?>">
<?php
do {
?><option value="<?php echo $row_rs_module['m_code']?>"><?php echo $row_rs_module['m_nom']?></option>
<?php
} while ($row_rs_module = mysql_fetch_assoc($rs_module));
$rows = mysql_num_rows($rs_module);
if($rows > 0) {
mysql_data_seek($rs_module, 0);
$row_rs_module = mysql_fetch_assoc($rs_module);
}
?>
</select></td>
<td bgcolor="#FFF4EA"><input type="text" name="controle1:<?php echo $i; ?>" value="" size="10" /></td>
<td bgcolor="#FFF4EA"><input type="text" name="controle2:<?php echo $i; ?>" value="" size="10" /></td>
<td bgcolor="#FFF4EA"><input type="text" name="TD:<?php echo $i; ?>" value="" size="10" /></td>
<td bgcolor="#FFF4EA"><input type="text" name="TP:<?php echo $i; ?>" value="" size="10" /></td>
<td bgcolor="#FFF4EA"><input type="text" name="syntyse:<?php echo $i; ?>" value="" size="10" /></td>
<td bgcolor="#FFF4EA"><input type="text" name="rattrapage:<?php echo $i; ?>" value="" size="10" /></td>
<td bgcolor="#FFF4EA"><input type="text" name="rapport:<?php echo $i; ?>" value="" size="10" /></td>
</tr>
<?php } ?>
</table>
<div align="right">
<input type="submit" name="Submit" value="Insérer" />
</div>
</form>
<?php } ?>
</body>
</html>
<?php
mysql_free_result($rs_module);
mysql_free_result($rs_note);
mysql_free_result($rs_filiere);
mysql_free_result($rs_etudiant);
mysql_free_result($rs_inscription);
?> |
Partager