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.12.163.23
Current Path : /var/www/html/gcg/src/ |
| Current File : /var/www/html/gcg/src/freeze_module_at_university_college.php |
<?php
function getFmacCollegeDegreeDetails($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $aobj_context->mobj_data["college_code"];
$degree = $aobj_context->mobj_data["degree"];
$module = $aobj_context->mobj_data["module"];
$college_code=($college_code=='')?" ":" and cd.FCOLLCODE like '%{$college_code}%'";
$qry=" select cd.FCOLLCODE,concat(c.FCOLLNAME,', ',c.FTOWN) as FCOLLNAME,ifnull(if(cd.FCSTATUS='',0,cd.FCSTATUS),0) as FCSTATUS,
cd.FCDATE,
ifnull(if(cd.FUSTATUS='',0,cd.FUSTATUS),0) as FUSTATUS,cd.FUDATE
from colldeg cd inner join college c on c.FCOLLCODE=cd.FCOLLCODE
where cd.FDEGREE='{$degree}' {$college_code} and FMODULE='{$module}'";
$obj_get_details = $aobj_context->mobj_db->GetAll($qry);
//echo $qry;
$e_data.="<table width='100%' align='center' cellspacing='0' cellpadding='0' border='0' >";
$e_data.=" <tr><td class='act_txtclr' colspan='8' style='background-color:#3D83CC; color:#fff; font-weight:700; width:222px; padding-left:5px; letter-spacing:0.5pt;'>Freeze Details </td> </tr>";
$e_data.="<tr style='background-image:url(../jqGrid3/themes/tarka/images/grid-blue-hd.gif);border-bottom:1px solid #CBC7B8; color:#000; font-weight:700; padding:3px 6px; letter-spacing:0.5pt;'>";
$e_data.="<td align=center style='font-family:monospace;padding:2px; width:14px; border-bottom:1px solid #ccc; border-left:1px solid #ccc; border-right:1px solid #ccc;'>Code</td>";
$e_data.="<td align=center style='font-family:monospace;padding:2px;width:120px; border-bottom:1px solid #ccc;border-left:0px solid #ccc; border-right:1px solid #ccc;'>College Name</td>";
$e_data.="<td align=center style='font-family:monospace;padding:2px; width:50px; border-bottom:1px solid #ccc; border-left:0px solid #ccc; border-right:1px solid #ccc;'>FCSTATUS</td>";
$e_data.="<td align=center style='font-family:monospace;padding:2px; width:55px; border-bottom:1px solid #ccc; border-left:0px solid #ccc; border-right:1px solid #ccc;'>FCDATE</td>";
$e_data.="<td align=center style='font-family:monospace;padding:2px; width:45px; border-bottom:1px solid #ccc; border-left:0px solid #ccc; border-right:1px solid #ccc;'>FC<input type=checkbox onclick='checkAllFamuFc(this.id)' id=fmau_fc_check></td>";
$e_data.="<td align=center style='font-family:monospace;padding:2px; width:50px; border-bottom:1px solid #ccc; border-left:0px solid #ccc; border-right:1px solid #ccc;'>FUSTATUS</td>";
$e_data.="<td align=center style='font-family:monospace;padding:2px; width:55px; border-bottom:1px solid #ccc; border-left:0px solid #ccc; border-right:1px solid #ccc;'>FUDATE</td>";
$e_data.="<td align=center style='font-family:monospace;padding:2px; width:50px; border-bottom:1px solid #ccc; border-left:0px solid #ccc; border-right:1px solid #ccc;'>FU<input type=checkbox onclick='checkAllFamuFU(this.id)' id=fmau_fu_check</td>";
$e_data.="</tr>";
for($m=0;$m<count($obj_get_details);$m++)
{
$FCOLLCODE=$obj_get_details[$m]['FCOLLCODE'];
$FCOLLNAME=$obj_get_details[$m]['FCOLLNAME'];
$FCSTATUS=$obj_get_details[$m]['FCSTATUS'];
$fc_checked=($FCSTATUS=='0')?"":"checked";
$FCDATE=$obj_get_details[$m]['FCDATE'];
$FUSTATUS=$obj_get_details[$m]['FUSTATUS'];
$fu_checked=($FUSTATUS=='0')?"":"checked";
$FUDATE=$obj_get_details[$m]['FUDATE'];
if($k%2==0)
{
$class='tbl_row';
}
else
{
$class='tbl_row1';
}
$e_data.="<tr class={$class}>";
$e_data.="<td align='center' style=' width:10px;border-left:1px solid #ccc;padding:2px;' id='fmauc_FCOLLCODE_{$m}'>{$FCOLLCODE} </td>";
$e_data.="<td align='center' style=' padding:2px;' id='fmauc_FCOLLNAME_{$m}'>{$FCOLLNAME} </td>";
$e_data.="<td align='center' style=' padding:2px;' id='fmauc_FCSTATUS_{$m}'>{$FCSTATUS} </td>";
$e_data.="<td align='center' style=' padding:2px;' id='fmauc_FCDATE_{$m}'>{$FCDATE} </td>";
$e_data.="<td align='center' style=' padding:2px;'><input id='fmauc_FCSTATUS_check_{$m}' type=checkbox {$fc_checked} ></td>";
$e_data.="<td align='center' style=' padding:2px;' id='fmauc_FUSTATUS_{$m}'>{$FUSTATUS} </td>";
$e_data.="<td align='center' style=' padding:2px;' id='fmauc_FUDATE_{$m}'>{$FUDATE} </td>";
$e_data.="<td align='center' style=' padding:2px;'><input id='fmauc_FUSTATUS_check_{$m}' type=checkbox {$fu_checked} ></td>";
$e_data.="</tr>";
$k++;
} // for non entered Subjects
//$arr['table_data']=$obj_get_details;
$arr['html_data']=$e_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 savefreezeModuleAtUniversityOrCollege($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$format_file= $aobj_context->main_src."/src/format.php";
include($format_file);
$degree=trim($aobj_context->mobj_data["degree"]);
$module=trim($aobj_context->mobj_data["module"]);
$select_all=trim($aobj_context->mobj_data["select_all"]);
include_once("/JSON.php");
$json = new Services_JSON();
$lstr_param = stripslashes($aobj_context->mobj_data["arr"]);
$mobj_jsondata = $json->decode($lstr_param);
$arr_data = get_object_vars($mobj_jsondata);
if($select_all==1)
{
$update_table="update colldeg
set FCSTATUS={'$module}'
where FCSTATUS is null";
$obj_update_table = $aobj_context->mobj_db->Execute($update_table);
}
else if ($select_all==0)
{
$update_table="update colldeg
set FCSTATUS=NULL
where FCSTATUS={'$module}'";
$obj_update_table = $aobj_context->mobj_db->Execute($update_table);
}
for($k=0;$k<count($arr_data);$k++)
{
$rand_no=strtoupper(get_rand_letters(6));
if($arr_data[$k]->fc_checked==1)
{
$update_fcstatus_1="update colldeg
set FCSTATUS='{$rand_no}'
,FCDATE=NOW() WHERE FCOLLCODE={$arr_data[$k]->FCOLLCODE}
and FDEGREE='{$degree}' and FMODULE='{$module}'";
$obj_update_fcstatus_1 = $aobj_context->mobj_db->Execute($update_fcstatus_1);
}
else if($arr_data[$k]->fc_checked==0)
{
$update_fcstatus_0="update colldeg
set FCSTATUS=NULL
,FCDATE='0000-00-00 00:00:00' WHERE FCOLLCODE={$arr_data[$k]->FCOLLCODE}
and FDEGREE='{$degree}' and FMODULE='{$module}' ";
$obj_update_fcstatus_0 = $aobj_context->mobj_db->Execute($update_fcstatus_0);
}
if($arr_data[$k]->fu_checked==1)
{
$update_fustatus_1="update colldeg
set FUSTATUS='{$rand_no}'
,FUDATE=NOW() WHERE FCOLLCODE={$arr_data[$k]->FCOLLCODE}
and FDEGREE='{$degree}' and FMODULE='{$module}' ";
$obj_update_fustatus_1 = $aobj_context->mobj_db->Execute($update_fustatus_1);
}
else if($arr_data[$k]->fu_checked==0)
{
$update_fustatus_0="update colldeg
set FUSTATUS=NULL
,FUDATE='0000-00-00 00:00:00' WHERE FCOLLCODE={$arr_data[$k]->FCOLLCODE}
and FDEGREE='{$degree}' and FMODULE='{$module}' ";
$obj_update_fustatus_0 = $aobj_context->mobj_db->Execute($update_fustatus_0);
}
}
if($arr_data)
{
$arr='Data Updated Successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr='Updatation Failed';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
?>
|