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.139.236.144
<?php
//require('code39.php');
require('rotation.php');
class BundleDispatch
{
public $aobj_context;
public $degree_code;
public $print_per_page;
public $sub_appearing_count;
public $bundle_arr;
// university
public $std_FUNIVNAME;
public $std_FUNIVCODE;
public $std_FTOWN;
public $FEXAMCNTR;
public $exam_center_name;
// college info
public $college_code;
public $college_name;
public $college_address;
// student info
public $STD_CollCode;
public $STD_Course;
// date
public $date_time;
public $bundle_count;
public $qpcode;
public $qpcodename;
public $qpdate;
public $qpsession;
function __construct($aobj_context)
{
$this->aobj_context = $aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$this->college_code = $_SESSION['collcode'];
$bth_flag = 0;
}
function getUniversityDetails()
{
$page_header_university = "select FUNIVCODE, FUNIVNAME,FTOWN,FUNIVADD1,DATE_FORMAT(NOW(),'%d/%m/%Y %h:%i %p') as now_date from control";
$lobj_page_header_university = $this->aobj_context->mobj_db->GetRow($page_header_university);
$this->std_FUNIVCODE = $lobj_page_header_university['FUNIVCODE'];
$this->std_FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
$this->std_FTOWN = $lobj_page_header_university['FTOWN'];
$this->std_FUNIVADD1 = $lobj_page_header_university['FUNIVADD1'];
$this->date_time = $lobj_page_header_university['now_date'];
}
function getCollegeDetails()
{
$page_header_college = "select c.FCOLLCODE, c.FCOLLNAME, c.FEXAMCNTR,
ec.FCOLLNAME AS exam_center_name,c.FTOWN,
CONCAT(c.FCOLLADD1,SPACE(2), c.FTOWN,'\n',c.FEXAMCNTR) AS COLLEGE_ADRS
FROM college c
LEFT JOIN college ec ON ec.FCOLLCODE=c.FEXAMCNTR
WHERE c.FCOLLCODE='{$this->college_code}'";
//var_dump($page_header_college);
$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college);
$this->college_code = $lobj_page_header_college['FCOLLCODE'];
$this->FEXAMCNTR = $lobj_page_header_college['FEXAMCNTR'];
$this->exam_center_name = $lobj_page_header_college['exam_center_name'];
$this->college_name = $lobj_page_header_college['FCOLLNAME'];
$this->college_address = $lobj_page_header_college['COLLEGE_ADRS'];
$this->FTOWN = $lobj_page_header_college['FTOWN'];
} //and ifnull(col.FDELETED,'F')='F'
function getBundleDispatchDetails()
{
$this->qpcode = $this->aobj_context->mobj_data['qpcode'];
$this->qpdate = $this->aobj_context->mobj_data['qpdate'];
$this->qpsession = $this->aobj_context->mobj_data['qpsession'];
//$page_subject = "select FSUBNAME,FDEGREE from subject where FQPCODE = '{$this->qpcode}'";
$page_subject = "select distinct s.FSUBNAME,s.FDEGREE from subject s
where FQPCODE = '{$this->qpcode}'
order by s.fdegree desc";
//var_dump($page_subject);
$lobj_get_subject = $this->aobj_context->mobj_db->GetRow($page_subject);
$this->qpcodename = $lobj_get_subject['FSUBNAME'];
$page_degree = "select distinct FEXAMDATE from degree where fdegree = '{$lobj_get_subject['FDEGREE']}'";
$lobj_get_subject = $this->aobj_context->mobj_db->GetRow($page_degree);
$this->freshExamDate = $lobj_get_subject['FEXAMDATE'];
$get_bundle_data = "select c.FBUNO, c.FCOLLCODE, c.FQPCODE, c.FTOTSCRIPT,
DATE_FORMAT(c.FDOE,'%d/%m/%Y') as FDOE, c.FSESSION, r.FDESCPN
from colldesp c, reason r
where c.fsession = r.freasoncd and c.fqpcode = '{$this->qpcode}'
and c.fcollcode ='{$this->college_code}'
order by FBUNO";
//var_dump($get_bundle_data);
$lobj_get_bundle_data = $this->aobj_context->mobj_db->GetAll($get_bundle_data);
$this->bundle_count = count($lobj_get_bundle_data);
foreach ($lobj_get_bundle_data as $rek => $rev) {
$this->bundle_arr[$rev['FBUNO']]['FBUNO'] = $rev['FBUNO'];
$this->bundle_arr[$rev['FBUNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
$this->bundle_arr[$rev['FBUNO']]['FQPCODE'] = $rev['FQPCODE'];
$this->bundle_arr[$rev['FBUNO']]['FTOTSCRIPT'] = $rev['FTOTSCRIPT'];
$this->bundle_arr[$rev['FBUNO']]['FDOE'] = $rev['FDOE'];
$this->bundle_arr[$rev['FBUNO']]['FSESSION'] = $rev['FDESCPN'];
}
}
}
function generateBundleDispatchQPWise($aobj_context)
{
$class_obj = new BundleDispatch($aobj_context);
ini_set("memory_limit", -1);
ini_set('max_execution_time', 3300);
$main_src_obj = (explode("/", $_SERVER["REQUEST_URI"]));
$main_src = $main_src_obj[1];
$pdf_reader_class = $aobj_context->main_src . "/maya-pdf/fpdi/FPDI_Protection.php";
$pdf_psw_function = $aobj_context->main_src . "/maya-pdf/TarkaPDFEncryption.php";
$root_pdf_file_download = $aobj_context->main_src . "/Report_details/output/report_adm_ticket.pdf";
include($pdf_writer_class);
$pdf = new PDF_Code39();
$pdf->SetMargins(15, 2, 15);
$pdf->aobj_context = $aobj_context;
$pdf->WhichReport = 'AdmissionTicket';
$pdf->SetFillColor(248, 248, 255);
$pdf->SetFont('Times', '', 10);
$adm_details = $class_obj->getUniversityDetails();
$adm_details = $class_obj->getCollegeDetails();
$adm_details = $class_obj->getBundleDispatchDetails();
$pdf->AddPage();
$i = 1;
$class_obj->college_code = substr("00000000" . $class_obj->college_code, -4);
foreach ($class_obj->bundle_arr as $reg_k => $reg_v) {
//$pdf->AddPage();
$pdf->Ln(3);
$pdf->SetLineWidth(0.01);
$barcode = $class_obj->college_code . $reg_v['FQPCODE'] . $reg_v['FBUNO'] . str_pad($reg_v['FTOTSCRIPT'], 3, 0, STR_PAD_LEFT);
$pdf->SetFont('Times', 'B', 14);
$img_path = $aobj_context->main_src . "/img/report_uni_logo.jpg";
$ypos = $pdf->GetY();
$xpos = $pdf->GetX();
if (file_exists($img_path))
$pdf->Image($img_path, $xpos, $ypos - 10, 22);
$ypos = $pdf->GetY();
$pdf->SetY($ypos - 15);
$pdf->Cell(0, 4, $class_obj->std_FUNIVNAME, 0, 1, 'C');
$pdf->SetFont('Times', '', 8);
$pdf->Cell(0, 4, $class_obj->std_FUNIVADD1, 0, 1, 'C');
$pdf->SetFont('Times', 'B', 14);
$pdf->Cell(185, 0, 'Page No. : ' . $i . ' / ' . $class_obj->bundle_count, 0, 1, 'R');
$pdf->Ln(2);
$pdf->Cell(0, 4, 'Answer Bundle Packing Information ', '0', 1, 'C');
$pdf->SetFont('Times', 'B', 10);
$pdf->Ln(1);
$pdf->Cell(0, 4, $class_obj->freshExamDate . ' ' . ' EXAMINATION ', '0', 0, 'C');
$pdf->SetFont('Times', 'B', 20);
$pdf->Cell(10, 4, 'QP Code : ' . $reg_v['FQPCODE'], '0', 1, 'R');
$pdf->Ln(2);
$new_yl = $pdf->GetY();
//$pdf->SetDash(1, .3);
$pdf->SetFillColor(0, 0, 0);
$pdf->Cell(0, 3, $pdf->Code39($pdf->GetX() + 40, $pdf->GetY(), $barcode, true, false, 0.3, 8, true, 30), '0', 1, 'C');
$pdf->Ln(1);
$new_yl = $pdf->GetY() + 10;
$pdf->Line(10, $new_yl, 200, $new_yl);
$pdf->Line(10, $new_yl + .5, 200, $new_yl + .5);
$pdf->Ln(13);
$pdf->SetFont('Times', 'B', 14);
$pdf->Cell(60, 3, 'Bundle No.', 0, 0, 'L');
$pdf->Cell(5, 3, ':', 0, 0, 'L');
$pdf->Cell(0, 3, '' . $reg_v['FBUNO'], 0, 1, 'L');
$pdf->Ln(3);
$pdf->SetFillColor(0, 0, 0);
//$xpos=$pdf->GetX();
//$ypos=$pdf->GetY();
$pdf->SetFont('Times', 'B', 10);
$pdf->Cell(60, 3, 'Center Code & Name ', 0, 0, 'L');
$pdf->Cell(5, 3, ':', 0, 0, 'L');
$pdf->MultiCell(90, 5, ' ' . $class_obj->college_code . " - " . $class_obj->college_name . ' , ' . $class_obj->FTOWN, 0, 'L');
$pdf->Ln(2);
$pdf->Cell(60, 3, 'QP Code & Paper Name ', 0, 0, 'L');
$pdf->Cell(5, 3, ':', 0, 0, 'L');
$pdf->MultiCell(90, 5, ' ' . $reg_v['FQPCODE'] . ' - ' . $class_obj->qpcodename, 0, 'L');
$pdf->Ln(2);
$pdf->Cell(60, 3, 'No. of Scripts ', 0, 0, 'L');
$pdf->Cell(5, 3, ':', 0, 0, 'L');
$pdf->Cell(0, 3, ' ' . $reg_v['FTOTSCRIPT'], 0, 1, 'L');
$pdf->Ln(2);
$pdf->Cell(60, 3, 'Date & Session ', 0, 0, 'L');
$pdf->Cell(5, 3, ':', 0, 0, 'L');
$pdf->Cell(0, 3, ' ' . $reg_v['FDOE'] . ' ' . $reg_v['FSESSION'], 0, 1, 'L');
$pdf->Ln(5);
$pdf->Cell(80, 2, 'Bundle Prepared by ', 0, 0, 'L');
$pdf->Cell(0, 4, 'Principal / Chairman / Coordinator :', 0, 1, 'L');
$pdf->Ln(1);
$pdf->SetFont('Times', '', 10);
$pdf->Cell(80, 6, 'Name :................................', 0, 0, 'L');
$pdf->Cell(0, 6, 'Name :................................', 0, 1, 'L');
$pdf->Cell(80, 6, 'Mobile No :.........................', 0, 0, 'L');
$pdf->Cell(0, 6, 'Mobile No :.........................', 0, 1, 'L');
//$reg_v['FBUNO']
$pdf->Ln(9);
$pdf->Cell(100, 5, '', '0', 0, 'L');
$pdf->SetFont('Times', 'B', 10);
$pdf->Cell(0, 4, ' Chairman / Chief Superintendent', 0, 1, 'L');
$pdf->Cell(115, 5, '', '0', 0, 'L');
$pdf->Cell(0, 4, '(Signature with seal)', 0, 1, 'L');
$pdf->Rotate(270);
$pdf->Cell(0, 3, $pdf->Code39($pdf->GetX() - 65, $pdf->GetY() - 180, $barcode, true, false, 0.2, 10, true, 10), '0', 1, 'R');
$pdf->Rotate(0);
$pdf->Ln(-14);
$pdf->SetFont('Times', '', 10);
$pdf->Cell(0, 4, 'Note: 1. Prepare individual bundle for each qp code.', 0, 1, 'L');
$pdf->Ln(1);
$pdf->Cell(0, 4, ' 2. Send invigilators dairy along with bundle.', 0, 1, 'L');
$pdf->Ln(1);
$pdf->Cell(0, 4, ' 3. Bundle Weight is compulsory.', 0, 1, 'L');
$pdf->Ln(4);
$pdf->SetFont('Times', 'B', 12);
$pdf->Cell(40, 3, 'Bundle Weight ', 0, 0, 'L');
$pdf->Cell(0, 3, ': ____________', 0, 1, 'L');
$ip = $_SERVER["REMOTE_ADDR"];
$pdf->SetFont('Times', '', 8);
$new_yl = $pdf->GetY() + 2;
//$pdf->SetDash(1, .3);
$pdf->Line(10, $new_yl + 3, 200, $new_yl + 3);
$pdf->Line(10, $new_yl + 3.5, 200, $new_yl + 3.5);
$pdf->Ln(5);
$pdf->Cell(150, 4, 'Printed : IP Address : ' . $ip . ", Date : " . $class_obj->date_time, '0', 0, 'L');
$pdf->Ln(16);
$ypos = $pdf->GetY();
$i++;
if ($ypos > 190)
$pdf->AddPage();
}
$pdf->Output("report_bundle_report.pdf", "D");
}
function PrintFooter($pdf, $date)
{ }
|