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, $dbh,$charset; $rqt = "select temps_passe from demandes_actions where id_action='".$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, $temps, $msg; $req = "update demandes_actions set temps_passe='".$temps."' where id_action='".$this->idobjet."'"; pmb_mysql_query($req,$dbh); switch($this->champ_sortie){ default : if(strpos($temps,$msg['demandes_action_time_unit']) !== false) $this->display = $temps; else $this->display = $temps.$msg['demandes_action_time_unit']; break; } } } ?>