ok
Direktori : /proc/self/root/home2/selectio/www/y1jobportal.in/apps-api/ |
Current File : //proc/self/root/home2/selectio/www/y1jobportal.in/apps-api/get-interview-list.php |
<?php include_once('config/config.php'); include_once('config/custom-functions.php'); include 'config/send-sms.php'; $fn = new custom_functions(); date_default_timezone_set('Asia/Kolkata'); $today=date('d-m-Y h:m:s A'); try{ $client_id = 0; $client_name = ''; $where = ''; $offset = (isset($_POST['offset']) && !empty(trim($_POST['offset'])) && is_numeric($_POST['offset'])) ? trim($fn->xss_clean($_POST['offset'])) : 0; $limit = (isset($_POST['limit']) && !empty(trim($_POST['limit'])) && is_numeric($_POST['limit'])) ? trim($fn->xss_clean($_POST['limit'])) : 5; $sort = (isset($_POST['sort']) && !empty(trim($_POST['sort']))) ? trim($fn->xss_clean($_POST['sort'])) : 'id'; $order = (isset($_POST['order']) && !empty(trim($_POST['order']))) ? trim($fn->xss_clean($_POST['order'])) : 'DESC'; $id = (isset($_POST['id']) && !empty(trim($_POST['id']))) ? trim($fn->xss_clean($_POST['id'])) : ''; $date=date('Y-m-d'); $conditions=''; if($id!=''){ $conditions.=" and tbl_job_assign.employee_id='".$id."'"; } $total = 0; $statement = $pdo->prepare("SELECT tbl_job_assign.*, tbl_job_vacancy.job_vacancy, sub_category.name as sub_category_name, client.company_name, client.latitude, client.longitude FROM `tbl_job_assign` LEFT JOIN tbl_job_vacancy ON tbl_job_vacancy.id=tbl_job_assign.requirement_id LEFT JOIN sub_category ON sub_category.id=tbl_job_vacancy.sub_category LEFT JOIN client ON client.id=tbl_job_vacancy.client_id LEFT JOIN customer ON customer.id=tbl_job_assign.employee_id WHERE 1=1 $conditions"); $statement->execute(); $res = $statement->fetchAll(PDO::FETCH_ASSOC); if (isset($_POST['search']) && !empty($_POST['search'])) { $search = $fn->xss_clean($_POST['search']); $conditions .= " and company_name like '%" . $search . "%' OR mobile like '%" . $search . "%'"; } if (!empty($res)) { foreach ($res as $row) $total = $row['total']; $total_=$row['none']; $sql=''; $sql.="SELECT tbl_job_assign.*, tbl_job_vacancy.job_vacancy, sub_category.name as sub_category_name, client.company_name, category.name as category, client.latitude, client.latitude, longitude, client.logo, client.dynamic_address as address, client.mobile, DATE_FORMAT(tbl_job_assign.interview_date, '%d-%m-%Y') AS interview_date FROM `tbl_job_assign` LEFT JOIN tbl_job_vacancy ON tbl_job_vacancy.id=tbl_job_assign.requirement_id LEFT JOIN sub_category ON sub_category.id=tbl_job_vacancy.sub_category LEFT JOIN client ON client.id=tbl_job_vacancy.client_id LEFT JOIN customer ON customer.id=tbl_job_assign.employee_id LEFT JOIN category ON category.id=client.category_id where tbl_job_assign.id!=0 and tbl_job_assign.status=1"; $statement = $pdo->prepare($sql. $conditions . "order by id desc LIMIT " . $offset . ", " . $limit); $statement->execute(); $res = $statement->fetchAll(PDO::FETCH_ASSOC); $t=0; foreach($res as $rs){ if($rs['logo']==""){ $rs['logo']="/upload/y1.png"; } $res[$t]['logo']=$site_url.$rs['logo']; if($rs['latitude']==''){ $res[$t]['latitude']="0"; } $t++; } $response['error'] = false; $response['message'] = "Job Details Fetched Successfully."; $response['total'] = $total; $response['data'] = $res; } else { $response['error'] = true; $response['message'] = "Something Went Wrong, Please Try Again Later."; } $pdo = null; print_r(json_encode($response)); }catch(Exception $e){ $response["error"] = true; $response["status_code"] = '403'; $response["status"] = 'Forbidden'.$e; $pdo = null; print_r(json_encode($response)); return 0; } ?>