$username, 'DbPass' => $password, 'ServerIP' => $serverip, 'OrgDBName' => $database, 'Usercode' => $usercode, 'EmpId' => $empid, 'Clientdetails' => $clientdetails, 'Query' => $reportquery, ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $apipathurl.'fetchrsdata.php'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data')); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $cres = curl_exec($ch); $rsarray = json_decode($cres,true); print_r($rsarray) ; $command = $rsarray[""][0]['command']; $msg = $rsarray[""][0]['Msg']; $empid = $rsarray[""][0]["EmpID"]; $db = $rsarray[""][0]['OrgDBName']; $alerttext = $rsarray[""][0]['Msg']; if($command == 1) { require("Webphp/hrorgdbinfo.php"); $localconnectionInfo = array( "Database"=>$db, "UID"=>$username, "PWD"=>$password,"CharacterSet" => "UTF-8"); $localserver = sqlsrv_connect ($serverip,$localconnectionInfo); $_SESSION['DbUser'] = $username; $_SESSION['DbPass'] = $password; $_SESSION['ServerIP'] = $serverip; $reportquery = "HRApp_Droid_Proc_User_GetPhotoV2 '".$empid."','-1'"; $post = [ 'DbUser' => $username, 'DbPass' => $password, 'ServerIP' => $serverip, 'OrgDBName' => $db, 'Usercode' => $usercode, 'EmpId' => $empid, 'Clientdetails' => $clientdetails, 'Query' => $reportquery, ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $apipathurl.'fetchrsdata.php'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data')); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $cres = curl_exec($ch); $rsarray = json_decode($cres,true); $img = $rsarray[""][0]["Photo"]; // $empimage = base64_encode($img); $reportquery = "HRApp_Web_Proc_User_GetDetails '".$usercode."','".$clientdetails."','".$empid."'"; echo $reportquery ; $post = [ 'DbUser' => $username, 'DbPass' => $password, 'ServerIP' => $serverip, 'OrgDBName' => $db, 'Usercode' => $usercode, 'EmpId' => $empid, 'Clientdetails' => $clientdetails, 'Query' => $reportquery, ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $apipathurl.'fetchrsdata.php'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data')); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $cres = curl_exec($ch); $rsarray = json_decode($cres,true); print_r($rsarray) ; $_SESSION['login'] = true; $_SESSION['FirstName'] = $rsarray[""][0]["FirstName"]; $_SESSION['LastName'] = $rsarray[""][0]["LastName"]; $_SESSION['EmpID'] = $rsarray[""][0]["EmpID"]; $_SESSION['OrgName'] = $rsarray[""][0]["OrgName"]; $_SESSION['OrgDBName'] = $rsarray[""][0]["OrgDBName"]; $_SESSION['EmpImage'] = $img ; $_SESSION['Usercode'] = $usercode ; $_SESSION['Clientdetails'] = $clientdetails ; $_SESSION['Apipathurl'] = $apipathurl ; header("Location:Dashboard.x-httpd-php .htm .html"); exit; } else { echo '
'; echo ''; } ?>