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.143.7.112
<?php
class pending_certificate
{
function __construct($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->aobj_context=$aobj_context;
$this->ip=$_SERVER["REMOTE_ADDR"];
$this->login_cnt=$_SESSION['login_cnt'];
$this->f_user_name=$_SESSION['f_user_name'];
$this->collcode=$_SESSION['f_college_code'];
$query = 'Select * from control';
$rst = $aobj_context->mobj_db->GetRow($query);
$this->appstatus = $rst['FAPPROVE'];
}
function GetPendingCertificates()
{
$from_app=trim($this->aobj_context->mobj_data["from_app"]);
$to_app=trim($this->aobj_context->mobj_data["to_app"]);
$get_qry="SELECT s.FAPPNO,s.FNAME,s.FCOLLCODE,s.FDEGREE,s.FBOARDNAME,s.FQAULEXAMREGNO,
GROUP_CONCAT(FCERTDESC,'->',file_path) AS docs
FROM student s
LEFT JOIN studoc d ON d.app_no=s.FAPPNO
LEFT JOIN masdoc md ON md.internal_code=d.ref_mas_doc_code
WHERE IFNULL(s.FAPPROVESTATUS,'New')='New'
AND IFNULL(s.FAPPNO,'')!=''
and FPAYMENTSTATUS = 'success'
and s.FAPPNO>='{$from_app}' and s.FAPPNO<='{$to_app}' and s.FCOLLCODE = '{$this->collcode}'
GROUP BY s.FAPPNO ORDER BY s.FAPPNO";
$this->aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=10000");
$up_obj=$this->aobj_context->mobj_db->GetAll($get_qry);
$html=' <div class="row"> <div class="col-md-10"> <div class="portlet box green">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-picture"></i>Pending Certificates
</div>
</div>
<div class="portlet-body">
<div class="table-responsive">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>
#
</th>
<th>
APP No
</th>
<th>
Candidate Name
</th>
<th>
College
</th>
<th>
Degree
</th>
<th>
Board
</th>
<th>
Reg. No.
</th>';
if($this->appstatus <> 'T')
{
$html.='<th class="text-left">
Approve / Reject
</th>';
}
$html.='<th class="text-left">
Documents
</th>
</tr>
</thead>
<tbody>';
$sl=1;
$col_span="9";
foreach($up_obj as $ak=>$av)
{
$docs=$av['docs'];
if(empty($docs))
$doc_tr="<span style='color:red;'>No Documents found</span>";
else
{
$doc_tr="";
$exp_arr=explode(",",$docs);
$s=1;
foreach($exp_arr as $ek=>$ev)
{
$arr_exp=explode("->",$ev);
$doc_tr.=" <a style='color:blue;'target='_new' href={$arr_exp[1]}>{$s}. {$arr_exp[0]} </a><br>";
$s++;
}
}
$html.="<tr ondblclick = \"javascript:CMS.viewCollCandidateDetails('{$av['FAPPNO']}','{$av['FCOLLCODE']}','pending')\" >";
$html.="<td>{$sl}</td>";
$html.="<td>{$av['FAPPNO']}</td>";
$html.="<td>{$av['FNAME']}</td>";
$html.="<td>{$av['FCOLLCODE']}</td>";
$html.="<td>{$av['FDEGREE']}</td>";
$html.="<td>{$av['FBOARDNAME']}</td>";
$html.="<td>{$av['FQAULEXAMREGNO']}</td>";
if($this->appstatus <> 'T')
{
$html.="<td><a class='btn btn-xs green' href=\"javascript:CMS.ApproveRejectCertificate('{$av['FAPPNO']}','Approved')\">
Approve <i class='fa fa-check-circle'></i>
</a>
<a class='btn btn-xs red' href=\"javascript:CMS.ApproveRejectCertificate('{$av['FAPPNO']}','Rejected')\">
Reject <i class='fa fa-ban'></i>
</a></td>";
}
$html.="<td><a class='btn btn-xs blue' href=\"javascript:CMS.ShowCertficateToggle('{$sl}')\">
Documents <i class='fa fa-code-fork'></i>
</a></td>";
$html.="</tr>";
$html.="<tr id='cert_tr_{$sl}' style='display:none;'> <td colspan={$col_span}> {$doc_tr} </td> </tr>";
$sl++;
}
$html.='</tbody>
</table>
</div>
</div>
</div>
</div></div>';
$arr['html']=$html;
echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");
return;
}
function GetVerifiedCertificates()
{
$from_app=trim($this->aobj_context->mobj_data["from_app"]);
$to_app=trim($this->aobj_context->mobj_data["to_app"]);
$get_qry="SELECT s.FAPPNO,s.FNAME,s.FCOLLCODE,s.FDEGREE,s.FBOARDNAME,s.FQAULEXAMREGNO,FAPPROVESTATUS,
GROUP_CONCAT(FCERTDESC,'->',file_path) AS docs
FROM student s
LEFT JOIN studoc d ON d.app_no=s.FAPPNO
LEFT JOIN masdoc md ON md.internal_code=d.ref_mas_doc_code
WHERE IFNULL(s.FAPPROVESTATUS,'New')!='New'
AND IFNULL(s.FAPPNO,'')!=''
and s.FAPPNO>='{$from_app}' and s.FAPPNO<='{$to_app}' and s.FCOLLCODE = '{$this->collcode}'
GROUP BY s.FAPPNO ORDER BY s.FAPPNO";
$this->aobj_context->mobj_db->execute("SET @@session.group_concat_max_len=10000");
$up_obj=$this->aobj_context->mobj_db->GetAll($get_qry);
$html=' <div class="row"> <div class="col-md-10"> <div class="portlet box green">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-picture"></i>Verified Certificates
</div>
</div>
<div class="portlet-body">
<div class="table-responsive">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>
#
</th>
<th>
APP No
</th>
<th>
Candidate Name
</th>
<th>
College
</th>
<th>
Degree
</th>
<th>
Board
</th>
<th>
Reg No
</th>';
if($this->appstatus <> 'T')
{
$html.='<th class="text-left">
Status
</th>';
}
$html.='<th class="text-left">
Documents
</th>
</tr>
</thead>
<tbody>';
$sl=1;
$col_span="9";
foreach($up_obj as $ak=>$av)
{
$FAPPROVESTATUS=$av['FAPPROVESTATUS'];
$docs=$av['docs'];
if(empty($docs))
$doc_tr="<span style='color:red;'>No Documents found</span>";
else
{
$doc_tr="";
$exp_arr=explode(",",$docs);
$s=1;
foreach($exp_arr as $ek=>$ev)
{
$arr_exp=explode("->",$ev);
$doc_tr.=" <a style='color:blue;'target='_new' href={$arr_exp[1]}>{$s}. {$arr_exp[0]} </a><br>";
$s++;
}
}
$html.="<tr ondblclick = \"javascript:CMS.viewCollCandidateDetails('{$av['FAPPNO']}','{$av['FCOLLCODE']}','verified')\">";
$html.="<td>{$sl}</td>";
$html.="<td>{$av['FAPPNO']}</td>";
$html.="<td>{$av['FNAME']}</td>";
$html.="<td>{$av['FCOLLCODE']}</td>";
$html.="<td>{$av['FDEGREE']}</td>";
$html.="<td>{$av['FBOARDNAME']}</td>";
$html.="<td>{$av['FQAULEXAMREGNO']}</td>";
if($this->appstatus <> 'T')
{
if($FAPPROVESTATUS=="Approved")
$status_data="<span class='label label-sm label-success'>
{$FAPPROVESTATUS}
</span>";
else if($FAPPROVESTATUS=="Rejected")
$status_data="<span class='label label-sm label-danger'>
{$FAPPROVESTATUS}
</span>";
else
$status_data="<span class='label label-sm label-warning'>
{$FAPPROVESTATUS}
</span>";
$html.="<td>{$status_data}</td>";
}
$html.="<td><a class='btn btn-xs blue' href=\"javascript:CMS.ShowCertficateToggle('{$sl}')\">
Documents <i class='fa fa-code-fork'></i>
</a></td>";
$html.="</tr>";
$html.="<tr id='cert_tr_{$sl}' style='display:none;'> <td colspan={$col_span}> {$doc_tr} </td> </tr>";
$sl++;
}
$html.='</tbody>
</table>
</div>
</div>
</div>
</div></div>';
$arr['html']=$html;
echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");
return;
}
function ApproveRejectCertificate()
{
$FAPPNO=trim($this->aobj_context->mobj_data["FAPPNO"]);
$status=trim($this->aobj_context->mobj_data["status"]);
$remarks=trim($this->aobj_context->mobj_data["remarks"]);
$qry=" update student set
FAPPROVESTATUS='{$status}',
FAPPROVEDBY='{$this->f_user_name}',
FAPPROVEDDATE=now(),FREMARKS = '{$remarks}'
where FAPPNO='{$FAPPNO}'";
$up_obj=$this->aobj_context->mobj_db->Execute($qry);
echo $this->aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
}
function GetPendingCertificates($aobj_context)
{
$obj=new pending_certificate($aobj_context);
$obj->GetPendingCertificates();
}
function ApproveRejectCertificate($aobj_context)
{
$obj=new pending_certificate($aobj_context);
$obj->ApproveRejectCertificate();
}
function GetVerifiedCertificates($aobj_context)
{
$obj=new pending_certificate($aobj_context);
$obj->GetVerifiedCertificates();
}
?>
|