"; $l_sessid=(isset($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID']; $r.=""; $r.=" Date "; $r.=" Echéance "; $r.=" Description"; $r.=" Montant "; $r.="Op. Concernée"; $r.=""; for ($i=0; $i < $Max;$i++) { $row=pg_fetch_array($Res,$i); if ( $i % 2 == 0 ) $tr=''; else $tr=''; $r.=$tr; // date $r.=""; $r.=$row['jr_date']; $r.=""; // echeance $r.=""; $r.=$row['jr_ech']; $r.=""; // comment $r.=""; $r.=sprintf(' %s', "Détail",$row['jr_grpt_id'],$l_sessid,$row['jr_comment']); $r.=""; $r.=""; // Amount $r.=""; $r.=$row['jr_montant']; $r.=""; // Rapt $r.=""; $r.=''; $r.=$row['jr_rapt']; $r.=""; $r.=""; // TODO Add print // end row $r.=""; } $r.=""; return $r; } /* function InsertStockGoods($p_cn,$j_id,$a_good[$i],$a_quant[$i],'c'); ************************************************** * Purpose : Insert data into stock_goods, * * parm : * - $p_cn database connection * - $p_j_id the j_id * - $p_goods the goods * - $p_quant quantity * - $p_type c for credit or d for debit * gen : * - none * return: * none */ function InsertStockGoods($p_cn,$p_j_id,$p_good,$p_quant,$p_type) { if ( $p_type == 'd' ) $col='sg_quantity_deb'; else $col='sg_quantity_cred'; $Res=ExecSql($p_cn,"insert into stock_goods ( j_id, f_id, $col) values ( $p_j_id, $p_good, $p_quant) "); } /* function withStock($p_cn,$p_f_id) ************************************************** * Purpose : return true if we manage stock for it * value is stored in attr_value * * parm : * - $p_cn database connection * - $p_f_id fiche.f_id * gen : * - none * return: * none */ function withStock($p_cn,$p_f_id) { $a=getFicheAttribut($p_cn,$p_f_id, ATTR_DEF_STOCK); if ( $a == "1" ) return true; return false; }