66 lines
2.1 KiB
PHP
Executable File
66 lines
2.1 KiB
PHP
Executable File
<?php
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
class PatientDashboard_model extends CI_model
|
|
{
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->database();
|
|
|
|
}
|
|
function checkEmail($ion_user_id,$email)
|
|
{
|
|
// $result=$this->db->get_where('users', array('email' => $email))->row();
|
|
$result=$this->db->get_where('users', array('id' => $ion_user_id))->row();
|
|
$ion_email=$result->email;
|
|
if($email==$ion_email){
|
|
return true;
|
|
}else{
|
|
$result=$this->db->get_where('users', array('email' => $email))->row();
|
|
if($result){
|
|
return false;
|
|
}else{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
function check_patient_email_avl($pid,$email){
|
|
$row=$this->db->get_where('patient_details', array('id'=>$pid))->row();
|
|
$patient_email=$row->patient_email;
|
|
$patient_ion_user_email=$this->db->get_where('users',array('id'=>$row->ion_user_id))->row()->email;
|
|
if($email==$patient_email || $email==$patient_ion_user_email){
|
|
return true;
|
|
}else{
|
|
$rec1=$this->db->get_where('patient_details',array('patient_email'=>$email));
|
|
$rec2=$this->db->get_where('users',array('email'=>$email));
|
|
return ($rec1->num_rows()>0 || $rec2->num_rows()>0)?false:true;
|
|
}
|
|
}
|
|
function checkMail($email)
|
|
{
|
|
$result=$this->db->get_where('patient_details', array('patient_email' => $email))->num_rows();
|
|
return $result;
|
|
}
|
|
function checkTel($pid,$tel)
|
|
{
|
|
// $result=$this->db->get_where('users', array('email' => $email))->row();
|
|
$result=$this->db->get_where('patient_details', array('id' => $pid))->row();
|
|
$telephone=$result->telephone;
|
|
if($tel==$telephone){
|
|
return true;
|
|
}else{
|
|
$result=$this->db->get_where('patient_details', array('telephone' => $tel))->row();
|
|
if($result){
|
|
return false;
|
|
}else{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|