Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 require_once("class_ihidden.php");
00027 require_once ('class_anc_plan.php');
00028 require_once ('class_anc_print.php');
00029 require_once ('class_anc_operation.php');
00030
00031
00032
00033
00034
00035
00036 class Anc_Listing extends Anc_Print
00037 {
00038 function display_form($p_string="")
00039 {
00040 echo '<form method="get">';
00041 $r=parent::display_form($p_string);
00042 $r.=HtmlInput::submit('result','Afficher');
00043 $r.= '</form>';
00044 return $r;
00045
00046 }
00047
00048
00049
00050
00051 function get_request()
00052 {
00053 parent::get_request();
00054 $this->pa_id=(isset($_REQUEST['pa_id']))?$_REQUEST['pa_id']:"";
00055 }
00056
00057
00058
00059
00060
00061
00062
00063 function display_html()
00064 {
00065 $idx=0;
00066 $r="";
00067
00068 $array=$this->load();
00069 if ( is_array($array) == false )
00070 {
00071 return $array;
00072
00073 }
00074
00075 if ( empty($array) )
00076 {
00077 $r.= _("aucune donnée");
00078 return $r;
00079 }
00080 $r.= '<table class="result" style="width=100%">';
00081 $r.= '<tr>'.
00082 '<th>'._('Date').'</th>'.
00083 '<th>'._('Poste').'</th>'.
00084 '<th>'._('Quick_code').'</th>'.
00085 '<th>'._('Analytique').'</th>'.
00086 th(_('Description')).
00087 '<th>'._('libelle').'</th>'.
00088 '<th>'._('Num.interne').'</th>'.
00089 '<th>'._('Montant').'</th>'.
00090 '<th>'._('D/C').'</th>'.
00091 '</tr>';
00092 foreach ( $array as $row )
00093 {
00094 $class=($idx%2==0)?'even':'odd';
00095 $idx++;
00096 $r.= '<tr class="'.$class.'">';
00097 $detail=($row['jr_id'] != null)?HtmlInput::detail_op($row['jr_id'],$row['jr_internal']):'';
00098 $post_detail=($row['j_poste'] != null)?HtmlInput::history_account($row['j_poste'],$row['j_poste']):'';
00099 $card_detail=($row['f_id'] != null)?HtmlInput::history_card($row['f_id'],$row['qcode']):'';
00100
00101 $r.=
00102 '<td>'.$row['oa_date'].'</td>'.
00103 td($post_detail).
00104 td($card_detail).
00105 '<td>'.h($row['po_name']).'</td>'.
00106 '<td>'.h($row['oa_description']).'</td>'.
00107 td($row['jr_comment']).
00108 '<td>'.$detail.'</td>'.
00109 '<td class="num">'.nbm($row['oa_amount']).'</td>'.
00110 '<td>'.(($row['oa_debit']=='f')?'CREDIT':'DEBIT').'</td>';
00111 $r.= '</tr>';
00112 }
00113 $r.= '</table>';
00114 return $r;
00115 }
00116
00117
00118
00119
00120
00121 function load()
00122 {
00123 $op=new Anc_Operation ($this->db);
00124 $op->pa_id=$this->pa_id;
00125 $array=$op->get_list($this->from,$this->to,$this->from_poste,$this->to_poste);
00126 return $array;
00127 }
00128
00129
00130
00131
00132
00133 function display_csv()
00134 {
00135 $array=$this->load($this->from,$this->to,$this->from_poste,$this->to_poste);
00136 if ( empty($array) == true )
00137 {
00138 return $array;
00139
00140 }
00141 $r="";
00142 foreach ( $array as $row)
00143 {
00144
00145 $r.=sprintf('"%s";',$row['oa_date']);
00146 $r.=sprintf('"%s";',$row['j_poste']);
00147 $r.=sprintf('"%s";',$row['qcode']);
00148 $r.=sprintf('"%s";',$row['po_name']);
00149 $r.=sprintf('"%s";',$row['oa_description']);
00150 $r.=sprintf('"%s";',$row['oa_description']);
00151
00152 $r.=sprintf("%12.2f;",$row['oa_amount']);
00153 $r.=sprintf("'%s'",(($row['oa_debit']=='f')?'CREDIT':'DEBIT'));
00154 $r.="\r\n";
00155 }
00156 return $r;
00157
00158 }
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169 function show_button($p_string='')
00170 {
00171 $r="";
00172 $submit=HtmlInput::submit('','');
00173 $hidden=new IHidden();
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188 $r.= '<form method="GET" action="export.php" style="display:inline">';
00189 $r.= HtmlInput::hidden("to",$this->to);
00190 $r.= HtmlInput::hidden("from",$this->from);
00191 $r.= HtmlInput::hidden("pa_id",$this->pa_id);
00192 $r.= HtmlInput::hidden("from_poste",$this->from_poste);
00193 $r.= HtmlInput::hidden("to_poste",$this->to_poste);
00194 $r.=HtmlInput::hidden('act','CSV:AncList');
00195 $r.=HtmlInput::hidden('ac',$_REQUEST['ac']);
00196 $r.= $p_string;
00197 $r.= dossier::hidden();
00198 $r.=HtmlInput::submit('bt_csv',"Export en CSV");
00199 $r.= '</form>';
00200 return $r;
00201
00202 }
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212 static function test_me()
00213 {
00214 }
00215 }