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.255.103
Current Path : /var/www/html/uet/src/ |
| Current File : /var/www/html/uet/src/freeze_module_at_admin_college_subjectold.php |
<?php
function getFmacasSubjectDetails($aobj_context)
{
session_start();
$college_code = $_SESSION['collcode'];
$user_type = $_SESSION['user_type'];
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$subject_code = $aobj_context->mobj_data["subject_code"];
$degree = trim($aobj_context->mobj_data["degree"]);
$module = trim($aobj_context->mobj_data["module"]);
$exam_no = trim($aobj_context->mobj_data["exam_no"]);
$query="Select FUNIVCODE,FUNIVNAME,pdf_logo_path,DATE_FORMAT(NOW(),'%d/%m/%Y') as date from control";
$rst = $aobj_context->mobj_db->GetRow($query);
$univcode = $rst[FUNIVCODE];
$subject_code=($subject_code=='')?" ":" and cs.FSUBCODE like '%{$subject_code}%'";
$select_category_cond="select * from markentrycodition where Code={$module}";
$cat_cond='';
$lobj_select_category_cond = $aobj_context->mobj_db->GetRow($select_category_cond);
if($lobj_select_category_cond['Value']!='0' || $lobj_select_category_cond['Value']!=0)
$cat_cond=" and ".$lobj_select_category_cond['Value'];
/* $get_subject = " select distinct subject.FCSUBCODE,concat(subject.fsubname,' - ',subject.fssubname) as fsubname from
subject, marks where subject.fdegree = marks.fdegree and subject.fexamno = marks.fexamno
and subject.fcsubcode = marks.fsubcode and marks.fcollcode = '{$college_code}' and subject.fdegree = '{$degree}'
and subject.fexamno='{$exam_no}' and (concat(IFNULL(subject.FINTASS,'F'),IFNULL(subject.FRETAIN,'F')) = 'TT'
or IFNULL(subject.FSUBSIDARY,'F') = 'T')";
$obj_get_details = $aobj_context->mobj_db->GetAll($get_subject);
//var_dump($get_subject); die();
$qry_status = "select FMESTATUS{$exam_no} as type from colldeg
where FDEGREE = '{$degree}'
and FCOLLCODE='{$college_code}' ";
$obj_get_status = $aobj_context->mobj_db->GetRow($qry_status); */
$query = "select subject.FCSUBCODE,concat(subject.fsubname,', ',subject.fssubname) as fsubname,ifnull(ffreezed,'') as ffreezed from
subject inner join collia on subject.FDEGREE = collia.fdegree and subject.FEXAMNO = collia.fexamno
and subject.FCSUBCODE = collia.fsubcode and collia.fcollcode = '{$college_code}'
where subject.fdegree = '{$degree}' and subject.fexamno='{$exam_no}'
and (concat(IFNULL(subject.FINTASS,'F'),IFNULL(subject.FRETAIN,'F')) = 'TT'
or IFNULL(subject.FSUBSIDARY,'F') = 'T') ";
$obj_get_details = $aobj_context->mobj_db->GetAll($query);
$exam_subject_status = $obj_get_status['type'];
$exam_removed_subject_code = $exam_subject_status;
$check_all="";
$subj_list = '';
$disableAllck ='';
for($m=0;$m<count($obj_get_details);$m++)
{
$FSUBCODE=$obj_get_details[$m]['FCSUBCODE'];
$FSUBNAME=$obj_get_details[$m]['fsubname'];
$pos = strpos($exam_removed_subject_code,$FSUBCODE);
$disablefreeze = '';
$disablestatus = '';
if($univcode == '018')
{
$query = "select sum(if(fmarks = -1,1,0)) as markspending from marks
where fcollcode='{$college_code}' and fdegree = '{$degree}'
and FEXAMNO ='{$exam_no}' and FSUBCODE='{$FSUBCODE}'";
$rst = $aobj_context->mobj_db->GetRow($query);
if($rst[markspending] != 0)
{
$disablefreeze = 'disabled';
$disablestatus = 'pending';
$disableAllck = 'disabled=true';
}
}
if($pos === FALSE)
{
if($univcode == '018')
{
if($disablefreeze !='')
$fc_checked = 'disabled';
else
$fc_checked = '';
}
else
$fc_checked = '';
}
else
{
//echo $pos; die();
$start_val = '';
$end_val = '';
$start_val =substr($exam_removed_subject_code,0,$pos-1);
$end_val =substr($exam_removed_subject_code,$pos+5);
$exam_removed_subject_code =$start_val.$end_val;
//echo 'pos---?'.$pos.'s------->'.$start_val.'e---------->'.$end_val.'total'.$exam_removed_subject_code."<br><br>";
//if($m>2) echo $FSUBCODE."------------".$pos.$exam_removed_subject_code."<->".$start_val."=".$end_val;
$exam_removed_subject_code =$start_val.$end_val;
//echo $FSUBCODE."<->".$exam_removed_subject_code."->";
$fc_checked = "checked disabled=true;";
if(strtolower($user_type)=='superuser')
{
if($univcode == '018')
{
if($disablefreeze !='')
{
$fc_checked = 'checked disabled=true';
}
else
$fc_checked=" checked";
}
else
{
$fc_checked=" checked";
}
}
}
if($k%2==0)
{
$class='tbl_row';
}
else
{
$class='tbl_row1';
}
$subj_list.="<tr class='ui-widget-content jqgrow'>";
$subj_list.="<td class='tbl_row_new' align='center' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;' id='fmacas_FSUBCODE_{$m}'>{$FSUBCODE} </td>";
$subj_list.="<td class='tbl_row_new' align='left' style='border-right:1px solid #C5DBEC; padding:2px;' id='fmacas_FSUBNAME_{$m}'>{$FSUBNAME} </td>";
$subj_list.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC; padding:2px;'><input id='fmacas_FCSTATUS_check_{$m}' type=checkbox {$fc_checked} ><span style='color:red;'>{$disablestatus}</span></td>";
$subj_list.="</tr>";
$k++;
}
if(strtolower($user_type)=='superuser')
$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='3' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:22px;'>Admin 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;'>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;'>FC {$check_all}</td>";//
$e_data.="</tr>";
// echo $exam_removed_subject_code; die();
$arr['html_data']=$e_data.$subj_list;
$arr['total_count']=$m;
$arr['rem_sub']=trim($exam_removed_subject_code);
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 savefreezeModuleAtAdminCollegeSubject($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);
$degree=trim($aobj_context->mobj_data["degree"]);
$module=trim($aobj_context->mobj_data["module"]);
$examno=trim($aobj_context->mobj_data["exam_no"]);
$rem_sub1=trim($aobj_context->mobj_data["rem_sub"]);
$rem_sub = str_replace('**','*',$rem_sub1);
//$select_all=trim($aobj_context->mobj_data["select_all"]);
$update_fcstatus = "update colldeg
set FMESTATUS{$examno}='' ,FMESTATUS{$examno}='{$rem_sub}'
WHERE FCOLLCODE='{$college_code}'
and FDEGREE='{$degree}'
";
$obj_update_fcstatus = $aobj_context->mobj_db->Execute($update_fcstatus);
//echo $update_fcstatus_1; die();
if($obj_update_fcstatus)
{
$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;
}
}
?>
|