PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/report/disposisisuratmasuk.php

https://bitbucket.org/metamorph/kppnadministration
PHP | 262 lines | 224 code | 6 blank | 32 comment | 25 complexity | c337c859c43aeea2ab79d5b7553c95a4 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. require_once(dirname(dirname(__FILE__)) . '/fpdf/fpdf.php');
  3. require_once(dirname(dirname(__FILE__)) . '/config/koneksi.php');
  4. require_once(dirname(dirname(__FILE__)) . '/config/helper.php');
  5. $helper = new helper();
  6. $idsurat = $_POST['idsurat'];
  7. $noagenda = $_POST['noagenda'];
  8. $nomorsuratmasuk = $_POST['nomorsuratmasuk'];
  9. $tglsurat = $_POST['tglsurat'];
  10. $asalsurat = $_POST['asalsurat'];
  11. $perihal = $_POST['perihal'];
  12. $disposisi = $_POST['disposisi'];
  13. $Batasselesai = $_POST['batasselesai'];
  14. $batasselesai = $helper->dateConvert($Batasselesai);
  15. // header dan footer
  16. class PDF extends FPDF{
  17. function Header()
  18. {
  19. // Logo
  20. $this->Image(dirname(dirname(__FILE__)) . '/templates/images/logodepkeu.png',1,1,1.5,1.5);
  21. // Times bold 13
  22. $this->SetFont('Times','B',9);
  23. // Move to the right
  24. $this->Cell(0.5);
  25. // Title 1
  26. $this->Cell(13,0.4,'KEMENTERIAN KEUANGAN REPUBLIK INDONESIA',0,1,'C');
  27. // Times bold 12
  28. $this->SetFont('Times','B',8);
  29. // Move to the right
  30. $this->Cell(0.5);
  31. // Title 2
  32. $this->Cell(13,0.4,'DIREKTORAT JENDERAL PERBENDAHARAAN',0,1,'C');
  33. // Times bold 12
  34. $this->SetFont('Times','B',7);
  35. // Move to the right
  36. $this->Cell(0.5);
  37. // Title 3
  38. // Query kanwil
  39. $qKanwil = mysql_query("SELECT nmkanwil FROM t_kanwil WHERE aktif='1'")or die(mysql_error);
  40. $rKanwil = mysql_fetch_object($qKanwil);
  41. $nmKanwil = $rKanwil->nmkanwil;
  42. $this->Cell(13,0.4,'KANTOR WILAYAH '.$nmKanwil,0,1,'C');
  43. // Times bold 12
  44. $this->SetFont('Times','',7);
  45. // Move to the right
  46. $this->Cell(0.5);
  47. // Title 4
  48. // Query KPPN
  49. $qKppn = mysql_query("SELECT nmkppn FROM t_kppn WHERE kddefa='1'")or die(mysql_error);
  50. $rKppn = mysql_fetch_array($qKppn);
  51. $nmKppn = $rKppn['nmkppn'];
  52. $this->Cell(13,0.3,'KANTOR PELAYANAN PERBENDAHARAAN '.$nmKppn,0,1,'C');
  53. // Times 8
  54. $this->SetFont('Times','',5);
  55. // Move to the right
  56. $this->Cell(0.5);
  57. // Title 5
  58. $qryKppn = mysql_query("SELECT almkppn,kotakppn,telkppn,email,kodepos,faxkppn,website,smsgateway FROM t_kppn WHERE kddefa='1'")or die(mysql_error);
  59. $rsltKppn = mysql_fetch_array($qryKppn);
  60. $almKppn = $rsltKppn['almkppn']." ".$rsltKppn['kotakppn']." ".$rsltKppn['kodepos']." Telepon: ".$rsltKppn['telkppn']." Faksimile: ".$rsltKppn['faxkppn'];
  61. $this->Cell(13,0.3,$almKppn,0,1,'C');
  62. // Move to the right
  63. $this->Cell(0.5);
  64. // Title 6
  65. $queryKppn= mysql_query("SELECT email,website,smsgateway FROM t_kppn WHERE kddefa='1'")or die(mysql_error);
  66. $resultKppn= mysql_fetch_array($queryKppn);
  67. $webKppn = "Website: ".$resultKppn['website']." Email: ".$resultKppn['email']." SMS Gateway: ".$resultKppn['smsgateway'];
  68. $this->Cell(13,0.3,$webKppn,0,1,'C');
  69. // Draw line
  70. //$this->Line(1.0,3.95,20.0,3.95);
  71. //$this->Line(1.0,4.0,20.0,4.0);
  72. $timezone = "Asia/Jakarta";
  73. if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
  74. $datedisposisi= date("Y-m-d H:i:s");
  75. $idsurat = $_POST['idsurat'];
  76. $username = $_POST['username'];
  77. // Update user, tanggal, status pencetakan disposisi. Status proses ='2'
  78. if(isset($_POST['reportcetakdisposisi']) && $_POST['reportcetakdisposisi'] == "Cetak"){
  79. $statproses = $_POST['statproses'];
  80. if($statproses == 1){
  81. mysql_query("UPDATE d_suratmasuk SET usertrmsekret='$username', timetrmsekret='$datedisposisi', statproses='2' WHERE idsurat='$idsurat'");
  82. }elseif($statproses == 2){
  83. mysql_query("UPDATE d_suratmasuk SET statproses='3' WHERE idsurat='$idsurat'");
  84. }
  85. }
  86. // Line break
  87. $this->Ln(0.3);
  88. }
  89. function Footer(){
  90. $this->SetTextColor(015,015,015);
  91. $this->SetFont('','U');
  92. $this->SetY(-2,5);
  93. }
  94. }
  95. //menampilkan data
  96. $query = mysql_query("SELECT DISTINCT timeloket FROM d_suratmasuk WHERE idsurat='$idsurat'");
  97. $hasil = mysql_fetch_object($query);
  98. $Dateloket = strtotime($hasil->timeloket);
  99. $dateloket = date("d-m-Y",$Dateloket);
  100. $pdf=new PDF('P','cm','A5');
  101. $pdf->Open();
  102. $pdf->AliasNbPages();
  103. $pdf->AddPage();
  104. $pdf->SetFont('Arial','B','6');
  105. $pdf->Cell(13,0.4,'LEMBAR DISPOSISI','B',0,'C',0);
  106. $pdf->Ln();
  107. $pdf->SetFont('Arial','','6');
  108. $pdf->Cell(13,0.4,'PERHATIAN: Dilarang memisahkan sehelai surat pun yang tergabung dalam berkas ini','B',0,'C',0);
  109. $pdf->Ln();
  110. $pdf->Cell(3,0.4,'Tanggal Penerimaan Surat:',0,0,'L');
  111. $pdf->Cell(0.4,0.4,$dateloket,0,0,'L');
  112. $pdf->Cell(5,0.4,'No.Agenda:',0,0,'R');
  113. $pdf->Cell(2,0.4,$noagenda,0,1,'R');
  114. //next row
  115. $pdf->Line(1,4.6,14,4.6);
  116. $pdf->Cell(1.75,0.4,'No./Tgl.Surat:',0,0,'L');
  117. $pdf->Cell(3.35,0.4,$nomorsuratmasuk,0,0,'L');
  118. $pdf->Cell(2,0.4,'/',0,0,'L');
  119. $pdf->Cell(1,0.4,$tglsurat,0,1,'L');
  120. //next row
  121. $pdf->Cell(1.75,0.4,'Dari :',0,0,'L');
  122. $pdf->Cell(2,0.4,$asalsurat,0,1,'L');
  123. //next row
  124. $pdf->Cell(1.75,0.4,'Perihal :',0,0,'L');
  125. $pdf->Cell(2,0.4,$perihal,0,1,'L');
  126. //next row
  127. $pdf->Cell(1.75,0.4,'Sifat :',0,0,'L');
  128. $pdf->Line(3.4,5.9,3.6,5.9); //checkbox kilat
  129. $pdf->Line(3.4,5.9,3.4,6.1);
  130. $pdf->Line(3.4,6.1,3.6,6.1);
  131. $pdf->Line(3.6,5.9,3.6,6.1);
  132. $pdf->Cell(1.5,0.4,'Kilat',0,0,'L');
  133. $pdf->Line(5.9,5.9,5.9,6.1); //garis y //checkbox sangat segera
  134. $pdf->Line(6.1,5.9,6.1,6.1);
  135. $pdf->Line(5.9,6.1,6.1,6.1);
  136. $pdf->Line(5.9,5.9,6.1,5.9);
  137. if($_POST['sangatsegera'] == "1")
  138. {
  139. $pdf->Line(5.9,5.9,6.1,6.1); //garis silang
  140. $pdf->Line(5.9,6.1,6.1,5.9); //garis silang
  141. }
  142. $pdf->Cell(3.2,0.4,'Sangat Segera',0,0,'L');
  143. $pdf->Line(8.4,5.9,8.4,6.1); //garis y1 //checkbox segera
  144. $pdf->Line(8.6,5.9,8.6,6.1); //garis y2
  145. $pdf->Line(8.4,6.1,8.6,6.1); //garis x1
  146. $pdf->Line(8.4,5.9,8.6,5.9); //garis x2
  147. if($_POST['segera'] == "1")
  148. {
  149. $pdf->Line(8.4,5.9,8.6,6.1); //garis silang
  150. $pdf->Line(8.4,6.1,8.6,5.9); //garis silang
  151. }
  152. $pdf->Cell(2.3,0.4,'Segera',0,0,'L');
  153. $pdf->Line(10.5,5.9,10.5,6.1); //garis y1 //checkbox biasa
  154. $pdf->Line(10.7,5.9,10.7,6.1); //garis y2
  155. $pdf->Line(10.5,5.9,10.7,5.9); //garis x1
  156. $pdf->Line(10.5,6.1,10.7,6.1); //garis x2
  157. if($_POST['biasa'] == "1")
  158. {
  159. $pdf->Line(10.5,5.9,10.7,6.1); //garis silang
  160. $pdf->Line(10.5,6.1,10.7,5.9); //garis silang
  161. }
  162. $pdf->Cell(2.3,0.4,'Biasa',0,1,'L');
  163. $pdf->Line(1,6.5,14,6.5);
  164. //next row
  165. $pdf->Ln();
  166. $pdf->SetFont('Arial','UB','6');
  167. $pdf->Cell(3.47,0.4,'DISPOSISI KEPALA KANTOR:',0,'L',0);
  168. $pdf->Ln(0.5);
  169. $pdf->SetFont('Arial','','6');
  170. $pdf->Rect(2.5,7.2,0.2,0.2,'D'); //checkbox kasubag umum
  171. if($_POST['um'] == "1"){
  172. $pdf->Line(2.5,7.2,2.7,7.4);
  173. $pdf->Line(2.5,7.4,2.7,7.2);
  174. }
  175. $pdf->Cell(3.47,0.4,'Kasubag Umum',0,'L',0);
  176. $pdf->Rect(7.5,7.2,0.2,0.2,'D'); //checkbox kasi verak
  177. if($_POST['vr'] == "1"){
  178. $pdf->Line(7.5,7.2,7.7,7.4);
  179. $pdf->Line(7.5,7.4,7.7,7.2);
  180. }
  181. $pdf->Cell(4.47,0.4,'Kasi Verak',0,'L',0);
  182. $pdf->Ln();
  183. $pdf->Rect(2.5,7.6,0.2,0.2,'D'); //checkbox kasi pencairan dana
  184. if($_POST['pd'] == "1"){
  185. $pdf->Line(2.5,7.6,2.7,7.8);
  186. $pdf->Line(2.5,7.8,2.7,7.6);
  187. }
  188. $pdf->Cell(3.95,0.4,'Kasi Pencairan Dana',0,'L',0);
  189. $pdf->Rect(7.5,7.6,0.2,0.2,'D'); //checkbox kasi bank giro pos
  190. if($_POST['bp'] == "1"){
  191. $pdf->Line(7.5,7.6,7.7,7.8);
  192. $pdf->Line(7.5,7.8,7.7,7.6);
  193. }
  194. $pdf->Cell(4.8,0.4,'Kasi Bank Giro Pos',0,'L',0);
  195. $pdf->Ln();
  196. $pdf->Rect(2.5,8,0.2,0.2,'D'); //checkbox sekretariat
  197. if($_POST['sk'] == "1"){
  198. $pdf->Line(2.5,8,2.7,8.2);
  199. $pdf->Line(2.5,8.2,2.7,8);
  200. }
  201. $pdf->Cell(3,0.4,'Sekretariat',0,'L',0);
  202. $pdf->Line(1,8.5,14,8.5);
  203. $pdf->Ln(0.7);
  204. $pdf->SetFont('Arial','UB','6');
  205. $pdf->Cell(1.68,0.4,'PETUNJUK:',0,'L',0);
  206. $pdf->Ln(0.5);
  207. $pdf->SetFont('Arial','','6');
  208. $pdf->Rect(2.5,9.2,0.2,0.2,'D'); //checkbox proses
  209. $pdf->Cell(2.68,0.4,'Proses',0,'L',0);
  210. $pdf->Rect(6.1,9.2,0.2,0.2,'D'); //checkbox jawab
  211. $pdf->Cell(3.5,0.4,'Jawab',0,'L',0);
  212. $pdf->Rect(9.8,9.2,0.2,0.2,'D'); //checkbox simpan
  213. $pdf->Cell(3.8,0.4,'Simpan',0,'L',0);
  214. $pdf->Ln();
  215. $pdf->Rect(2.5,9.6,0.2,0.2,'D'); //checkbox laksanakan
  216. $pdf->Cell(3.16,0.4,'Laksanakan',0,'L',0);
  217. $pdf->Rect(6.1,9.6,0.2,0.2,'D'); //checkbox edarkan
  218. $pdf->Cell(3.2,0.4,'Edarkan',0,'L',0);
  219. $pdf->Rect(9.8,9.6,0.2,0.2,'D'); //checkbox ingatkan
  220. $pdf->Cell(3.73,0.4,'Ingatkan',0,'L',0);
  221. $pdf->Ln();
  222. $pdf->Rect(2.5,10,0.2,0.2,'D'); //checkbox pedomani
  223. $pdf->Cell(2.97,0.4,'Pedomani',0,'L',0);
  224. $pdf->Rect(6.1,10,0.2,0.2,'D'); //checkbox teliti dan pendapat
  225. $pdf->Cell(4.2,0.4,'Teliti & Pendapat',0,'L',0);
  226. $pdf->Rect(9.8,10,0.2,0.2,'D'); //checkbox perbanyak
  227. $pdf->Cell(3.8,0.4,'Perbanyak .... kali',0,'L',0);
  228. $pdf->Ln();
  229. $pdf->Rect(2.5,10.4,0.2,0.2,'D'); //checkbox untuk diketahui
  230. $pdf->Cell(3.52,0.4,'Untuk Diketahui',0,'L',0);
  231. $pdf->Rect(6.1,10.4,0.2,0.2,'D'); //checkbox bicarakan dengan saya
  232. $pdf->Cell(4.3,0.4,'Bicarakan dengan Saya',0,'L',0);
  233. $pdf->Cell(3.13,0.4,'asli kepada .........',0,'L',0);
  234. $pdf->Ln(0.7);
  235. $pdf->SetFont('Arial','UB','6');
  236. $pdf->Cell(3.5,0.4,'CATATAN KEPALA KANTOR:',0,1,'L',0);
  237. $pdf->SetFont('Arial','','6');
  238. $pdf->Cell(3.5,0.4,$disposisi,0,1,'L');
  239. if($batasselesai != "00-00-0000"){
  240. $pdf->Cell(3.5,0.4,'Tanggal batas penyelesaian surat tanggapan:',0,0,'L');
  241. $pdf->SetFont('Arial','IB','6');
  242. $pdf->Cell(1.0);
  243. $pdf->Cell(0,0.4,$batasselesai,0,0,'L');
  244. }
  245. $pdf->Line(1,10.8,14,10.8);
  246. $pdf->Ln(2.0);
  247. $pdf->SetFont('Arial','UB','6');
  248. $pdf->Cell(5.1,0.4,'DISPOSISI KASUBAG UMUM/KEPALA SEKSI:',0,'L',0);
  249. $pdf->Ln(0.5);
  250. $pdf->SetFont('Arial','','6');
  251. $pdf->Cell(1.382,0.4,'Kepada :',0,'L',0);
  252. $pdf->Ln();
  253. $pdf->Cell(1.38,0.4,'Petunjuk:',0,'L',0);
  254. $pdf->Ln();
  255. $pdf->Output();
  256. ?>