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.226.52.26
<?php
function GetDefaultanscancelEntryQp($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='6' 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: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:160px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Old Ans Book No</center></td>";
$e_data.="<td style='padding:2px; width:160px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>New Ans Book No</center></td>";
$e_data.="<td style='padding:2px; width:160px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'><center>Remarks</center></td>";
$e_data.="</tr>";
$get_records="select distinct al.fregno,stu.fname,al.fremarks,al.fansbookno,ifnull(a.fansbookno,'') as fnewansbookno
from ansallot al inner join student stu on stu.FREGNO=al.FREGNO
left join ansallot a on al.fregno = a.fregno and ifnull(a.fenttype,'') ='M'
where al.FQPCODE='{$qp_code}' and ifnull(al.fcancel,'') = 'T'
and al.fremarks not in('ABSENT','MAL PRACTICE')
order by al.FREGNO";
$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;
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';
}
if($value['fremarks'] == 'ABSENT' || $value['fremarks'] == 'MAL PRACTICE')
$diabled = "readOnly";
else
$diabled = "";
//$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:60px;border:none;' 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:170px;border:none;' readonly id='abs_subwise_stuname_{$row_id}' value='{$value['fname']}'></td>";//fansbookno
$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_subwise_ansbookno_{$row_id}' value='{$value['fansbookno']}'></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;' id='abs_subwise_newansbookno_{$row_id}' value='{$value['fnewansbookno']}'></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;' {$diabled} id='abs_subwise_remarks_{$row_id}' value='{$value['fremarks']}'></td>";
// $e_data.="<td class='tbl_row_new' align='center' style='border-right:1px solid #C5DBEC; padding:2px;'><input type=checkbox id='abs_check_{$row_id}' > <input id='st_{$row_id}' type=hidden value='U'> </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 SaveansEntryQpStudetwise($aobj_context)
{
session_start();
include_once("/JSON.php");
$json = new Services_JSON();
$User_code = $_SESSION['usr'];
$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);
session_start();
$College = $_SESSION['FCOLLCODE'];
$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=strtoupper($av->FRegno);
$fremarks=strtoupper($av->fremarks);
$newansbookno=strtoupper($av->newansbookno);
$ansbookno=strtoupper($av->ansbookno);
if($FRegno != '')
{
$query = "select fregno from ansallot where fregno = '{$FRegno}' limit 1";
$results = $aobj_context->mobj_db->getRow($query);
$count = $results['fregno'];
if(count($count) <= 0)
{
$rdata = "Invaid Register No.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
if($newansbookno == '')
{
$rdata = "Enter New Ans book no";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
if($fremarks == '')
{
$rdata = "Enter Remarks";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
if($ansbookno == '')
{
$rdata = "Enter Ans Book No";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
$query = "select ifnull(flastused,ffromans) as flastused from ansdist
where fcollcode = '{$College}' and fanstype = 'R' and (flastused < ftoans or flastused is null)
and '{$newansbookno}' between ffromans and ftoans";
$results = $aobj_context->mobj_db->getRow($query);
//var_dump($query);
if(count($results) > 0)
{
$query = "select * from ansallot where fansbookno = '{$newansbookno}'";
$results = $aobj_context->mobj_db->getRow($query);
if(count($results) > 0)
{
$rdata = "Anser Book No. Allready alloted.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
else
{
}
}
else
{
$rdata = "Invalid Answer Book No.";
print_r($aobj_context->mobj_output->ToJSONEnvelope($rdata,-1,"Failure"));
return $rdata;
}
}
/* $query = "select * from ansallot where fansbookno = '{$newansbookno}'";
$results = $aobj_context->mobj_db->getRow($query);
if(count($results) > 0)
{
} */
$College_Code = $results['fcollcode'];
$query = "update ansallot set fcancel = 'T',fremarks = '{$fremarks}',FENTDATE = now(),FUSERNAME = '{$User_code}'
where fregno = '{$FRegno}' and fqpcode = '{$qp_code}' and fansbookno = '{$ansbookno}'";
$lobj_insert_qry = $aobj_context->mobj_db->Execute($query);
$query2 = "insert into ansallot
select fcntrcode,fcollcode,fqpcode,fregno,fdoe,fsession,'{$newansbookno}',null,null,fyear,fexamtype,'M',now(),'{$User_code}',null,null from ansallot
where fregno = '{$FRegno}' and fqpcode = '{$qp_code}' and fcancel = 'T'";
//var_dump($query2);
$lobj_insert_qry = $aobj_context->mobj_db->Execute($query2);
}
if($lobj_insert_qry)
{
$rdata = "Updated 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;
}
}
?>
|