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.216.126.33
<?php
function getattfreezdeatils($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$user_type = $_SESSION['user_type'];
$userid = $_SESSION['user_id'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$mth = trim($aobj_context->mobj_data["mth"]);
$degfrom = trim($aobj_context->mobj_data["degfrom"]);
$degto = trim($aobj_context->mobj_data["degto"]);
$collfrom = trim($aobj_context->mobj_data["collfrom"]);
$collto = trim($aobj_context->mobj_data["collto"]);
$examfrom = trim($aobj_context->mobj_data["examfrom"]);
$examto = trim($aobj_context->mobj_data["examto"]);
$query = "select distinct a.fcollcode,a.fdegree,a.fexamno,a.fsubcode,ifnull(c.FFREEZED,'') as FFREEZED,
concat(s.fsubname,', ',s.fsubshort) as subname from attend a
inner join subject s on a.fdegree = s.fdegree
and a.fexamno = s.fexamno and a.fsubcode = s.fcsubcode
left join collatt c on c.fcollcode = a.fcollcode and c.fdegree = a.fdegree and c.fexamno = a.fexamno
and c.fsubcode = a.fsubcode and c.FPERIOD = '{$mth}'
where a.fdegree between '{$degfrom}' and '{$degto}'
and a.fcollcode between '{$collfrom}' and '{$collto}'
and a.fexamno between '{$examfrom}' and '{$examto}'
order by a.fdegree,a.fexamno,a.fsubcode";
$obj_get_details = $aobj_context->mobj_db->GetAll($query);
for($m=0;$m<count($obj_get_details);$m++)
{
$fsubname = $obj_get_details[$m]['subname'];
$fcollcode = $obj_get_details[$m]['fcollcode'];
$fdegree = $obj_get_details[$m]['fdegree'];
$fexamno = $obj_get_details[$m]['fexamno'];
$fsubcode = $obj_get_details[$m]['fsubcode'];
$ffreezed = $obj_get_details[$m]['FFREEZED'];
if($k%2==0)
{
$class='tbl_row';
}
else
{
$class='tbl_row1';
}
$checked = "";
if($ffreezed == 'T')
$checked = "checked";
$edy_data.="<tr class='ui-widget-content jqgrow'>";
$edy_data.="<td class='tbl_row_new' align='center' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='fmacas_collcode_{$m}'>{$fcollcode} </td>";
$edy_data.="<td class='tbl_row_new' align='left' style='border-right:1px solid #C5DBEC; padding:2px;' id='fmacas_degree_{$m}'>{$fdegree}</td>";
$edy_data.="<td class='tbl_row_new' align='left' style='border-right:1px solid #C5DBEC; padding:2px;' id='fmacas_examno_{$m}'>{$fexamno}</td>";
$edy_data.="<td class='tbl_row_new' align='left' style='border-right:1px solid #C5DBEC; padding:2px;' id='fmacas_subcode_{$m}'>{$fsubcode}</td>";
$edy_data.="<td class='tbl_row_new' align='left' style='border-right:1px solid #C5DBEC; padding:2px;' id='fmacas_subname_{$m}'>{$fsubname}</td>";
$edy_data.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC; padding:2px;'><input id='fmacas_FCSTATUS_check_{$m}' {$checked} type=checkbox {$fc_checked} ></td>";
$edy_data.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC; padding:2px;display:none;'><input id='fmacas_FCSTATUS_checkH_{$m}' {$checked} type=checkbox {$fc_checked} ></td>";
$edy_data.="</tr>";
$k++;
}
$check_all="<input type='checkbox' onclick='checkAllFamuFcSubjects(this.id);' {$disableAllck} id=Fmacas_fc_check> ";
$e_data="<table width='90%' class='tr_ventor_row' align='center' cellspacing='0' cellpadding='0' border='0' >";
$e_data.="<th align='left' colspan='6' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:22px;'>Subject Freeze Details </th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td align=center style='padding:2px; width:24px; border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>College Code</td>";
$e_data.="<td align=center style='padding:2px; width:24px; border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Degree Code</td>";
$e_data.="<td align=center style='padding:2px; width:24px; border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Exam No.</td>";
$e_data.="<td align=center style='padding:2px; width:24px; border-bottom:1px solid #C5DBEC; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sub Code</td>";
$e_data.="<td align=center style='padding:2px; width:60px; border-bottom:1px solid #C5DBEC;border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sub Name</td>";
$e_data.="<td align=center style='padding:2px; width:20px; border-bottom:1px solid #C5DBEC; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Freeze{$check_all}</td>";//
$e_data.="</tr>";
$arr['html_data']=$e_data.$edy_data;
$arr['total_count']=$m;
if($obj_get_details)
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
else
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
function saveattfreezmth($aobj_context)
{
session_start();
include_once($aobj_context."/src/JSON.php");
$json = new Services_JSON();
$format_file= $aobj_context->main_src."/src/format.php";
include($format_file);
$clientIp ='';
if(!empty($_SERVER['HTTP_X_REAL_IP']))
$_SERVER['HTTP_X_REAL_IP'];
else if(!empty($_SERVER['HTTP_CLIENT_IP']))
$clientIp = $_SERVER['HTTP_CLIENT_IP'];
else if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
$clientIp = $_SERVER['HTTP_X_FORWARDED_FOR'];
else
$clientIp = $_SERVER['REMOTE_ADDR'];
$college_code = $_SESSION['collcode'];
$realname = $_SESSION['realname'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$mth = trim($aobj_context->mobj_data["mth"]);
$degfrom = trim($aobj_context->mobj_data["degfrom"]);
$degto = trim($aobj_context->mobj_data["degto"]);
$collfrom = trim($aobj_context->mobj_data["collfrom"]);
$collto = trim($aobj_context->mobj_data["collto"]);
$examfrom = trim($aobj_context->mobj_data["examfrom"]);
$examto = trim($aobj_context->mobj_data["examto"]);
$arraychecked = stripcslashes(trim($aobj_context->mobj_data["arraychecked"]));
$mobj_jsondata = $json->decode($arraychecked);
$arraychecked = get_object_vars($mobj_jsondata);
$arraynotchecked = stripcslashes(trim($aobj_context->mobj_data["arraynotchecked"]));
$mobj_jsondata = $json->decode($arraynotchecked);
$arraynotchecked = get_object_vars($mobj_jsondata);
$user_id = $_SESSION['user_id'];
$sql = array();
if($arraychecked != '')
{
$detelete = "delete from collatt where fcollcode between '{$collfrom}' and '{$collto}' and fdegree between '{$degfrom}' and '{$degto}'
and fexamno between '{$examfrom}' and '{$examto}' and FPERIOD = '{$mth}' and ifnull(FFREEZED,'') = 'T'";
$results = $aobj_context->mobj_db->Execute($detelete);
for($k=1;$k<=count($arraychecked);$k++)
{
$sql[] = "('{$arraychecked[$k]->collcode}','{$arraychecked[$k]->degree}','{$arraychecked[$k]->examno}','{$arraychecked[$k]->subcode}','{$mth}','T',now(),'{$user_id}','{$clientIp}')";
}
$query = 'INSERT INTO collatt VALUES '.implode(',', $sql);
$results1 = $aobj_context->mobj_db->Execute($query);
}
$sql = array();
if($arraynotchecked != '')
{
$detelete = "delete from collatt where fcollcode between '{$collfrom}' and '{$collto}' and fdegree between '{$degfrom}' and '{$degto}'
and fexamno between '{$examfrom}' and '{$examto}' and FPERIOD = '{$mth}' and ifnull(FFREEZED,'') = 'F'";
$results = $aobj_context->mobj_db->Execute($detelete);
for($k=1;$k<=count($arraynotchecked);$k++)
{
$sql[] = "('{$arraynotchecked[$k]->collcode}','{$arraynotchecked[$k]->degree}','{$arraynotchecked[$k]->examno}','{$arraynotchecked[$k]->subcode}','{$mth}','F',now(),'{$user_id}','{$clientIp}')";
}
$query = 'INSERT INTO collatt VALUES '.implode(',', $sql);
$results2 = $aobj_context->mobj_db->Execute($query);
}
if($results1 || $results2)
{
$arr='Updated Successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr='Updation failed';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
?>
|