$sql="select count(*) as COUNT from CSS_APP_GENERAL where CSS_APPLICANT_ID=$userId";
// echo $sql;
$rs=OCIParse($conn,$sql);
OCIExecute($rs);
OCIFetchInto($rs,$arr,OCI_ASSOC);
$count=$arr["COUNT"];
$sql4="select count(*) as COUNT from CSS_JOB_RECIEPT a,CSS_APP_GENERAL b where b.CSS_PARENT_ID=$userId and a.CSS_APPLICANT_ID=b.CSS_APPLICANT_ID and a.CSS_ADVERTISEMENT_ID=$_GET[jid]";
// echo $sql4;
$rs4=OCIParse($conn,$sql4);
OCIExecute($rs4);
OCIFetchInto($rs4,$arr4,OCI_ASSOC);
$count4=$arr4["COUNT"];
$jobId=$_GET["jid"];
$a=$_REQUEST["a"];
// echo " count ".$count." ";
// echo " count4 ".$count4." post array ";
// print_r($_POST);
//echo " get ";
//print_r($_GET);
//echo " request ";
//print_r($_REQUEST);
//// checking eligibility
$errMsg="";
$eligible=1;
if($count<=0)
{ $eligible=2;
$errMsg="You have not created your profile. please create you profile to proceed further.
Create Profile ";
} else {
if($count4>0)
{ $eligible=3;
$errMsg="You have already applied. You cannot apply more than once in CE CSS 2022 (MPT).
View Application History ";
} else {
$age_sql="select T.CSS_APPLICANT_ID, t.css_dob, p.age_cal_date, t.css_agerex1,
case when months_between(p.age_cal_date,(to_date(t.css_dob,'dd-mm-yyyy')-1))/12 > decode(t.css_agerex1, '00', 30,32) then 'OVERAGE'
when months_between(p.age_cal_date,(to_date(t.css_dob,'dd-mm-yyyy')-1))/12 <21 then 'UNDERAGE' ELSE 'AGEOK' end as age_check
from css_app_general t,
(SELECT d.age_cal_date
FROM CSS_POST_ADVERTISEMENT d
where d.css_advertisement_id=$jobId
) p
where t.css_dob is not null
and T.CSS_APPLICANT_ID=$userId ";
//echo $age_sql; exit;
$age_rs=OCIParse($conn,$age_sql);
OCIExecute($age_rs);
OCIFetchInto($age_rs,$age_ar,OCI_ASSOC);
//print_r($age_ar);
if($age_ar['AGE_CHECK']=='UNDERAGE' or $age_ar['AGE_CHECK']=='OVERAGE') {
$eligible=4;
$errMsg="You are ".$age_ar['AGE_CHECK']." and NOT ELIGIBLE to apply for CE CSS 2022 (MPT).
";
} // end of if for age check
//new change
else {
//For checking valid date
$valid_date1="select count(*) as CNTAPP
from css_post_advertisement cpa
where cpa.css_advertisement_id = $jobId
and (trunc(SYSDATE) - trunc(cpa.close_date) <= 0)";
//echo $valid_date1;exit;
$valid_date_rs1=OCIParse($conn,$valid_date1);
OCIExecute($valid_date_rs1);
OCIFetchInto($valid_date_rs1,$valid_date_check1,OCI_ASSOC);
if($valid_date_check1['CNTAPP']<1)
{
$eligible=5;
$errMsg="Sorry, You cannot apply as the CLOSING DATE ".$valid_date_check2["CLOSE_DATE"]." for CSS has expired
";
} //end of if for closing date check
} //new change ends
}// end of if for already applied
} //end if for count porifle creation
// end of eligibility check
/*
if($errMsg<>""){
?>
ERROR
: echo $errMsg; ?>
}*/
//exit;
if(count($_POST)){ ///&& $count>0
// echo " post if";
foreach ($_POST as $key => $value) //new change
{
$$key = $value;
}
//exit;
if ($a =='Confirm and Apply'){
$myv = verifyForm_apply();
if ($myv == 1){
// commented after closing date 18-12-2021 12:02AM
//$w=insert_data($conn);
if ($w==1) //CHANGES MADE DUE TO EDUCATION CHECK THROUGH PROCEDURE
{
$sql_sms="select t.css_applicant_id, '92'||replace(replace(replace(substr(t.css_applicant_mobile,instr(t.css_applicant_mobile,'3')),'-',''),' ',''),'.','') as css_applicant_mobile, c.center_name
from css_app_general t, css_job_reciept s, center c
where t.css_applicant_id = s.css_applicant_id
and s.css_center_id=c.center_id
and t.css_parent_id = $userId";
//echo $sql_sms;
$rs_sms=OCIParse($conn,$sql_sms);
OCIExecute($rs_sms);
OCIFetchInto($rs_sms,$rs_sms_data,OCI_ASSOC);
$sms_track_id=$rs_sms_data["CSS_APPLICANT_ID"];
$sms_mobile=$rs_sms_data["CSS_APPLICANT_MOBILE"];
$sms_test_centre=$rs_sms_data["CENTER_NAME"];
//SendJobSMS(); // Should be commented as following code is directly embedded
$response = file_get_contents('https://bsms.ufone.com/bsms_v8_api/sendapi-0.3.jsp?id=03318590247&message=Your%20Application%20has%20been%20submitted%20Successfully%20for%20CE-2022(MPT).%20Your%20tracking%20id%20is%20'.urlencode($sms_track_id).'%20Helpline%20051-111-000-248&shortcode=FPSC&lang=English&mobilenum='.urlencode($sms_mobile).'&password=Ufone_123!!!@@@');
//echo "Click me";
//$response = new SimpleXMLElement($response);
//echo "===".$response."---";
//exit;
SendJobEmail();
echo "";
//header("Location: applicationhistory.php");
// echo "IN SMS";
}
else //CHANGES MADE DUE TO EDUCATION CHECK THROUGH PROCEDURE CSS_ADD_APPLICANT
{
if ($eligible==15)
{
$errMsg=" Your application cannot be submitted, atleast enter one Educational Record and mark R/M/F which makes you eligible before applying.
Go Back";
//echo "Application not submitted, check your profile and ensure you have entered education record as well.";
}
else if ($eligible==16) //CHANGES MADE DUE TO PROFILE AND APPLICATION CHECK THROUGH PROCEDURE CSS_ADD_APPLICANT
{
$errMsg=" Your application not submitted due to some profile data is not correct.
Go Back";
}
}
}
else
{ //echo "eligible=".$eligible;
/* new code added for css_2016 already applied */
if($eligible==21){
$errMsg=" You have already applied for CE CSS 2022 (MPT).
Go Back";
}
/* new code added for css_2016 already applied */
if($eligible==11){
$errMsg=" Please upload Your Picture in your Profile before applying.
Go Back";
}
if($eligible==12){
$errMsg=" Please Enter Your Educational record, enter atleast one Educational record and mark R/M/F which makes you eligible for applying.
Go Back";
}
if($eligible==14){
$errMsg=" Please Select your Test Center
Go Back";
}
/* MPT-2022 */
/*
if($eligible==6){
$errMsg=" Please choose valid Optional Subjects before applying...
Go Back";
}
if($eligible==17){ //////////////FOR OCCUPATIONAL GROUPS
$errMsg=" Please choose/rank all Occupational Groups before applying.
Go Back";
}
if($eligible==18){ //////////////FOR PARENTS INFORMATION
$errMsg=" Please enter Parents information before applying.
Go Back";
}
*/
if($eligible==7){
$errMsg=" Please Enter Treasury Receipt Amount.
Go Back";
}
if($eligible==8){
$errMsg=" Please Enter Valid Treasury Receipt Date.
Go Back";
}
if($eligible==15){ //CHANGES MADE DUE TO EDUCATION CHECK THROUGH PROCEDURE
$errMsg=" Educational record Not found.
Go Back";
}
//echo $errMsg;
}
}
if ($a =='Proceed Next' && $eligible==1){
?>
$myv = verifyForm_apply();
if ($myv == 1) {
/* View data just before apply from CE2016 */
$verifydata=ViewApplicantDetail();
?>
// echo "eligible=".$eligible;
if ($eligible==10)
{
?>
$errMsg="Note : Your application will be accepted subject to submission of duly signed computer generated prefilled Online Form, copies of all documents/certificates as mentioned in para 27 of the Form alongwith original Treasury Receipt to FPSC so as to reach FPSC Headquarters within 10 days of online submission date, otherwise your candidature will be rejected
View Application History";
} //end if eligible=10
} // else of $V=1
else
{ //echo "eligible=".$eligible;
/* new code added for css_2016 already applied */
if($eligible==21){
$errMsg=" You have already applied for CE CSS 2022 (MPT).
Go Back";
}
/* new code added for css_2016 already applied */
if($eligible==11){
$errMsg=" Please upload Your Picture in your Profile before applying.
Go Back";
}
if($eligible==12){
$errMsg=" Please Enter Your Educational record, enter atleast one Educational record and mark R/M/F which makes you eligible for applying.
Go Back";
}
if($eligible==14){
$errMsg=" Please Select your Test Center
Go Back";
}
/* MPT-2022 */
/*
if($eligible==6){
$errMsg=" Please choose valid Optional Subjects before applying...
Go Back";
}
if($eligible==17){ //////////////FOR OCCUPATIONAL GROUPS
$errMsg=" Please choose/rank all Occupational Groups before applying.
Go Back";
}
if($eligible==18){ //////////////FOR PARENTS INFORMATION
$errMsg=" Please enter Parents information before applying.
Go Back";
}
*/
if($eligible==7){
$errMsg=" Please Enter Treasury Receipt Amount.
Go Back";
}
if($eligible==8){
$errMsg=" Please Enter Valid Treasury Receipt Date.
Go Back";
}
if($eligible==15){ //CHANGES MADE DUE TO EDUCATION CHECK THROUGH PROCEDURE
$errMsg=" Educational record Not found.
Go Back";
}
//echo $errMsg;
}
} //end of a=Proceed Next if
} ///// end of count($_POST) && $count>0 if
/*
$ssl="select * from CSS_APP_GENERAL where CSS_APPLICANT_ID=$userId";
$rs=OCIParse($conn,$ssl);
OCIExecute($rs);
OCIFetchInto($rs,$arr1,OCI_ASSOC);
*/
$ad="select CSS_NEW_NIC, CSS_FATHER_NAME from CSS_APP_GENERAL where CSS_APPLICANT_ID=$userId";
$rs=OCIParse($conn,$ad);
OCIExecute($rs);
OCIFetchInto($rs,$ar1,OCI_ASSOC);
$css_nic=$ar1["CSS_NEW_NIC"];
?>