public function unformat($value) { if (!empty($value)) { return php_sql_date(date_php($value)); } return ""; }
function setDbVars($id = 0) { if ($id == 0 && $this->cur_id != 0) { $id = $this->getCurId(); } include_once "db_funcs.php"; $link = openDb(); $req = "SELECT * FROM {$this->name} where ID_{$this->name} = {$id}"; // print "<H1>$req </H1><BR>"; $result = queryDb($link, $req); //$num_rows = mysql_num_rows( $result ); //Aller chercher dans la table Gestab while ($a_row = fetchRowAssocDb($result)) { while (list($key, $value) = each($a_row)) { // print "Clé: $key; Valeur: $value<br>"; if (ereg("_DATE\$", $key)) { $this->vars[$key] = date_php($value); } else { $this->vars[$key] = $value; } } } //mysql_free_result($result); closeDb($link); return 0; }