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

Documentation generated on Fri, 01 Apr 2011 09:33:10 +0200 by phpDocumentor 1.4.1