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

show_tva.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 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00020 /* $Revision: 1.8 $ */
00025 include_once ("ac_common.php");
00026 include_once ("postgres.php");
00027 /* Admin. Dossier */
00028 $rep=DbConnect();
00029 include_once ("class_user.php");
00030 $User=new cl_user($rep);
00031 $User->Check();
00032 
00033 html_page_start($User->theme,"onLoad='window.focus();'");
00034 
00035 if ( ! isset ( $_SESSION['g_dossier'] ) ) {
00036   echo "You must choose a Dossier ";
00037   phpinfo();
00038   exit -2;
00039 }
00040 ?>
00041 <script>
00042 function GetIt(ctl,tva_id) {
00043            self.opener.SetValue(ctl,tva_id)
00044            window.close();      
00045         } 
00046 </script>
00047 <?
00048 
00049 $condition="";
00050 $cn=DbConnect($_SESSION['g_dossier']);
00051 $Res=ExecSql($cn,"select * from tva_rate order by tva_rate desc");
00052 $Max=pg_NumRows($Res);
00053 echo "<TABLE BORDER=\"1\">";
00054 for ($i=0;$i<$Max;$i++) {
00055   $row=pg_fetch_array($Res,$i);
00056   $set=sprintf( '<INPUT TYPE="BUTTON" Value="select" onClick="GetIt(\'%s\',\'%s\');">',
00057              $_GET['ctl'],$row['tva_id']);
00058   printf("<tr><TD BGCOLOR=\LIGHTGREEN\" >%s %d</TD><TD>%s</TD><TD>%s</TD></TR>",
00059          $set,
00060          $row['tva_id'],
00061          $row['tva_label'],
00062          $row['tva_comment']);
00063 }
00064 echo '</TABLE>';
00065 ?>
00066 <input type='button' Value="fermer" onClick='window.close();'>
00067 <?
00068 html_page_stop();
00069 ?>