Exemple #1
0
function RegisterUser($inputArr)
{
    try {
        global $db;
        foreach ($inputArr as $key => $key_value) {
            $keyArr[$key] = $key_value;
        }
        //print_r($keyArr);
        $docObj = new Doctor($db);
        $r_user = $docObj->getDocDetails($keyArr['mobile_num']);
        //print_r($r_user);
        if (is_array($r_user) && sizeof($r_user) > 0) {
            $arr = array('status' => "Mobile Number already exits!");
        } else {
            $row_doc = $docObj->insertDocDetails($keyArr);
            if ($row_doc > 0) {
                $arr = array('status' => 1);
            } else {
                $arr = array('status' => 0);
            }
        }
        return $arr;
    } catch (Exception $e) {
        echo 'Caught exception: ', $e->getMessage(), "\n";
    }
}