';
return $r;
}
/*!
* \brief
* \param
* \param
* \param
*
*
* \return
*/
function get_data()
{
$op=new operation ($this->db);
$op->pa_id=$this->pa_id;
$array=$op->get_list($this->from,$this->to,$this->from_poste,$this->to_poste);
return $array;
}
function display_csv()
{
$array=$this->get_data($this->from,$this->to,$this->from_poste,$this->to_poste);
if ( empty($array) == true ){
return $array;
}
$r="";
foreach ( $array as $row) {
// the name and po_id
$r.=sprintf("'%s',",$row['oa_date']);
$r.=sprintf("'%s',",$row['po_name']);
$r.=sprintf("'%s',",$row['oa_description']);
$r.=sprintf("%12.2f,",$row['oa_amount']);
$r.=sprintf("'%s'",(($row['oa_debit']=='f')?'CREDIT':'DEBIT'));
$r.="\r\n";
}
return $r;
}
/*!
* \brief show the export button to pdf and CSV
* \param $p_string string containing some HTML tag as hidden field
* \param
* \param
*
*
* \return string containing the html code
*/
function show_button($p_string='') {
$r="";
$submit=new widget();
$submit->table=0;
$hidden=new widget("hidden");
/* for the export in PDF
* Not yet needed, the html print should be enough
$r.= '';
*/
$r.= '';
return $r;
}
/*!
* \brief debugging and test function for dev. only
* \param
* \param
* \param
*
*
* \return
*/
static function test_me() {
}
}