| 12
 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
 
 | <?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;
}
}
 
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
 
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO notes (numero_inscription, m_code, controle1, controle2, TD, TP, syntyse, rattrapage) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['numero_inscription'], "text"),
                       GetSQLValueString($_POST['m_code'], "int"),
                       GetSQLValueString($_POST['controle1'], "text"),
                       GetSQLValueString($_POST['controle2'], "text"),
                       GetSQLValueString($_POST['TD'], "text"),
                       GetSQLValueString($_POST['TP'], "text"),
                       GetSQLValueString($_POST['syntyse'], "text"),
                       GetSQLValueString($_POST['rattrapage'], "text"));
 
  mysql_select_db($database_informatique, $informatique);
  $Result1 = mysql_query($insertSQL, $informatique) or die(mysql_error());
 
  $insertGoTo = "../reussite.html";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
 
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);
 
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);
 
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);
 
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);
 
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=utf-8" />
<title>Untitled Document</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" id="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>
<p>
  <?php } else { ?>
</p>
<p> </p>
<h3>Etape 2 :: Saisie des données </h3>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1"id="form1">
  <input name="etape2" type="hidden" value="2" />
  <input name="nb_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>
    </tr>
    <?php for($i=0;$i<$_POST['nombre'];$i++){ ?>
    <tr>
      <td bgcolor="#FFF4EA"><input name="numero_inscription" type="text" id="numero_inscription" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><select name="m_code" id="m_code">
        <?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 name="controle1" type="text" id="controle1" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="controle2" type="text" id="controle2" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="TD" type="text" id="TD" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="TP" type="text" id="TP" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="syntyse" type="text" id="syntyse" value="" size="10" /></td>
      <td bgcolor="#FFF4EA"><input name="rattrapage" type="text" id="rattrapage" value="" size="10" /></td>
    </tr>
    <?php } ?>
  </table>
  <div align="right">
    <input type="hidden" name="MM_insert" value="form1" />
    <input type="submit" name="Submit" value="Insérer" />
  </div>
</form>
<?php } ?>
</body>
</html>
<?php
mysql_free_result($rs_note);
 
mysql_free_result($rs_filiere);
 
mysql_free_result($rs_etudiant);
 
mysql_free_result($rs_inscription);
 
mysql_free_result($rs_module);
?> | 
Partager