noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
doc_state.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 /**
00024  * @file
00025  * @brief Manage the status of the document (document_state)
00026  *
00027  */
00028 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00029 global $cn;
00030 
00031 if ( isset($_POST['add']))
00032 {
00033         if (trim ($_POST['s_value'])!="")
00034         {
00035                 if ( isset($_POST['s_state']))
00036                 {
00037                         $cn->exec_sql('insert into document_state(s_value,s_status) values ($1,$2)',array($_POST['s_value'],'C'));
00038                 }
00039                 else
00040                 {
00041                         $cn->exec_sql('insert into document_state(s_value) values ($1)',array($_POST['s_value']));
00042                 }
00043         }
00044 }
00045 $a_stat=$cn->get_array("select s_value,s_status from document_state order by 1");
00046 ?>
00047 
00048 <table>
00049         <?php for ($i=0;$i<count($a_stat);$i++):?>
00050 
00051         <tr>
00052                 <td>
00053                         <?php echo h($a_stat[$i]['s_value'])?>
00054                 </td>
00055 
00056                 <td>
00057                         <?php if ($a_stat[$i]['s_status']=='C') { echo _("Ferme l'action"); } ?>
00058                 </td>
00059         </tr>
00060         <?php endfor;?>
00061 </table>
00062 <h2>Ajout d'un état</h2>
00063 <form method="post" onsubmit="return confirm ('Vous confirmez ?'); ">
00064         <p>
00065                 Nom de l'état <?php $value=new IText("s_value",""); echo $value->input()?>
00066         </p>
00067         <p>
00068                 Cochez la case si cet état ferme une action <?php $state=new ICheckBox("s_state",""); echo $state->input()?>
00069                 <?php echo HtmlInput::submit("add", "Ajouter")?>
00070         </p>
00071 </form>
 All Data Structures Namespaces Files Functions Variables Enumerations