Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.144.37.178
<?php
function getregcodeyear($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
// $collcode = $aobj_context->mobj_data['collcode'];
$query = " SELECT DISTINCT a.fyear,a.fexamtype,d.fexamdate
FROM degexam d INNER JOIN (SELECT DISTINCT fyear,fexamtype FROM codeslips) a
ON d.fyear = a.fyear AND d.fexamtype = a.fexamtype";
$result = $aobj_context->pobj_db->GetAll($query);
// var_dump($result);
// die();
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
return;
}else{
echo $aobj_context->mobj_output->TOJSONEnvelope($result,-1,"failure");
return;
}
}
function getregqpcode($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
// $collcode = $aobj_context->mobj_data['collcode'];
$year= $aobj_context->mobj_data['year'];
$year_arr =(explode(",",$year));
$examyear=$year_arr[0];
$mode=$year_arr[1];
$date=$year_arr[2];
$query ="SELECT DISTINCT codeslips.fqpcode,codeslips.fyear,codeslips.FEXAMTYPE,subject.FQPCODE,subject.fsubname
FROM codeslips JOIN subject ON codeslips.fqpcode=subject.fqpcode
WHERE fyear='{$examyear}' AND FEXAMTYPE='{$mode}'";
$result = $aobj_context->pobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
return;
}else{
$arr['msg'] = "Data not Found";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failure");
return;
}
}
function getregpacket($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
// $collcode = $aobj_context->mobj_data['collcode'];
$year= $aobj_context->mobj_data['year'];
$qpcode= $aobj_context->mobj_data['qpcode'];
$year_arr =(explode(",",$year));
$examyear=$year_arr[0];
$mode=$year_arr[1];
$date=$year_arr[2];
if($qpcode=="All")
{
$cond="fqpcode BETWEEN '0' AND 'Z'";
}
else{
$cond=" fqpcode='{$qpcode}'";
}
$query ="SELECT DISTINCT fqpcode,fpacket,fyear,FUNIVCODE FROM
codeslips WHERE {$cond} AND fexamtype='{$mode}' AND fyear='{$examyear}'";
$result = $aobj_context->pobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
return;
}else{
echo $aobj_context->mobj_output->TOJSONEnvelope($result,-1,"failure");
return;
}
}
function viewsearchregcode($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
// $collcode = $aobj_context->mobj_data['collcode'];
$year= $aobj_context->mobj_data['year'];
$mode= $aobj_context->mobj_data['mode'];
$qpcode= $aobj_context->mobj_data['qpcode'];
$qppacket= $aobj_context->mobj_data['qppacket'];
$year_arr =(explode(",",$year));
$examyear=$year_arr[0];
$mode=$year_arr[1];
$date=$year_arr[2];
if($qpcode=="All")
{
$cond="codeslips.fqpcode BETWEEN '0' AND 'Z'";
}
else{
$cond=" codeslips.fqpcode='{$qpcode}'";
}
if($qppacket=="All")
{
$cond1="codeslips.fpacket BETWEEN '0' AND 'Z'";
}
else{
$cond1="codeslips.fpacket='{$qppacket}'";
}
$query ="SELECT DISTINCT codeslips.funivcode,codeslips.fyear,codeslips.fexamtype,codeslips.fqpcode,
codeslips.fpacket,codeslips.fslno,codeslips.fregcode,codeslips.fansbook,codeslips.ffilepath,
degexam.fexamdate FROM codeslips JOIN degexam ON degexam.fyear=codeslips.fyear
AND codeslips.fexamtype=degexam.fexamtype
WHERE codeslips.fyear='{$examyear}' AND degexam.fexamdate='{$date}' AND codeslips.fexamtype='{$mode}' AND $cond
AND $cond1
";
// var_dump($query);
// die();
$result = $aobj_context->pobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
return;
}else{
$arr['msg'] = "Data not Found";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failure");
return;
}
}
function deleteRegcode($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$reg= $aobj_context->mobj_data['reg'];
$query ="DELETE FROM codeslips WHERE fregcode='{$reg}'";
$result = $aobj_context->pobj_db->Execute($query);
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
return;
}else{
$arr['msg'] = "Failed to Delete";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|