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.141.41.109
<?php
function SaveAttendanceDetails($aobj_context)
{
session_start();
include_once("/JSON.php");
$json = new Services_JSON();
$degree_code = ($aobj_context->mobj_data["Fdegree"]);
$Examno = ($aobj_context->mobj_data["FExamno"]);
$Sub_code = ($aobj_context->mobj_data["Fsubcode"]);
$month_name = ($aobj_context->mobj_data["month_name"]);
$College_Code = $_SESSION['collcode'];
$User_code = $_SESSION['usr'];
$conducted_field=" F{$month_name}C ";
$attended_field=" F{$month_name}A ";
$lstr_param = stripslashes($aobj_context->mobj_data["output_details"]);
$mobj_jsondata = $json->decode($lstr_param);
$att_details = get_object_vars($mobj_jsondata);
foreach($att_details as $ak=>$av)
{
$update="update attend set
{$conducted_field}='{$av->c}',
{$attended_field}='{$av->a}',
FENTDATE=now()
where fintcode={$ak}";
$lobj_insert_qry = $aobj_context->mobj_db->Execute($update);
}
if($lobj_insert_qry)
{
$rdata = "Updated Successfully.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
return $rdata;
}
else
{
$rdata = "No Updation / Add..!";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
}
function GetAttendanceRegisterNumbers($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$College_Code = $_SESSION['collcode'];
$Subcode = $aobj_context->mobj_data["Subcode"];
$Degcode = $aobj_context->mobj_data["Degcode"];
$Examno = $aobj_context->mobj_data["Examno"];
$Section = $aobj_context->mobj_data["Section"];
$month_name = $aobj_context->mobj_data["month_name"];
$conducted_field=" ifnull(F{$month_name}C,0) ";
$attended_field=" ifnull(F{$month_name}A,0) ";
$path = $aobj_context->main_src.'/imported_files/';
$path_name = "imported_files/att_{$College_Code}_{$_SESSION['user_id']}.html";
$filename = "{$path}att_{$College_Code}_{$_SESSION['user_id']}.html";
if($Section =='All')
$Section_query ='';
else
$Section_query ="and stu.FSECTION ='{$Section}'";
unlink($filename);
$fp = fopen($filename, 'w+');
$e_data.="<table width='75%' cellspacing='0' class='tr_ventor_row' 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;'>Attendance Entry</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:140px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Student Name</center></td>";
$e_data.="<td style='padding:2px; width:20px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Classes Conducted</center></td>";
$e_data.="<td style='padding:2px; width:20px; border-left:0px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Classes Attended</center></td>";
$e_data.="</tr>";
$get_records = "SELECT mak.fintcode,stu.FREGNO, stu.FNAME ,
{$conducted_field} as conducted,
{$attended_field} as attended
FROM student stu
INNER JOIN attend mak ON stu.fdegree = mak.fdegree AND stu.FREGNO=mak.FREGNO
and mak.Fdegree='{$Degcode}' and mak.Fexamno='{$Examno}' and mak.FCOLLCODE='{$College_Code}'
inner join subject sub on sub.FCSUBCODE = mak.FSUBCODE
inner join degree d on d.FDEGREE =mak.FDEGREE
and d.Fexamno=mak.Fexamno
and d.FMEYEAR=mak.FYEAR and d.FMEEXAMTYP=mak.FEXAMTYPE
and sub.FCSUBCODE='{$Subcode}' and sub.FDEGREE='{$Degcode}' and sub.FEXAMNO='{$Examno}'
WHERE stu.FREGNO != '' {$Section_query}
group by stu.FREGNO order by stu.FREGNO limit 0, 1000";
$lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
$k=1;
$border_bottom="";
foreach($lobj_get_records as $key=>$value)
{
$fintcode=$value['fintcode'];
$conducted=$value['conducted'];
$attended=$value['attended'];
if($k==count($lobj_get_records))
$border_bottom="border-bottom:1px solid #C5DBEC;";
$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 tabindex=-1 align='center' style='{$border_bottom}; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;'><input tabindex=-1 {$inp_class} type=text name='Regno' style='width:80px;border:none;' readonly id='reg_{$value[FREGNO]}' value='{$value[FREGNO]}'> </td>";
$e_data.="<td tabindex=-1 align='left' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;' id='mes_std_name_{$value[FREGNO]}' > {$value[FNAME]} </td>";
$e_data.="<td tabindex=1 align='center' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;'> <input onblur='AssignAttendanceNextTdConductedVal({$fintcode});' type=text style='width:30px;text-align:center;{$border}' id='conducted_{$fintcode}' class='ElementCount' onkeypress='return acceptNumbersOnlyForModule(event);' value='{$conducted}' > </td>";
$e_data.="<td tabindex=2 align='center' style='{$border_bottom};border-right:1px solid #C5DBEC; padding:2px;'> <input onblur='AssignAttendanceNextTdConductedVal({$fintcode});' type=text style='width:30px;text-align:center;{$border}' id='attended_{$fintcode}' class='ElementCount' onkeypress='return acceptNumbersOnlyForModule(event);' value='{$attended}' > </td>";
$e_data.="</tr>";
$k++;
}
if(empty($lobj_get_records))
{
$e_data.="<tr style='height: 20'>";
$e_data.="<td COLSPAN=4 align = 'center'>No Records Found For this Search</td>";
$e_data.="</tr>";
}
$e_data.="</table><br>";
fwrite($fp, $e_data);
$arr['filenme']=$path_name;
//$arr['table_data']=$lobj_get_records;
fclose($fp);
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
?>
|