Пример #1
0
function getUserDetails()
{
    $companyID = trim($_REQUEST['companyID']);
    $rm = new Response_Methods();
    if ($companyID == "") {
        $result = $rm->fields_validation();
        return $result;
    }
    $userDetailsArray = array();
    $dataResultSet = $rm->getSpecificDetails($companyID, 'user_details_t', 'company_id');
    //$dataResultSet=$rm->getAllDetails('user_details_t');
    if (mysql_num_rows($dataResultSet) > 0) {
        while ($row = mysql_fetch_array($dataResultSet)) {
            /*					
            $getUserFields['userID']=$row['user_id'];			
            if($row['user_image']!='')					
            $userPic=$row['user_image'];
            else
            $userPic='noImage.jpg';					
            $getUserFields['image']="http://phbjharkhand.in/bookOfAccounts/userPics/$userPic";
            $getUserFields['login_user_id']=$row['login_user_id'];
            $cdate=$row['user_created_date'];
            $getUserFields['createdDate']=date('Y/m/d', strtotime($cdate));
            */
            $getUserFields['userID'] = $row['user_id'];
            $getUserFields['userFname'] = $row['user_fname'];
            $getUserFields['userLname'] = $row['user_lname'];
            $getUserFields['age'] = $row['user_age'];
            $getUserFields['sex'] = $row['user_sex'];
            $getUserFields['emailId'] = $row['user_email_id'];
            $userType = $rm->getUserType($row['login_user_id']);
            $getUserFields['userType'] = $userType;
            $getUserFields['address'] = $row['user_address'];
            array_push($userDetailsArray, $getUserFields);
        }
        $result = $rm->get_anything_details_success($userDetailsArray, 'User');
        return $result;
    } else {
        $result = $rm->get_anything_details_fail('User');
        return $result;
    }
}
 public function userRegisterSuccessJson($lastInsertId)
 {
     $getList = array();
     $rm = new Response_Methods();
     $dataQueryInfo = "SELECT user_fname,user_lname,user_age,user_sex, user_email_id, user_address, login_user_id FROM user_details_t WHERE user_id='{$lastInsertId}'";
     $dataResultSet = mysql_query($dataQueryInfo, $GLOBALS['link']);
     if (mysql_num_rows($dataResultSet) > 0) {
         while ($row = mysql_fetch_array($dataResultSet)) {
             //$getGroupDetails['userFullName']=ucfirst($row['user_fname']).' '.ucfirst($row['user_lname']);
             $getGroupDetails['userFname'] = $row['user_fname'];
             $getGroupDetails['userLname'] = $row['user_lname'];
             $getGroupDetails['age'] = $row['user_age'];
             $getGroupDetails['sex'] = $row['user_sex'];
             $getGroupDetails['emailId'] = $row['user_email_id'];
             $getGroupDetails['address'] = $row['user_address'];
             $login_user_id = $row['login_user_id'];
             $userType = $rm->getUserType($row['login_user_id']);
             $getGroupDetails['userType'] = $userType;
             array_push($getList, $getGroupDetails);
             //converting array to string
         }
         $newData = json_encode(array($getList));
         $newData = str_replace('\\/', '/', $newData);
         $newData = substr($newData, 1, strlen($newData) - 2);
         $newData = "{\"data\":{\"Error_Code\":\"1\",\"Error_Msg\":\"Success\",\"result\":" . $newData . "}}";
         return $newData;
     } else {
         $errorCode = "2";
         $errorMsg = "Result Not Found";
         $newData = "{\"data\":{\"Error_Code\":\"" . $errorCode . "\",\"Error_Msg\":\"" . $errorMsg . "\"}}";
         return $newData;
     }
 }