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.116.34
<?php
function saveSubjectwiseBlock($aobj_context)
{
session_start();
include_once("/JSON.php");
$json = new Services_JSON();
$fdegree = ($aobj_context->mobj_data["fdegree"]);
$fexamno = ($aobj_context->mobj_data["fexamno"]);
$fsubcode = substr($aobj_context->mobj_data["fsubcode"],0,4);
$asubcode = $aobj_context->mobj_data["fsubcode"];
$College_Code = $_SESSION['collcode'];
$funivcode = $_SESSION['FUNIVCODE'];
$User_code = $_SESSION['usr'];
$lstr_param = stripslashes($aobj_context->mobj_data["output_details"]);
$mobj_jsondata = $json->decode($lstr_param);
$att_details = get_object_vars($mobj_jsondata);
foreach($att_details as $ak=>$av)
{
$query = "select fyear,fexamtype from candsum where fregno = '{$av->fregno}'";
$res = $aobj_context->mobj_db->getRow($query);
$fyear = $res['fyear'];
$fexamtype = $res['fexamtype'];
// var_dump($query,$res,$av->status);die();
if($av->status == 'T')
{
$update = "INSERT INTO `attshort` (`FDEGREE`,fcollcode, `FEXAMNO`, `FSUBCODE`, `FREGNO`, `FREMARKS`,fyear,fexamtype,FUPDDATE)
VALUES ('{$fdegree}','{$College_Code}', '{$fexamno}', '{$asubcode}', '{$av->fregno}', '{$av->remarks}','{$fyear}','{$fexamtype}',now())
ON DUPLICATE KEY update FREMARKS = '{$av->remarks}'";
$lobj_insert_qry = $aobj_context->mobj_db->Execute($update);
$query = "update canddet set fpassmth = 'Short'
where fdegree = '{$fdegree}' and fcollcode = '{$College_Code}'
and fsubcode = left('{$fsubcode}',4) and fregno = '{$av->fregno}'";
$res = $aobj_context->mobj_db->Execute($query);
}else
{
$query = "delete from attshort where fregno = '{$av->fregno}' and fdegree = '{$fdegree}'
and fexamno = '{$fexamno}' and fsubcode = '{$asubcode}'
and fyear = '{$fyear}' and fexamtype = '{$fexamtype}'";
$lobj_insert_qry = $aobj_context->mobj_db->Execute($query);
// $query = "delete from attshort where fregno = '{$av->fregno}' and fdegree = '{$fdegree}'
// and fexamno = '{$fexamno}' and fsubcode = '{$fsubcode}'";
// $lobj_insert_qry = $aobj_context->mobj_db->Execute($query);
$query = "update canddet set fpassmth = ''
where fdegree = '{$fdegree}' and fcollcode = '{$College_Code}'
and fsubcode = left('{$fsubcode}',4) and fregno = '{$av->fregno}'";
$res = $aobj_context->mobj_db->Execute($query);
}
}
if($lobj_insert_qry)
{
$rdata = "Updated Successfully.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
return $rdata;
}
else
{
$rdata = "No Updation / Add..!";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
}
function GetSubShortRegisterNumbers($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$College_Code = $_SESSION['collcode'];
$fdegree = $aobj_context->mobj_data["fdegree"];
$fexamno = $aobj_context->mobj_data["fexamno"];
$fsubcode = $aobj_context->mobj_data["fsubcode"];
$e_data.="<table width='90%' cellspacing='0' class='tr_ventor_row' cellpadding='0' border='0' >";
$e_data.="<th align='left' colspan='4' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Subject Wise Block</th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td style='padding:2px; width:60px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Reg No</center></td>";
$e_data.="<td style='padding:2px; width:140px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Student Name</center></td>";
$e_data.="<td style='padding:2px; width:20px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Select to Block</center></td>";
$e_data.="<td style='padding:2px; width:20px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Remarks</center></td>";
$e_data.="</tr>";
$get_records = "select cd.fregno,s.fname,cd.fsubcode,a.FREMARKS,if(ifnull(a.fregno,'') = '','F','T') as attsh
from canddet cd
inner join student s on cd.fdegree = s.fdegree and cd.fcollcode = s.fcollcode and
cd.fregno = s.fregno
left join attshort a on cd.fdegree = a.fdegree and cd.fexamno = a.fexamno
and cd.fsubcode = left(a.fsubcode,4) and cd.fregno = a.fregno
and a.fyear = cd.fyear and a.fexamtype = cd.fexamtype
where cd.fdegree = '{$fdegree}'
and cd.fsubcode = left('{$fsubcode}',4)
and cd.fexamno = '{$fexamno}'
and cd.fcollcode = '{$College_Code}'
and (ifnull(fpassmth,'') = '' or ifnull(fpassmth,'') = 'Short')";
//var_dump($get_records);
$lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
$k=1;
$border_bottom="";
foreach($lobj_get_records as $key=>$value)
{
$attsh=$value['attsh'];
if($attsh == 'T')
$cnd = "checked";
else
$cnd = "";
if($k==count($lobj_get_records))
$border_bottom="border-bottom:1px solid #C5DBEC;";
$e_data.="<tr class='ui-widget-content jqgrow'>";
$e_data.="<td tabindex=-1 align='center' style='{$border_bottom}; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;'><input tabindex=-1 {$inp_class} type=text name='Regno' style='width:90%;border:none;' readonly id='reg_{$k}' value='{$value['fregno']}'> </td>";
$e_data.="<td tabindex=-1 align='left' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;' id='mes_std_name_{$value['fregno']}' > {$value['fname']} </td>";
$e_data.="<td tabindex=1 align='center' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;'> <input type='checkbox' name='vehicle1' value='{$value['fregno']}' {$cnd} id = '{$value['fregno']}' onchange = 'updatehiddenfiled(\"{$value['fregno']}\")'>
<input type='hidden' value = '' id = 'h_{$value['fregno']}' >
</td>";
$e_data.="<td tabindex=2 align='center' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;'> <input type = 'text' value = '{$value['FREMARKS']}' style = 'width:95%' placeholder = 'Remarks' id = 'remarks_{$value['fregno']}'> </td>";
$e_data.="</tr>";
$k++;
}
if(empty($lobj_get_records))
{
$e_data.="<tr style='height: 20'>";
$e_data.="<td COLSPAN=4 align = 'center'>No Records Found For this Search</td>";
$e_data.="</tr>";
}
$e_data.="</table><br>";
$arr['table']=$e_data;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function loadExamAppDegree($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$collegeCode = $_SESSION['collcode'];
$qry_degree = "select ifnull(c.fdegree,'')as fdegree, ifnull(d.fdescpn,'')as fdescpn
from canddet c inner join degree d on d.fdegree = c.fdegree
and d.fexamno = c.fexamno
where c.fcollcode = '{$collegeCode}'
group by c.fdegree";
$res_degree = $aobj_context->mobj_db->GetAll($qry_degree);
if($res_degree){
echo $aobj_context->mobj_output->ToJSONEnvelope($res_degree,0,"success");
return;
}else{
$data = "No Degree Found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"Failure");
return;
}
}
function loadExamAppExamno($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$collegeCode = $_SESSION['collcode'];
$degree = $aobj_context->mobj_data["degree"];
$qry_sem = "select ifnull(c.fexamno,'')as fexamno, ifnull(d.fexamname,'')as fexamname
from canddet c inner join degree d
on c.fdegree = d.fdegree and c.fexamno = d.fexamno
where c.fdegree = '{$degree}'
and c.fcollcode = '{$collegeCode}'
group by c.fexamno;";
$res_sem = $aobj_context->mobj_db->GetAll($qry_sem);
if($res_sem){
echo $aobj_context->mobj_output->ToJSONEnvelope($res_sem,0,"success");
return;
}else{
$data = "No Semester Found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"Failure");
return;
}
}
function loadExamAppSubject($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$collegeCode = $_SESSION['collcode'];
$degree = $aobj_context->mobj_data["degree"];
$examno = $aobj_context->mobj_data["examno"];
$qry_subject="select ifnull(s.fcsubcode,'')as fsubcode, ifnull(s.fsubname,'') as fsubname
from canddet c inner join subject s on s.fdegree = c.fdegree and
s.fexamno = c.fexamno and s.fsubcode = c.fsubcode
where s.fdegree = '{$degree}' and s.fexamno = '{$examno}'
and c.fcollcode = '{$collegeCode}'
and ifnull(s.fretain,'') <> 'T'
and ifnull(s.FINTASS,'') <> 'T'
group by s.fcsubcode";
$res_subject = $aobj_context->mobj_db->GetAll($qry_subject);
if($res_subject){
echo $aobj_context->mobj_output->ToJSONEnvelope($res_subject,0,"success");
return;
}else{
$data = "No Subject Details Found";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"Failure");
return;
}
}
?>
|