noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
stock_inv_histo.inc.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  *   This file is part of NOALYSS.
00005  *
00006  *   NOALYSS is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License as published by
00008  *   the Free Software Foundation; either version 2 of the License, or
00009  *   (at your option) any later version.
00010  *
00011  *   NOALYSS is distributed in the hope that it will be useful,
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *   GNU General Public License for more details.
00015  *
00016  *   You should have received a copy of the GNU General Public License
00017  *   along with NOALYSS; if not, write to the Free Software
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00022 /**
00023  * @file
00024  * @brief history of manuel change
00025  *
00026  */
00027 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00028 require_once 'class_exercice.php';
00029 
00030 if ( isset($_POST['del']))
00031 {
00032         if (isset($_POST['ok']))
00033         {
00034                 if ($g_user->can_write_repo($_POST['r_id']))
00035                 {
00036                         $cn->exec_sql('delete from stock_change where c_id=$1',array($_POST['c_id']));
00037                 }
00038                 else
00039                 {
00040                         alert(_("Vous ne pouvez pas modifier ce dépôt"));
00041                 }
00042         }
00043         else
00044         {
00045                 alert(_("Opération non effacée: vous n'avez pas confirmé"));
00046         }
00047 }
00048 $profile=$g_user->get_profile();
00049 $gDossier=dossier::id();
00050 $default_exercice=$g_user->get_exercice();
00051 $p_exercice=HtmlInput::default_value_get("p_exercice", $default_exercice);
00052 
00053 $a_change=$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_date from stock_change as sc
00054                         join stock_repository as sr on (sc.r_id=sr.r_id)
00055                         where sc.r_id in (select r_id from profile_sec_repository where p_id=$1)
00056                          and c_date >= (select min(p_start) from parm_periode where p_exercice = $2)
00057                         and c_date <= (select max(p_end) from parm_periode where p_exercice = $2)
00058                 order by c_date",array($profile,$p_exercice));
00059 
00060 
00061 $exercice=new Exercice($cn);
00062 ?>
00063 <div class="content">
00064     <form method="get" class="print">
00065       <?php echo HtmlInput::get_to_hidden(array('gDossier','ac',));?>
00066       <?php echo $exercice->select('p_exercice',$p_exercice)->input();?>
00067       <?php echo HtmlInput::submit("filter", _('Valider')); ?>
00068     </form>
00069 <table class="result">
00070         <tr>
00071 
00072                 <th>
00073                         <?php echo _('Date')?>
00074                 </th>
00075                 <th>
00076                         <?php echo _('Commentaire')?>
00077                 </th>
00078                 <th>
00079                         <?php echo _('Dépot')?>
00080                 </th>
00081                 <th>
00082                         <?php echo _('Utilisateur') ?>
00083                 </th>
00084                 <th>
00085 
00086                 </th>
00087         </tr>
00088         <?php for ($e=0;$e<count($a_change);$e++): ?>
00089         <?php $class=($e%2==0)?' class="even" ':' class="odd" '; ?>
00090         <tr <?php echo $class?>>
00091 
00092                 <td>
00093                         <?php echo   $a_change[$e]['str_date']?>
00094                 </td>
00095                 <td>
00096                         <?php echo h($a_change[$e]['c_comment'])?>
00097                 </td>
00098                 <td>
00099                         <?php echo h($a_change[$e]['r_name'])?>
00100                 </td>
00101                 <td>
00102                         <?php echo $a_change[$e]['tech_user']?>
00103                 </td>
00104                 <td>
00105                         <?php echo HtmlInput::anchor(_("Détail"),"javascript:void()",sprintf("onclick=\"stock_inv_detail('%s','%s')\"",$gDossier,$a_change[$e]['c_id']));?>
00106                 </td>
00107 
00108         </tr>
00109         <?php endfor; ?>
00110 </table>
00111 </div>
 All Data Structures Namespaces Files Functions Variables Enumerations