/applicationforms.php
PHP | 173 lines | 169 code | 4 blank | 0 comment | 7 complexity | 673a601fb9240b6277a05747f87df132 MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- global $url; if($_SERVER['HTTP_HOST']=='localhost') { $cn=mysql_connect("localhost","root",""); mysql_select_db("agpapp");
- $url='http://localhost/agpapp/sites/all/modules/manniragp/'; }
- else { $cn=mysql_connect("agpapp.db.8855061.hostedresource.com","agpapp","Customer13131"); mysql_select_db("agpapp");
- global $url; $url='http://agpapp.esystems.me/sites/all/modules/manniragp/'; }
- require_once('tcpdf/config/lang/eng.php');
- require_once('tcpdf/tcpdf.php');
- if(isset($_REQUEST['from']) && isset($_REQUEST['to']) && isset($_REQUEST['sortby'])) { $fr=$_REQUEST['from']; $to=$_REQUEST['to']; $sb=$_REQUEST['sortby'];
- $query = mysql_query("SELECT *,(select department from _programmes where _programmes.PROGRAMME=_application.programme1 LIMIT 1) AS department FROM `_application`
- WHERE id>='$fr' AND id<='$to' ORDER BY '$sb'"); $ar = array(); while($line = mysql_fetch_array($query, MYSQL_ASSOC)){ $ar[] = $line; }
- }
- else {
- $o = (object) mysqli_fetch_assoc(mysqli_query($con,"SELECT max(id) as mxid FROM _application")); $mxid=$o->mxid;
- $query = mysql_query("SELECT *,(select department from _programmes where _programmes.PROGRAMME=_application.programme1 LIMIT 1) AS department FROM `_application`
- WHERE id>=1 AND id<='$mxid'"); $ar = array(); while($line = mysql_fetch_array($query, MYSQL_ASSOC)){ $ar[] = $line; }
- }
- class MYPDF extends TCPDF {
- public function Header() { global $uid; global $url;
- $url='/sites/default/files/pictures/'; if($_SERVER['HTTP_HOST']=='localhost'){ $url='agp\sites\default\files\pictures\\'; }
- $p = (object) mysqli_fetch_assoc(mysqli_query($con,"SELECT filename FROM file_managed WHERE fid=(SELECT picture FROM users WHERE uid='$uid')"));
- $this->Image('logo.jpg', 10, 10, 25, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);
- $filename = '../../../default/files/pictures/'.$p->filename;
- $jpg=stristr($p->filename,".jpg"); $png=stristr($p->filename,".png"); if(isset($png)) { $tp='PNG'; } if(isset($jpg)) { $tp='JPG'; }
- //if (file_exists($filename)) { $this->Image($filename,175,10,25,25,$tp,'','R',false,300,'',false,false,0,false,0,false,false,false); }
- if(stristr($filename,$p->filename)!='') {
- $this->Image($filename,175,10,25,25,'','','R',false,300,'',false,false,0,false,0,false,false,false);
- //$this->Image($filename, 0, 0, '', '', '', '', '', false, 300, '', false, false, 0);
- }
- $this->SetFont('helvetica', 'B', 18);
- $this->SetY(10); $this->Cell(0, 15, 'ABDU GUSAU POLYTECHNIC, P.M.B. 1021', 0, false, 'C', 0, '', 0, false, 'M', 'M');
- $this->SetY(17); $this->Cell(0, 15, 'TALATA-MAFARA. ZAMFARA STATE', 0, false, 'C', 0, '', 0, false, 'M', 'M');
- $this->SetY(25); $this->Cell(0, 15, 'ONLINE APPLICATION FORM', 0, false, 'C', 0, '', 0, false, 'M', 'M');
- }
- public function Footer() {
- $this->SetY(-10);
- $this->SetFont('helvetica', 'I', 8);
- $this->Cell(0, 10, 'ABDU GUSAU POLYTECHNIC, TALATA-MAFARA, ZAMFARA STATE, System Developed By MANNIR ESYSTEMS LIMITED 2012 (www.mannir.net)', 0,
- false, 'C', 0, '', 0, false, 'T', 'M');
- // $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');
- }}
- $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
- $pdf->SetCreator(PDF_CREATOR);
- $pdf->SetAuthor('MUHAMMAD MANNIR AHMAD');
- $pdf->SetTitle('ABDUGUSAU POLYTECHNIC TALATA MAFARA: Online Application Form');
- $pdf->SetSubject('Application Form');
- $pdf->SetKeywords('Mannir, Mannir.com, eapplication');
- $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
- $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
- $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
- $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
- $pdf->SetMargins(10, 10, 10);
- $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
- $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
- $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
- $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
- $pdf->setLanguageArray($l);
- //$pdf->SetFont('times', 'BI', 12);
- $pdf->SetDisplayMode('fullpage', 'SinglePage', 'UseNone');
- $pdf->SetFont('times', 'B', 10);
- foreach($ar as $k=>$v) {
- session_start(); error_reporting(0); global $uid; $uid=$ar[$k]['uid']; //$uid = $_REQUEST['uid'];
- $a = (object) mysqli_fetch_assoc(mysqli_query($con,"SELECT * FROM _application WHERE uid='$uid'"));
- $ap = (object) mysqli_fetch_assoc(mysqli_query($con,"SELECT * FROM _application WHERE uid='$uid'"));
- $sc=explode(',',$a->schoolinfo); $s1=explode(':',$sc[0]); $s2=explode(':',$sc[1]); $s3=explode(':',$sc[2]); $s4=explode(':',$sc[3]);
- $s5=explode(':',$sc[4]); $e1=explode(',',$ap->examinfo1); $ee1=explode(':',$e1[0]); $e2=explode(',',$ap->examinfo2); $ee2=explode(':',$e2[0]);
- $pdf->AddPage('P', 'A4');
- $pdf->SetY(35); $pdf->Write(0, 'APPLICATION INFORMATION', '', 0, 'C', true, 0, false, false, 0);
- $pdf->SetY(40); $pdf->Cell(100, 0, 'User ID: '.$a->uid,1);
- $pdf->SetY(40); $pdf->SetX(115); $pdf->Cell(85, 0, 'Application No: '.$a->appno, 1);
- $pdf->SetY(46); $pdf->Cell(100, 0, 'Fullname: '.$a->fullname, 1);
- $pdf->SetY(46); $pdf->SetX(115); $pdf->Cell(85,0,'Gender: '.$a->gender,1,1,'L');
- $pdf->SetY(52); $pdf->Cell(100, 0, 'Date of Birth: '.$a->dob, 1);
- $pdf->SetY(52); $pdf->SetX(115); $pdf->Cell(85, 0, 'Religion: '.$a->religion, 1);
- $pdf->SetY(58); $pdf->Cell(100, 0, 'Marital Status: '.$a->maritalstatus, 1, 1,'','','',FALSE);
- $pdf->SetY(58); $pdf->SetX(115); $pdf->Cell(85,0,'Bloog Group: '.$a->bloodgroup,1);
- $pdf->SetY(64); $pdf->Cell(100, 0, 'Addres: '.$a->address,1);
- $pdf->SetY(64); $pdf->SetX(115); $pdf->Cell(85, 0, 'Place of Birth: '.$a->placeofbirth, 1);
- $pdf->SetY(70); $pdf->Cell(100, 0, 'Country: '.$a->country, 1);
- $pdf->SetY(70); $pdf->SetX(115); $pdf->Cell(85,0,'State: '.$a->state,1,1,'L');
- $pdf->SetY(77); $pdf->Cell(100, 0, 'L.G.A.: '.$a->lga, 1);
- $pdf->SetY(77); $pdf->SetX(115); $pdf->Cell(85, 0, 'Mobile No: '.$a->mobileno, 1);
- $pdf->SetY(84); $pdf->Cell(100, 0, 'PIN Code: '.$a->appno, 1);
- $pdf->SetY(84); $pdf->SetX(115); $pdf->Cell(85, 0, 'Teller No: '.$a->tellerno, 1);
- $pdf->SetY(92); $pdf->Write(0, 'SCHOOLS/ACADEMIC INFORMATION', '', 0, 'C', true, 0, false, false, 0);
- $pdf->SetY(97); $pdf->Cell(5, 0, 'SN', 0);
- $pdf->SetX(16); $pdf->Cell(70, 0, 'NAME OF SCHOOL', 0,'','C'); $pdf->SetX(87); $pdf->Cell(30, 0, 'DATE FROM', 0,'','C');
- $pdf->SetX(118); $pdf->Cell(30, 0, 'DATE TO', 0,'','C'); $pdf->SetX(149); $pdf->Cell(51, 0, 'CERTIFICATE', 0,'','C');
- $pdf->SetY(103); $pdf->Cell(5, 0, '1.', 1,'','C');
- $pdf->SetX(16); $pdf->Cell(70, 0, $s1[0], 1,'','C'); $pdf->SetX(87); $pdf->Cell(30, 0, $s1[1], 1,'','C');
- $pdf->SetX(118); $pdf->Cell(30, 0,$s1[2], 1,'','C'); $pdf->SetX(149); $pdf->Cell(51, 0,$s1[3], 1,'','C');
- $pdf->SetY(109); $pdf->Cell(5, 0, '2.', 1,'','C');
- $pdf->SetX(16); $pdf->Cell(70, 0,$s2[0], 1,'','C'); $pdf->SetX(87); $pdf->Cell(30, 0,$s2[1], 1,'','C');
- $pdf->SetX(118); $pdf->Cell(30, 0,$s2[2], 1,'','C'); $pdf->SetX(149); $pdf->Cell(51, 0,$s2[3], 1,'','C');
- $pdf->SetY(115); $pdf->Cell(5, 0, '3.', 1,'','C');
- $pdf->SetX(16); $pdf->Cell(70, 0,$s3[0], 1,'','C'); $pdf->SetX(87); $pdf->Cell(30, 0,$s3[1], 1,'','C');
- $pdf->SetX(118); $pdf->Cell(30, 0,$s3[2], 1,'','C'); $pdf->SetX(149); $pdf->Cell(51, 0,$s3[3], 1,'','C');
- $pdf->SetY(121); $pdf->Cell(5, 0, '4.', 1,'','C');
- $pdf->SetX(16); $pdf->Cell(70, 0,$s4[0], 1,'','C'); $pdf->SetX(87); $pdf->Cell(30, 0,$s4[1], 1,'','C');
- $pdf->SetX(118); $pdf->Cell(30, 0,$s4[2], 1,'','C'); $pdf->SetX(149); $pdf->Cell(51, 0,$s4[3], 1,'','C');
- $pdf->SetY(127); $pdf->Cell(5, 0, '5.', 1);
- $pdf->SetX(16); $pdf->Cell(70, 0,$s5[0], 1,'','C'); $pdf->SetX(87); $pdf->Cell(30, 0,$s5[1], 1,'','C');
- $pdf->SetX(118); $pdf->Cell(30, 0,$s5[2], 1,'','C'); $pdf->SetX(149); $pdf->Cell(51, 0,$s5[3], 1,'','C');
- $pdf->SetY(133); $pdf->Write(0, 'EXAMINATION INFORMATION', '', 0, 'C', true, 0, false, false, 0);
- $pdf->SetY(138); $pdf->Cell(93, 0, 'EXAM 1: '.$e1[0], 1,'','C');// $pdf->SetX(60); $pdf->Cell(40, 0, 'EXAMNO: '.$ee1[3], 1);
- $pdf->SetX(108); $pdf->Cell(92, 0, 'EXAM 2: '.$e2[0], 1,'','C');// $pdf->SetX(160); $pdf->Cell(40, 0, 'EXAMNO: '.$ee2[3], 1);
- $_SESSION['y']=144;
- for($i=1;$i<=9;$i++) {
- $pdf->SetY($_SESSION['y']); $pdf->Cell(6, 0, $i.'.', 1);
- $pdf->SetX(17); $pdf->Cell(70, 0,substr($e1[$i],0,strpos($e1[$i],'=')), 1,'','C');
- $pdf->SetX(88); $pdf->Cell(15, 0,substr($e1[$i],strpos($e1[$i],'=')+1), 1,'','C');
- $pdf->SetX(108); $pdf->Cell(5, 0, $i.'.', 1);
- $pdf->SetX(114); $pdf->Cell(70, 0,substr($e2[$i],0,strpos($e2[$i],'=')), 1,'','C');
- $pdf->SetX(185); $pdf->Cell(15, 0,substr($e2[$i],strpos($e2[$i],'=')+1), 1);
- $_SESSION['y']=$_SESSION['y']+6;
- }
- $pdf->SetY(199); $pdf->Write(0, 'CONTACT INFORMATION', '', 0, 'C', true, 0, false, false, 0);
- $pdf->SetY(203); $pdf->Cell(100,0,'Next of Kin Name: '.$a->nkname,1);
- $pdf->SetY(203); $pdf->SetX(115); $pdf->Cell(85, 0, 'Next of Kin Type: '.$a->nktype, 1);
- $pdf->SetY(209); $pdf->Cell(100, 0, 'Next of Kin Address: '.$a->address,1);
- $pdf->SetY(209); $pdf->SetX(115); $pdf->Cell(85, 0, 'Next of Kin Mobile No: '.$a->nkmobileno, 1);
- $pdf->SetY(215); $pdf->Cell(100, 0, 'Sponsor Name: '.$a->spname,1);
- $pdf->SetY(215); $pdf->SetX(115); $pdf->Cell(85, 0, 'Sponsor Type: '.$a->sptype, 1);
- $pdf->SetY(221); $pdf->Cell(190, 0, 'Sponsor Address: '.$a->spaddress, 1,'','C');
- $pdf->SetY(228); $pdf->Write(0, 'APPLICATION INFORMATION', '', 0, 'C', true, 0, false, false, 0);
- $pdf->SetY(233); $pdf->Cell(190, 0, 'Programme First Choice: '.$a->programme1, 1,'','C');
- $pdf->SetY(239); $pdf->Cell(190, 0, 'Programme Second Choice: '.$a->programme2, 1,'','C');
- $pdf->SetY(245); $pdf->Cell(190, 0, 'Programme Third Choice: '.$a->programme3, 1,'','C');
- //$pdf->SetY(253); $pdf->Cell(190, 0, 'User ID: 1 PIN Number: '.$a->pincode.' Teller Number: 0123456789', 1,'','C');
- //$pdf->SetY(255); $pdf->Cell(190, 15, 'Decalaration: ', 1);
- $pdf->SetY(255);
- $style = array(
- 'position' => 'C',
- 'align' => 'C',
- 'stretch' => false,
- 'fitwidth' => true,
- 'cellfitalign' => '',
- 'border' => true,
- 'hpadding' => 'auto',
- 'vpadding' => 'auto',
- 'fgcolor' => array(0,0,0),
- 'bgcolor' => false, //array(255,255,255),
- 'text' => false,
- 'font' => 'helvetica',
- 'fontsize' => 10,
- 'stretchtext' => 4);
- $pdf->write1DBarcode($ap->appno, 'C39E+', '', '', '', 16, 0.4, $style, 'C');
- }
- //$pdf->lastPage();
- $pdf->Output('AGP ePortal Application Forms.', 'D');