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

Source for file mod_p.php

Documentation is available at mod_p.php

  1. <?php
  2. /**
  3.  * @package linea21.modules
  4.  * @subpackage sdi
  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. $link_mod_r=$rub_link."&amp;todo=mod_r&amp;id=";
  19. $link_mod_e=$rub_link."&amp;todo=mod_e&amp;id=";
  20. $link_mod=$rub_link."&amp;todo=mod&amp;id=";
  21.  
  22. if(!isset($_GET['id']) && !isset($_POST['id'])) {
  23.     $id="1";
  24. } else {
  25.     if(isset($_POST['id']))    $id=$_POST['id'];
  26.     if(isset($_GET['id']))    $id=$_GET['id'];
  27. }
  28.  
  29. if (isset($_POST['enregistrer'])) {
  30.     $data_table = unserialize(urldecode($_POST['data_table']));
  31. $j=0;
  32.     for ($i=19;$i<27;$i++){
  33.     $data_table_p[$j]=$data_table[$i];
  34.     $j++;
  35.     }
  36.     $sdi_object= new sdi;
  37.     $result=$sdi_object->ModifyParam($id, $data_table_p, "P", $sql_object);
  38.     $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&id=".$id;
  39.     if(isset($result)) header("Location: ".$link_confirm);
  40.     else  system_error();
  41. } 
  42.  
  43. $sdi_object= new sdi;
  44. //$data_provider=$sdi_object->GetProvider($id_idd=$id, $sql_object, $ID="-1");
  45.  
  46. $req_sdip=SQL_getProvider($id_idd=$id, $sql_object, $ID="-1");
  47. $data_provider = $sql_object -> DBSelect($req_sdip);
  48.  
  49.  
  50. $form_p_name = formatText($data_provider[0]['sdip_name'], '2FIELD');
  51. $form_p_service  = formatText($data_provider[0]['sdip_service'], '2FIELD');
  52. $form_p_description  = formatText($data_provider[0]['sdip_description'], '2FIELD');
  53. $form_p_incharge  = formatText($data_provider[0]['sdip_incharge'], '2FIELD');
  54. $form_p_address  = formatText($data_provider[0]['sdip_address'], '2FIELD');
  55. $form_p_phone  = $data_provider[0]['sdip_phone'];
  56. $form_p_fax  = $data_provider[0]['sdip_fax'];
  57. $form_p_email = $data_provider[0]['sdip_email'];
  58.  
  59. if (isset($_POST['valider3'])) {
  60.  
  61.     //$table = unserialize(urldecode($_POST['table']));
  62.  
  63.     $table[19] = $_POST['p_name'];
  64.     $table[20] = $_POST['p_service'];
  65.     $table[21] = $_POST['p_description'];
  66.     $table[22] = $_POST['p_incharge'];
  67.     $table[23] = $_POST['p_address'];
  68.     $table[24] = $_POST['p_phone'];
  69.     $table[25] = $_POST['p_fax'];
  70.     $table[26] = $_POST['p_email'];
  71.  
  72.     $sdi_object = new sdi;
  73.     $integrity3 = $sdi_object -> CheckDataIntegrity_provider($table);
  74.  
  75.     $form_p_name = formatText($_POST['p_name'], '2FIELD');
  76.     $form_p_service = formatText($_POST['p_service'], '2FIELD');
  77.     $form_p_description = formatText($_POST['p_description'], '2FIELD');
  78.     $form_p_incharge = formatText($_POST['p_incharge'], '2FIELD');
  79.     $form_p_address = formatText($_POST['p_address'], '2FIELD');
  80.     $form_p_phone = $_POST['p_phone'];
  81.     $form_p_fax = $_POST['p_fax'];
  82.     $form_p_email = $_POST['p_email'];
  83.  
  84.     $table = urlencode(serialize($table));
  85. } 
  86. include_once(THEME_ADMIN_PATH."quickicons.php");
  87. $req_list_sdiname=SQL_getOnesdiname($id);
  88. $data_sdi_name = $sql_object -> DBSelect($req_list_sdiname);
  89. $navtitle=_t('sdi','mod_p')." : ".$data_sdi_name[0]['sdii_name'];
  90.  ?>
  91.  <div id="chemin">
  92.     <ul>
  93.         <li>
  94.             <a href="index.php" class="chemin_home"><?php echo _t('way','home') ?></a>
  95.         </li>
  96.         <li>
  97.                <a href="<?php echo $rub_link; ?>" id="chemin_<? echo $rub; ?>" class="chemin_rub"><?php echo _t('menu','sdi')?></a>
  98.         </li>
  99.         <li>
  100.             <span><?php echo formatnavTitle($navtitle) ?></span>
  101.         </li>
  102.     </ul>
  103. </div>
  104. <!--end barre haute -->
  105.  <?
  106.  if (!isset($integrity3) || is_string($integrity3)) {
  107. ?>
  108. <div class="contentcontainer">
  109.         <?php
  110.             include_once($dir . "/menurub.php");
  111.  
  112.             ?>
  113.         <div id="content">
  114.             <?php 
  115.             
  116.             
  117.             if (isset($integrity3) && is_string($integrity3)) display_errors($integrity3);
  118.  
  119.             ?>
  120.                         <div class="mod_link">
  121.     <a href="<? echo $link_mod.$id ;?>"><?echo _t('sdi','mod');?></a> | 
  122.     <a href="<? echo $link_mod_e.$id ;?>"><?echo _t('sdi','modify_sdi_e');?></a> | 
  123.     <a href="<? echo $link_mod_r.$id ;?>"><?echo _t('sdi','modify_sdi_r');?></a>
  124.     </div>
  125.             <br class="brendstep" />
  126.             <h2><?php echo formatTitleh2($data_sdi_name[0]['sdii_name']); ?></h2>
  127.             
  128.             <form id="addsdi3" action="<?php echo $_SERVER['SCRIPT_NAME'];
  129.             ?>" method="post">
  130.                 <p>
  131.                 <label for="p_name" ><?php echo _t('sdi','p_name') ?> * :</label>
  132.                 <input name="p_name" type="text" class="textfield" id="p_name" maxlength="255" value="<?php echo $form_p_name;
  133.             ?>" />
  134.                 </p>
  135.                 <p>
  136.                 <label for="p_service" ><?php echo _t('sdi','p_service') ?>  :</label>
  137.                 <input name="p_service" type="text" class="textfield" id="p_service" maxlength="255" value="<?php echo $form_p_service;
  138.             ?>" />
  139.                 </p>
  140.  
  141.                 <p>
  142.                 <label for="p_incharge" ><?php echo _t('sdi','p_incharge') ?>  :</label>
  143.                 <input name="p_incharge" type="text" class="textfield" id="p_incharge" maxlength="150" value="<?php echo $form_p_incharge;
  144.             ?>" />
  145.                 </p>
  146.                 <p>
  147.                 <label for="p_address" ><?php echo _t('sdi','p_address') ?> * :</label>
  148.                 <textarea id="p_address" name="p_address" <?php echo AREA_SETTINGS; ?> class="largetextfield" ><?php echo $form_p_address;
  149.             ?></textarea>
  150.                 </p>
  151.                 <p>
  152.                 <label for="p_phone" ><?php echo _t('sdi','p_phone') ?>  :</label>
  153.                 <input name="p_phone" type="text" class="textfield" id="p_phone" maxlength="10" value="<?php echo $form_p_phone;
  154.             ?>" />
  155.                 </p>
  156.                 <p>
  157.                 <label for="p_fax" ><?php echo _t('sdi','p_fax') ?>  :</label>
  158.                 <input name="p_fax" type="text" class="textfield" id="p_fax" maxlength="10" value="<?php echo $form_p_fax;
  159.             ?>" />
  160.                 </p>
  161.                 <p>
  162.                 <label for="p_email" ><?php echo _t('sdi','p_email') ?> * :</label>
  163.                 <input name="p_email" type="text" class="textfield" id="p_email" maxlength="200" value="<?php echo $form_p_email;
  164.             ?>" />
  165.                 </p>
  166.                 <p>
  167.                 <label for="p_description" ><?php echo _t('sdi','p_description') ?>  :</label>
  168.                 <textarea id="p_description" name="p_description" <?php echo AREA_SETTINGS; ?> class="largetextfield" ><?php echo $form_p_description;
  169.             ?></textarea>
  170.                 </p>
  171.                 <div>
  172.         <br />
  173.                 <? echo cancel_button($rub_link."&amp;todo=det&amp;id=".$id); ?>
  174.                         <input name="rub" type="hidden" value="<?php echo $rub;
  175.             ?>" id="rub" />
  176.                 <input name="todo" type="hidden" value="<?php echo $todo;
  177.             ?>" id="todo" />
  178.                             <input name="id" type="hidden" value="<?php echo $id;
  179.             ?>" id="id" />
  180.                 <input name="valider3" type="submit" value="<?php echo _t('btn','valid') ?>" class="button" id="valider" />
  181.                 </div>
  182.             </form>
  183.         </div>
  184. <?php include_once($dir . "/help.php");
  185.             ?>
  186. </div>
  187.  
  188. <?php
  189.         } else {
  190.                 if (!isset($integrity5) || is_string($integrity5)) {
  191.                 
  192.                 
  193.                     $table=unserialize(urldecode($table));
  194.                     $display_p_name = formatText(empty_nc($table[19]), '2HTML');
  195.                     $display_p_service = formatText(empty_nc($table[20]), '2HTML');
  196.                     $display_p_description =formatText(empty_nc($table[21]), '2HTML');
  197.                     $display_p_incharge = formatText(empty_nc($table[22]), '2HTML');
  198.                     $display_p_address = formatText(empty_nc($table[23]), '2HTML');
  199.                     $display_p_phone = empty_nc($table[24]);
  200.                     $display_p_fax = empty_nc($table[25]);
  201.                     $display_p_email = empty_nc($table[26]);
  202.                     $table = urlencode(serialize($table));
  203.  
  204.                     ?>
  205. <div class="contentcontainer">
  206. <?php
  207.                     include_once($dir . "/menurub.php");
  208.  
  209.                     ?>
  210. <div id="content">
  211.             <h2><?php echo _t('recap','title') ;
  212.                     ?></h2>
  213.             <dl class="dl3">
  214.                 <dt><?php echo _t('sdi','p_name') ;
  215.                     ?> : </dt>
  216.                 <dd><?php echo $display_p_name ;
  217.                     ?><br /></dd>
  218.                 <dt><?php echo _t('sdi','p_service') ;
  219.                     ?> : </dt>
  220.                 <dd><?php echo $display_p_service ;
  221.                     ?><br /></dd>
  222.                 <dt><?php echo _t('sdi','p_description') ;
  223.                     ?> : </dt>
  224.                 <dd><?php echo $display_p_description ;
  225.                     ?><br /></dd>
  226.                 <dt><?php echo _t('sdi','p_incharge') ;
  227.                     ?> : </dt>
  228.                 <dd><?php echo $display_p_incharge ;
  229.                     ?><br /></dd>
  230.                 <dt><?php echo _t('sdi','p_address') ;
  231.                     ?> : </dt>
  232.                 <dd><?php echo $display_p_address ;
  233.                     ?><br /></dd>
  234.                 <dt><?php echo _t('sdi','p_phone') ;
  235.                     ?> : </dt>
  236.                 <dd><?php echo $display_p_phone ;
  237.                     ?><br /></dd>
  238.                 <dt><?php echo _t('sdi','p_fax') ;
  239.                     ?> : </dt>
  240.                 <dd><?php echo $display_p_fax ;
  241.                     ?><br /></dd>
  242.                 <dt><?php echo _t('sdi','p_email') ;
  243.                     ?> : </dt>
  244.                 <dd><?php echo $display_p_email ;
  245.                     ?><br /></dd>
  246.             </dl>
  247.             <form id="addsdi5" action="<?php echo $_SERVER['SCRIPT_NAME'];
  248.                     ?>" method="post">
  249.                 <div>
  250.                 <input name="rub" type="hidden" value="<?php echo $rub;
  251.                     ?>" id="rub" />
  252.                 <input name="todo" type="hidden" value="<?php echo $todo;
  253.                     ?>" id="todo" />
  254.                     <input name="id" type="hidden" value="<?php echo $id;
  255.             ?>" id="id" />
  256.             <br />
  257.                 <? echo cancel_button($rub_link."&amp;todo=det&amp;id=".$id); ?>
  258.                 
  259.                 <input name="data_table" type="hidden" value="<?php echo $table;
  260.                     ?>" id="data_table" />
  261.                 <input name="retour" type="button" value="<?php echo _t('btn','preview') ?>" class="button" id="retour" onclick="history.go(-1);" />
  262.                 <input name="enregistrer" type="submit" value="<?php echo _t('btn','save') ?>" class="button" id="valider" />
  263.                 </div>
  264.             </form>
  265.         </div>
  266.     <?php include_once($dir . "/help.php");
  267.                     ?>
  268. </div>
  269. <?php
  270.                 } 
  271.             } 
  272. ?>

Documentation generated on Fri, 16 Oct 2009 09:37:25 +0200 by phpDocumentor 1.4.1