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.142.135.24
Current Path : /var/www/oasis/src_old/ |
| Current File : /var/www/oasis/src_old/freeze_Ad_Cl_Me.php |
<?php
/*
*
* FOR THE FREEZE MODULE FOR AD/CL/ME
* PROGRAMED BY NAVEEN
* DATE: 02/04/09
* TIME: 11:55 AM
*
*/
function getAllAdClMeDegreeCode($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$degree_code=trim($aobj_context->mobj_data["degree_range"]);
$degree_code=($degree_code=='')?" ":" AND FDEGREE like '%{$degree_code}%'";
$get_module_code = "select FDEGREE,
IFNULL(FUADSTATUS,0)as UADCH, IFNULL(FCADSTATUS,0) as CADCH,
IFNULL(FUCLSTATUS,0)as UCLCH, IFNULL(FCCLSTATUS,0) as CCLCH,
IFNULL(FUMESTATUS,0)as UMECH, IFNULL(FCMESTATUS,0) as CMECH
from
colldeg where FCOLLCODE='1001' {$degree_code} group by FDEGREE ";
//echo $get_module_code; die();
$lobj_get_module_code = $aobj_context->mobj_db->getAll($get_module_code);
//var_dump($lobj_get_module_code); die();
$e_data="<table align='center' class='tr_ventor_row' id='user_rights_table_data' width='100%' border='0' cellspacing='0' cellpadding='1'>";
$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;'>Freeze AD/CL/ME</th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td align='center' style='width:155px; font-size:11px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Degree Names</td>";
$e_data.="<td align='center' style='width:155px; font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Admission Entry</td>";
$e_data.="<td align='center' style='width:155px; font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Candidate List</td>";
$e_data.="<td align='center' style='width:155px; font-size:11px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Mark Entry</td>";
$e_data.="</tr>";
$k=0;
$id=0;
$m=0;
//var_dump($lobj_get_moudle_names); die();
foreach($lobj_get_module_code as $key=>$value)
{
$CHKCADCH=($value['CADCH']=='0')?" ":"checked";
$DIADMIN=($value['UADCH']=='0')?" ":"disabled";
$CHKCCLCH=($value['CCLCH']=='0')?" ":"checked";
$DICLMIN=($value['UCLCH']=='0')?" ":"disabled";
$CHKCMECH=($value['CMECH']=='0')?" ":"checked";
$DIMEMIN=($value['UMECH']=='0')?" ":"disabled";
$e_data.="<tr>";
$e_data.="<td align='Left' style=' font-size:10px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;' id='adclme_mname_{$id}' >{$value[FDEGREE]}</td>";
$e_data.="<td align='Center' style=' font-size:10px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><input type='checkbox' id='adclme_CHKCADCH_{$id}' {$CHKCADCH} {$DIADMIN} ></td>";
$e_data.="<td align='Center' style=' font-size:10px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><input type='checkbox' id='adclme_CHKCCLCH_{$id}' {$CHKCCLCH} {$DICLMIN} ></td>";
$e_data.="<td align='Center' style=' font-size:10px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><input type='checkbox' id='adclme_CHKCMECH_{$id}' {$CHKCMECH} {$DIMEMIN} ></td>";
$e_data.="</tr>";
$k++;
$id++;
$m++;
}
$e_data.="</table>";
$arr['total_count']= $m;
$arr['html']=$e_data;
// var_dump($arr['html']); die();
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function saveAdClMe($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$format_file= $aobj_context->main_src."/src/format.php";
include($format_file);
include_once("/JSON.php");
$json = new Services_JSON();
$lstr_param = stripslashes($aobj_context->mobj_data["adm_arr"]);
$mobj_jsondata = $json->decode($lstr_param);
$adm_arr_data = get_object_vars($mobj_jsondata);
for($k=0;$k<count($adm_arr_data);$k++)
{
$rand_no=strtoupper(get_rand_letters(6));
if($adm_arr_data[$k]->adclme_CHKCADCH == 1)
{
$update_adclme_CHKCADCH_1 = " update colldeg
set FCADSTATUS ='{$rand_no}',
FCADDATE = NOW()
WHERE FCOLLCODE={$college_code}
and FDEGREE='{$adm_arr_data[$k]->name}'
";
$obj_update_adclme_CHKCADCH_1 = $aobj_context->mobj_db->Execute($update_adclme_CHKCADCH_1);
}
else
{
$update_adclme_CHKCADCH_0 = " update colldeg
set FCADSTATUS =NULL,
FCADDATE = '0000-00-00 00:00:00'
WHERE FCOLLCODE={$college_code}
and FDEGREE='{$adm_arr_data[$k]->name}'
";
$obj_update_adclme_CHKCADCH_0 = $aobj_context->mobj_db->Execute($update_adclme_CHKCADCH_0);
}
if($adm_arr_data[$k]->adclme_CHKCCLCH == 1)
{
$update_adclme_CHKCCLCH_1 = " update colldeg
set FCCLSTATUS ='{$rand_no}',
FCCLDATE = NOW()
WHERE FCOLLCODE={$college_code}
and FDEGREE='{$adm_arr_data[$k]->name}'
";
$obj_update_adclme_CHKCCLCH_1 = $aobj_context->mobj_db->Execute($update_adclme_CHKCCLCH_1);
}
else
{
$update_adclme_CHKCCLCH_0 = " update colldeg
set FCCLSTATUS =NULL,
FCCLDATE = '0000-00-00 00:00:00'
WHERE FCOLLCODE={$college_code}
and FDEGREE='{$adm_arr_data[$k]->name}'
";
$obj_update_adclme_CHKCCLCH_0 = $aobj_context->mobj_db->Execute($update_adclme_CHKCCLCH_0);
}
if($adm_arr_data[$k]->adclme_CHKCMECH == 1)
{
$update_adclme_CHKCMECH_1 = " update colldeg
set FCMESTATUS ='{$rand_no}',
FCMEDATE = NOW()
WHERE FCOLLCODE={$college_code}
and FDEGREE='{$adm_arr_data[$k]->name}'
";
$obj_update_adclme_CHKCMECH_1 = $aobj_context->mobj_db->Execute($update_adclme_CHKCMECH_1);
}
else
{
$update_adclme_CHKCMECH_0 = " update colldeg
set FCMESTATUS =NULL,
FCMEDATE = '0000-00-00 00:00:00'
WHERE FCOLLCODE={$college_code}
and FDEGREE='{$adm_arr_data[$k]->name}'
";
$obj_update_adclme_CHKCMECH_0 = $aobj_context->mobj_db->Execute($update_adclme_CHKCMECH_0);
}
}
if($obj_update_adclme_CHKCADCH_1 || $obj_update_adclme_CHKCCLCH_1 || obj_update_adclme_CHKCMECH_1 )
{
$arr='Updated Successfully';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr='Updation Failure';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
}
|