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 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. include_once("../lib/input_helpers.php");
  19. if(!isset($_GET['id']&& !isset($_POST['id'])) {
  20.   $id="1";
  21. else {
  22.   if(isset($_POST['id']))    $id=$_POST['id'];
  23.   if(isset($_GET['id']))    $id=$_GET['id'];
  24. }
  25.  
  26. $link_mod_e=$rub_link."&amp;todo=mod_e&amp;id=";
  27. $link_mod_r=$rub_link."&amp;todo=mod_r&amp;id=";
  28. $link_mod_p=$rub_link."&amp;todo=mod_p&amp;id=";
  29.  
  30.  
  31. if (isset($_POST['enregistrer'])) {
  32.   $data_table unserialize(urldecode($_POST['data_table']));
  33.   $j=0;
  34.   for ($i=0;$i<14;$i++){
  35.     $data_table_sdi[$j]=$data_table[$i];
  36.     $j++;
  37.   }
  38.   $sdi_objectnew sdi;
  39.   $result=$sdi_object->ModifySdi($ID=$id$data_table_sdi$sql_object);
  40.   $link_confirm="confirm.php?rub=".$rub."&todo=".$todo."&id=".$id;
  41.   if(isset($result)) header("Location: ".$link_confirm);
  42.   else  system_error();
  43. }
  44.  
  45. $sdi_objectnew sdi;
  46. $req_sdii=SQL_getInfoSdi($id);
  47. $data_form_sdi $sql_object -> DBSelect($req_sdii);
  48. //$data_form_sdi=$sdi_object->GetInfoSdi($id, $sql_object);
  49. $form_name formatText($data_form_sdi[0]['sdii_name']'2FIELD');
  50. $form_theme =  $data_form_sdi[0]['sdii_theme'];
  51. //$form_range =  $data_form_sdi[0]['sdii_range'];
  52. $form_description =  formatText($data_form_sdi[0]['sdii_description']'2FIELD');
  53. $form_comment =  formatText($data_form_sdi[0]['sdii_comment']'2FIELD');
  54. $form_goal =  formatText($data_form_sdi[0]['sdii_goal']'2FIELD');
  55. $form_consulting formatText($data_form_sdi[0]['sdii_consulting']'2FIELD');
  56. $form_unit =  formatText($data_form_sdi[0]['sdii_unit']'2FIELD');
  57. $form_max_value =  $data_form_sdi[0]['sdii_max_value'];
  58. $form_min_value =  $data_form_sdi[0]['sdii_min_value'];
  59. $form_threshold_value $data_form_sdi[0]['sdii_threshold_value'];
  60. $form_frequency $data_form_sdi[0]['sdii_frequency'];
  61. $form_threshold_relative=$data_form_sdi[0]['sdii_threshold_relative'];
  62. if($data_form_sdi[0]['sdii_statut']=='D'$mask_statut_D="checked=\"checked\""else $mask_statut_D='';
  63. if($data_form_sdi[0]['sdii_statut']=='P'$mask_statut_P="checked=\"checked\""else $mask_statut_P='';
  64.  
  65.  
  66. if (isset($_POST['valider1'])) {
  67.  
  68.   $table[0$_POST['sdi_name'];
  69.   $table[1$_POST['description'];
  70.   $table[2$_POST['comment'];
  71.   $table[3$_POST['sdi_theme'];
  72.   //$table[4] = $_POST['range'];
  73.   $table[40;
  74.   $table[5$_POST['goal'];
  75.   $table[6$_POST['consulting'];
  76.   $table[7$_POST['unit'];
  77.   $table[8$_POST['max_value'];
  78.   $table[9$_POST['min_value'];
  79.   $table[10]$_POST['threshold_value'];
  80.   $table[11]$_POST['frequency'];
  81.   $table[12]$_POST['sdi_statut'];
  82.  
  83.   if (isset($_POST['threshold_relative'])) {
  84.     $table[13]="Y";
  85.   }
  86.   else $table[13]="N";
  87.  
  88.   $sdi_object new sdi;
  89.   $integrity $sdi_object -> CheckDataIntegrity_info($table);
  90.  
  91.   $form_name formatText($_POST['sdi_name']'2FIELD');
  92.   $form_theme $_POST['sdi_theme'];
  93.   $form_statut =$_POST['sdi_statut'];
  94.   //$form_range = $_POST['range'];
  95.   $form_description formatText($_POST['description']'2FIELD');
  96.   $form_comment formatText($_POST['comment']'2FIELD');
  97.   $form_goal formatText($_POST['goal']'2FIELD');
  98.   $form_consulting formatText($_POST['consulting']'2FIELD');
  99.   $form_unit formatText($_POST['unit']'2FIELD');
  100.   $form_max_value $_POST['max_value'];
  101.   $form_min_value $_POST['min_value'];
  102.   $form_threshold_value $_POST['threshold_value'];
  103.   $form_threshold_relative=$table[13];
  104.   $form_frequency $_POST['frequency'];
  105.   $table urlencode(serialize($table));
  106.   if($form_statut=='D'$mask_statut_D="checked=\"checked\""else $mask_statut_D='';
  107.   if($form_statut=='P'$mask_statut_P="checked=\"checked\""else $mask_statut_P='';
  108.  
  109. }
  110.  
  111. include_once(THEME_ADMIN_PATH."quickicons.php");
  112.  
  113. $data $sql_object -> DBSelect($req_list_theme);
  114. $select_theme=ThemeSelectBox($data"sdi_theme"$form_theme);
  115.  
  116. $req_list_sdiname=SQL_getOnesdiname($id);
  117. $data_sdi_name $sql_object -> DBSelect($req_list_sdiname);
  118. $navtitle=_t('sdi','mod_e')." : ".$data_sdi_name[0]['sdii_name'];
  119. ?>
  120. <div id="chemin">
  121. <ul>
  122.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home'?></a>
  123.     </li>
  124.     <li><a href="<?php echo $rub_link;
  125. ?>" id="chemin_<?php echo $rub?>"
  126.         class="chemin_rub"><?php echo _t('menu','sdi')?></a></li>
  127.     <li><span><?php echo formatnavTitle($navtitle?></span></li>
  128. </ul>
  129. </div>
  130. <?php
  131. if (!isset($integrity|| is_string($integrity)) {
  132.  
  133.   ?>
  134. <div class="contentcontainer"><?php
  135. include_once($dir "/menurub.php");
  136.  
  137. ?>
  138. <div id="content"><?php
  139. if (isset($integrity&& is_string($integrity)) display_errors($integrity);
  140.  
  141. ?>
  142. <div class="mod_link"><a href="<?php echo $link_mod_e.$id ;?>"><?echo _t('sdi','modify_sdi_e');?></a>
  143. | <a href="<?php echo $link_mod_p.$id ;?>"><?echo _t('sdi','modify_sdi_p');?></a>
  144. | <a href="<?php echo $link_mod_r.$id ;?>"><?echo _t('sdi','modify_sdi_r');?></a>
  145. </div>
  146. <br class="brendstep" />
  147. <h2><?php echo formatTitleh2($data_sdi_name[0]['sdii_name'])?></h2>
  148.  
  149. <form id="addsdi" action="<?php echo $_SERVER['SCRIPT_NAME'];
  150.     ?>"
  151.     method="post">
  152. <p><label for="sdi_name"><?php echo _t('sdi','name2'?> * :</label> <input
  153.     name="sdi_name" type="text" class="textfield" id="sdi_name"
  154.     maxlength="255" value="<?php echo $form_name;
  155.     ?>" /></p>
  156. <p><label for="sdi_theme"><?php echo _t('sdi','theme'?> * : </label> <?php echo $select_theme;
  157. ?></p>
  158. <p><label for="statut_P"><?php echo _t('divers','statut')?> * : </label>
  159. <input name="sdi_statut" type="radio" id="statut_P" value="P"
  160. <?php echo $mask_statut_P?> /><span class="radio"><?php echo _t('statut','public')?></span>
  161. <input name="sdi_statut" type="radio" id="statut_D" value="D"
  162. <?php echo $mask_statut_D?> /><span class="radio"><?php echo _t('statut','draft')?></span>
  163. <br />
  164. </p>
  165. <?php /* <p>
  166. <label for="range" ><?php echo _t('sdi','range') ?> * :</label>
  167. <input name="range" type="text" class="textfield" id="range" maxlength="150" value="<?php echo $form_range;
  168. ?>" />
  169. </p> */ ?>
  170. <p><label for="description"><?php echo _t('sdi','description'?> * :</label>
  171. <textarea id="description" name="description"
  172. <?php echo AREA_SETTINGS?> class="largetextfield"><?php echo $form_description;
  173. ?></textarea></p>
  174. <p><label for="comment"><?php echo _t('sdi','comment'?> :</label> <textarea
  175.     id="comment" name="comment" <?php echo AREA_SETTINGS?>
  176.     class="largetextfield"><?php echo $form_comment;
  177.     ?></textarea></p>
  178. <p><label for="goal"><?php echo _t('sdi','goal'?> :</label> <textarea
  179.     id="goal" name="goal" <?php echo AREA_SETTINGS?>
  180.     class="largetextfield"><?php echo $form_goal;
  181.     ?></textarea></p>
  182. <p><label for="consulting"><?php echo _t('sdi','consulting'?> :</label>
  183. <textarea id="consulting" name="consulting" <?php echo AREA_SETTINGS?>
  184.     class="largetextfield"><?php echo $form_consulting;
  185.     ?></textarea></p>
  186.  
  187.  
  188. <p><?php echo _t('sdi','info_mesure')?></p>
  189.  
  190. <p><label for="unit"><?php echo _t('sdi','unit'?> * :</label> <input
  191.     name="unit" type="text" class="textfield" id="unit" maxlength="100"
  192.     value="<?php echo $form_unit;
  193.     ?>" /></p>
  194. <p><label for="max_value"><?php echo _t('sdi','max_value'?> * :</label>
  195. <input name="max_value" type="text" class="textfield" id="max_value"
  196.     maxlength="6" value="<?php echo $form_max_value;
  197.     ?>" /></p>
  198. <p><label for="min_value"><?php echo _t('sdi','min_value'?> * :</label>
  199. <input name="min_value" type="text" class="textfield" id="min_value"
  200.     maxlength="100" value="<?php echo $form_min_value;
  201.     ?>" /></p>
  202. <p><label for="threshold_value"><?php echo _t('sdi','threshold_value'?>
  203. * :</label> <input name="threshold_value" type="text" class="textfield"
  204.     id="threshold_value" maxlength="100"
  205.     value="<?php echo $form_threshold_value;
  206.     ?>" /></p>
  207. <p><label for="frequency"><?php echo _t('sdi','frequency'?> * :</label>
  208. <input name="frequency" type="text" class="textfield" id="frequency"
  209.     maxlength="11" value="<?php echo $form_frequency;
  210.     ?>" /></p>
  211. <p><label for="threshold_relative"><?php echo _t('sdi','threshold_relative'?>
  212. * :</label> <input type="checkbox" name="threshold_relative"
  213.     id="threshold_relative"
  214.     <?php if ($form_threshold_relative=='Y'echo " checked=\"checked\"" ?> />
  215. </p>
  216. <div class="chekbox"><?php echo _t('sdi','threshold_relative_comment'?></div>
  217. <div><br />
  218. <input name="id" type="hidden" value="<?php echo $id;
  219.             ?>"
  220.     id="id" /> <br />
  221.             <?php echo cancel_button($rub_link."&amp;todo=det&amp;id=".$id)?>
  222. <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  223. <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  224. <input name="valider1" type="submit"
  225.     value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  226. </div>
  227. </form>
  228. </div>
  229.             <?php include_once($dir "/help.php");
  230.             ?></div>
  231.             <?php
  232.             // Récapitulatif
  233. else {
  234.   if (!isset($integrity5|| is_string($integrity5)) {
  235.  
  236.  
  237.     $table=unserialize(urldecode($table));
  238.  
  239.     $display_sdi_name formatText(empty_nc($table[0])'2HTML');
  240.     $display_sdi_description =formatText(empty_nc($table[1])'2HTML');
  241.     $display_sdi_comment =formatText(empty_nc($table[2])'2HTML');
  242.     //$display_sdi_range = empty_nc($table[4]);
  243.     $display_sdi_goal formatText(empty_nc($table[5])'2HTML');
  244.     $display_sdi_consulting formatText(empty_nc($table[6])'2HTML');
  245.     $display_sdi_unit formatText(empty_nc($table[7])'2HTML');
  246.     $display_sdi_max_value empty_nc($table[8]);
  247.     $display_sdi_min_value empty_nc($table[9]);
  248.     $display_sdi_threshold_value empty_nc($table[10]);
  249.     $display_sdi_frequency empty_nc($table[11]);
  250.     $display_sdi_statut empty_nc($table[12]);
  251.     $onetheme SQL_getOnesditheme($table[3]);
  252.     $onetheme $sql_object -> DBSelect($onetheme);
  253.     $display_sdi_theme formatText($onetheme[0]['theme_name']'2HTML');
  254.  
  255.     if ($table[13]=='Y'$display_sdi_threshold_relative _t('sdi','threshold_relative_Y');
  256.     else $display_sdi_threshold_relative _t('sdi','threshold_relative_N');
  257.         
  258.     $table urlencode(serialize($table));
  259.  
  260.     ?>
  261. <div class="contentcontainer"><?php
  262. include_once($dir "/menurub.php");
  263.  
  264. ?>
  265. <div id="content">
  266. <h2><?php echo _t('recap','title';
  267. ?></h2>
  268. <dl class="dl3">
  269.     <dt><?php echo _t('sdi','name2';
  270.     ?> :</dt>
  271.     <dd><?php echo $display_sdi_name ;
  272.     ?><br />
  273.     </dd>
  274.     <dt><?php echo _t('divers','statut';
  275.     ?> :</dt>
  276.     <dd><?php echo display_statut($display_sdi_statut;
  277.     ?><br />
  278.     </dd>
  279.     <dt><?php echo _t('sdi','theme';
  280.     ?> :</dt>
  281.     <dd><?php echo $display_sdi_theme ;
  282.     ?><br />
  283.     </dd>
  284.     <?php /*<dt><?php echo _t('sdi','range') ;
  285.     ?> :</dt>
  286.     <dd><?php echo $display_sdi_range ;
  287.     ?><br /></dd> */ ?>
  288.     <dt><?php echo _t('sdi','description';
  289.     ?> :</dt>
  290.     <dd><?php echo $display_sdi_description ;
  291.     ?><br />
  292.     </dd>
  293.     <dt><?php echo _t('sdi','comment';
  294.     ?> :</dt>
  295.     <dd><?php echo $display_sdi_comment ;
  296.     ?><br />
  297.     </dd>
  298.     <dt><?php echo _t('sdi','goal';
  299.     ?> :</dt>
  300.     <dd><?php echo $display_sdi_goal ;
  301.     ?><br />
  302.     </dd>
  303.     <dt><?php echo _t('sdi','consulting';
  304.     ?> :</dt>
  305.     <dd><?php echo $display_sdi_consulting ;
  306.     ?><br />
  307.     </dd>
  308.     <dt><?php echo _t('sdi','unit';
  309.     ?> :</dt>
  310.     <dd><?php echo $display_sdi_unit ;
  311.     ?><br />
  312.     </dd>
  313.     <dt><?php echo _t('sdi','max_value';
  314.     ?> :</dt>
  315.     <dd><?php echo $display_sdi_max_value ;
  316.     ?><br />
  317.     </dd>
  318.     <dt><?php echo _t('sdi','min_value';
  319.     ?> :</dt>
  320.     <dd><?php echo $display_sdi_min_value ;
  321.     ?><br />
  322.     </dd>
  323.     <dt><?php echo _t('sdi','threshold_value';
  324.     ?> :</dt>
  325.     <dd><?php echo $display_sdi_threshold_value ;
  326.     ?><br />
  327.     </dd>
  328.     <dt><?php echo _t('sdi','threshold_relative';
  329.     ?> :</dt>
  330.     <dd><?php echo $display_sdi_threshold_relative ;
  331.     ?><br />
  332.     </dd>
  333.     <dt><?php echo _t('sdi','frequency';
  334.     ?> :</dt>
  335.     <dd><?php echo $display_sdi_frequency ;
  336.     ?><br />
  337.     </dd>
  338. </dl>
  339. <form id="addsdi5"
  340.     action="<?php echo $_SERVER['SCRIPT_NAME'];
  341.                     ?>"
  342.     method="post">
  343. <div><input name="rub" type="hidden"
  344.     value="<?php echo $rub;
  345.                     ?>" id="rub" /> <input name="todo" type="hidden"
  346.     value="<?php echo $todo;
  347.                     ?>" id="todo" /> <input name="id" type="hidden"
  348.     value="<?php echo $id;
  349.             ?>" id="id" /> <br />
  350.             <?php echo cancel_button($rub_link."&amp;todo=det&amp;id=".$id)?>
  351.  
  352. <input name="data_table" type="hidden"
  353.     value="<?php echo $table;
  354.                     ?>" id="data_table" /> <input name="retour"
  355.     type="button" value="<?php echo _t('btn','preview'?>" class="button"
  356.     id="retour" onclick="history.go(-1);" /> <input name="enregistrer"
  357.     type="submit" value="<?php echo _t('btn','save'?>" class="button"
  358.     id="valider" /></div>
  359. </form>
  360. </div>
  361.                     <?php include_once($dir "/help.php");
  362.                     ?></div>
  363.                     <?php
  364.   }
  365. }
  366. ?>

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