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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
<form name="formu" method="POST" action="selection_intervention.php">
<fieldset>
<legend><h1 align="center" class="Style5">INTERVENTION</h1>
</legend>
<span class="Style4"></span>
<p>
<?php
// on se connecte à MySQL
mysql_connect('localhost', 'Pascal', 'Pascal');
// on sélectionne la base
mysql_select_db('suivi véhicule');
// on crée la requête SQL
$sqldoss ="SELECT COUNT(*)
FROM dossierkilometrage";
// on envoie la requête
$reqdoss = mysql_query($sqldoss) or die('Erreur SQL !<br>'.$sqldoss.'<br>'.mysql_error());
$datadoss=mysql_fetch_row($reqdoss);
$dossier=$datadoss[0]+1;
echo "<strong>Numéro de dossier:</strong> <input type='text' value='$dossier' size=3><br>";
?>
</p>
<p>
<strong>Immatriculation:</strong>
<?php
// on se connecte à MySQL
mysql_connect("localhost","Pascal","Pascal");
// on sélectionne la base
mysql_select_db('suivi véhicule');
// on crée la requête SQL
$sql ="SELECT immatriculation FROM vehicule";
// on envoie la requête
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
echo "<script type='text/javascript'>
function envoi()
{
var entr = document.formu.entreprise.value;
var im = document.formu.immatriculation.value;
var url_dest = 'selection_intervention.php?entre=' + entr + '&imma=' + im;
document.location.href = url_dest;
}
</script>";
echo "<select name='immatriculation' onChange='envoi()'>";
while($data = mysql_fetch_array($req))
{
// on affiche les informations de l'enregistrement en cours
if ($_REQUEST['ima']==$data['immatriculation']) {
echo "ok";
echo "<option selected value='$data[immatriculation]' name='$data[immatriculation]'>".$data['immatriculation']."</option>";
}
else {
echo "<option value='$data[immatriculation]' name='$data[immatriculation]'>".$data['immatriculation']."</option>";
}
}
echo "</select>";
// on ferme la connexion à mysql
mysql_close();
?>
</p>
<?php
if (isset($_REQUEST['mark'])) {
echo "<strong>Marque du véhicule:</strong> <input type='text' value='$_REQUEST[mark]'><br>";
}
?>
</p>
<p>
<p>
<strong>Date début de l'intervention:</strong> <input name="Date debut intervention" type="text" size="8" >
<br /><br />
<strong>Date fin de l'intervention:</strong> <input name="Date fin intervention" type="text" size="8" >
<br /><br />
<label><input name="intervention" type="radio" value="Produit" checked>Produit</label>
<label><input name="intervention" type="radio" value="Travaux" >Travaux</label>
<label><input name="intervention" type="radio" value="Autre" >Autre</label>
<br />
</p>
</fieldset><br />
</p>
<fieldset>
<legend>PRODUITS</legend>
<strong>Références du produit:</strong> <input name="References produit" type="text" size="8" readonly="true">
<br /><br />
<strong>Nom du produit:</strong> <input name="Nom produit" type="text" size="8" readonly="true">
<br /><br />
<strong>Quantité achetée:</strong> <input name="Quantité produit" type="text" size="8" readonly="true">
<br /><br />
<input name="Ajout produit" type="button" value="Ajouter Produit" disabled="true">
</fieldset><br />
<fieldset>
<legend>TRAVAUX</legend>
<strong>Type Travaux:</strong> <select name="Typetravaux">
<option>Réparation</option>
<option>Vidange</option>
<option>Contrôle technique</option>
<option>Révision</option>
</select>
<br /><br />
<strong>Observations:</strong><br />
<textarea name="autre" cols="40" rows="5" disabled="disabled"></textarea>
<br /><br />
<input name="Ajout Travaux" type="button" value="Ajouter Travaux" disabled="true">
</fieldset><br />
<fieldset>
<legend>AUTRE</legend>
<strong>Observations:</strong><br />
<textarea name="autre" cols="40" rows="5" disabled="disabled"></textarea>
</fieldset><br />
</p>
<br />
<fieldset>
<legend>ENTREPRISE</legend>
<p>
<strong>Nom de l'entreprise:</strong>
<?php
// on se connecte à MySQL
mysql_connect("localhost","Pascal","Pascal");
// on sélectionne la base
mysql_select_db('suivi véhicule');
// on crée la requête SQL
$sqlEnt ="SELECT NomEntreprise FROM entreprise";
// on envoie la requête
$reqEnt = mysql_query($sqlEnt) or die('Erreur SQL !<br>'.$sqlEnt.'<br>'.mysql_error());
echo "<select name='entreprise' onChange='envoi()'>";
while($data = mysql_fetch_array($reqEnt))
{
// on affiche les informations de l'enregistrement en cours
if ($_REQUEST['nomEnt']==$data['NomEntreprise']) {
echo "ok";
echo "<option selected value='$data[NomEntreprise]' name='$data[NomEntreprise]'>".$data['NomEntreprise']."</option>";
}
else {
echo "<option value='$data[NomEntreprise]' name='$data[NomEntreprise]'>".$data['NomEntreprise']."</option>";
}
}
echo "</select>";
// on ferme la connexion à mysql
mysql_close();
?>
<?php
if (isset($_REQUEST['ADR'])) {
echo "<br><br>";
echo "Adresse: <input type='text' value='$_REQUEST[ADR]'>";
}
if (isset($_REQUEST['CP'])) {
echo "<br><br>";
echo "Code Postal: <input type='text' value='$_REQUEST[CP]'>";
}
if (isset($_REQUEST['VILLE'])) {
echo "<br><br>";
echo "Ville: <input type='text' value='$_REQUEST[VILLE]'>";
}
if (isset($_REQUEST['TEL'])) {
echo "<br><br>";
echo "Téléphone: <input type='text' value='$_REQUEST[TEL]'>";
}
if (isset($_REQUEST['FAX'])) {
echo "<br><br>";
echo "Fax: <input type='text' value='$_REQUEST[FAX]'>";
}
?>
</p>
<br />
</fieldset>
<p><strong>Montant Intervention</strong>: <input name="Montant intervention" type="text" size="8" readonly="true"> </p>
<p><span><input type="submit" value="OK">
<input type="reset" value="supprimer dossier">
<input type="button" value="Nouveau dossier"></span></p>
<div id="pied-de-page">
<p>Copyright 2005, tous droits réservés</p>
</div>
</form> |
Partager