Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

fiche_def.inc.php

Go to the documentation of this file.
00001 <?
00002 /*
00003  *   This file is part of PhpCompta.
00004  *
00005  *   PhpCompta 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  *   PhpCompta 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 PhpCompta; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 /* $Revision: 1.4 $ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00021 require_once("class_fiche_def.php");
00026 // record change
00027 if ( isset ($_POST['confirm_mod'])) {
00028   extract ($_POST);
00029   $update=new fiche_def_ref($cn);
00030   $update->frd_id=FormatString($frd_id);
00031   $update->frd_text=FormatString($frd_text);
00032   $update->frd_class_base=FormatString($frd_class_base);
00033   $update->Save();
00034 }
00035 // Load All Fiche_def
00036 $fiche_def=new fiche_def_ref($cn);
00037 $all=$fiche_def->LoadAll();
00038 // Display Them
00039 echo '<table align="left">';
00040 for ($i=0;$i<sizeof($all);$i++) 
00041 {
00042   echo '<TR>';
00043   echo $all[$i]->Display();
00044   echo "<TD>";
00045   echo '<form method="post">';
00046   $w=new widget('hidden');
00047   echo $w->IOValue('idx',$i);
00048   echo $w->Submit('mod','modifie');
00049   echo $w->IOValue('fiche','p_action');
00050   echo "</form>";
00051   echo "</TD>";
00052   echo '</TR>';
00053 }
00054 echo "</table>";
00055 // modify input
00056 if ( isset ($_POST['mod']) ) 
00057 {
00058   extract ($_POST);
00059   echo '<div style="position:float;padding:2%">';
00060   echo "Voulez-vous modifier ?<br><font color=\"red\"> Attention, ne changer pas la signification de ";
00061   echo " ce poste, <i>par exemple ne pas changer Client par fournisseur</i>, <br>sinon le programme fonctionnera mal, utiliser uniquement des chiffres pour la classe de base ou rien</font>";
00062   $idx=$_POST['idx'];
00063   $mod=new fiche_def_ref($cn);
00064   $mod->frd_id=$all[$idx]->frd_id;
00065   $mod->frd_text=$all[$idx]->frd_text;
00066   $mod->frd_class_base=$all[$idx]->frd_class_base;
00067   echo '<form method="post">';
00068   echo '<ul style="list-style-type:none"';
00069   echo $mod->Input();
00070   echo "</ul>";
00071   $w=new widget("hidden");
00072   echo $w->IOValue('p_action','fiche');
00073   echo $w->Submit('confirm_mod' ,'Confirme');
00074   echo $w->Submit('no','Cancel');
00075   echo '</form>';
00076   echo '</div>';
00077 }