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 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336
| <? include("config.php");
require_once ('includes/config.inc');
$titre_page = "Demande de tarifs";
if (isset($_POST['submit']))
{
require_once ('../mysql_connect.php');
// verifier le nom
if (eregi ("^[[:alpha:].'-]{2,30}$",
stripslashes(trim($_POST['nom']))))
{
$no = echappement($_POST['nom']);
}
else
{
$no = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez votre nom </font></p>";
}
// verifier le prénom
if (eregi ("^[[:alpha:].'-]{2,30}$",
stripslashes(trim($_POST['prenom']))))
{
$pr = echappement($_POST['prenom']);
}
else
{
$pr = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez votre prénom </font></p>";
}
// verifier la société
if (eregi ("^[[:alnum:]_]{2,50}$",
stripslashes(trim($_POST['societe']))))
{
$soc = echappement($_POST['societe']);
}
else
{
$soc = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez le nom de votre société </font></p>";
}
// verifier l'activité
if (eregi ("^[[:alpha:].'-]{2,50}$",
stripslashes(trim($_POST['activite']))))
{
$act = echappement($_POST['activite']);
}
else
{
$act = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez l'activité de votre société </font></p>";
}
// verifier le code APE
if (eregi ("^[[:alnum:]_]{3,8}$",
stripslashes(trim($_POST['code_ape']))))
{
$ape = echappement($_POST['code_ape']);
}
else
{
$ape = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez le code APE de votre activité </font></p>";
}
// verifier l'adresse
if (eregi ("^[[:alnum:]_]{2,200}$",
stripslashes(trim($_POST['adresse']))))
{
$adr = echappement($_POST['adresse']);
}
else
{
$adr = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez l'adresse de votre société </font></p>";
}
// verifier le code postal
if (eregi ("^[[:digit:]]{5}$",
stripslashes(trim($_POST['code_postal']))))
{
$cp = echappement($_POST['code_postal']);
}
else
{
$cp = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez le code postal de la ville </font></p>";
}
// verifier la ville
if (eregi ("^[[:alpha:].'-]{2,50}$",
stripslashes(trim($_POST['ville']))))
{
$vil = echappement($_POST['ville']);
}
else
{
$vil = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez la ville de votre société </font></p>";
}
// verifier le numéro de téléphone
if (eregi ("^[[:digit:]]{10,15}$",
stripslashes(trim($_POST['telephone']))))
{
$te = echappement($_POST['telephone']);
}
else
{
$te = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez votre numéro de téléphone dans la société </font></p>";
}
// verifier le numéro de fax
if (eregi ("^[[:digit:]]{10,15}$",
stripslashes(trim($_POST['fax']))))
{
$fa = echappement($_POST['fax']);
}
else
{
$fa = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez le numéro de fax de la société </font></p>";
}
// verifier le mail
if (eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,50}$",
stripslashes(trim($_POST['email']))))
{
$em = echappement($_POST['email']);
}
else
{
$em = FALSE;
echo "<p><font color='red' size='+1'>
Votre email est incorrect </font></p>";
}
// verifier le site
if (eregi ("^[[:alnum:]_][\+?{}.]{2,200}$",
stripslashes(trim($_POST['site']))))
{
$url = echappement($_POST['site']);
}
else
{
$url = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez le site de votre société </font></p>";
}
// verifier le numéro SIREN
if (eregi ("^[[:digit:]]{9}$",
stripslashes(trim($_POST['num_siren']))))
{
$si = echappement($_POST['num_siren']);
}
else
{
$si = FALSE;
echo "<p><font color='red' size='+1'>
Indiquez le numéro SIREN de votre société </font></p>";
}
if ($soc && $act && $ape && $si && $adr && $cp && $vil && $no && $pr && $te && $fa && $url && $em)
{
$rq = "SELECT id FROM demande_tarif
WHERE societe='$soc'";
$result = @mysql_query ($rq);
if (mysql_num_rows($result) = = 0)
{
$rq = "INSERT INTO demande_tarif ".
"(societe, activite, ape, siren, adresse, cp, ville, nom , prenom, tel, fax, site, mail, date) ".
"VALUES ('$soc', '$act', '$ape', '$si', '$adr', '$cp', '$vil', '$no', '$pr', '$te', '$fa' '$url', '$em', NOW())";
$result = @mysql_query ($rq)
if ($result)
{
echo "<h3>Merci de votre demande</h3>";
exit():
}
else
{
echo "<p><font color='red' size='+1'>".
"Demande impossible à cause d'une erreur système, toutes nos excuses.".
"</font></p>";
}
}
else
{
echo "<p><font color='red' size='+1'>".
"Ce numéro SIREN éxiste déja.".
"</font></p>";
}
mysql_close();
}
else
{
echo "<p><font color='red' size='+1'>".
"Réessayez, svp.".
"</font></p>";
}
}
?>
<style type="text/css">
<!--
.Style2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #688425;
}
.Style3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
color: #688425;
}
.Style4 {color: #688425}
-->
</style>
<form action="envoiform.php" method="post">
<tr>
<td align="center" valign="top"><tr><div align="left">
<p class="Style3">DEMANDE DE TARIFS </p>
<table width="100%" border="0">
<tr>
<td width="17%"><div align="left"><span class="Style2">Société * : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="societe" size="15" maxlength="50"
value="<?php if (isset($_POST['societe'])) echo $_POST['societe']; ?>" />
</span></div></td>
<td><div align="left"><span class="Style2">Activité * : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="activite" size="15" maxlength="50"
value="<?php if (isset($_POST['activite'])) echo $_POST['activite']; ?>" />
</span></div></td>
</tr>
<tr>
<td><div align="left"><span class="Style2">Code APE * : </span></div></td>
<td width="43%"><div align="left"><span class="Style2">
<input type="text" name="code_ape" size="10" maxlength="5"
value="<?php if (isset($_POST['code_ape'])) echo $_POST['code_ape']; ?>" />
</span></div></td>
<td width="20%"><div align="left"><span class="Style2">Numéro SIREN * : </span></div></td>
<td width="20%"><div align="left"><span class="Style2">
<input type="text" name="num_siren" size="10" maxlength="9"
value="<?php if (isset($_POST['num_siren'])) echo $_POST['num_siren']; ?>" />
</span></div></td>
</tr>
<tr>
<td><div align="left"><span class="Style2">Adresse * : </span></div></td>
<td colspan="3"><div align="left"><span class="Style2">
<input type="text" name="adresse" size="30" maxlength="200"
value="<?php if (isset($_POST['adresse'])) echo $_POST['adresse']; ?>" />
</span></div></td>
</tr>
<tr>
<td><div align="left"><span class="Style2">Code postal * : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="code_postal" size="10" maxlength="5"
value="<?php if (isset($_POST['code_postal'])) echo $_POST['code_postal']; ?>" />
</span></div></td>
<td><div align="left"><span class="Style2">Ville * : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="ville" size="15" maxlength="50"
value="<?php if (isset($_POST['ville'])) echo $_POST['ville']; ?>" />
</span></div></td>
</tr>
<tr>
<td><div align="left"><span class="Style2">Nom * : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="nom" size="15" maxlength="30"
value="<?php if (isset($_POST['nom'])) echo $_POST['nom']; ?>" />
</span></div></td>
<td><div align="left"><span class="Style2">Prénom : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="prenom" size="15" maxlength="30"
value="<?php if (isset($_POST['prenom'])) echo $_POST['prenom']; ?>" />
</span></div></td>
</tr>
<tr>
<td><div align="left"><span class="Style2">Téléphone *: </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="telephone" size="15" maxlength="15"
value="<?php if (isset($_POST['telephone'])) echo $_POST['telephone']; ?>" />
</span></div></td>
<td><div align="left"><span class="Style2">Fax * : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="fax" size="15" maxlength="15"
value="<?php if (isset($_POST['fax'])) echo $_POST['fax']; ?>" />
</span></div></td>
</tr>
<tr>
<td><div align="left"><span class="Style2">Site Internet : </span></div></td>
<td><div align="left"><span class="Style2">
<input type="text" name="site" size="30" maxlength="100"
value="<?php if (isset($_POST['site'])) echo $_POST['site']; ?>" />
</span></div></td>
<td><span class="Style2">Email * :</span></td>
<td><span class="Style4">
<input type="text" name="email" size="15" maxlength="100"
value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" />
</span></td>
</tr>
</table>
</div>
<div align="center">
<p>
<input type="submit" name="submit" value="Envoyer" />
</p>
</div>
</form>
</tr> |
Partager