Server IP : 202.29.229.35 / Your IP : 18.119.120.88 Web Server : Apache System : Linux aapanel2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 User : www ( 1001) PHP Version : 5.5.38 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/www.ivecr2.ac.th/stdcard/ |
Upload File : |
<?php require('fpdf.php'); require('code128.php'); function utf8_to_tis620($string) { $str = $string; $res = ""; for ($i = 0; $i < strlen($str); $i++) { if (ord($str[$i]) == 224) { $unicode = ord($str[$i+2]) & 0x3F; $unicode |= (ord($str[$i+1]) & 0x3F) << 6; $unicode |= (ord($str[$i]) & 0x0F) << 12; $res .= chr($unicode-0x0E00+0xA0); $i += 2; } else { $res .= $str[$i]; } } return $res; } class PDF extends FPDF { //Load data function LoadData($file) { //Read file lines $lines=file($file); $data=array(); foreach($lines as $line) $data[]=explode(';',chop($line)); return $data; } } // end class $pdf=new PDF_Code128('P','cm',array(10.5,29.5)); $pdf->AddPage(); $pdf->AddFont('angsanab','','angsanab.php'); $pdf->SetMargins(0,0,0,0); /* $host="localhost"; $user_name="root"; $pass_word="1234"; $db="std_card_db"; */ $host="localhost"; $user_name="stdcard_db"; $pass_word="Stdcard123"; $db="stdcard_db"; mysql_connect( $host,$user_name,$pass_word) or die ("can not connect to server"); mysql_query("SET NAMES utf8"); mysql_select_db($db) or die("can not select database"); $group_id = $_REQUEST['group_id']; $student_id = $_REQUEST['student_id']; if($group_id=="") { if($student_id==""){ echo "กรุณากรอกรหัสกลุ่ม หรือ รหัสนักเรียนนักศึกษา"; exit(); }else{ $sql_std = "select * from tblstd_idcard where student_id = '$student_id'"; } }else{ $sql_std = "select * from tblstd_idcard where group_id = '$group_id' order by student_id "; } $result1 = mysql_query($sql_std); $i = 0.5; $b=0.8; $row = 0; while($rs_std = mysql_fetch_array($result1)){ $row++; $student_id = $rs_std['student_id']; $people_id = $rs_std['people_id']; $perfix_id = $rs_std['perfix_id']; $stu_fname = $rs_std['stu_fname']; $stu_lname = $rs_std['stu_lname']; $start_year = $rs_std['start_year']; $schedu_id = $rs_std['schedu_id']; $group_id = $rs_std['group_id']; $minor_name = $rs_std['minor_name']; $card_no = $rs_std['card_no']; $date_print = $rs_std['date_print']; $date_expire = $rs_std['date_expire']; $pdf->SetXY(.2,1); $pdf->SetThaiFont(); $pdf->SetFont('angsanab','',12); //รหัสนักศึกษา $pdf->SetXY(.5,$i); $i+=1.4; $pdf->Cell(20,0,$student_id,0,0,'L'); //id std $pdf->SetXY(1,1); $pdf->Code128(0.5,$b,$student_id,7,.7); $b+=1.4; $pdf->SetThaiFont(); $pdf->SetFont('angsanab','',12); if($row == 20){ $pdf->AddPage(); $row = 0; $i = 0.5; $b=0.8; } }//end while $pdf->Output(); ?>