Ikki_wrs

Untitled

Jul 13th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.28 KB | None | 0 0
  1. ======================r-p.php=====================
  2. <?php
  3. include "../../config/koneksi.php";
  4. require('../../config/fpdf/fpdf.php');
  5.  
  6. if(isset($_GET['Cetak'])){
  7. $taw = $_GET['tgl_a'];
  8. $tak = $_GET['tgl_b'];
  9. $result=mysqli_query($db,"Select a.no_voucher,a.tgl_voucher,a.jam,a.km_akhir,a.liter,a.total,b.nip,b.nama, c.nopol,c.ket,c.jenis,d.id_bbm,d.jenis_bbm,d.harga,a.cabang from voucher a, karyawan b,trasportasi c,bbm d where a.nip=b.nip and a.nopol=c.nopol and a.id_bbm=d.id_bbm and a.tgl_voucher>='$taw' and a.tgl_voucher<='$tak'") or die(mysqli_error());
  10. //and a.thn_ajaran like '%$ta'
  11. //Inisiasi untuk membuat header kolom
  12.  
  13. $b1 = "";
  14. $b2 = "";
  15. $b3 = "";
  16. $b4 = "";
  17. $b5 = "";
  18. $b6 = "";
  19. $b7 = "";
  20. $b8 = "";
  21. $b9 = "";
  22. $b10 = "";
  23. $b11 = "";
  24.  
  25.  
  26. //For each row, add the field to the corresponding column
  27. while($row = mysqli_fetch_array($result))
  28. {
  29. $no=1;
  30. $a = $row["no_voucher"];
  31. $a1 = $row["tgl_voucher"];
  32. $a2 = $row["nama"];
  33. $a3 = $row["nopol"];
  34. $a4 = $row["jenis"];
  35. $a5 = $row["ket"];
  36. $a6 = $row["jenis_bbm"];
  37. $a7 = $row["liter"];
  38. $a8 = $row["harga"];
  39. $a9 = $row["total"];
  40. $a10 = $row["cabang"];
  41.  
  42.  
  43.  
  44. $b1 = $b1.$no."\n";
  45. $b2 = $b2.$a1."\n";
  46. $b3 = $b3.$a2."\n";
  47. $b4 = $b4.$a3."\n";
  48. $b5 = $b5.$a4."\n";
  49. $b6 = $b6.$a5."\n";
  50. $b7 = $b7.$a6."\n";
  51. $b8 = $b8.$a7."\n";
  52. $b9 = $b9.$a8."\n";
  53. $b10 = $b10.$a9."\n";
  54. $b11 = $b11.$a10."\n";
  55.  
  56.  
  57. //Create a new PDF file
  58. $pdf = new FPDF('L','mm',array(210,297)); //L For Landscape / P For Portrait
  59. $pdf->AddPage();
  60.  
  61. //Menambahkan Gambar
  62. //$pdf->Image('../foto/logo.png',10,10,-175);
  63.  
  64. $pdf->SetFont('Arial','B',13);
  65. $pdf->Cell(80);
  66. $pdf->Cell(30,10,'Laporan Penggunaan Subsidi BBM;',0,0,'C');
  67. $pdf->Ln();
  68. $pdf->Cell(80);
  69. $pdf->Cell(30,10,'PT. Krida Dinamik Autonusa',0,0,'C');
  70. $pdf->Ln();
  71.  
  72. }
  73. //Fields Name position
  74. $Y_Fields_Name_position = 30;
  75.  
  76. //First create each Field Name
  77. //Gray color filling each Field Name box
  78. $pdf->SetFillColor(110,180,230);
  79. //Bold Font for Field Name
  80. $pdf->SetFont('Arial','B',10);
  81. $pdf->SetY($Y_Fields_Name_position);
  82. $pdf->SetX(5);
  83. $pdf->Cell(25,8,'No',1,0,'C',1);
  84. $pdf->SetX(30);
  85. $pdf->Cell(40,8,'Kode Voucher',1,0,'C',1);
  86. $pdf->SetX(70);
  87. $pdf->Cell(25,8,'Tanggal',1,0,'C',1);
  88. $pdf->SetX(95);
  89. $pdf->Cell(25,8,'Nama',1,0,'C',1);
  90. $pdf->SetX(120);
  91. $pdf->Cell(50,8,'Nopol',1,0,'C',1);
  92. $pdf->SetX(170);
  93. $pdf->Cell(50,8,'Nopol',1,0,'C',1);
  94. $pdf->SetX(170);
  95. $pdf->Cell(50,8,'Jenis Kendaraan',1,0,'C',1);
  96. $pdf->SetX(170);
  97. $pdf->Cell(50,8,'Keterangan',1,0,'C',1);
  98. $pdf->SetX(170);
  99. $pdf->Cell(50,8,'Jenis',1,0,'C',1);
  100. $pdf->SetX(170);
  101. $pdf->Cell(50,8,'Liter',1,0,'C',1);
  102. $pdf->SetX(170);
  103. $pdf->Cell(50,8,'Harga/Liter',1,0,'C',1);
  104. $pdf->SetX(170);
  105. $pdf->Cell(50,8,'Total',1,0,'C',1);
  106. $pdf->SetX(170);
  107. $pdf->Cell(35,8,'Cabang',1,0,'C',1);
  108. $pdf->Ln();
  109.  
  110. //Table position, under Fields Name
  111. $Y_Table_Position = 38;
  112.  
  113. //Now show the columns
  114. $pdf->SetFont('Arial','',10);
  115.  
  116. $pdf->SetY($Y_Table_Position);
  117. $pdf->SetX(5);
  118. $pdf->MultiCell(25,6,$column_nik,1,'C');
  119.  
  120. $pdf->SetY($Y_Table_Position);
  121. $pdf->SetX(30);
  122. $pdf->MultiCell(40,6,$column_nama,1,'L');
  123.  
  124. $pdf->SetY($Y_Table_Position);
  125. $pdf->SetX(70);
  126. $pdf->MultiCell(25,6,$column_tempat,1,'C');
  127.  
  128. $pdf->SetY($Y_Table_Position);
  129. $pdf->SetX(95);
  130. $pdf->MultiCell(25,6,$column_tanggal,1,'C');
  131.  
  132. $pdf->SetY($Y_Table_Position);
  133. $pdf->SetX(120);
  134. $pdf->MultiCell(50,6,$column_alamat,1,'L');
  135.  
  136. $pdf->SetY($Y_Table_Position);
  137. $pdf->SetX(170);
  138. $pdf->MultiCell(35,6,$column_no,1,'C');
  139.  
  140. $pdf->Output();
  141. }
  142. ?>
  143. ==================================================
  144. <?php
  145. require_once "../../config/koneksi.php";
  146. ?>
  147. <!DOCTYPE html>
  148. <html lang="en">
  149. <head>
  150. <meta charset="utf-8">
  151. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  152. <meta name="viewport" content="width=device-width, initial-scale=1">
  153. <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  154. <title>Sysco Admin Finance</title>
  155.  
  156. <!-- favicon -->
  157. <link rel="shortcut icon" href="">
  158.  
  159. <!-- Bootstrap -->
  160. <link href="../../assets/css/bootstrap.min.css" rel="stylesheet">
  161. <link href="../../assets/css/datepicker.min.css" rel="stylesheet">
  162.  
  163. <!-- styles -->
  164. <link href="../../assets/css/style.css" rel="stylesheet">
  165. <link rel="shortcut icon" href="../favicon.ico">
  166. <link rel="stylesheet" type="text/css" href="../css/normalize.css" />
  167. <link rel="stylesheet" type="text/css" href="../css/demo.css" />
  168. <link rel="stylesheet" type="text/css" href="../css/component.css" />
  169. <script src="../js/modernizr.custom.js"></script>
  170. </head>
  171. <body>
  172. <br><br>
  173. <link href="../assets/css/bootstrap.css" rel="stylesheet" />
  174. <link href="../assets/css/font-awesome.css" rel="stylesheet" />
  175. <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
  176.  
  177. <!-- Fungsi untuk membatasi karakter yang diinputkan -->
  178. <script language="javascript">
  179. function getkey(e)
  180. {
  181. if (window.event)
  182. return window.event.keyCode;
  183. else if (e)
  184. return e.which;
  185. else
  186. return null;
  187. }
  188.  
  189. function goodchars(e, goods, field)
  190. {
  191. var key, keychar;
  192. key = getkey(e);
  193. if (key == null) return true;
  194.  
  195. keychar = String.fromCharCode(key);
  196. keychar = keychar.toLowerCase();
  197. goods = goods.toLowerCase();
  198.  
  199. // check goodkeys
  200. if (goods.indexOf(keychar) != -1)
  201. return true;
  202. // control keys
  203. if ( key==null || key==0 || key==8 || key==9 || key==27 )
  204. return true;
  205.  
  206. if (key == 13) {
  207. var i;
  208. for (i = 0; i < field.form.elements.length; i++)
  209. if (field == field.form.elements[i])
  210. break;
  211. i = (i + 1) % field.form.elements.length;
  212. field.form.elements[i].focus();
  213. return false;
  214. };
  215. // else return false
  216. return false;
  217. }
  218. </script>
  219. </head>
  220. <body>
  221. <div class="container-fluid">
  222. <form action="r-p.php" method="post" target="_blank">
  223. <div class="form-group">
  224. <label class="col-sm-2 control-label">Dari Tanggal</label>
  225. <table width="600"><td width="300"><div class="col-sm-3">
  226. <input name="tgl_a" type="text" class="form-control date-picker" id="tgl_a" autocomplete="off" size="50" data-date-format="dd-mm-yyyy" >
  227. </div></td></table>
  228. </div>
  229. <div class="form-group">
  230. <label class="col-sm-2 control-label">Sampai Tanggal</label>
  231. <table width="600"><td width="300"><div class="col-sm-3">
  232. <input name="tgl_b" type="text" class="form-control date-picker" id="tgl_b" autocomplete="off" size="50" data-date-format="dd-mm-yyyy" >
  233. </div></td></table>
  234. </div>
  235. <hr/>
  236. <div class="form-group">
  237. <div class="col-sm-offset-2 col-sm-10">
  238. <input type="submit" class="btn btn-info btn-submit" name="cetak" value="cetak">
  239. <a href="../bbm.php" class="btn btn-default btn-reset">Batal</a>
  240. </div>
  241. </div>
  242. </form>
  243.  
  244. </div> <!-- /.container-fluid -->
  245. <ul id="gn-menu" class="gn-menu-main">
  246. <li class="gn-trigger">
  247. <a class="gn-icon gn-icon-menu"><span>Menu</span></a>
  248. <nav class="gn-menu-wrapper">
  249. <div class="gn-scroller">
  250. <ul class="gn-menu">
  251. <li><a class="gn-icon gn-icon-archive" href="../bbm.php">Beranda BBM</a></li>
  252. <li><a class="gn-icon gn-icon-archive" href="../staff/index.php">Data Karyawan</a></li>
  253. <li><a class="gn-icon gn-icon-archive" href="../kendaraan/index.php">Data Kendaraan</a></li>
  254. <li><a class="gn-icon gn-icon-archive" href="../supir/index.php">Data Supir</a></li>
  255. <li><a class="gn-icon gn-icon-archive" href="index.php">Data BBM</a>
  256. <li><a class="gn-icon gn-icon-archive" href="../voucher/index.php">Data Transaksi</a>
  257. </li>
  258. </ul>
  259. </div><!-- /gn-scroller -->
  260. </nav>
  261. </li>
  262. <li><a href="../index.php">Home</a></li>
  263. <li><a class="codrops-icon codrops-icon-prev" href="../config/log.php?op=out"><span>Log Out</span></a></li>
  264. </ul>
  265.  
  266.  
  267.  
  268. <footer class="footer">
  269. <div class="container-fluid">
  270. <p class="text-muted pull-left">&copy; 2016 Bu5eT KDA</p>
  271. <p class="text-muted pull-right ">System By <a href="" target="_blank">Krida Dinamik Autonusa</a></p>
  272. </div>
  273. </footer>
  274.  
  275. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  276. <script src="../../assets/js/jquery.min.js"></script>
  277. <!-- Include all compiled plugins (below), or include individual files as needed -->
  278. <script src="../../assets/js/bootstrap.min.js"></script>
  279. <script src="../../assets/js/bootstrap-datepicker.min.js"></script>
  280. </div><!-- /container -->
  281. <script src="../js/classie.js"></script>
  282. <script src="../js/gnmenu.js"></script>
  283. <script>
  284. new gnMenu( document.getElementById( 'gn-menu' ) );
  285. </script>
  286. <script type="text/javascript">
  287. $(function () {
  288.  
  289. //datepicker plugin
  290. $('.date-picker').datepicker({
  291. autoclose: true,
  292. todayHighlight: true
  293. });
  294.  
  295. // toolip
  296. $('[data-toggle="tooltip"]').tooltip();
  297. })
  298. </script>
  299. </body>
  300. </html>
  301. ======================re-p.ph========================
Advertisement
Add Comment
Please, Sign In to add comment