Viewing file: m_umuser.php (1.79 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include_once("da_umuser.php"); class M_Umuser extends Da_umuser {
function getAll($aOrderBy=""){ $orderBy = ""; if (is_array($aOrderBy)) { $orderBy.="ORDER BY "; foreach ($aOrderBy as $key => $value) { $orderBy.= "$key $value, "; } $orderBy = substr($orderBy, 0, strlen($orderBy)-2); } $sql = "SELECT * FROM umuser $orderBy"; $query = $this->db->query($sql); return $query ; } //and UsActive=1" function check_user($un, $pwd){ $sql = "select * from umuser where UsLogin =? and UsPassword =? "; $result = $this->db->query($sql, array($un,md5("O]O".$pwd."O[O"))); if($result->num_rows()<>0){ //if($result){ return $result->row_array(); }else{ return false; } }
public function qry() { $sql = "SELECT * FROM UMUSER"; $query = $this->db->query($sql); return $query; }
function test2db(){ $db_rg=$this->load->database('rg',TRUE); $db_ppc=$this->load->database('ppc',TRUE); $sql = "SELECT * FROM $db_rg->database.rg_Person, $db_rg->database.rg_Prefix, $db_ppc->database.Person WHERE $db_rg->database.rg_Person.prsUsId=$db_ppc->database.Person.personId AND $db_ppc->database.Person.prefixId=$db_rg->database.rg_Prefix.pfId" ; $query = $db_rg->query($sql); return $query; }
function checkUserByPsId ($ps_id) { $sql = "select * from umuser where UsPsCode =?"; $result = $this->db->query($sql, array($ps_id)); if ($result->num_rows() <> 0) { return $result->row_array(); } else { return false; } }
function qryUmUserByUsPsCode($usPsCode){ $sql = "select * from ".$this->config->item('alumni_ums_dbname').".umuser where UsPsCode =?"; $query = $this->db->query($sql, array($usPsCode)); return $query; } } //=== end class Umuser
?>
|