noalyss Version-9
anc_group.inc.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 *\brief manage the group
24 *
25 */
26if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
28
29
30//----------------------------------------------------------------------
31// REMOVE
32if ( isset ($_POST['remove']))
33{
34 if (isset($_POST['ck'] ))
35 {
36 foreach ($_POST['ck'] as $m )
37 {
38 $obj=new Anc_Group($cn);
39 $obj->ga_id=$m;
40 $obj->remove();
41 }
42 }
43}
44
45//----------------------------------------------------------------------
46// INSERT
47if ( isset($_POST['add']))
48{
49 $obj=new Anc_Group($cn);
50 $obj->get_from_array($_POST);
51 echo $obj->insert();
52}
53$array=$r->myList();
54
55echo '<div class="content" >';
56echo '<form method="post">';
57echo dossier::hidden();
58echo '<table class="result" >';
59echo '<tr> <th>'._("Code")." </th><th>"._("Plan")." </td><th>"._("Description").'</th></tr>';
60foreach ($array as $idx=>$m)
61{
62 echo '<tr>';
63 echo '<td>'.h($m->ga_id).'</td>';
64 echo '<td>'.h($m->pa_name).'</td>';
65 echo '<td>'.h($m->ga_description).'</td>';
66 echo '<td> Effacer <input type="Checkbox" name="ck[]" value="'.$m->ga_id.'">'.'</td>';
67 echo '</tr>';
68}
69$w=new IText("ga_id");
70$wDesc=new IText("ga_description");
71$val_pa_id=$cn->make_array("select pa_id,pa_name from plan_analytique");
72$wPa_id=new ISelect("pa_id");
74
75echo "<td>".$w->input()."</td>";
76echo "<td>".$wPa_id->input("pa_id")."</td>";
77echo "<td>".$wDesc->input("ga_description").
78HtmlInput::submit('add',_('Ajouter')).
79"</td>";
80;
81
82echo '</table>';
83
84echo "<hr>";
85echo HtmlInput::submit('remove',_('Effacer'));
86
87echo '</div>';
$idx
$wPa_id
$val_pa_id
foreach($array as $idx=> $m) $w
$wDesc
if(isset( $_POST[ 'remove'])) if(isset($_POST['add'])) $array
class for the group of the analytic account
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Html Input.
Definition: itext.class.php:30
$_POST['ac']
Definition: do.php:310