GetName(); // step asked ? //-- if ($_GET['p_step'] == 0 ) { if ( $_GET ['type_periode'] == 0 ) $array=$Form->GetRow( $_GET['from_periode'],$_GET['to_periode'], $_GET['type_periode']); else $array=$Form->GetRow( $_GET['from_date'],$_GET['to_date'], $_GET['type_periode']); } else { // step are asked //-- for ($e=$_GET['from_periode'];$e<=$_GET['to_periode'];$e+=$_GET['p_step']) { $periode=getPeriodeName($cn,$e); if ( $periode == null ) continue; $array[]=$Form->GetRow($e,$e,$_GET['type_periode']); $periode_name[]=$periode; } } $rep=""; $submit=new widget(); $hid=new widget("hidden"); echo '
'; if ( $_GET['type_periode'] == 0) { $t=($_GET['from_periode']==$_GET['to_periode'])?"":" -> ".getPeriodeName($cn,$_GET['to_periode'],'p_end'); echo '

'.$Form->id." ".$Form->name. " - ".getPeriodeName($cn,$_GET['from_periode'],'p_start'). " ".$t. '

'; } else { echo '

'.$Form->id." ".$Form->name. ' Date :'. $_GET['from_date']. " au ". $_GET['to_date']. '

'; } echo ''; echo ''; echo '"; echo '"; echo '"; echo ""; echo "
'. dossier::hidden(). $submit->Submit('bt_other',"Autre Rapport"). $hid->IOValue("type","rapport").$hid->IOValue("p_action","impress")."
'. $submit->Submit('bt_pdf',"Export PDF"). dossier::hidden(). $hid->IOValue("type","rapport"). $hid->IOValue("p_action","impress"). $hid->IOValue("form_id",$Form->id). $hid->IOValue("from_periode",$_GET['from_periode']). $hid->IOValue("to_periode",$_GET['to_periode']). $hid->IOValue("p_step",$_GET['p_step']). $hid->IOValue("from_date",$_GET['from_date']). $hid->IOValue("to_date",$_GET['to_date']). $hid->IOValue("type_periode",$_GET['type_periode']); echo "
'. $submit->Submit('bt_csv',"Export CSV"). dossier::hidden(). $hid->IOValue("type","form"). $hid->IOValue("p_action","impress"). $hid->IOValue("form_id",$Form->id). $hid->IOValue("from_periode",$_GET['from_periode']). $hid->IOValue("to_periode",$_GET['to_periode']). $hid->IOValue("p_step",$_GET['p_step']). $hid->IOValue("from_date",$_GET['from_date']). $hid->IOValue("to_date",$_GET['to_date']). $hid->IOValue("type_periode",$_GET['type_periode']); echo "
"; if ( count($Form->row ) == 0 ) exit; if ( $_GET['p_step'] == 0) { // check the step // show tables ShowReportResult($Form->row); } else { $a=0; foreach ( $array as $e) { echo '

Periode : '.$periode_name[$a]."

"; $a++; ShowReportResult($e); } } echo "
"; exit; } //----------------------------------------------------- // Show the jrn and date //----------------------------------------------------- include_once("postgres.php"); $ret=make_array($cn,"select fr_id,fr_label from formdef order by fr_label"); if ( sizeof($ret) == 0 ) { echo "Aucun Rapport"; return; } //----------------------------------------------------- // Form //----------------------------------------------------- echo '
'; echo '
'; $hidden=new widget("hidden"); echo $hidden->IOValue("p_action","impress"); echo $hidden->IOValue("type","rapport"); echo dossier::hidden(); echo ''; $w=new widget("select"); $w->table=1; $w->label="Choississez le rapport"; print $w->IOValue("form_id",$ret); print ''; print ''; // filter on the current year $filter_year=" where p_exercice='".$User->getExercice()."'"; $periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end"); $w->label="Période comptable : Depuis"; print $w->IOValue('from_periode',$periode_start); $w->label=" jusqu'à "; $periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end"); print $w->IOValue('to_periode',$periode_end); print ""; //--- by date $date=new widget('js_date'); $date->table=1; $date->label="Calendrier depuis :"; echo $date->IOValue('from_date'); $date->label="jusque"; echo $date->IOValue('to_date'); //-- calendrier ou periode comptable $aCal=array( array('value'=>0,'label'=>'Période comptable'), array('value'=>1,'label'=>'Calendrier') ); $w->label='Type de date : '; echo ''; echo $w->IOValue('type_periode',$aCal); echo ''; $aStep=array( array('value'=>0,'label'=>'Pas d\'étape'), array('value'=>1,'label'=>'1 mois') ); $w->label='Par étape de'; echo ' '.$w->IOValue('p_step',$aStep); echo ''; echo '
'; echo ' Attention : vous ne pouvez pas utiliser les étapes avec les dates calendriers.'; echo '
'; echo ' Les clauses FROM sont ignorés avec les dates calendriers'; echo '
'; print $w->Submit('bt_html','Impression'); echo '
'; echo '
'; //----------------------------------------------------- // Function //----------------------------------------------------- function ShowReportResult($p_array) { echo ''; echo "". "". "". ""; $i=0; foreach ( $p_array as $op ) { $i++; $class= ( $i % 2 == 0 )?' class="odd"':""; echo "". "". "". ""; } echo "
Description montant
".$op['desc']."".sprintf("% 8.2f",$op['montant'])."
"; } ?>