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.   ReloadIndex('admin');
  87. }
  88. ////////////
  89. ?>
  90. <div id="chemin">
  91. <ul>
  92.     <li><a href="index.php" class="chemin_home"><?php echo _t('way','home')?></a>
  93.     </li>
  94.     <li><a href="<?php echo $rub_link?>" id="chemin_<?php echo $rub?>"
  95.         class="chemin_rub"><?php echo _t('menu','scale')?></a></li>
  96.     <li><span><?php echo _t('scale','sup').' : '.formatnavTitle($current_title)?></span>
  97.     </li>
  98. </ul>
  99. </div>
  100. <!--end barre haute -->
  101. <?php
  102. include_once(THEME_ADMIN_PATH."quickicons.php");
  103. ?>
  104. <div class="contentcontainer"><?php
  105. include_once($dir."/menurub.php");
  106. ?>
  107. <div id="content"><?php
  108. if(isset($integrity&& is_string($integrity)) display_errors($integrity);
  109. ?>
  110. <h2><?php echo formatTitleh2($current_title)?></h2>
  111. <form id="supscale" action="<?php echo $_SERVER['SCRIPT_NAME']?>"
  112.     method="post">
  113. <p><input type="radio" name="sup_method" value="delete"
  114.     onclick="ShowSuppInfo('mass_delete')" <?php echo $mask_del_meth?> />
  115. <?php echo _t('scale','sup_massd')?></p>
  116. <p><input type="radio" name="sup_method" value="modify"
  117.     onclick="ShowSuppInfo('mass_modify')" <?php echo $mask_mod_meth?> />
  118. <?php echo _t('scale','sup_massm')?></p>
  119. <p id="transfert" <?php echo $mask_mass_mod?>><label
  120.     for="transfert_scale"><?php echo _t('scale','sup_transfert')?></label>
  121. <?php echo $select_root?></p>
  122. <p><label for="securitycode"><?php echo _t('security','info'?></label>
  123. <img src="../lib/securitycode.php"
  124.     alt="<?php echo _t('security','info2'?>" id="securityimg" /> <input
  125.     type="text" class="shorttextfield" id="securitycode" maxlength="5"
  126.     name="securitycode" /></p>
  127. <?php
  128. echo "<div class=\"info\" id=\"mass_delete\" ".$mask_mass_del.">\n";
  129. echo _t('scale','sup_scale_info2');
  130. echo "</div>\n";
  131. echo "<div class=\"info\" id=\"mass_modify\" ".$mask_mass_mod.">\n";
  132. echo _t('scale','sup_scale_info1');
  133. echo "</div>\n";
  134. ?>
  135. <div><input name="id" type="hidden" value="<?php echo $id?>" /> <input
  136.     name="rub" type="hidden" value="<?php echo $rub?>" id="rub" /> <input
  137.     name="todo" type="hidden" value="<?php echo $todo?>" id="todo" /> <?php echo cancel_button('javascript:history.go(-1);')?>
  138. <input name="valider" type="submit"
  139.     value="<?php echo _t('btn','valid'?>" class="button" id="valider" />
  140. </div>
  141. </form>
  142. </div>
  143. <?php include_once($dir."/help.php")?></div>

Documentation generated on Thu, 03 May 2012 15:07:39 +0200 by phpDocumentor 1.4.1