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

Documentation generated on Thu, 20 Mar 2014 16:49:30 +0100 by phpDocumentor 1.4.1