OverLord Shell
<?php
class MACCIA_GET_JOB_LIST extends utils
{
//Event section from maccia treat as news for android show event greeter than current date
function WS_GET_JOB_LIST()
{
$row=new DB;
$data = $_POST;
global $row,$_POST;
// array for JSON response
$response = array();
//print_r($data);exit;
// check for required fields
if((isset($data['P_MID'])))
{
$P_MID = filter_var($data['P_MID'], FILTER_SANITIZE_NUMBER_INT);
if((!empty($P_MID)))
{
//GET News details
$S_DETAILS= $this->get_job_list($P_MID);
$ECNT=count($S_DETAILS);
if($ECNT!='0'){
$json = "{";
$json = $json . "\"X_STS\":\"1\",";
$json = $json . "\"X_MSG\":\"Job list found\",";
$json = $json . "\"X_JOB_LIST\":";
$json = $json . "[";
for($i=0;$i<count($S_DETAILS);$i++)
{
//city_sr_no, state_sr_no, city
$json = $json . "{";
$json = $json . "\"X_ABOUT\":\"".str_replace(' ',' ',strip_tags(htmlspecialchars_decode($S_DETAILS[$i]['about'])))."\",";
$json = $json . "\"X_CNAME\":\"".$S_DETAILS[$i]['company_name']."\",";//member id
$json = $json . "\"X_CTC\":\"".$S_DETAILS[$i]['ctc']."\",";
$json = $json . "\"X_WID\":\"".$S_DETAILS[$i]['workexp']."\",";
$json = $json . "\"X_EID\":\"".$S_DETAILS[$i]['education']."\",";
$json = $json . "\"X_JID\":\"".$S_DETAILS[$i]['jobcategory']."\",";
$json = $json . "\"X_CNAME\":\"".$S_DETAILS[$i]['company_name']."\",";
$A_DETAILS= $this->get_jobapplyed_list($S_DETAILS[$i]['jobcategory']);
$json = $json . "\"X_APPLIED\":\"".$A_DETAILS['apply']."\",";
$B_DETAILS= $this->get_applicable_list($S_DETAILS[$i]['jobcategory']);
$json = $json . "\"X_APPLICABLE\":\"".$B_DETAILS['applycable']."\",";
$json = $json . "\"X_ACTIVE\":\"".$S_DETAILS[$i]['active']."\"";
$json = $json . "}";
if(count($S_DETAILS)==($i+1))
{
$json = $json ."";
}
else
{
$json = $json .",";
}
}
$json = $json . "]";
$json = $json."}";
return $json;
}else
{
$json = "{";
$json = $json . "\"X_STS\":\"0\",";
$json = $json . "\"X_MSG\":\"Job list empty\"";
$json = $json . "}";
return $json;
}
}
else
{
$json = "{";
$json = $json . "\"X_STS\":\"0\",";
$json = $json . "\"X_MSG\":\"Filds is not empty\"";
$json = $json . "}";
return $json;
}
}
else
{
$json = "{";
$json = $json . "\"X_STS\":\"0\",";
$json = $json . "\"X_MSG\":\"Required field(s) is missing\"";
$json = $json . "}";
return $json;
}
}
// Get employee under user work
function get_job_list($P_MID)
{
global $row;
$evt_name=array();
$sql="SELECT * from busdir_mst_companyjob where company_id ='".$P_MID."' and active='y' ";
$db_query=$row->query($sql);
while($client_result=$row->next_record())
{
$record = array();
foreach(array_keys($client_result) as $key)
{
if(gettype($key)=="string")
{
$record[$key] = stripslashes(stripslashes($client_result[$key]));
}
}
$evt_name[]=$record;
}
return $evt_name;
}
function get_jobapplyed_list($JID)
{
global $row;
$evt_name=array();
$sql="Select count(id) as apply from busdir_mst_jobapply where `compnayjob_id`='".$JID."' and `by`='1' ";
$db_query=$row->query($sql);
while($client_result=$row->next_record())
{
$record = array();
foreach(array_keys($client_result) as $key)
{
if(gettype($key)=="string")
{
$record[$key] = stripslashes(stripslashes($client_result[$key]));
}
}
$evt_name[]=$record;
}
return $evt_name;
}
function get_applicable_list($JID)
{
global $row;
$evt_name=array();
$sql="SELECT count(a.job_id) as applycable FROM busdir_mst_companyjob a INNER JOIN busdir_mst_all_company b ON a.my_company_id = b.my_company_id INNER JOIN busdir_mst_jobprofile c ON c.jobcategory=a.jobcategory where b.active='y' and deleted='n' and a.job_id='".$JID."'";
$db_query=$row->query($sql);
while($client_result=$row->next_record())
{
$record = array();
foreach(array_keys($client_result) as $key)
{
if(gettype($key)=="string")
{
$record[$key] = stripslashes(stripslashes($client_result[$key]));
}
}
$evt_name[]=$record;
}
return $evt_name;
}
}
?>
xRyukZ - Copyright 2k19