* * parm : * - Label * - The type * - Name of the variable * - Default Value * - View_only * - $p_list for the select, give the possible values item[0] is the val and item[1] * is the label * gen : * - None * return: string */ function InputType($p_label,$p_type,$p_name,$p_value,$p_viewonly=false,$p_list=null) { // View only if ( $p_viewonly==false) return "$p_label$value"; // Input type == select if ( strtolower($p_type)=="select" ) { $r=" $p_label"; $r.=sprintf('"; return $r; } // input type == TEXT if ( strtolower($p_type)=="text") { $r=sprintf('%s ', $p_label, $p_type, $p_name, $p_value); return $r; } } /* function FormVente * Purpose : Display the form for a sell * Used to show detail, encode a new invoice * or update one * * parm : * - p_array which can be empty * - the "journal" * - view_only if we cannot change it (no right or centralized op) * gen : * - * return: string with the form */ function FormVente($p_cn,$p_jrn,$p_array=null,$view_only=true) { $r=""; if ( $view_only == false) { $r="
"; } $r.=''; $r.=''.InputType("Date ","Text","e_date","",$view_only).''; include_once("fiche_inc.php"); $fiche=GetFicheJrn($p_cn,$p_jrn,'cred'); $r.=''.InputType("Client ","SELECT","e_client","",$view_only,$fiche).''; $fiche=GetFicheJrn($p_cn,$p_jrn,'deb'); $r.=''.InputType("Article","SELECT","e_march","",$view_only,$fiche); $r.=InputType("Qt","TEXT","e_quant","",$view_only); $r.=''; $r.="
"; return $r; }