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

class_operation.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$ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00026 
00027 // If print is asked
00028 // First time in html
00029 // after in pdf or cvs
00031 if ( isset( $_POST['bt_html'] ) ) {
00032 include("jrn.php");
00033  $p_cent=( isset ( $_POST['cent']) )?'on':'off';
00034   // $POST=from_periode, to_periode, jrn_id, cent
00035   echo_debug('class_operation.php',__LINE__," jrn sql = $sql");
00036   $Jrn=new jrn($cn,$_POST['jrn_id']);
00037   $Jrn->GetName();
00038   $Jrn->GetRow( $_POST['from_periode'],
00039                 $_POST['to_periode'],
00040                 $p_cent);
00041   foreach ($Jrn->row as $op) {
00042     $a=new operation ($cn,$op);
00043     $a->cent=$p_cent;
00044 
00045 
00046   }
00047 
00048  }
00049 
00051 // Show the jrn and date
00053 include_once('form_input.php');
00054 include_once("postgres.php");
00055 include_once("class_widget.php");
00056 if ( $User->Admin() ==0) {
00057   $ret=make_array($cn,"select jrn_def_id,jrn_def_name
00058                              from jrn_def join jrn_type on jrn_def_type=jrn_type_id
00059                              join user_sec_jrn on uj_jrn_id=jrn_def_id 
00060                              where
00061                              uj_login='$User->id'
00062                              and uj_priv !='X'
00063                              ");
00064     } else {
00065   $ret=make_array("select jrn_def_id,jrn_def_name
00066                              from jrn_def join jrn_type on jrn_def_type=jrn_type_id");
00067 
00068  } 
00069 
00070 //    include_once("check_priv.php");
00071 // printf ('<TR><TD class="cell"><a class="mtitle"
00072 //        href="user_impress.php?type=jrn&action=print&p_id=%d">%s</a></TD></TR>',$l_line['jrn_def_id'],$l_line['jrn_def_name']);
00073 
00074 // Count the forbidden journaux
00075     $NoPriv=CountSql($cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
00076                                 jrn_deb_max_line,jrn_cred_max_line
00077                              from jrn_def join jrn_type on jrn_def_type=jrn_type_id
00078                              join  user_sec_jrn on uj_jrn_id=jrn_def_id 
00079                              where  
00080                              uj_login='$User->id'
00081                              and uj_priv ='X'
00082                    ");
00083     // Pour voir tout les journal ?
00084     if ( $NoPriv == 0 ) {
00085       $a=count($ret);
00086       $all=array('value'=>0,'label'=>'All');
00087       $ret[$a]=$all;
00088    }
00089 if ( count($ret) < 1 ) 
00090   NoAccess();
00092 // Form
00094 echo '<div class="u_redcontent">';
00095 echo '<FORM ACTION="?type=jrn" METHOD="POST">';
00096 echo '<TABLE><TR>';
00097 $w=new widget("select");
00098 $w->table=1;
00099 $w->label="Choississez le journal";
00100 print $w->IOValue("jrn_id",$ret);
00101 print '</TR>';
00102 print '<TR>';
00103 $periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id");
00104 $w->label="Depuis";
00105 print $w->IOValue('from_periode',$periode_start);
00106 $w->label=" jusqu'à ";
00107 $periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode order by p_id");
00108 print $w->IOValue('to_periode',$periode_end);
00109 print "</TR><TR>";
00110 $centralise=new widget("checkbox");
00111 $centralise->label="Depuis les journaux centralisés";
00112 $centralise->table=1;
00113 print $centralise->IOValue('cent');
00114 
00115 print "</TR>";
00116 echo '</TABLE>';
00117 print $w->Submit('bt_html','Impression');
00118 
00119 echo '</FORM>';
00120 echo '</div>';
00121 ?>

Generated on Fri Jun 23 00:12:45 2006 for phpcompta by  doxygen 1.4.4