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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<?php
//CONNEXION A LA BASE DE DONNEES
$connexion=mysql_connect('localhost','root','');
mysql_select_db('keinfor');
if ($connexion == false)
{
echo "<b>Echec de connexion</b><br>";
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" type="text/css" title="format" href="styles/format.css" />
</head>
<script language="JavaScript">
function reload_form(theForm)
{
theForm.submit()
}
}
</script>
<body class="page">
<h1 align="center"><img src="images/logo.gif" width="200" height="70"></h1>
<h2 align="center"><i><b> Gestion du parc informatique de Kea & Partners </i></b></h2>
<hr>
<br />
<A HREF="index.html"> Acceuil </A> >
<br />
<div style="width:650px;margin-left:250px;">
<fieldset>
<legend><b>INstallation d'une licence sur un PC</b></legend> <!-- Titre du fieldset -->
<!--=Insertion des données pour traitement-->
<form name="ajout" enctype="multipart/form-data" action="instalic.php" method="post">
<table class="nonTableau">
<tr>
<td class="field">Choisir une licence</td>
<td class="value"><SELECT name="id_lic" size="1" onChange="javascript:reload_form(this.form)">
<option value="-1" selected="selected">Choisissez une licence</option>
<?
$requeteSelect="SELECT id_lic,nbr_valid_lic, nom_lic FROM licence;";
$requete=mysql_query($requeteSelect);
While($var=mysql_fetch_assoc($requete))
{
$clef=$var["id_lic"];
$nom=$var["nom_lic"];
$valid_lic=$var["nbr_valid_lic"];
If (isset($_POST['id_lic']))
{
if ($clef == $_POST['id_lic'])
{
Echo "<option value='".$clef."' selected='selected'>".$nom." -----> (Reste".$valid_lic." Licences)</option>";
}
Else
{
Echo "<option value='".$clef."'>".$nom." -----> (Reste".$valid_lic." Licences)</option>";
}
}
else
{
Echo "<option value='".$clef."'>".$nom." -----> (Reste".$valid_lic." Licences)</option>";
}
}
?>
</SELECT></td>
</tr>
<tr>
<td class="field">Choisir le PC</td>
<td class="value"><SELECT name="mat_ord" size="1" onChange="javascript:reload_form(this.ajout)">
<option value="-1" selected="selected">Choisissez le pc</option>
<?
$SQL = "SELECT mat_ord
FROM ordinateur
WHERE mat_ord NOT IN (SELECT mat_ord FROM instal_lic WHERE id_lic = ".$_POST['id_lic'].") AND etat_ord NOT LIKE 'HS'";
echo $SQL;
$res = mysql_query($SQL);
while($val=mysql_fetch_array($res))
{
echo '<option>'.$val['mat_ord'].'</option>';
}
?>
</SELECT></td>
</tr>
</TABLE>
<h5 align="center">
* Champs obligatoires
</h5>
<br>
<h3 align="center">
<a href="validinstallic.php">Valider</a>
</form>
</fieldset>
</div>
<!--=envoi des données vers ajoutord.php-->
</body>
</html> |