<?php require_once('../Connections/conn_clients.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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"] == "form2")) {
$insertSQL = sprintf("INSERT INTO contacts (CO_raisonSocial, CO_secteur, CO_abonner, CO_adresse, CO_boitePostale, CO_codePostal, CO_ville, CO_commentaire, CO_nom, CO_prénom, CO_fonction, CO_email, CO_telephoneFixe, CO_telephonePortable, CO_numDebutAbo, CO_numFinAbo, CO_dateDebutAbo, CO_dateFinAbo, CO_telephoneEntreprise, CO_web, CO_civilite) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['raisonSociale'], "text"),
GetSQLValueString($_POST['secteur'], "text"),
GetSQLValueString($_POST['abonner'], "text"),
GetSQLValueString($_POST['adresse'], "text"),
GetSQLValueString($_POST['boitePostale'], "text"),
GetSQLValueString($_POST['codePostal'], "text"),
GetSQLValueString($_POST['ville'], "text"),
GetSQLValueString($_POST['commentaire'], "text"),
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['prenom'], "text"),
GetSQLValueString($_POST['fonction'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['telephoneFixe'], "text"),
GetSQLValueString($_POST['telephonePortable'], "text"),
GetSQLValueString($_POST['numDebutAbo'], "int"),
GetSQLValueString($_POST['numFinAbo'], "int"),
GetSQLValueString($_POST['dateDebutAbo'], "date"),
GetSQLValueString($_POST['numFinAbo'], "date"),
GetSQLValueString($_POST['telephoneEntreprise'], "text"),
GetSQLValueString($_POST['web'], "text"),
GetSQLValueString($_POST['civilite'], "text"));
mysql_select_db($database_conn_clients, $conn_clients);
$Result1 = mysql_query($insertSQL, $conn_clients) or die(mysql_error());
$insertGoTo = "operationReussie.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$colname_rsEntrepriseConnue2 = "0";
if (isset($_GET['entreprise'])) {
$colname_rsEntrepriseConnue2 = (get_magic_quotes_gpc()) ? $_GET['entreprise'] : addslashes($_GET['entreprise']);
}
mysql_select_db($database_conn_clients, $conn_clients);
$query_rsEntrepriseConnue2 = sprintf("SELECT * FROM contacts WHERE contacts.CO_raisonSocial=%s", $colname_rsEntrepriseConnue2);
$rsEntrepriseConnue2 = mysql_query($query_rsEntrepriseConnue2, $conn_clients) or die(mysql_error());
$row_rsEntrepriseConnue2 = mysql_fetch_assoc($rsEntrepriseConnue2);
$totalRows_rsEntrepriseConnue2 = mysql_num_rows($rsEntrepriseConnue2);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/ModeleDeBase+logout.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Document sans titre</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<link href="../CSS/policetitre.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Style1 {color: #FFFFFF}
-->
</style>
<style type="text/css">
<!--
.Style2 {color: #000000}
-->
</style>
<!-- InstanceEndEditable -->
<link href="feuille_css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="bordure1">
<th width="16%" height="102" bordercolor="#FF6600" scope="col"><img src="../Images/arobase.bmp" class="Style1"></th>
<!-- InstanceBeginEditable name="EditRegion2" -->
<th width="84%" bordercolor="#FF6600" bgcolor="#CCCCCC" class="policetitre" scope="col">Formulaire de saisie </th>
<!-- InstanceEndEditable --></tr>
<tr class="bordure1">
<td bordercolor="#FF6600" bgcolor="#CCCCCC"><em><!-- InstanceBeginEditable name="EditRegion3" --> <!-- InstanceEndEditable --></em>
<form name="form1" method="post" action="../accueil.php">
<div align="center">
<input type="submit" name="Submit" value="Logout">
</div>
</form></td>
<td align="center" bordercolor="#FF6600" bgcolor="#DDDDDD"><!-- InstanceBeginEditable name="EditRegion1" -->
<form action="operationReussie.php" method="get" name="entreprise" id="entreprise">
<p> </p>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#333333">
<th colspan="2" scope="col"><div align="center" class="Style1">Entreprise</div> </th>
</tr>
<tr bgcolor="#FFFFFF">
<td width="50%"><div align="left" class="Style2">Raison sociale </div></td>
<td width="50%"><div align="left" class="Style2">
<input name="raisonSociale" type="text" id="raisonSociale" value="
<?php echo $row_rsEntrepriseConnue2['CO_raisonSocial']; ?>"readonly>
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Adresse</div></td>
<td><div align="left">
<input name="adresse" type="text"readonly id="adresse" value="
<?php echo $row_rsEntrepriseConnue2['CO_adresse']; ?>">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Boite postale </div></td>
<td><div align="left">
<input name="boitePostale" type="text"readonly id="boitePostale" value="
<?php echo $row_rsEntrepriseConnue2['CO_boitePostale']; ?>">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Code Postal </div></td>
<td><div align="left">
<input name="codePostal" type="text"readonly id="codePostal" value="
<?php echo $row_rsEntrepriseConnue2['CO_codePostal']; ?>">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Ville</div></td>
<td><div align="left">
<input name="ville" type="text"readonly id="ville" value="
<?php echo $row_rsEntrepriseConnue2['CO_ville']; ?>">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Secteur</div></td>
<td><div align="left">
<input name="secteur" type="text"readonly id="secteur" value="
<?php echo $row_rsEntrepriseConnue2['CO_secteur']; ?>">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Abonner</div></td>
<td><div align="left">
<input name="abonner" type="text"readonly id="abonner" value="
<?php echo $row_rsEntrepriseConnue2['CO_abonner']; ?>">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Adresse web</div></td>
<td><div align="left">
<input name="web" type="text"readonly id="web" value="
<?php echo $row_rsEntrepriseConnue2['CO_web']; ?>">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Téléphone</div></td>
<td><div align="left">
<input name="telephoneEntreprise" type="text"readonly id="telephoneEntreprise" value="
<?php echo $row_rsEntrepriseConnue2['CO_telephoneEntreprise']; ?>">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Commentaire</div></td>
<td><div align="left">
<input name="commentaire" type="text"readonly id="commentaire" value="
<?php echo $row_rsEntrepriseConnue2['CO_commentaire']; ?>">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Numéro de lettre du début d'abonnement </div></td>
<td><div align="left">
<input name="numDebutAbo" type="text"readonly id="numDebutAbo" value="
<?php echo $row_rsEntrepriseConnue2['CO_numDebutAbo']; ?>">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Numéro de lettre de fin d'abonnement</div></td>
<td><div align="left">
<input name="numFinAbo" type="text"readonly id="numFinAbo" value="
<?php echo $row_rsEntrepriseConnue2['CO_numFinAbo']; ?>">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Date de début d'abonnement </div></td>
<td><div align="left">
<input name="dateDebutAbo" type="text"readonly id="dateDebutAbo" value="
<?php echo $row_rsEntrepriseConnue2['CO_dateDebutAbo']; ?>">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Date de fin d'abonnement </div></td>
<td><div align="left">
<input name="dateFinAbo" type="text"readonly id="dateFinAbo" value="
<?php echo $row_rsEntrepriseConnue2['CO_dateFinAbo']; ?>">
</div></td>
</tr>
<tr bgcolor="#DDDDDD">
<th height="38" scope="col"><div align="center" class="Style1">
</div></th>
<th scope="col"><span class="Style1"></span></th>
</tr>
<tr bgcolor="#333333">
<th colspan="2" bgcolor="#000000"><div align="left" class="Style1">
<div align="center">Contact</div>
</div></th>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Civilté</div></td>
<td><div align="left">
<select name="civilite" id="civilite">
<option value="monsieur">Mr</option>
<option value="madame">Mme</option>
<option value="mademoiselle">Mlle</option>
</select>
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Nom</div></td>
<td><div align="left">
<input name="nom" type="text" id="nom3" size="40">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Prénom</div></td>
<td><div align="left">
<input name="prenom" type="text" id="prénom3" size="40">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Fonction</div></td>
<td><div align="left">
<input name="fonction" type="text" id="fonction3" size="40">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Email</div></td>
<td><div align="left">
<input name="email" type="text" id="email3" size="40">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td><div align="left">Téléphone portable </div></td>
<td><div align="left">
<input name="telephonePortable" type="text" id="telephonePortable3">
</div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td><div align="left">Téléphone Fixe </div></td>
<td>
<div align="left">
<input name="telephoneFixe" type="text" id="telephoneFixe3">
</div></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><div align="center">
<input name="valider" type="submit" id="valider" value="Valider">
</div></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form2">
</form>
<h3 align="left"><em></em></h3>
<!-- InstanceEndEditable --></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($rsEntrepriseConnue2);
?>
Partager