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.224.45.82
<?php
function getDefaultAbsentEntrySubjectRegNos($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start(); $College_Code = $_SESSION['collcode'];
$range = ($aobj_context->mobj_data["range"]);
$ScreenType = ($aobj_context->mobj_data["ScreenType"]);
$type = ($aobj_context->mobj_data["type"]);
$limit = ($aobj_context->mobj_data["limit"]);
$Subcode = ($aobj_context->mobj_data["Subcode"]);
$Degcode = ($aobj_context->mobj_data["Degcode"]);
$Examno = ($aobj_context->mobj_data["Examno"]);
$LastRegno = ($aobj_context->mobj_data["LastRegno"]);
$FirstRegno = ($aobj_context->mobj_data["FirstRegno"]);
$date = ($aobj_context->mobj_data["date"]);
$fsession = ($aobj_context->mobj_data["fsession"]);
$range_cond=($range=='')?"":" and stu.FREGNO like '%{$range}%'";
$e_data.="<table align='center' width='80%' cellspacing='0' 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;'>Absent Entry List</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:160px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Student Name</center></td>";
$e_data.="<td style='padding:2px; width:70px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Select<input type=checkbox></td>";
$e_data.="</tr>";
if($LastRegno!="")
{
$get_records="select distinct stu.FREGNO,stu.FNAME
from absent a inner join student stu on stu.FREGNO=a.FREGNO
where a.Fdegree='{$Degcode}' and a.Fexamno='{$Examno}' {$range_cond} and a.FCSUBCODE='{$Subcode}'
and a.FCOLLCODE='{$College_Code}' and a.FREGNO>'{$LastRegno}'
and FABSTYPE='{$ScreenType}' order by a.FREGNO
";
}
else
{
$get_records="select distinct stu.FREGNO,stu.FNAME
from absent a inner join student stu on stu.FREGNO=a.FREGNO
where a.Fdegree='{$Degcode}' and a.Fexamno='{$Examno}' {$range_cond} and a.FCSUBCODE='{$Subcode}'
and a.FCOLLCODE='{$College_Code}'
and fsession='{$fsession}'
and fdoe='{$date}'
and FABSTYPE='{$ScreenType}' order by a.FREGNO
";
}
$lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
//echo $get_records;
$k=0;
//$border=($type=='Edit')?"":"border:none;";
//$read_only=($type=='Edit')?"":"readOnly";
foreach($lobj_get_records as $key=>$value)
{
if($k%2==0)
{
$class='tbl_row';
$inp_class='tbl_row_input';
}
else
{
$input_class='tbl_row1';
$inp_class='tbl_row1_input';
}
//$on_blur=($type=='Edit')?" onblur=\"validateRegNoMarks($('#markentry_sub_maxmark').val(),this.value,'mes_present_{$value[FREGNO]}',this.id);\" ":" ";
//$on_blur=($type=='Edit')?" onblur=\"validateEditRegNoMarks(this.id);\" ":" ";
//$on_focus=($type=='Edit')?" onfocus=\"if(\$g_mes_edit_valid_marks_flag==0) $('#mes_marks_{$value[FREGNO]}').focus();\" ":" ";
$e_data.="<tr class='ui-widget-content jqgrow' >";
$e_data.="<td class='tbl_row_new' align='center' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px;'><input {$inp_class} type=text name='Regno' style='width:60px;border:none;' readonly id='abs_reg_no_{$value[FREGNO]}' value='{$value[FREGNO]}'></td>";
$e_data.="<td class='tbl_row_new' align='left' style='border-right:1px solid #C5DBEC; padding:2px;'><input {$inp_class} type=text style='width:170px;border:none;' readonly id='abs_std_name_{$value[FREGNO]}' value='{$value[FNAME]}'></td>";
$e_data.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC; padding:2px;'><input type=checkbox id='abs_check_{$value[FREGNO]}' checked></td>";
$e_data.="</tr>";
$k++;
}
$e_data.="</table><br>";
//$e_data.="<center><a href='#' onclick='MarkEnterySubjectWiseTablePrevPage()' style='color:#FF9900'><b>Prev</b></a> ";
//$e_data.="<a href='#' onclick='MarkEnterySubjectWiseTableNextPage()' style='color:#FF9900'><b>Next</b></a></center>";
$arr['html']=$e_data;
$arr['table_data']=$lobj_get_records;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function saveAbsEntrySubjectwise($aobj_context)
{
session_start();
include_once("/JSON.php");
$json = new Services_JSON();
$degree_code = ($aobj_context->mobj_data["Degcode"]);
$Examno = ($aobj_context->mobj_data["Examno"]);
$Sub_code = ($aobj_context->mobj_data["Subcode"]);
$all_reg_nos = stripslashes($aobj_context->mobj_data["all_reg_nos"]);
$all_reg_nos=substr($all_reg_nos,0,strlen($all_reg_nos)-1);
$College_Code = $_SESSION['collcode'];
$User_code = $_SESSION['usr'];
$type =($aobj_context->mobj_data["type"]);
$date =($aobj_context->mobj_data["date"]);
$ScreenType =($aobj_context->mobj_data["ScreenType"]);
$Session =($aobj_context->mobj_data["Session"]);
$date =($aobj_context->mobj_data["date"]);
$abs_all_reg_nos =stripslashes(trim(($aobj_context->mobj_data["abs_all_reg_nos"])));
$abs_all_reg_nos=substr($abs_all_reg_nos,0,strlen($abs_all_reg_nos)-1);
$lstr_param = stripslashes($aobj_context->mobj_data["output_details"]);
$mobj_jsondata = $json->decode($lstr_param);
$Markentry_details = get_object_vars($mobj_jsondata);
$get_year_exam_type="select FMEYEAR,FMEEXAMTYP from degree where fdegree='{$degree_code}'";
$lobj_get_year_exam_type = $aobj_context->mobj_db->getRow($get_year_exam_type);
$FMEYEAR=$lobj_get_year_exam_type['FMEYEAR'];
$FMEEXAMTYP=$lobj_get_year_exam_type['FMEEXAMTYP'];
//var_dump($Markentry_details);
if($type=='Add')
{
$check_dup="select count(*) as count from absent where
FREGNO in ({$all_reg_nos}) and FABSTYPE='{$ScreenType}'
and FDEGREE='{$degree_code}'
and FCOLLCODE='{$College_Code}'
and FREGNO='{$Markentry_details[$i]->FRegno}'
and FCSUBCODE='{$Sub_code}'
and FEXAMNO='{$Examno}'";
$lobj_check_dup = $aobj_context->mobj_db->getRow($check_dup);
if($lobj_check_dup['count']==0)
{
for( $i = 1; $i <=count($Markentry_details); $i++ )
{
if($Markentry_details[$i]->FRegno!='')
{
$insert_qry="insert into absent (
FDEGREE,
FEXAMNO,
FCOLLCODE,
FCSUBCODE,
FREGNO,
FDOE,
FABSTYPE,
FLOGNAME,
FLOGDATE,
FDELETED,
FSESSION, FYEAR,FEXAMTYPE)
values(
'{$degree_code}',
'{$Examno}',
'{$College_Code}',
'{$Sub_code}',
'{$Markentry_details[$i]->FRegno}',
'{$date}',
'{$ScreenType}',
'{$User_code}',
NOW(),
'F',
'{$Session}','{$FMEYEAR}','{$FMEEXAMTYP}'
)";
$lobj_insert_qry = $aobj_context->mobj_db->Execute($insert_qry);
}
}
if($lobj_insert_qry)
{
$rdata = "Details Inserted Successfully.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
return $rdata;
}
else
{
$rdata = "insertion Failed.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
}
else
{
$rdata = "Reg Nos Allready Exists {$all_reg_nos}";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-2,"Failure"));
return $rdata;
}
}
else
{
for($i = 0; $i <count($Markentry_details); $i++ )
{
if($Markentry_details[$i]->cheked==0)
{
$update_qry="delete from absent
where FDEGREE='{$degree_code}'
and FCOLLCODE='{$College_Code}'
and FREGNO='{$Markentry_details[$i]->FRegno}'
and FCSUBCODE='{$Sub_code}'
and FEXAMNO='{$Examno}' and FABSTYPE='{$ScreenType}'";
$lobj_update_qry = $aobj_context->mobj_db->Execute($update_qry);
}
}
//echo $update_qry;
$rdata = " Details Updated Successfully.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
return $rdata;
}
}
?>
|