rendered paste body<?php
//////////////////////////////////
// Chargements des includes
//////////////////////////////////
//// Parametres de la base
include_once ("../config_db.php");
/// variables
include_once ("../var/var.php");
//// fonction
include_once ("../fonctions.php");
if (isset ($_GET['id'])) {
$client_id = $_GET['id'];
echo $client_id."<br />";
}
if (isset ($_POST['tag'][$j])) {
echo "caca";
//$tag[$j] = $_POST['tag[$j]'];
//echo $tag[1]."<br />";
}
if (isset ($_POST['adr'])) {
$adresse = $_POST['adr'];
echo $adresse."<br />";
if (isset ($_POST['cp'])) {
$codepostal = $_POST['cp'];
echo $codepostal."<br />";
if (isset ($_POST['ville'])) {
$ville = $_POST['ville'];
echo $ville."<br />";
}
if(empty($adresse) OR empty($codepostal) OR empty($ville) )
{
echo '<font color="red">Attention, les champs adresse, code postal et ville doivent être renseignés</font><br />';
}
}
}
if (isset ($_POST['tel_princ'])) {
$telephoneprinc = $_POST['tel_princ'];
echo $telephoneprinc."<br />";
}
if (isset ($_POST['fax'])) {
$fax = $_POST['fax'];
echo $fax."<br />";
}
if (isset ($_POST['tel_cont'])) {
$telephonecont = $_POST['tel_cont'];
echo $telephonecont."<br />";
}
if (isset ($_POST['mail'])) {
$mail = $_POST['mail'];
echo $mail."<br />";
}
mysql_connect($serveur,$loginbase,$loginpwd);
mysql_select_db($base);
$tagocs = gettag();
mysql_close();
$k=1;
/// formatage des donnees
while ( $tagocs[$k] != NULL) {
foreach ($tagocs[$k] as $key => $value) {
//echo $key." - ".$value."<br />";
$tagocs[$k][$key] = $value;
}
$k++;
}
?>
<FORM method=post >
<FIELDSET>
<LEGEND align=top><img src="../images/add.png" border=0> <? echo $titre_form_site ?></LEGEND>
Adresse : <INPUT type="text" name="adr" ><br />
Code Postal : <INPUT type="text" name="cp" ><br />
Ville : <INPUT type="text" name="ville" ><br />
N° Téléphone : <INPUT type="text" name="tel_princ" ><br />
Fax : <INPUT type="text" name="fax" ><br />
N° Téléphone contact : <INPUT type="text" name="tel_cont" ><br />
Email contact : <INPUT type="text" name="mail" ><br />
Tag Ocsinventory : <select multiple="multiple" size="3" name="tableau">
<? for ($j = 1 ; $j < $k ; $j++)
{
echo "<option name='.$tag[$j].'>".$tagocs[$j]['tag']."</option>";
}?>
</select><br />
<input type="submit" value="ajouter" /><br />
</FIELDSET>
</FORM>
<img src="../images/home.png" border=0> <?
echo "<a href='../index.php'>".$retour_index."</a>";
?>