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 : 13.58.191.60
Current Path : /var/www/oasis/src/ |
| Current File : /var/www/oasis/src/absent_entry_setupQp.php |
<?php
function getDefaultAbsentEntrySubjectRegNosQp($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$College_Code = $_SESSION['collcode'];
$range = ($aobj_context->mobj_data["range"]);
$qp_code = ($aobj_context->mobj_data["qp_code"]);
$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"]);
$FDOE = ($aobj_context->mobj_data["FDOE"]);
$FSESSION = ($aobj_context->mobj_data["FSESSION"]);
$range_cond=($range=='')?"":" and stu.FREGNO like '%{$range}%'";
$e_data.="<table id='tbl_absent_subjectwise' align='center' width='80%' 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:24px;'></th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td style='padding:2px; width:40px; 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:260px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;text-align:center;'><center>Student Name</center></td>";
$e_data.="<td style='padding:2px; width:40px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;text-align:center;'>Delete?</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
wher 1=1 {$range_cond} and a.FQPCODE='{$qp_code}'
and a.FREGNO>'{$LastRegno}'
and FABSTYPE='{$ScreenType}'
and a.FCOLLCODE='{$College_Code}'
and a.FDOE='{$FDOE}'
order by a.FREGNO
limit {$limit}";
}
else
{
$get_records="select distinct stu.FREGNO,stu.FNAME
from absent a inner join student stu on stu.FREGNO=a.FREGNO
where 1=1 and a.FQPCODE='{$qp_code}'
and a.FCOLLCODE='{$College_Code}'
and a.FDOE='{$FDOE}'
and a.FSESSION='{$FSESSION}'
{$range_cond}
and FABSTYPE='{$ScreenType}' order by a.FREGNO";
// $get_records="select distinct stu.FREGNO,stu.FNAME
// from absent a inner join student stu on stu.FREGNO=a.FREGNO
// where 1=1 and a.FQPCODE='{$qp_code}'
// and a.FCOLLCODE='{$College_Code}'
// and a.FDOE='{$FDOE}'
// and a.FSESSION='{$FSESSION}'
// {$range_cond}
// and FABSTYPE='{$ScreenType}' order by a.FREGNO
// limit {$limit}";
// var_dump($get_records);
}
// if($College_Code == '1827')
// var_dump($get_records);die();
$lobj_get_records = $aobj_context->mobj_db->GetAll($get_records);
$k=0;
//$border=($type=='Edit')?"":"border:none;";
//$read_only=($type=='Edit')?"":"readOnly";
$row_id=1;
// var_dump($lobj_get_records);
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' id='qp_row_{$row_id}' >";
$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 style='width:90%;border:none;text-alignment:center' readonly id='abs_subwise_regno_{$row_id}' 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:240px;border:none;' readonly id='abs_subwise_stuname_{$row_id}' value='{$value[FNAME]}'></td>";
$regno = $value['FREGNO'];
$e_data.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC; padding:2px;'><div ><span id='$value[FREGNO]' style='background-color: #a93535f0;border: none;color: white;padding: 5px 20px;text-align: center;text-decoration: none;display: inline-block;font-size: 9px;cursor: pointer;border-radius: 7px;' value='{$value[FREGNO]}' onclick='deleteabsentstudent(qp_row_{$row_id},this)'>Delete</span></div> </td>";
$e_data.="</tr>";
$k++;
$row_id++;
}
$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 SaveAbsEntryQpStudetwise($aobj_context)
{
session_start();
include_once("/JSON.php");
$json = new Services_JSON();
$qp_code = ($aobj_context->mobj_data["qp_code"]);
$get_degree_data="select FMEYEAR,FMEEXAMTYP from subject s
inner join degree d on d.FDEGREE=s.FDEGREE
where FQPCODE='{$qp_code}' limit 1";
$lobj_check_dup = $aobj_context->mobj_db->getRow($get_degree_data);
$FMEYEAR=$lobj_check_dup['FMEYEAR'];
$FMEEXAMTYP=$lobj_check_dup['FMEEXAMTYP'];
$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"]);
$lstr_param = stripslashes($aobj_context->mobj_data["output_details"]);
$mobj_jsondata = $json->decode($lstr_param);
$Markentry_details = get_object_vars($mobj_jsondata);
foreach($Markentry_details as $ak=>$av)
{
$delete=$av->delete;
$FRegno=$av->FRegno;
$a_type=$av->a_type;
if($a_type=="U" && $FRegno!="" && $delete=="1")
{
$update_qry="delete from absent
where
FREGNO='{$FRegno}'
and FYEAR='{$FMEYEAR}'
and FEXAMTYPE='{$FMEEXAMTYP}'
and FABSTYPE='{$ScreenType}'
and FQPCODE='{$qp_code}'";
$lobj_insert_qry = $aobj_context->mobj_db->Execute($update_qry);
}
if($a_type=="I" && $FRegno!="" && $delete=="0")
{
$insert_qry="insert into absent (FCOLLCODE,
FQPCODE,
FDOE,
FYEAR,FEXAMTYPE,
FREGNO,
FABSTYPE,
FLOGNAME,
FLOGDATE,
FDELETED,
FSESSION)
values(
'{$College_Code}',
'{$qp_code}',
'{$date}',
'{$FMEYEAR}',
'{$FMEEXAMTYP}',
'{$FRegno}',
'{$ScreenType}',
'{$User_code}',
NOW(),
'F',
'{$Session}'
)";
// var_dump($insert_qry);die();
$lobj_insert_qry = $aobj_context->mobj_db->Execute($insert_qry);
$univcode = $_SESSION['FUNIVCODE'];
$ip=$_SERVER["REMOTE_ADDR"];
$mob = $_SESSION['FMOBILE'];
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip_address = $_SERVER['HTTP_CLIENT_IP'];
}
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip_address = $_SERVER['REMOTE_ADDR'];
}
$query = "INSERT INTO logisys3_logs.daylog (funivcode, fdate, fip, fremarks, fcollcode, fenttype, fuser, fmobileno)
VALUES ('{$univcode}', now(),'{$ip_address}', 'ABS - Absent Entry - $qp_code, $date, $FRegno', '{$College_Code}', 'ABS', '{$User_code}', '{$mob}')";
$res = $aobj_context->mobj_db->Execute($query);
}
$query = "update absent ab,student st,subject sb set ab.fdegree=st.fdegree, ab.fexamno=sb.fexamno,
ab.fcsubcode = sb.fcsubcode
where ab.fregno = st.fregno and ab.fqpcode = sb.fqpcode and sb.fdegree = st.fdegree
and ifnull(ab.fcsubcode,'')<>ifnull(sb.fcsubcode,'')
and sb.fintass='f' and sb.ftheory='T'";
$res = $aobj_context->mobj_db->Execute($query);
}
if($lobj_insert_qry)
{
$rdata = "Details Inserted Successfully.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
return $rdata;
}
else
{
$rdata = "insertion Failed.".mysql_error();
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
}
function deletestudentabsententry($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$lstr_param = stripslashes($aobj_context->mobj_data["deletestudlist"]);
$College_Code = $_SESSION['collcode'];
// var_dump($lstr_param);
$lstr_param = json_decode($lstr_param, true);
$qpc = $lstr_param['qpc'];
$studregno = $lstr_param['studregno'];
// var_dump($qpc,$studregno,$College_Code);
$qry="SELECT * FROM absent WHERE fcollcode='{$College_Code}' AND fqpcode='{$qpc}' AND fregno='{$studregno}' ";
// var_dump($qry);
$insertdet = $aobj_context->mobj_db->getRow($qry);
var_dump($insertdet,$insertdet['FYEAR'],$insertdet['FEXAMTYPE']);
$fdoe = $insertdet['FDOE'];
$fsession = $insertdet['FSESSION'];
$fuser = $_SESSION['usr'];
$fyear = $insertdet['FYEAR'];
$fexamtype = $insertdet['FEXAMTYPE'];
$insert_qry="insert into absdelt (FCOLLCODE,
FQPCODE,
FDOE,
FSESSION,
FREGNO,
FUSER,
FDELDATE,
FYEAR,
FEXAMTYPE)
values(
'{$College_Code}',
'{$qpc}',
'{$fdoe}',
'{$fsession}',
'{$studregno}',
'{$fuser}',
NOW(),
'{$fyear}',
'{$fexamtype}'
)";
$lobj_insert_qry = $aobj_context->mobj_db->Execute($insert_qry);
$qry="DELETE FROM absent WHERE fcollcode='{$College_Code}' AND fqpcode='{$qpc}' AND fregno='{$studregno}' ";
// var_dump($qry);
$lobj_delete_qry = $aobj_context->mobj_db->Execute($qry);
$univcode = $_SESSION['FUNIVCODE'];
$ip=$_SERVER["REMOTE_ADDR"];
$mob = $_SESSION['FMOBILE'];
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip_address = $_SERVER['HTTP_CLIENT_IP'];
}
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip_address = $_SERVER['REMOTE_ADDR'];
}
$query = "INSERT INTO logisys3_logs.daylog (funivcode, fdate, fip, fremarks, fcollcode, fenttype, fuser, fmobileno)
VALUES ('{$univcode}', now(),'{$ip_address}', 'ABS - Absent Delete - $qpc, $fdoe, $studregno', '{$College_Code}', 'ABS', '{$fuser}', '{$mob}')";
$res = $aobj_context->mobj_db->Execute($query);
if($lobj_insert_qry && $lobj_delete_qry && $res)
{
$rdata = "$qpc Deleted Successfully.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,0,"success"));
return $rdata;
}
else
{
$rdata = "Deletion Failed.".mysql_error();
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
}
?>
|