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
| <?php session_start();
mysql_connect("localhost","root","");
mysql_select_db("art-mania");
?>
<!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>ajout matière premièreq</title>
</head>
//variable session
<?
for ($i=1;$i++;$i<12){
@$vcode_mat= $_REQUEST['mat_pre'.$i];
@$vcode_typ_mat= $_REQUEST['code_typ_mat'.$i];
}
?>
<body>
<table width="700" border="1"><!--table matières premières -->
<tr>
<td width="192"><div align="center">Matière première </div></td>
<td width="192"><div align="center">DéSIGNATION</div></td>
<td width="144"><div align="center">QTE</div></td>
<td width="144"><div align="center">couleur</div></td>
</tr>
<tr>
//liste matiere premiere1
<td><select name='mat_pre1' onchange="form1.submit()">
<option >----------------</option>
<?
$req = mysql_query("SELECT * FROM matiere_premiere where des_mat_pre!='tissus' ORDER BY des_mat_pre;");
while($res = mysql_fetch_array($req)){
if (@$vcode_mat == $req[0])
$selected = "selected";
else
$selected = "";?>
<option value= "<?= $res[0] ?>" <?=$selected?> ><?php print ("$res[1]");?> </option>
<?php
}
?>
</select></td>
//type matière première
<td height="23"><select name='code_typ_mat1' onChange="form1.submit()">
<option >Choisir une matière première</option>
<?php
$req = mysql_query("SELECT * FROM type_matiere_premiere where code_mat_pre =$vcode_mat ");
while($res = mysql_fetch_array($req)){
if (@$vcode_typ_mat == $res[3])
$selected = "selected";
else
$selected = "";?>
<option value= <?= $res[3] ?> <?=$selected?> ><?php print ("$res[4]");?> </option>
<?php
}
?>
</select></td>
//insèrer quantité
<td><input type="text" name="qte_mat_pre5" id="qte_mat_pre5"/></td>
//insérer coleur
<td><input type="text" name="couleur" id="couleur"/></td>
</tr>
<tr>
<td><select name='mat_pre2' onchange="form1.submit()">
<option >----------------</option>
<?
$req = mysql_query("SELECT * FROM matiere_premiere where des_mat_pre!='tissus' ORDER BY des_mat_pre;");
while($res = mysql_fetch_array($req)){
if (@$vcode_mat == $req[0])
$selected = "selected";
else
$selected = "";?>
<option value= "<?= $res[0] ?>" <?=$selected?> ><?php print ("$res[1]");?> </option>
<?php
}
?>
</select></td>
<td><select name='code_typ_mat2' onchange="form1.submit()">
<option >Choisir une matière première</option>
<?php
$req = mysql_query("SELECT * FROM type_matiere_premiere where code_mat_pre =$vcode_mat ");
while($res = mysql_fetch_array($req)){
if (@$vcode_typ_mat == $res[3])
$selected = "selected";
else
$selected = "";?>
<option value= "<?= $res[3] ?>" <?=$selected?> ><?php print ("$res[4]");?> </option>
<?php
}
?>
</select></td>
<td><input type="text" name="qte_mat_pre6" id="qte_mat_pre6"/></td>
<td><input type="text" name="couleur2" id="couleur2"/></td>
</tr>
<tr>
<td><select name='mat_pre3' onchange="form1.submit()">
<option >----------------</option>
<?
$req = mysql_query("SELECT * FROM matiere_premiere where des_mat_pre!='tissus' ORDER BY des_mat_pre;");
while($res = mysql_fetch_array($req)){
if (@$vcode_mat == $req[0])
$selected = "selected";
else
$selected = "";?>
<option value= "<?= $res[0] ?>" <?=$selected?> ><?php print ("$res[1]");?> </option>
<?php
}
?>
</select></td>
<td><select name='code_typ_mat3' onchange="form1.submit()">
<option >Choisir une matière première</option>
<?php
$req = mysql_query("SELECT * FROM type_matiere_premiere where code_mat_pre =$vcode_mat ");
while($res = mysql_fetch_array($req)){
if (@$vcode_typ_mat == $res[3])
$selected = "selected";
else
$selected = "";?>
<option value= "<?= $res[3] ?>" <?=$selected?> ><?php print ("$res[4]");?> </option>
<?php
}
?>
</select></td>
<td><input type="text" name="qte_mat_pre7" id="qte_mat_pre7"/></td>
<td><input type="text" name="couleur3" id="couleur3"/></td>
</tr>
... |
Partager