noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
anc_group.inc.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  *\brief manage the group
00024  *
00025  */
00026 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00027 require_once("class_itext.php");
00028 require_once("class_iselect.php");
00029 require_once ('class_anc_group.php');
00030 $r=new Anc_Group($cn);
00031 
00032 
00033 //----------------------------------------------------------------------
00034 // REMOVE
00035 if ( isset ($_POST['remove']))
00036 {
00037     if (isset($_POST['ck'] ))
00038     {
00039         foreach ($_POST['ck'] as $m )
00040         {
00041             $obj=new Anc_Group($cn);
00042             $obj->ga_id=$m;
00043             $obj->remove();
00044         }
00045     }
00046 }
00047 
00048 //----------------------------------------------------------------------
00049 // INSERT
00050 if ( isset($_POST['add']))
00051 {
00052     $obj=new Anc_Group($cn);
00053     $obj->get_from_array($_POST);
00054     echo $obj->insert();
00055 }
00056 $array=$r->myList();
00057 
00058 echo '<div class="content" >';
00059 echo '<form method="post">';
00060 echo dossier::hidden();
00061 echo '<table class="result"  >';
00062 echo '<tr> <th>'._("Code")." </th><th>"._("Plan")." </td><th>"._("Description").'</th></tr>';
00063 foreach ($array as $idx=>$m)
00064 {
00065     echo '<tr>';
00066     echo '<td>'.h($m->ga_id).'</td>';
00067     echo '<td>'.h($m->pa_name).'</td>';
00068     echo '<td>'.h($m->ga_description).'</td>';
00069     echo '<td> Effacer <input type="Checkbox" name="ck[]" value="'.$m->ga_id.'">'.'</td>';
00070     echo '</tr>';
00071 }
00072 $w=new IText("ga_id");
00073 $wDesc=new IText("ga_description");
00074 $val_pa_id=$cn->make_array("select pa_id,pa_name from plan_analytique");
00075 $wPa_id=new ISelect("pa_id");
00076 $wPa_id->value=$val_pa_id;
00077 
00078 echo "<td>".$w->input()."</td>";
00079 echo "<td>".$wPa_id->input("pa_id")."</td>";
00080 echo "<td>".$wDesc->input("ga_description").
00081 HtmlInput::submit('add',_('Ajouter')).
00082 "</td>";
00083 ;
00084 
00085 echo '</table>';
00086 
00087 echo "<hr>";
00088 echo HtmlInput::submit('remove',_('Effacer'));
00089 
00090 echo '</div>';
 All Data Structures Namespaces Files Functions Variables Enumerations