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.142.172.250
<?php
class AdmissionTicket
{
public $aobj_context;
public $degree_code;
public $registor_no_starts;
public $registor_no_ends;
public $sub_appearing_count;
public $sub_arr;
// college info
public $college_code;
public $college_name;
public $college_address;
// student info
public $STD_RegNo;
public $STD_CollCode;
public $STD_Course;
public $STD_Name;
public $STD_FAT;
public $STD_MAT;
public $STD_DOB;
function __construct($aobj_context)
{
$this->aobj_context=$aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
$this->college_code = $_SESSION['collcode'];
}
function getCollegeDetails()
{
$page_header_college = "select FCOLLCODE, FCOLLNAME,
CONCAT(FCOLLADD1,SPACE(2), FTOWN) AS COLLEGE_ADRS FROM COLLEGE
WHERE FCOLLCODE='{$this->college_code}' AND FDELETED='F'";
$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college);
//$this->college_code = $lobj_page_header_college['FCOLLCODE']
$this->college_name = $lobj_page_header_college['FCOLLNAME'];
$this->college_address = $lobj_page_header_college['COLLEGE_ADRS'];
}
function getStudentDetails()
{
$get_student_data= " SELECT S.FREGNO,S.FCOLLCODE,CONCAT(D.FDESCPN, SPACE(2), FEXAMDATE) AS COURSE,
S.FNAME,S.FFATNAME,S.FMOTNAME,S.FDOB
FROM STUDENT S LEFT JOIN DEGREE D ON
S.FDEGREE=D.FDEGREE
WHERE S.FREGNO='{$this->registor_no_starts}'
AND S.FDEGREE='{$this->degree_code}'
GROUP BY S.FAREGNO ";
$lobj_get_student_data = $this->aobj_context->mobj_db->GetRow($get_student_data);
$this->STD_RegNo = $lobj_get_student_data['FREGNO'];
$this->STD_CollCode = $lobj_get_student_data['FCOLLCODE'];
$this->STD_Course = $lobj_get_student_data['COURSE'];
$this->STD_Name = $lobj_get_student_data['FNAME'];
$this->STD_FAT =$lobj_get_student_data['FFATNAME'];
$this->STD_MAT =$lobj_get_student_data['FMOTNAME'];
$this->STD_DOB =$lobj_get_student_data['FDOB'];
}
function getSubjectAppearing()
{
$get_subject_appearing = "SELECT C.FDEGREE,
GROUP_CONCAT(D.FEXAMNAME ORDER BY D.FEXAMNO) EXAMNAME,
GROUP_CONCAT(C.FEXAMNO ORDER BY C.FSUBCODE) FEXAMNO, C.FREGNO,
GROUP_CONCAT(C.FSUBCODE ORDER BY C.FSUBCODE) AS SUBCODE ,
GROUP_CONCAT(S.FSUBSHORT ORDER BY S.FSUBCODE) AS SUBDECPN
FROM CANDDET C INNER JOIN SUBJECT S ON
C.FDEGREE=S.FDEGREE AND C.FEXAMNO=S.FEXAMNO AND
C.FSUBCODE=S.FSUBCODE AND S.FSSUBCODE=1
inner join DEGREE D on
C.FDEGREE= D.FDEGREE AND C.FEXAMNO=D.FEXAMNO
WHERE
C.FDEGREE='{$this->degree_code}' AND
C.FCOLLCODE='{$this->college_code}' AND C.FPASSMTH='' AND
C.FREGNO >= '{$this->registor_no_starts}' AND C.FREGNO <='{$this->registor_no_ends}'
GROUP BY C.FREGNO, C.FDEGREE";
$lobj_get_subject_appearing = $this->aobj_context->mobj_db->GetAll($get_subject_appearing);
$this->sub_appearing_count = count($lobj_get_subject_appearing);
/* echo "<PRE>";
var_dump($lobj_get_subject_appearing);
echo count($lobj_get_subject_appearing); die(); */
/* echo count($lobj_get_subject_appearing[0]); die(); */
for($i=0; $i< count($lobj_get_subject_appearing); $i++)
{
$this->sub_arr[$i]['FDEGREE'] = $lobj_get_subject_appearing[$i]['FDEGREE'];
$this->sub_arr[$i]['EXAMNAME'] = $lobj_get_subject_appearing[$i]['EXAMNAME'];
$this->sub_arr[$i]['FEXAMNO'] = $lobj_get_subject_appearing[$i]['FEXAMNO'];
$this->sub_arr[$i]['FREGNO'] = $lobj_get_subject_appearing[$i]['FREGNO'];
$this->sub_arr[$i]['SUBCODE'] = $lobj_get_subject_appearing[$i]['SUBCODE'];
$this->sub_arr[$i]['SUBDECPN'] = $lobj_get_subject_appearing[$i]['SUBDECPN'];
}
//echo $sub_arr[1]['SUBDECPN']; die();
}
}
function generateAdmissionTicket($aobj_context)
{
$class_obj=new AdmissionTicket($aobj_context);
$class_obj->degree_code = $aobj_context->mobj_data["degree_code"];
$class_obj->registor_no_starts= $aobj_context->mobj_data["reg_starts"];
$class_obj->registor_no_ends= $aobj_context->mobj_data["reg_ends"];
$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
$main_src=$main_src_obj[1];
$pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";
$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_adm_ticket.pdf";
include($pdf_writer_class);
$pdf= new FPDF();
$pdf->SetMargins(40,5,35);
$pdf->WhichReport = 'AdmissionTicket';
$pdf->AddPage();
$pdf->SetFont('Times','',10);
$adm_details=$class_obj->getCollegeDetails();
$adm_details=$class_obj->getStudentDetails();
$adm_details=$class_obj->getSubjectAppearing();
$pdf->Cell(0,5,$class_obj->college_name,0,1,'C');
$pdf->Cell(0,5,$class_obj->college_address ,'0',1,'C');
$pdf->Ln(3);
$pdf->Cell(0,5,'ADMISSION TICKET' ,'0',1,'C');
$pdf->Ln(3);
$pdf->Cell(40,6,' App. No.',1,0,'L');
$pdf->Cell(95,6,' ' ,1,1,'L');
$pdf->Cell(40,6,' Course',1,0,'L');
$pdf->Cell(95,6,' '.$class_obj->STD_Course,1,1,'L');
$pdf->Cell(40,6,' College',1,0,'L');
$pdf->Cell(95,6,' '.$class_obj->STD_CollCode ,1,1,'L');
$pdf->Cell(40,6,' Reg. No.',1,0,'L');
$pdf->Cell(95,6,' '.$class_obj->STD_RegNo ,1,1,'L');
$pdf->Cell(40,6,' Name',1,0,'L');
$pdf->Cell(95,6,' '.$class_obj->STD_Name ,1,1,'L');
$pdf->Cell(40,6,' Comb.',1,0,'L');
$pdf->Cell(95,6,' ' ,1,1,'L');
$pdf->Cell(40,6,' Par. Name.',1,0,'L');
$pdf->Cell(95,6,' '.$class_obj->STD_FAT ,1,1,'L');
$pdf->Cell(40,6,' DOB',1,0,'L');
$pdf->Cell(95,6,' '.$class_obj->STD_DOB ,1,1,'L');
$pdf->Ln(1);
$pdf->Cell(0,5,'SUBJECT APPEARING',0,1,'C');
$pdf->Ln(2);
$Same_Exam_No='';
$Chk_Col=2;
for($z=0; $z < $class_obj->sub_appearing_count; $z++)
{
if($class_obj->STD_RegNo == $class_obj->sub_arr[$z]['FREGNO'])
{
$sap_subcode = explode(",",$class_obj->sub_arr[$z]['SUBCODE']);
$sap_subdecp = explode(",",$class_obj->sub_arr[$z]['SUBDECPN']);
$sap_subexm = explode(",",$class_obj->sub_arr[$z]['FEXAMNO']);
$sap_subexmdecp = explode(",",$class_obj->sub_arr[$z]['EXAMNAME']);
// check for semister
$Same_Exam_No = $sap_subexm[0];
$pdf->Cell(30,6,$sap_subexmdecp[0],1,1,'C');
$Width_x = $pdf->GetX();
$Width_y = $pdf->GetY();
for($k=0; $k<count($sap_subcode); $k++ )
{
if($Same_Exam_No == $sap_subexm[$k])
{
$pdf->Text($pdf->GetX()+$Width, $pdf->GetY(), $sap_subcode[$k].' - '.$sap_subdecp[$k]);
//$pdf->Cell(30,6,$sap_subcode[$k].' - '.$sap_subdecp[$k],'LR',1,'C');
$Chk_Col++;
$rem_x = $pdf->GetX();
$rem_y = $pdf->GetY();
}
else
{
$pdf->Cell(30,6,$sap_subexmdecp[$k],1,1,'C');
$pdf->Cell(30,6,$sap_subcode[$k].' - '.$sap_subdecp[$k],'LR',1,'C');
$Same_Exam_No = $sap_subexm[$k];
$Chk_Col++;
$rem_x = $pdf->GetX();
$rem_y = $pdf->GetY();
}
if($Chk_Col == 3)
{
$Chk_Col=1;
$pdf->SetX(30+$rem_x);
$Width = 30;
}
}
}
}
$pdf->Output($root_pdf_file_download);
header("Content-type: application/vnd.pdf");
header("Content-Disposition: attachment; filename=report_adm_ticket.pdf");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
readfile($root_pdf_file_download);
unlink($root_pdf_file_download);
}
?>
|