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

Source for file sup.php

Documentation is available at sup.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage scale
  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. if(isset($_POST['id']))    $id=$_POST['id'];
  19. if(isset($_GET['id']))    $id=$_GET['id'];
  20.  
  21.  
  22. $link_cancel=$rub_link."&todo=det&amp;id=".$id
  23.  
  24. $mask_mass_del="style=\"visibility:hidden;\"";
  25. $mask_mass_mod="style=\"visibility:hidden;\"";
  26. $mask_del_meth='';
  27. $mask_mod_meth='';
  28. $form_scale_transfert=-1;
  29.  
  30.  
  31. $scale_objectnew scale;
  32.  
  33. if(isset($_POST['valider'])) {
  34.     $integrity=1;
  35.     if(isset($_POST['sup_method'])) {
  36.         $sup_method=$_POST['sup_method'];
  37.         if($sup_method=='delete'{
  38.             $type='MASS_DELETE';
  39.             $mask_mass_del="style=\"visibility:visible;\"";
  40.             $mask_del_meth="checked=\"checked\"";
  41.             $form_scale_transfert=-1;
  42.         }
  43.         if($sup_method=='modify'{
  44.             $type='MASS_MODIFY';
  45.             $mask_mod_meth="checked=\"checked\"";
  46.             $mask_mass_mod="style=\"visibility:visible;;\"";
  47.             if($_POST['transfert_scale']==-1$integrity=_t('scale','sup_noscale');
  48.             else $form_scale_transfert=$_POST['transfert_scale'];
  49.         }
  50.         if($_SESSION['securityaction']!=md5($_POST['securitycode'])) {
  51.             $integrity=_t('security','message');
  52.         }
  53.         if(!is_string($integrity)) {
  54.             $link_confirm="confirm.php?rub=".$rub."&todo=".$todo;
  55.             $result=$scale_object->DeleteScale($id$sql_object$type$form_scale_transfert);
  56.             //exit;
  57.             if(is_numeric($result)) header("Location: ".$link_confirm);
  58.             else  system_error();
  59.         }
  60.     }    else  {
  61.         $integrity=_t('scale','sup_nomethod');
  62.     }
  63.     
  64. }
  65.  
  66. include_once("../lib/input_helpers.php");
  67. // select-box des échelles
  68. #$req_list=SQL_getlistscale($id);
  69. #$data=$sql_object->DBSelect($req_list);
  70. #$select_root=ScaleSelectBox($data, "transfert_scale", $form_scale_transfert);
  71.  
  72. // select-box des échelles
  73. $table_exclu=$scale_object->getMaxDepth($id$sql_object);
  74. $req=SQL_getMaxScalesDepth($table_exclu["depth"]$table_exclu["exclusion"]);
  75. $data=$sql_object->DBSelect($req);
  76. $select_root=ScaleSelectBox($data"transfert_scale"$form_scale_transfert);
  77.  
  78.  
  79.  
  80. $req_detSQL_getdetscale($id);
  81. $result1=$sql_object->DBSelect($req_det);
  82. $current_title=$result1[0]['scale_denomination'];
  83.  
  84. //////////// Check si pas suppresion échelle root //////////// 
  85. if ($result1[0]['scale_root']==0)
  86. include_once("../lib/lib_common.php");
  87. ReloadIndex('admin');
  88. }
  89. ////////////
  90. ?>
  91. <div id="chemin">
  92.     <ul>
  93.         <li>
  94.             <a href="index.php" class="chemin_home"><? echo _t('way','home')?></a>
  95.         </li>
  96.         <li>
  97.                <a href="<?php echo $rub_link?>" id="chemin_<? echo $rub?>" class="chemin_rub"><? echo _t('menu','scale')?></a>
  98.         </li>
  99.         <li>
  100.             <span><? echo _t('scale','sup').' : '.formatnavTitle($current_title)?></span>
  101.         </li>
  102.     </ul>
  103. </div>
  104. <!--end barre haute -->
  105. <?php
  106. include_once(THEME_ADMIN_PATH."quickicons.php");
  107. ?>
  108. <div class="contentcontainer">
  109. <?php
  110. include_once($dir."/menurub.php");
  111. ?>
  112. <div id="content">
  113. <?php
  114. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  115. ?>
  116. <h2><? echo formatTitleh2($current_title)?></h2>    
  117. <form id="supscale" action="<?php echo $_SERVER['SCRIPT_NAME']?>" method="post">
  118. <p>
  119.     <input type="radio" name="sup_method" value="delete" onclick="ShowSuppInfo('mass_delete')" <?php echo $mask_del_meth?> /> 
  120.     <? echo _t('scale','sup_massd')?>
  121. </p>
  122. <p>
  123.     <input type="radio" name="sup_method" value="modify" onclick="ShowSuppInfo('mass_modify')" <?php echo $mask_mod_meth?> />
  124.     <? echo _t('scale','sup_massm')?>
  125. </p>
  126. <p id="transfert" <?php echo $mask_mass_mod?> >
  127.     <label for="transfert_scale" ><? echo _t('scale','sup_transfert')?></label>
  128.     <?php echo $select_root?>
  129. </p>
  130. <p>
  131.   <label for="securitycode" ><? echo _t('security','info'?></label>
  132.   <img src="../lib/securitycode.php" alt="<? echo _t('security','info2'?>" id="securityimg" />
  133.   <input type="text" class="shorttextfield" id="securitycode" maxlength="5" name="securitycode" />  
  134. </p>
  135. <?php
  136. echo "<div class=\"info\" id=\"mass_delete\" ".$mask_mass_del.">\n";
  137. echo _t('scale','sup_scale_info2');
  138. echo "</div>\n"
  139. echo "<div class=\"info\" id=\"mass_modify\" ".$mask_mass_mod.">\n";
  140. echo _t('scale','sup_scale_info1');
  141. echo "</div>\n"
  142. ?>
  143. <div>
  144.     <input name="id" type="hidden" value="<?php echo $id?>" />
  145.     <input name="rub" type="hidden" value="<?php echo $rub?>" id="rub" />
  146.     <input name="todo" type="hidden" value="<?php echo $todo?>" id="todo" />
  147.     <?php echo cancel_button('javascript:history.go(-1);')?>
  148.     <input name="valider" type="submit" value="<? echo _t('btn','valid'?>" class="button" id="valider" />
  149. </div>
  150. </form>
  151. </div>
  152. <?php include_once($dir."/help.php")?>
  153. </div>

Documentation generated on Fri, 16 Oct 2009 09:39:27 +0200 by phpDocumentor 1.4.1