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.191.118.36
<?php
function getDegreeNames($aobj_context)
{
$deg = $aobj_context->mobj_data["degtype"];
//var_dump($deg );
$query1="SELECT DISTINCT(fdegree) AS internal_code,CONCAT(fdegree,' - ',fdescpn) AS VALUE FROM degree where fdeggrp='{$deg}' ";
//var_dump($query1);
$results1=$aobj_context->mobj_db->GetAll($query1);
$arr['degree']=$results1;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function getIaDegName($aobj_context)
{
session_start();
$collcode=$_SESSION['collcode'];
$query1="SELECT DISTINCT d.fdegree AS internal_code,
CONCAT(d.fdegree,' - ',d.fdescpn) AS VALUE
FROM degree d inner join marks r on d.fdegree = r.fdegree and r.fexamno = d.fexamno
inner join subject s on r.fdegree = s.fdegree and r.fexamno = s.fexamno
and d.fdegree = s.fdegree and d.fexamno = s.fexamno
and s.fcsubcode = r.fsubcode
where r.fcollcode = '{$collcode}'
and ifnull(s.FNOQN,0) >0";
$results1=$aobj_context->mobj_db->GetAll($query1);
$arr['degree']=$results1;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function getIADegreeExamName($aobj_context)
{
session_start();
$collcode=$_SESSION['collcode'];
$degree = $aobj_context->mobj_data["degree"];
//var_dump($deg );
$query1="SELECT DISTINCT d.fexamno AS internal_code,CONCAT(d.fexamno,' - ',d.fexamname) AS VALUE FROM degree d
inner join marks r on d.fdegree = r.fdegree
and d.fexamno = r.fexamno
where r.fcollcode = '{$collcode}'
and r.fdegree = '{$degree}'";
$results1=$aobj_context->mobj_db->GetAll($query1);
$arr['degexam']=$results1;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function displayIATimetable($aobj_context)
{
session_start();
$collcode=$_SESSION['collcode'];
$degree = $aobj_context->mobj_data["degree"];
$exam = $aobj_context->mobj_data["degexam"];
$query1="select m.fdegree,m.fexamno,m.fsubcode,
concat(s.fsubname,' - ',s.fssubname) as fsubname,
date_format(t.fdoe,'%d/%m/%Y') as fdoe,
ifnull(t.fsession,'') as fsession
from marks m inner join subject s on m.fdegree = s.fdegree
and m.fexamno = s.fexamno and m.fsubcode = s.fcsubcode
left join iatimetable t on m.fcollcode = t.fcollcode
and m.fdegree = t.fdegree and m.fsubcode = t.fsubcode
and m.fexamno = t.fexamno
where m.fcollcode = '{$collcode}'
and m.fdegree = '{$degree}'
and m.fexamno = '{$exam}'
and s.FTHEORY = 'T' and s.FINTASS = 'T'
and ifnull(s.FNOQN,0) >0
group by m.fdegree,m.fexamno,m.fsubcode";
$results1=$aobj_context->mobj_db->GetAll($query1);
$e_data.="<table width='100%' id = 'showteachsub' cellspacing='0' class='tr_ventor_row' cellpadding='0' border='0' >";
$e_data.="<th align='left' colspan='5' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>IA Timetable</th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td style='padding:2px; width:20px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Sl.<br>No.</center></td>";
$e_data.="<td style='padding:2px; width:20px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Subject Code</center></td>";
$e_data.="<td style='padding:2px; width:300px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Subject Name</center></td>";
$e_data.="<td style='padding:2px; width:100px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>DOE</center></td>";
$e_data.="<td style='padding:2px; width:100px; border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Session</center></td>";
$e_data.="</tr>";
$k=1;
$border_bottom="border-bottom:1px solid #C5DBEC;";
if($results1)
{
foreach($results1 as $value)
{
$e_data.="<tr class='ui-widget-content jqgrow' style = 'height:25px;'>";
$e_data.="<td tabindex=-1 align='center' style='{$border_bottom}; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;'>{$k}</td>";
$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='subcode' style='width:40px;border:none;' readonly id='sub_{$value[fsubcode]}' value='{$value[fsubcode]}'> </td>";
$e_data.="<td tabindex=-1 align='left' style='{$border_bottom}; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;'>{$value[fsubname]}</td>";
$e_data.="<td tabindex=-1 align='center' style='{$border_bottom}; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;text-alignment:center;'>
<input {$inp_class} type=text name='subcode' id='doe_{$value[fsubcode]}' style='width:90%;text-alignment:center;' value='{$value[fdoe]}'
onkeypress='return acceptNumbersOnlyForModule(event);'
onkeydown='dmydateformat(event,this.id)'
placeholder='dd/mm/yyyy'
maxlength='10'
onchange = 'getiaupdate(this.id)' >
</td>";
$e_data.="<td tabindex=-1 align='center' style='{$border_bottom}; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; padding:2px;text-alignment:center;'>
<input {$inp_class} type=text name='subcode' style='width:90%;text-alignment:center;' id='time_{$value[fsubcode]}' value='{$value[fsession]}' onchange = 'getiaupdate(this.id)'>
<input type = 'hidden' id = 'h_{$value[fsubcode]}' value = ''>
</td>";
$k++;
$e_data.="</tr>";
}
$e_data.="</table>";
}else
{
$e_data.="<tr class='ui-widget-content jqgrow' style = 'height:25px;' ><td colspan='5'><b>Subject Details not found contact admin </b></td> </tr></table>";
}
$arr['tabledata'] = $e_data;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
function saveIATimetable($aobj_context)
{
session_start();
include("error_log.php");
$collcode=$_SESSION['collcode'];
$FLOGNAME = $_SESSION['usr'];
$degree = $aobj_context->mobj_data["degree"];
$exam = $aobj_context->mobj_data["degexam"];
$subarry = $aobj_context->mobj_data["subarry"];
$fsubarry = json_decode($subarry);
foreach($fsubarry as $value)
{
$subcode = $value->subcode;
$doe = $value->doe;
$time = $value->time;
$query = "INSERT ignore INTO iatimetable (fcollcode,fdegree,fexamno,fsubcode,fdoe,fsession,fcreateuser,fcreatedate)
values('{$collcode}','{$degree}','{$exam}','{$subcode}',date_format(str_to_date('{$doe}','%d/%m/%Y'),'%Y-%m-%d'),'{$time}','{$FLOGNAME}',now())
on duplicate key update
fdoe = date_format(str_to_date('{$doe}','%d/%m/%Y'),'%Y-%m-%d'),
fsession = '{$time}',
fupduser = '{$FLOGNAME}',
fupddate = now()";
$lobj_insert_canddet_records = $aobj_context->mobj_db->Execute($query);
}
$univcode = $_SESSION['FUNIVCODE'];
$mob = $_SESSION['FMOBILE'];
$usr = $_SESSION['usr'];
$college_code = $_SESSION['collcode'];
$remark = "IATT - IA Time table Entry - $degree, $exam, $College_Code";
$enttype = "IATT";
$res = error_logs($aobj_context,$univcode,$remark,$college_code,$enttype,$usr,$mob);
if($lobj_insert_canddet_records)
{
$rdata = "Updated Successfully.";
echo($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
return $rdata;
}
else
{
$rdata = "No Updation / Add..!";
echo($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
}
?>
|