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 : 18.117.170.80
Current Path : /var/www/oasis/src/ |
| Current File : /var/www/oasis/src/subblock.php |
<?php
function saveSubBlock($aobj_context)
{
session_start();
include_once("/JSON.php");
$json = new Services_JSON();
$degree_code = ($aobj_context->mobj_data["Fdegree"]);
$Examno = ($aobj_context->mobj_data["FExamno"]);
$Sub_code = ($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)
{
if($av->short == 'T')
{
$query3 = "UPDATE canddet set fpassmth = 'Short'
where fregno= '{$av->reg}' and fdegree = '{$degree_code}'
and fexamno = '{$Examno}' and fsubcode = left('{$Sub_code}',4)
and fcollcode = '{$College_Code}'";
$results3 = $aobj_context->mobj_db->Execute($query3);
$query ="delete from attshort
where fdegree = '{$degree_code}'
AND fexamno = '{$Examno}'
and fsubcode = '{$Sub_code}'
and fregno= '{$av->reg}'
and fcollcode = '{$College_Code}'";
$results = $aobj_context->mobj_db->Execute($query);
$query = "insert into attshort(FDEGREE,fcollcode,FEXAMNO,FSUBCODE,FREGNO,FREMARKS)
values('{$degree_code}','{$College_Code}','{$Examno}','{$Sub_code}','{$av->reg}','{$av->resmarks}')";
$results = $aobj_context->mobj_db->Execute($query);
}else
{
$query3 = "UPDATE canddet set fpassmth = NULL
where fregno= '{$av->reg}' and fdegree = '{$degree_code}'
and fexamno = '{$Examno}' and fsubcode = left('{$Sub_code}',4)
and fcollcode = '{$College_Code}'";
$results3 = $aobj_context->mobj_db->Execute($query3);
$query ="delete from attshort
where fdegree = '{$degree_code}'
AND fexamno = '{$Examno}'
and fsubcode = '{$Sub_code}'
and fregno= '{$av->reg}'
and fcollcode = '{$College_Code}'";
$results = $aobj_context->mobj_db->Execute($query);
}
}
if($results3)
{
$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 GetRegisterNumbers($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$College_Code = $_SESSION['collcode'];
$Subcode = $aobj_context->mobj_data["Subcode"];
$Degcode = $aobj_context->mobj_data["Degcode"];
$Examno = $aobj_context->mobj_data["Examno"];
$e_data.="<table width='85%' 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:100px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Remarks</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</center></td>";
$e_data.="</tr>";
$get_records = "select cd.fregno,s.fname,ifnull(at.FREMARKS,'') as remarks,
if(ifnull(at.fsubcode,'F') = 'F','F','T') as short
from canddet cd inner join student s on cd.fregno = s.fregno
and cd.fdegree = s.fdegree
and cd.fcollcode = s.fcollcode
left join attshort at on cd.fdegree = at.fdegree
and cd.fexamno = at.fexamno
and cd.fregno = at.fregno
and cd.fsubcode = left(at.fsubcode,4)
where cd.fdegree = '{$Degcode}'
and cd.fexamno = '{$Examno}'
and (ifnull(cd.fpassmth,'') = '' or ifnull(fpassmth,'') = 'Short')
and cd.fcollcode = '{$College_Code}'
and cd.fsubcode = left('{$Subcode}',4)";
$lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
//var_dump($get_records);
$k=1;
$border_bottom="";
foreach($lobj_get_records as $key=>$value)
{
$fregno = $value['fregno'];
$fname = $value['fname'];
$remarks = $value['remarks'];
$short = $value['short'];
$cnd = "";
$cndval = 'F';
if($short == 'T')
{
$cnd = "checked = true";
$cndval = 'T';
}
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:80px;border:none;' readonly id='reg_{$k}' value='{$fregno}'> </td>";
$e_data.="<td tabindex=-1 align='left' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;' id='mes_std_name_{$fregno}' > {$fname} </td>";
$e_data.="<td tabindex=1 align='center' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;'> <input type=text style='width:90%;text-align:left;{$border}' id='remarks_{$k}' class='ElementCount' value='{$remarks}' onclick = 'getcheckboxupd(\"{$k}\")' > </td>";
$e_data.="<td tabindex=2 align='center' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;'>
<input type='checkbox' id='short_{$k}' {$cnd} value='{$cndval}' onclick = 'getcheckboxupd(\"{$k}\")'>
<input type = 'hidden' value = 'F' id = 'hregno_{$k}'>
</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>";
}
$arr['filenme']=$e_data;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
?>
|