linea21-modules
[ class tree: linea21-modules ] [ index: linea21-modules ] [ all elements ]

Source for file mod.php

Documentation is available at mod.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage yellowpages
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //////////// Check Inclusion de pages ////////////
  12. if (!function_exists('AuthenthificationProcess')){
  13.   include_once("../lib/lib_common.php");
  14.   ReloadIndex('admin');
  15. }
  16. ////////////
  17.  
  18. include_once("../lib/input_helpers.php");
  19. if (isset($_GET['id']))    $yp_id=$_GET['id'];
  20. if (isset($_POST['id']))    $yp_id=$_POST['id'];
  21.  
  22. $requete=SQL_getdetyp($yp_id);
  23. $data_yp=$sql_object->DBSelect($requete'OBJECT');
  24. $display_title=formatTitleh2($data_yp[0]->yellowp_name);
  25. $navtitle=_t('yp','mod')." : ".$data_yp[0]->yellowp_name;
  26.  
  27. ?>
  28. <div id="chemin">
  29. <ul>
  30.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a></li>
  31.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>" class="chemin_rub"><?php echo _t('menu','yellowpages');?></a></li>
  32.     <li><span><?php echo formatnavTitle($navtitle)?></span></li>
  33. </ul>
  34. </div>
  35. <!--end barre haute -->
  36. <?php
  37. if(isset($_POST['enregistrer'])) {
  38.   $data_table=unserialize(urldecode($_POST['data_table']));
  39.   $yp_objectnew yellowpages;
  40.   $result=$yp_object->ModifyYellowPages($yp_id$data_table$sql_object);
  41.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&id=".$yp_id;
  42.  
  43.   if($resultheader("Location: ".$link_confirm);
  44.   else  system_error();
  45. }
  46.  
  47. $form_name=formatText($data_yp[0]->yellowp_name'2FIELD');
  48. $form_activity=formatText($data_yp[0]->yellowp_activity'2FIELD');
  49. $form_theme=$data_yp[0]->yellowp_theme;
  50. $form_street=formatText($data_yp[0]->yellowp_street'2FIELD');
  51. $form_postal_code=formatText($data_yp[0]->yellowp_postal_code'2FIELD');
  52. $form_city=formatText($data_yp[0]->yellowp_city'2FIELD');
  53. $form_phone=$data_yp[0]->yellowp_phone;
  54. $form_fax=$data_yp[0]->yellowp_fax;
  55. $form_email=formatText($data_yp[0]->yellowp_email'2FIELD');
  56. $form_website=formatText($data_yp[0]->yellowp_website'2FIELD');
  57. $form_statut=$data_yp[0]->yellowp_statut;
  58. if($form_statut=='AA'$mask_statut_D="checked=\"checked\""else $mask_statut_D='';
  59. if($form_statut=='P'$mask_statut_P="checked=\"checked\""else $mask_statut_P='';
  60.  
  61.  
  62. if(isset($_POST['valider'])) {
  63.   $table[0]=$_POST['yp_name'];
  64.   $table[1]=$_POST['yp_activity'];
  65.   $table[2]=$_POST['yp_theme'];
  66.   $table[3]=$_POST['yp_street'];
  67.   $table[4]=$_POST['yp_postal_code'];
  68.   $table[5]=$_POST['yp_city'];
  69.   $table[6]='';
  70.   $table[7]=$_POST['yp_phone'];
  71.   $table[8]=$_POST['yp_fax'];
  72.   $table[9]=$_POST['yp_email'];
  73.   $table[10]=$_POST['yp_website'];
  74.   $table[11]=$_POST['yp_statut'];
  75.   $yp_objectnew yellowpages;
  76.   $integrity=$yp_object->CheckDataIntegrity($table);
  77.  
  78.   $form_name=formatText($_POST['yp_name']'2FIELD');
  79.   $form_activity=formatText($_POST['yp_activity']'2FIELD');
  80.   $form_theme=$_POST['yp_theme'];
  81.   $form_street=formatText($_POST['yp_street']'2FIELD');
  82.   $form_postal_code=formatText($_POST['yp_postal_code']'2FIELD');
  83.   $form_city=formatText($_POST['yp_city']'2FIELD');
  84.   $form_phone=$_POST['yp_phone'];
  85.   $form_fax=$_POST['yp_fax'];
  86.   $form_email=formatText($_POST['yp_email']'2FIELD');
  87.   $form_website=formatText($_POST['yp_website']'2FIELD');
  88.   $form_statut=$_POST['yp_statut'];
  89.   if($form_statut=='AA'$mask_statut_D="checked=\"checked\""else $mask_statut_D='';
  90.   if($form_statut=='P'$mask_statut_P="checked=\"checked\""else $mask_statut_P='';
  91.  
  92.   $table=urlencode(serialize($table));
  93. }
  94. include_once(THEME_ADMIN_PATH."quickicons.php");
  95.  
  96. // select-box de thèmes
  97. $data=$sql_object->DBSelect($req_list_theme);
  98. $select_theme=ThemeSelectBox($data"yp_theme"$form_theme);
  99. ?>
  100.  
  101. <?php
  102. if(!isset($integrity|| is_string($integrity)) {
  103.   ?>
  104. <div class="contentcontainer">
  105. <?php
  106. include_once($dir."/menurub.php");
  107. ?>
  108. <div id="content">
  109. <?php 
  110. $link_det_state=$rub_link."&todo=det&state=".$form_statut."&amp;id=";
  111. if ($form_statut=='D'{  ?>
  112.   <div class="mod_link">
  113.       <a href="<?php echo $link_det_state.$yp_id ;?>"><?echo _t('yp','confirmation');?></a>
  114.   </div>
  115.   <br class="brendstep" />
  116. <?php ?> 
  117. <?php
  118. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  119. ?>
  120. <h2><?php echo $display_title?></h2>
  121.  
  122. <form id="addyp" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  123. <p>
  124.     <label for="yp_name"><?php echo _t('yp','name2'?> * :</label>
  125.     <input name="yp_name" type="text" class="textfield" id="yp_name" maxlength="150" value="<?php echo $form_name?>" />
  126. </p>
  127. <p>
  128.     <label for="yp_activity"><?php echo _t('yp','activity'?> * :</label>
  129.     <input name="yp_activity" type="text" class="textfield" id="yp_activity" maxlength="255" value="<?php echo $form_activity?>" />
  130. </p>
  131. <p>
  132.     <label for="yp_theme"><?php echo _t('yp','theme'?> : </label>
  133.     <?php echo $select_theme?>
  134. </p>
  135. <?php if($form_statut=='P' || $form_statut=='AA'){?>
  136.     <div class="label"><?php echo _t('divers','statut')?> * : </div>
  137.     <div class="rightpanel">
  138.         <input name="yp_statut" type="radio" id="statut_P" value="P" <?php echo $mask_statut_P?> />
  139.         <label for="statut_P"><?php echo _t('statut','public')?></label>
  140.         <input name="yp_statut" type="radio" id="statut_D" value="AA" <?php echo $mask_statut_D?> />
  141.         <label for="statut_D"><?php echo _t('statut','AA')?></label>
  142.     </div>
  143. <?php else {
  144.   echo "<input name=\"yp_statut\" type=\"hidden\" value=\"D\" id=\"yp_statut\" />" ;
  145. }
  146. ?>
  147. <h3 class="part"><?php echo _t('yp','infos_adresse'?></h3>
  148.  
  149. <p>
  150.     <label for="yp_street"><?php echo _t('yp','street'?> * :</label>
  151.     <input name="yp_street" type="text" class="textfield" id="yp_street" maxlength="200" value="<?php echo $form_street?>" />
  152. </p>
  153. <p>
  154.     <label for="yp_postal_code"><?php echo _t('yp','postal_code'?> * :</label>
  155.     <input name="yp_postal_code" type="text" class="textfield" id="yp_postal_code" maxlength="6" value="<?php echo $form_postal_code?>" />
  156. </p>
  157. <p>
  158.     <label for="yp_city"><?php echo _t('yp','city'?> * :</label>
  159.     <input name="yp_city" type="text" class="textfield" id="yp_city" maxlength="100" value="<?php echo $form_city?>" />
  160. </p>
  161. <p>
  162.     <label for="yp_phone"><?php echo _t('yp','phone'?> :</label>
  163.     <input name="yp_phone" type="text" class="textfield" id="yp_phone" maxlength="12" value="<?php echo $form_phone?>" />
  164. </p>
  165. <p>
  166.     <label for="yp_fax"><?php echo _t('yp','fax'?> :</label>
  167.     <input name="yp_fax" type="text" class="textfield" id="yp_fax" maxlength="12" value="<?php echo $form_fax?>" />
  168. </p>
  169. <p>
  170.     <label for="yp_email"><?php echo _t('yp','email'?> * :</label>
  171.     <input name="yp_email" type="text" class="textfield" id="yp_email" maxlength="150" value="<?php echo $form_email?>" />
  172. </p>
  173. <p>
  174.     <label for="yp_website"><?php echo _t('yp','website'?> :</label>
  175.     <input    name="yp_website" type="text" class="textfield" id="yp_website" maxlength="150" value="<?php echo $form_website?>" />
  176. </p>
  177. <div>
  178.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  179.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  180.     <?php echo cancel_button($rub_link."&amp;todo=det&amp;id=".$yp_id)?>
  181.     <input name="id" type="hidden" value="<?php echo $yp_id?>" id="id" />
  182.     <input name="valider" type="submit" value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  183. </div>
  184. </form>
  185. </div>
  186. <?php include_once($dir."/help.php")?></div>
  187. <?php
  188. // Récapitulatif
  189. else    {
  190.   if($form_theme==-1$display_form_theme=_t('yp','notheme');
  191.   else {
  192.     $onethemeSQL_getOneyptheme($form_theme);
  193.     $onetheme=$sql_object->DBSelect($onetheme);
  194.     $display_form_theme=formatText($onetheme[0]['theme_name']'2HTML');
  195.   }
  196.   $display_form_name=formatText(empty_nc($form_name)'2HTML');
  197.   $display_form_activity=formatText(empty_nc($form_activity)'2HTML');
  198.   $display_form_street=formatText(empty_nc($form_street)'2HTML');
  199.   $display_form_postal_code=formatText(empty_nc($form_postal_code)'2HTML');
  200.   $display_form_city=formatText(empty_nc($form_city)'2HTML');
  201.   $display_form_phone=formatText(empty_nc($form_phone)'2HTML');
  202.   $display_form_fax=formatText(empty_nc($form_fax)'2HTML');
  203.   $display_form_email=formatText(empty_nc($form_email)'2HTML');
  204.   $display_form_website=formatText(empty_nc($form_website)'2HTML');
  205.   if ($form_statut=='D'$display_form_statut=_t('yp','draft');
  206.   else $display_form_statut=display_statut($form_statut);
  207.   ?>
  208. <div class="contentcontainer">
  209. <?php
  210. include_once($dir."/menurub.php");
  211. ?>
  212. <div id="content">
  213. <h2><?php echo _t('recap','title')?></h2>
  214. <dl class="dl3">
  215.     <dt><?php echo _t('yp','name2')?> :</dt>
  216.     <dd><?php echo $display_form_name?></dd>
  217.     <dt><?php echo  _t('yp','activity';?> :</dt>
  218.     <dd><?php echo $display_form_activity?></dd>
  219.     <dt><?php echo _t('yp','theme')?> :</dt>
  220.     <dd><?php echo $display_form_theme?></dd>
  221.     <dt><?php echo _t('divers','statut')?> :</dt>
  222.     <dd><?php echo $display_form_statut?></dd>
  223.     <dt><?php echo _t('yp','street')?> :</dt>
  224.     <dd><?php echo $display_form_street?></dd>
  225.     <dt><?php echo _t('yp','postal_code';?> :</dt>
  226.     <dd><?php echo $display_form_postal_code?></dd>
  227.     <dt><?php echo _t('yp','city')?> :</dt>
  228.     <dd><?php echo $display_form_city?></dd>
  229.     <dt><?php echo  _t('yp','phone';?> :</dt>
  230.     <dd><?php echo $display_form_phone?></dd>
  231.     <dt><?php echo _t('yp','fax';?> :</dt>
  232.     <dd><?php echo $display_form_fax?></dd>
  233.     <dt><?php echo _t('yp','email';?> :</dt>
  234.     <dd><?php echo $display_form_email?></dd>
  235.     <dt><?php echo  _t('yp','website')?> :</dt>
  236.     <dd><?php echo $display_form_website?></dd>
  237. </dl>
  238. <form id="addscale" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  239.   <div>
  240.       <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  241.       <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  242.       <input name="id" type="hidden" value="<?php echo $yp_id?>" id="id" />
  243.       <?php echo cancel_button($rub_link."&amp;todo=det&amp;id=".$yp_id)?>
  244.       <input name="data_table" type="hidden" value="<?php echo $table?>" id="data_table" />
  245.       <input name="retour" type="button" value="<?php echo _t('btn','preview'?>" class="button" id="retour" onclick="history.go(-1);" />
  246.       <input name="enregistrer" type="submit" value="<?php echo _t('btn','save'?>" class="button" id="valider" />
  247.   </div>
  248. </form>
  249. </div>
  250. <?php include_once($dir."/help.php")?></div>
  251. <?php
  252. }
  253. ?>

Documentation generated on Thu, 03 May 2012 15:06:27 +0200 by phpDocumentor 1.4.1