Source for file add.php
Documentation is available at add.php
* @package linea21.modules
* @subpackage yellowpages
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
include_once("../lib/input_helpers.php");
if(isset ($_POST['enregistrer'])) {
$result= $yp_object->AddYellowPages($data_table, $sql_object);
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo;
$mask_statut_P= "checked=\"checked\"";
if(isset ($_POST['valider'])) {
$table[0]= $_POST['yp_name'];
$table[1]= $_POST['yp_activity'];
$table[2]= $_POST['yp_theme'];
$table[3]= $_POST['yp_street'];
$table[4]= $_POST['yp_postal_code'];
$table[5]= $_POST['yp_city'];
$table[7]= $_POST['yp_phone'];
$table[8]= $_POST['yp_fax'];
$table[9]= $_POST['yp_email'];
($_POST['yp_website'] != 'http://') ? $table[10]= $_POST['yp_website'] : $table[10]= '';
$table[11]= $_POST['yp_statut'];
$integrity= $yp_object->CheckDataIntegrity($table);
$form_name= formatText($_POST['yp_name'], '2FIELD');
$form_activity= formatText($_POST['yp_activity'], '2FIELD');
$form_theme= $_POST['yp_theme'];
$form_street= formatText($_POST['yp_street'], '2FIELD');
$form_postal_code= $_POST['yp_postal_code'];
$form_city= formatText($_POST['yp_city'], '2FIELD');
$form_phone= $_POST['yp_phone'];
$form_fax= $_POST['yp_fax'];
$form_email= formatText($_POST['yp_email'], '2FIELD');
$form_website= formatText($_POST['yp_website'], '2FIELD');
$form_statut= $_POST['yp_statut'];
if($form_statut== 'AA') $mask_statut_D= "checked=\"checked\""; else $mask_statut_D= '';
if($form_statut== 'P') $mask_statut_P= "checked=\"checked\""; else $mask_statut_P= '';
include_once(THEME_ADMIN_PATH. "quickicons.php");
$data= $sql_object->DBSelect($req_list_theme);
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home'); ?></a></li>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>" class="chemin_rub"> <?php echo _t('menu','yellowpages');?></a></li>
<li><span> <?php echo formatnavTitle(_t('yp','add')); ?></span></li>
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer">
include_once($dir. "/menurub.php");
<h2> <?php echo _t('yp','add_title') ?></h2>
<form id="addyp" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="yp_name"> <?php echo _t('yp','name2') ?> * :</label>
<input name="yp_name" type="text" class="textfield" id="yp_name" maxlength="150" value=" <?php echo $form_name; ?>" />
<label for="yp_activity"> <?php echo _t('yp','activity') ?> * :</label>
<input name="yp_activity" type="text" class="textfield" id="yp_activity" maxlength="255" value=" <?php echo $form_activity; ?>" />
<label for="yp_theme"> <?php echo _t('yp','theme') ?> : </label>
<?php echo $select_theme; ?>
<div class="label"> <?php echo _t('divers','statut'); ?> * : </div>
<input name="yp_statut" type="radio" id="statut_P" value="P" <?php echo $mask_statut_P; ?> />
<label for="statut_P"> <?php echo _t('statut','public'); ?></label>
<input name="yp_statut" type="radio" id="statut_D" value="AA" <?php echo $mask_statut_D; ?> />
<label for="statut_D"> <?php echo _t('statut','AA'); ?></label>
<h3 class="part"> <?php echo ucfirst(_t('yp','infos_adresse')); ?></h3>
<label for="yp_street"> <?php echo _t('yp','street') ?> * :</label>
<input name="yp_street" type="text" class="textfield" id="yp_street" maxlength="200" value=" <?php echo $form_street; ?>" />
<label for="yp_postal_code"> <?php echo _t('yp','postal_code') ?> * :</label>
<input name="yp_postal_code" type="text" class="textfield" id="yp_postal_code" maxlength="6" value=" <?php echo $form_postal_code; ?>" />
<label for="yp_city"> <?php echo _t('yp','city') ?> * :</label>
<input name="yp_city" type="text" class="textfield" id="yp_city" maxlength="100" value=" <?php echo $form_city; ?>" />
<label for="yp_phone"> <?php echo _t('yp','phone') ?> :</label>
<input name="yp_phone" type="text" class="textfield" id="yp_phone" maxlength="12" value=" <?php echo $form_phone; ?>" />
<label for="yp_fax"> <?php echo _t('yp','fax') ?> :</label>
<input name="yp_fax" type="text" class="textfield" id="yp_fax" maxlength="12" value=" <?php echo $form_fax; ?>" />
<label for="yp_email"> <?php echo _t('yp','email') ?> * :</label>
<input name="yp_email" type="text" class="textfield" id="yp_email" maxlength="150" value=" <?php echo $form_email; ?>" />
<label for="yp_website"> <?php echo _t('yp','website') ?> :</label>
<input name="yp_website" type="text" class="textfield" id="yp_website" maxlength="150" value=" <?php echo $form_website; ?>" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="valider" type="submit" value=" <?php echo _t('btn','valid') ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?></div>
$onetheme= $sql_object->DBSelect($onetheme);
if($form_theme==- 1) $display_form_theme= _t('yp','notheme');
$onetheme= $sql_object->DBSelect($onetheme);
$display_form_theme= formatText($onetheme[0]['theme_name'], '2HTML');
if($form_website== 'http://') $form_website= '';
<div class="contentcontainer">
include_once($dir. "/menurub.php");
<h2> <?php echo _t('recap','title'); ?></h2>
<dt> <?php echo _t('yp','name2'); ?> :</dt>
<dd> <?php echo $display_form_name; ?></dd>
<dt> <?php echo _t('yp','activity') ;?> :</dt>
<dd> <?php echo $display_form_activity; ?></dd>
<dt> <?php echo _t('yp','theme'); ?> :</dt>
<dd> <?php echo $display_form_theme; ?></dd>
<dt> <?php echo _t('divers','statut'); ?> :</dt>
<dd> <?php echo $display_form_statut; ?></dd>
<dt> <?php echo _t('yp','street'); ?> :</dt>
<dd> <?php echo $display_form_street; ?></dd>
<dt> <?php echo _t('yp','postal_code') ;?> :</dt>
<dd> <?php echo $display_form_postal_code; ?></dd>
<dt> <?php echo _t('yp','city'); ?> :</dt>
<dd> <?php echo $display_form_city; ?></dd>
<dt> <?php echo _t('yp','phone') ;?> :</dt>
<dd> <?php echo $display_form_phone; ?></dd>
<dt> <?php echo _t('yp','fax') ;?> :</dt>
<dd> <?php echo $display_form_fax; ?></dd>
<dt> <?php echo _t('yp','email') ;?> :</dt>
<dd> <?php echo $display_form_email; ?></dd>
<dt> <?php echo _t('yp','website'); ?> :</dt>
<dd> <?php echo $display_form_website; ?></dd>
<form id="addscale" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="data_table" type="hidden" value=" <?php echo $table; ?>" id="data_table" />
<input name="retour" type="button" value=" <?php echo _t('btn','preview') ?>" class="button" id="retour" onclick="history.go(-1);" />
<input name="enregistrer" type="submit" value=" <?php echo _t('btn','save') ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?></div>
|