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.214.1
<?php
class ReportObjChkList
{
public function Header()
{
// get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
$this->SetTitle("Valuator Report");
// set bacground image
$this->SetFillColor(248, 248, 255);
$img_path = $this->aobj_context->main_src . "/img/logo.jpg";
if (file_exists($img_path)) {
$this->Image($img_path, 6, 6, 20, 20);
}
$this->SetFont('Times', 'B', 13);
$this->SetY(5);
$this->Cell(0, 4, $this->aobj_context->FUNIVNAME, 0, 1, 'C');
//state
$this->SetFont('Times', '', 11);
$this->Cell(0, 4, $this->aobj_context->s_state, 0, 1, 'C');
$this->SetFont('Times', 'BU', 12);
$this->Ln(1);
$cur_year = date("Y");
$this->Cell(0, 5, ' Valuation Datewise Deatils', '0', 1, 'C');
$this->SetFont('Times', 'B', 12);
// var_dump($this->doe);
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
}
public function DefaultConstructor($aobj_context)
{
$this->aobj_context = $aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$main_src = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 7);
$pdf_writer_class = $main_src . "/tcpdf/tcpdf.php";
require_once $pdf_writer_class;
$this->ip = $_SERVER["REMOTE_ADDR"];
$get_date = "select DATE_FORMAT(now(), '%d/%m/%Y') as now_date";
$obj = $this->aobj_context->mobj_db->GetRow($get_date);
$this->reportType = $aobj_context->mobj_data["rtype"];
$get_coll_name = "select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
FUNIVADD1 as 'state', pdf_logo_path,
ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ From control";
$lobj_get_coll_name = $this->aobj_context->pobj_db->GetRow($get_coll_name);
// var_dump($get_coll_name);
$aobj_context->FUNIVNAME = $lobj_get_coll_name['FUNIVNAME'];
$aobj_context->s_state = $lobj_get_coll_name['state'];
$aobj_context->pdf_logo_path = $lobj_get_coll_name['pdf_logo_path'];
$aobj_context->FUNIVCODE = $lobj_get_coll_name['FUNIVCODE'];
$this->current_date = $obj['now_date'];
$deggrp = $this->aobj_context->mobj_data["fdeggrp"];
$reportType = $this->aobj_context->mobj_data["reportType"];
$get_coll_name = "select fdeggrp,fdescpn,fexamdate as fexamdate
from deggrp where fdeggrp = '{$deggrp}'";
$lobj_get_degree = $this->aobj_context->pobj_db->GetRow($get_coll_name);
$aobj_context->deggrp = $lobj_get_degree['fdeggrp'];
$aobj_context->fexamdate = $lobj_get_degree['fexamdate'];
$aobj_context->fdescpn = $lobj_get_degree['fdescpn'];
$aobj_context->rType = $reportType ;
$this->pdf = new TCPDF();
$this->pdf->aobj_context = $aobj_context;
}
public function ReportChkList($data)
{
$pdf = $this->pdf;
$pdf->SetMargins(15, 40);
$pdf->startPageGroup();
$pdf->AddPage("L");
$sl_no = 1;
$pdf->SetFont('Times', '', 10);
$tbl = '
<table cellspacing="0" cellpadding="5" border="1" nobr="true" style="border:0.01px;">
<thead>
<tr>
<th align="center" width="30"><b>Sl. <br />No.</b></th>
<th align="center" width="35" ><b>Coll. <br /> Code</b></th>
<th align="center" width="300" ><b>College Name</b></th>
<th align="center" width="40"><b>Teach.<br>Code</b></th>
<th align="center" width="300"><b>Teacher Name</b></th>
<th align="center" width="60"><b>Status</b></th>
</tr>
</thead>
';
foreach ($data as $key => $value) {
if ($pdf->getY() > 260) {
$pdf->AddPage("L");
$pdf->SetFont('Times', 'B', 12);
$pdf->SetFont('Times', '', 10);
}
$tbl .= '<tr>
<td align="center" width="30">'.$sl_no.'</td>
<td width="35">'.$value['fcollcode'].'</td>
<td width="300">'.$value['fcollname'].'</td>
<td width="40">'.$value['fteachcode'].'</td>
<td width="300">'.$value['fteachname'].'</td>
<td width="60">'.$value['fvalstatus'].'</td>
</tr>';
$sl_no++;
}
$tbl .='</table>';
$pdf->writeHTML($tbl, true, false, false, false, '');
}
public function SendOutput()
{
// ob_end_clean();
$this->pdf->Output("Valator_Details.pdf", "I");
}
}
function valuatorReport($aobj_context)
{
//$valuationType = $aobj_context->mobj_data['valuationType'];
$univcode = $aobj_context->mobj_data['univcode'];
$dateFrom = $aobj_context->mobj_data['dateFrom'];
$dateTo = $aobj_context->mobj_data['dateTo'];
$qpcodeFrom = $aobj_context->mobj_data['qpcodeFrom'];
$qpcodeTo = $aobj_context->mobj_data['qpcodeTo'];
$regnoFrom = $aobj_context->mobj_data['regnoFrom'];
$regnoTo = $aobj_context->mobj_data['regnoTo'];
$correctionType = $aobj_context->mobj_data['correctionType'];
$status = $aobj_context->mobj_data['status'];
$reportType = $aobj_context->mobj_data['reportType'];
$deggrp = $aobj_context->mobj_data["fdeggrp"];
$query = "select m.fcollcode, concat(c.fcollname,', ', c.ftown) as fcollname, m.fteachcode, m.fteachname,
if(ifnull(v.fvalcode,'') = '','Not Doing Valuation','Doing Valuation') as fvalstatus
from masteach m
inner join college c on m.fcollcode = c.fcollcode left join
(select distinct fvalcode from mastabu
union
select distinct frevcode from mastabu) v on v.fvalcode = m.fteachcode
where m.fcollcode between '1001' and '1001' and m.fteachcode between '0' and 'z'
order by m.fcollcode,fvalstatus desc";
$result = $aobj_context->pobj_db->GetAll($query);
// var_dump($query);
// die();
// var_dump($result);
// die();
$class_obj = new ReportObjChkList();
$class_obj->univcode = $univcode;
$class_obj->DefaultConstructor($aobj_context);
// If No data found Generate Blank Report
if (count($result) > 0) {
$class_obj->ReportChkList($result);
$class_obj->SendOutput();
}else
{
$arr['msg'] = "No data found!";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|