diff --git a/htdocs/lib/mysql.lib.php3 b/htdocs/lib/mysql.lib.php3 index 219bc14df9a..4dba652648a 100644 --- a/htdocs/lib/mysql.lib.php3 +++ b/htdocs/lib/mysql.lib.php3 @@ -34,126 +34,161 @@ class Db { global $conf; - if ($host == '') { - $host = $conf->db->host; - } - if ($user == '') { - $user = $conf->db->user; - } - if ($pass == '') { - $pass = $conf->db->pass; - } + if ($host == '') + { + $host = $conf->db->host; + } + + if ($user == '') + { + $user = $conf->db->user; + } + + if ($pass == '') + { + $pass = $conf->db->pass; + } - if ($name == '') { - $name = $conf->db->name; - } + if ($name == '') + { + $name = $conf->db->name; + } $this->db = $this->connect($host, $user, $pass); - if (! $this->db) { - print "Db->Db() raté
\n"; - $this->ok = 0; - return 0; - } + if (! $this->db) + { + print "Db->Db() raté
\n"; + $this->ok = 0; + return 0; + } + $ret = $this->select_db($name); + $this->ok = 1; + return $ret; + } /* * */ - Function select_db($database) { - return mysql_select_db($database, $this->db); - } + Function select_db($database) + { + return mysql_select_db($database, $this->db); + } /* * */ - Function connect($host, $login, $passwd) { - $this->db = mysql_connect($host, $login, $passwd); - return $this->db; - } + Function connect($host, $login, $passwd) + { + $this->db = mysql_connect($host, $login, $passwd); + return $this->db; + } /* * */ - Function clone() { - $db2 = new Db("", "", "", "", ""); - $db2->db = $this->db; - return $db2; - } - - Function pconnect($host, $login, $passwd) { - $this->db = mysql_pconnect($host, $login, $passwd); - return $this->db; - } - - Function close() { - $this->ret = mysql_close($this->db); - return $this->ret; - } - - Function query($query, $limit="", $offset="") { - $query = trim($query); - $this->results = mysql_query($query, $this->db); - return $this->results; - } - - Function result($nb, $fieldname) { - return mysql_result($this->results, $nb, $fieldname); - } - - Function free() { - return mysql_free_result($this->results); - } - - Function fetch_object() { - return mysql_fetch_object($this->results); - } - - Function plimit($limit=0,$offset=0) { - if ($offset > 0) { - return " LIMIT $offset,$limit "; - } else { - return " LIMIT $limit "; + Function clone() + { + $db2 = new Db("", "", "", "", ""); + $db2->db = $this->db; + return $db2; } - } - Function pdate($fname) { - return "unix_timestamp($fname)"; - } + Function pconnect($host, $login, $passwd) + { + $this->db = mysql_pconnect($host, $login, $passwd); + return $this->db; + } - Function idate($fname) { - return strftime("%Y%m%d%H%M%S",$fname); - } + Function close() + { + $this->ret = mysql_close($this->db); + return $this->ret; + } - Function fetch_array() { - return mysql_fetch_array($this->results); - } - Function fetch_row() { - return mysql_fetch_row($this->results); - } - Function fetch_field() { - return mysql_fetch_field($this->results); - } - Function num_rows() { - return mysql_num_rows($this->results); - } - Function affected_rows() { - return mysql_affected_rows($this->results); - } - Function num_fields() { - return mysql_num_fields($this->results); - } - Function error() { - return mysql_error($this->db); - } - Function last_insert_id() { - return mysql_insert_id(); - } - Function affected_rows() { - return mysql_affected_rows(); + Function query($query, $limit="", $offset="") + { + $query = trim($query); + $this->results = mysql_query($query, $this->db); + return $this->results; + } + + Function result($nb, $fieldname) + { + return mysql_result($this->results, $nb, $fieldname); + } + + Function free() + { + return mysql_free_result($this->results); + } + + Function fetch_object() + { + return mysql_fetch_object($this->results); } + + Function plimit($limit=0,$offset=0) + { + if ($offset > 0) { + return " LIMIT $offset,$limit "; + } else { + return " LIMIT $limit "; + } + } + + Function pdate($fname) + { + return "unix_timestamp($fname)"; + } + + Function idate($fname) + { + return strftime("%Y%m%d%H%M%S",$fname); + } + + Function fetch_array() + { + return mysql_fetch_array($this->results); + } + + Function fetch_row() + { + return mysql_fetch_row($this->results); + } + + Function fetch_field() + { + return mysql_fetch_field($this->results); + } + + Function num_rows() + { + return mysql_num_rows($this->results); + } + + Function num_fields() + { + return mysql_num_fields($this->results); + } + + Function error() + { + return mysql_error($this->db); + } + + Function last_insert_id() + { + return mysql_insert_id(); + } + + Function affected_rows() + { + return mysql_affected_rows(); + } } ?> diff --git a/htdocs/user/fiche.php3 b/htdocs/user/fiche.php3 index 5b4ddcc3664..ceea00e9465 100644 --- a/htdocs/user/fiche.php3 +++ b/htdocs/user/fiche.php3 @@ -85,13 +85,13 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
Prénom
Nom
Login
Description'; @@ -120,9 +120,9 @@ else print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/user/index.php3 b/htdocs/user/index.php3 index a710d5a26bb..f033cdfad9c 100644 --- a/htdocs/user/index.php3 +++ b/htdocs/user/index.php3 @@ -41,8 +41,8 @@ if ($result) print ''; print ""; print ""; - print ""; print ''; + print ""; print "\n"; $var=True; while ($i < $num)
Nom'.$fuser->nom.''.$fuser->nom.'Prénom'.$fuser->prenom.'
'.$fuser->prenom.'
Login'.$fuser->login.'
PrenomNomcodelogincode