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; } } function make_display(){ global $msg, $dbh,$charset; $rqt = "select temps_passe from demandes_actions where id_action='".$this->idobjet."'"; $res = mysql_query($rqt,$dbh); $act = mysql_fetch_object($res); $display =""; $submit = ""; switch($this->champ_entree){ case 'text': $display = "
$submit
"; break; default: $display = ""; break; } $this->display = $display; } function update(){ global $dbh, $temps, $msg; $req = "update demandes_actions set temps_passe='".$temps."' where id_action='".$this->idobjet."'"; 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; } } } ?>