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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
|
<?php
session_start(); // En premier dans la page
//valeurs champs premier formulaire = inscription2.php
if (isset($_POST['labs'])) {
$_SESSION['forma']['labs'] = $_POST['labs'];}
if (isset($_POST['company'])) {
$_SESSION['forma']['company'] = $_POST['company'];}
if (isset($_POST['adress'])) {
$_SESSION['forma']['adress'] = $_POST['adress'];}
if (isset($_POST['bat'])) {
$_SESSION['forma']['bat'] = $_POST['bat'];}
if (isset($_POST['code_postal'])) {
$_SESSION['forma']['code_postal'] = $_POST['code_postal'];}
if (isset($_POST['ville'])) {
$_SESSION['forma']['ville'] = $_POST['ville'];}
if (isset($_POST['pays'])) {
$_SESSION['forma']['pays'] = $_POST['pays'];}
if (isset($_POST['tel'])) {
$_SESSION['forma']['tel'] = $_POST['tel'];}
if (isset($_POST['fax'])) {
$_SESSION['forma']['fax'] = $_POST['fax'];}
//valeurs champs formulaire facturation = inscriptionFacturation.php
if (isset($_POST['labsf'])) {
$_SESSION['forma']['labsf'] = $_POST['labsf'];}
if (isset($_POST['companyf'])) {
$_SESSION['forma']['companyf'] = $_POST['companyf'];}
if (isset($_POST['adressf'])) {
$_SESSION['forma']['adressf'] = $_POST['adressf'];}
if (isset($_POST['batf'])) {
$_SESSION['forma']['batf'] = $_POST['batf'];}
if (isset($_POST['code_postalf'])) {
$_SESSION['forma']['code_postalf'] = $_POST['code_postalf'];}
if (isset($_POST['villef'])) {
$_SESSION['forma']['villef'] = $_POST['villef'];}
if (isset($_POST['paysf'])) {
$_SESSION['forma']['paysf'] = $_POST['paysf'];}
if (isset($_POST['telf'])) {
$_SESSION['forma']['telf'] = $_POST['telf'];}
if (isset($_POST['faxf'])) {
$_SESSION['forma']['faxf'] = $_POST['faxf'];}
// on initialise le tableau des erreurs
$erreurs= array(
"labsf" => array("msg" => ""),
"companyf" => array("msg" => ""),
"adressf" => array("msg" => ""),
"batf" => array("msg" => ""),
"code_postalf" => array("msg" => ""),
"villef" => array("msg" => ""),
"paysf" => array("msg" => ""),
"telf" => array("msg" => ""),
"faxf" => array("msg" => ""),
);
$error_exist= false;
$erreur2= "";
$labsf= (isset($_POST['labsf'])) ?($_POST['labsf']) :("");
$companyf= (isset($_POST['companyf'])) ?($_POST['companyf']) :("");
$adressf= (isset($_POST['adressf'])) ?($_POST['adressf']) :("");
$batf= (isset($_POST['batf'])) ?($_POST['batf']) :("");
$code_postalf= (isset($_POST['code_postalf'])) ?($_POST['code_postalf']) :("");
$villef= (isset($_POST['villef'])) ?($_POST['villef']) :("");
$paysf= (isset($_POST['paysf'])) ?($_POST['paysf']) :("");
$telf= (isset($_POST['telf'])) ?($_POST['telf']) :("");
$faxf= (isset($_POST['faxf'])) ?($_POST['faxf']) :("");
// on teste si le visiteur a soumis le formulaire
if(isset($_POST['inscription'])) {
//si tous les champs sont vides(verif avec empty), erreur2 = tous les champs sont requis
if(empty($labsf) || empty($companyf) || empty($adressf) || empty($batf) || empty($code_postalf) || empty($villef) || empty($paysf) || empty($telf) || empty($faxf)) {
$erreur2 = "All fields are requested !";
$error_exist= true;
}
// test sur laboratoire
$labsf_ko= (strlen($labsf) < 2);
if($labsf_ko) {
$erreurs["labs"]["msg"].="Fill the field labsf !<br/>";
$error_exist= true;
}
// test sur company
$companyf_ko= (strlen($companyf) < 2);
if($companyf_ko) {
$erreurs["company"]["msg"].="Fill the field company !<br/>";
$error_exist= true;
}
// test sur adress
$adressf_ko= (strlen($adressf) < 2);
if($adressf_ko) {
$erreurs["adress"]["msg"].="Fill the field adress !<br/>";
$error_exist= true;
}
// test sur bat
$batf_ko= (strlen($batf) < 2);
if($batf_ko) {
$erreurs["bat"]["msg"].="Fill the field building !<br/>";
$error_exist= true;
}
// test sur code postal
$code_postalf_ko= (strlen($code_postalf) < 2);
if($code_postalf_ko) {
$erreurs["code_postal"]["msg"].="Fill the field postal code !<br/>";
$error_exist= true;
}
// test sur city
$villef_ko= (strlen($villef) < 2);
if($villef_ko) {
$erreurs["ville"]["msg"].="Fill the field city !<br/>";
$error_exist= true;
}
// test sur country
$paysf_ko= (strlen($paysf) < 2);
if($paysf_ko) {
$erreurs["pays"]["msg"].="Fill the field country !<br/>";
$error_exist= true;
}
// test sur tel
if(!is_numeric($telf)) {
$erreurs["tel"]["msg"].= "This fiels must contain only figures !<br/>";
}
// test sur fax
if(!is_numeric($faxf)) {
$erreurs["fax"]["msg"].= "This fiels must contain only figures !<br/>";
}
if(!$error_exist) {
// et on commence la session qui s'appelle email
$_SESSION['email'] = $email;
header('Location: inscriptionLivraison.php');
exit();
}
else {
$erreur2 = 'One of the fields is empty !';
}
}
// Rajouter condition si case cochée "un autre compte pour acheter"
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//FR" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
</head>
<body>
<div id="contour_formulaire">
<form action="inscriptionFacturation.php" method="POST">
<fieldset style="border-color:#73aad2;border-size:2px;" width="625">
<legend class="titre_labelaut"> Four steps and few clicks...<span class="Style4"></span></legend>
<img src="images/Ronds3.jpg" alt="" width="250" height="60" align="right" class="AlignementPointFormul"/>
<p class="TitreFormulaire1">Billing adress #1<br/>
<span class="ClickHere">Does my billing adress different from this one ?</span> <br/>
</p>
<table width="628" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td width="108"><label for="labsf" class="TexteLogin">Dept/Labs : </label></td>
<td width="263"><input name="labsf" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['labs'])) echo htmlentities(trim($_SESSION['forma']['labs'])); ?>"/>
<span class="TexteCheck">*</span></td>
<td width="257" colspan="3" class="error2"> <?php echo $erreurs["labs"]["msg"]; ?> </td>
</tr>
<tr>
<td width="108"><label for="companyf" class="TexteLogin">Company : </label></td>
<td width="263"><input name="companyf" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['company'])) echo htmlentities(trim($_SESSION['forma']['company'])); ?>"/>
<span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["company"]["msg"]; ?></td>
</tr>
<tr>
<td width="108"><label for="adressf" class="TexteLogin">Adress : </label></td>
<td><input name="adressf" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['adress'])) echo htmlentities(trim($_SESSION['forma']['adress'])); ?>"/>
<span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["adress"]["msg"]; ?> </td>
</tr>
<tr>
<td width="108"><label for="batf" class="TexteLogin">Building : </label></td>
<td width="263"><input name="batf" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['bat'])) echo htmlentities(trim($_SESSION['forma']['bat'])); ?>"/>
<span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["bat"]["msg"]; ?> </td>
</tr>
<tr>
<td width="108"><label for="code_postalf" class="TexteLogin">Postal code : </label></td>
<td width="263"><input name="code_postalf" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['code_postal'])) echo htmlentities(trim($_SESSION['forma']['code_postal'])); ?>"/><span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["code_postal"]["msg"]; ?> </td>
</tr>
<tr>
<td width="108"><label for="villef" class="TexteLogin">City : </label></td>
<td width="263"><input name="villef" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['ville'])) echo htmlentities(trim($_SESSION['forma']['ville'])); ?>"/>
<span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["ville"]["msg"]; ?> </td>
</tr>
<tr>
<td width="108"><label for="paysf" class="TexteLogin">Country : </label></td>
<td width="263">
<select class="loginRemplissage" style="width:130px;" name="paysf" id="paysf" size="1">
<option value="Algeria"<?php if($_SESSION['forma']['pays'] == 'Algeria') echo "selected"; ?>>Algeria</option>
<option value="Argentina"<?php if($_SESSION['forma']['pays'] == 'Argentina') echo "selected" ; ?>>Argentina</option>
<option value="Australia"<?php if($_SESSION['forma']['pays'] == 'Australia') echo "selected" ; ?>>Australia</option>
<option value="Austria"<?php if($_SESSION['forma']['pays'] == 'Austria') echo "selected" ; ?>>Austria</option>
</select>
<span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["pays"]["msg"]; ?> </td>
</tr>
<tr>
<td width="108"><label for="tel" class="TexteLogin">Tel : </label></td>
<td width="263"><input name="company" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['company'])) echo htmlentities(trim($_SESSION['forma']['company'])); ?>"/>
<span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["tel"]["msg"]; ?> </td>
</tr>
<tr>
<td width="108"><label for="fax" class="TexteLogin">Fax : </label></td>
<td width="263"><input name="company" type="text" class="loginRemplissage" SIZE="30" value="<?php if (!empty($_SESSION['forma']['company'])) echo htmlentities(trim($_SESSION['forma']['company'])); ?>"/>
<span class="TexteCheck">*</span></td>
<td colspan="3" class="error2"> <?php echo $erreurs["fax"]["msg"]; ?> </td>
</tr>
<tr>
<td> </td>
<td colspan="7" class="TexteErreur"><?php if (isset($erreur2)) echo '<br />',$erreur2; ?></td>
</tr>
<tr>
<td> </td>
<td colspan="7" class="texteCheckBoxT" valign="top"><input type="checkbox" name="OtherAccount" />
I have other accounts from wich I can buy. </td>
</tr>
<tr>
<td> </td>
<td colspan="7" class="TexteCheck"> </td>
</tr>
<tr>
<td> </td>
<td colspan="7" class="TexteCheck">* Must be mandatory filled </td>
</tr>
<tr>
<td> </td>
<td colspan="7" class="TexteCheck"> </td>
</tr>
<tr>
<td colspan="8"><tr>
<td height="28" colspan="2"><table width="297" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80" class="loginRemplissage2"><div align="center"><strong><img src="images/Fleche.jpg" alt="" width="16" height="16" align="left" class="AlignementFleche5"/><a href="inscription1.php" class="loginRemplissage2Copie">Account</a></strong></div></td>
<td width="80" class="loginRemplissage2"><div align="center"><strong><img src="images/Fleche.jpg" alt="" width="16" height="16" align="left" class="AlignementFleche5"/><a href="inscription2.php" class="loginRemplissage2Copie">Account</a></strong> 2 </div></td>
<td width="116" class="loginRemplissage2"><div align="center"><strong><img src="images/Fleche.jpg" alt="" width="16" height="16" align="left" class="AlignementFleche5"/><a href="InterfineChemicals.php" class="loginRemplissage2Copie">Field of interest </a></strong> </div></td>
<td> </td>
</tr>
</table></td>
<td width="257"></td>
<td width="4"> </td>
<td width="4"> </td>
<td width="4"> </td>
<td width="14"> </td>
<td width="82"><input type="submit" name="inscription" class="AlignementNext" value=""/></td>
</tr></td>
</tr>
<tr>
<td colspan="8"> </td>
</tr>
</table>
</fieldset>
</form><br/>
</div>
</body>
</html> |
Partager