id_element = $id_elt; $format_affichage = explode('/',$fieldElt); $this->champ_entree = $format_affichage[0]; if($format_affichage[1]) $this->champ_sortie = $format_affichage[1]; $ids = explode("_",$id_elt); $this->idobjet = $ids[1]; switch($quoifaire){ case 'edit': $this->make_display(); break; case 'save': $this->update(); break; } } public function make_display(){ global $msg, $charset,$pmb_gestion_devise,$dbh; $rqt="select montant, recouvr_type from recouvrements where recouvr_id='".$this->idobjet."'"; $res = pmb_mysql_query($rqt,$dbh); $act = pmb_mysql_fetch_object($res); $display =""; $submit = ""; switch($this->champ_entree){ case 'text': $display = "
$submit
"; break; default: $display = ""; break; } $this->display = $display; } public function update(){ global $dbh, $recouvr_prix, $pmb_gestion_devise; $req = "update recouvrements set montant='".$recouvr_prix."' where recouvr_id='".$this->idobjet."'"; pmb_mysql_query($req,$dbh); if(!$recouvr_prix)$recouvr_prix="0.00"; switch($this->champ_sortie){ default : if(strpos($recouvr_prix,$pmb_gestion_devise) !== false) $this->display = $recouvr_prix; else $this->display = $recouvr_prix." ".$pmb_gestion_devise; break; } } } ?>