Skip to content

Commit 77bb202

Browse files
committed
v2.1
1 parent b3418a1 commit 77bb202

File tree

27,514 files changed

+248455
-433484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

27,514 files changed

+248455
-433484
lines changed

adm/cp/_siswa_prt.php

+196
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
<?php
2+
session_start();
3+
4+
5+
//ambil nilai
6+
require("../../inc/config.php");
7+
require("../../inc/fungsi.php");
8+
require("../../inc/koneksi.php");
9+
require("../../inc/class/kartu_ujian.php");
10+
11+
12+
13+
nocache;
14+
15+
//nilai
16+
$filenya = "siswa_prt.php";
17+
$judul = "Print Kartu Tes";
18+
$judulku = $judul;
19+
$ku_judul = $judulku;
20+
$s = nosql($_REQUEST['s']);
21+
$kdx = nosql($_REQUEST['ckd']);
22+
$kd = nosql($_REQUEST['ckd']);
23+
24+
25+
26+
27+
28+
29+
30+
//start class
31+
$pdf=new PDF('P','mm','A4');
32+
$pdf->AliasNbPages();
33+
$pdf->AddPage();
34+
$pdf->SetTitle($judul);
35+
$pdf->SetAuthor($author);
36+
$pdf->SetSubject($description);
37+
$pdf->SetKeywords($keywords);
38+
39+
40+
41+
42+
43+
44+
45+
//profil
46+
$qx = mysqli_query($koneksi, "SELECT * FROM siswa ".
47+
"WHERE kd = '$kdx'");
48+
$rowx = mysqli_fetch_assoc($qx);
49+
$tx = mysqli_num_rows($qx);
50+
$e_nis = balikin($rowx['nis']);
51+
$e_nisn = balikin($rowx['nisn']);
52+
$e_nama = balikin($rowx['nama']);
53+
$e_user = balikin($rowx['usernamex']);
54+
$e_pass = balikin($rowx['passwordx2']);
55+
$e_kelas = balikin($rowx['kelas']);
56+
$e_lahir_tmp = balikin($rowx['lahir_tmp']);
57+
$e_lahir_tgl = balikin($rowx['lahir_tgl']);
58+
$e_user = balikin($rowx['username']);
59+
$e_passx2 = balikin($rowx['passwordx2']);
60+
61+
62+
63+
64+
65+
//jika null
66+
if (empty($e_pass))
67+
{
68+
//pass
69+
$passku = substr($x,0,5);
70+
$passkux = md5($passku);
71+
}
72+
//jika ada
73+
else
74+
{
75+
$passku = $e_pass;
76+
$passkux = md5($e_pass);
77+
}
78+
79+
80+
81+
//bikin user
82+
mysqli_query($koneksi, "UPDATE siswa SET usernamex = '$e_nis', ".
83+
"passwordx = '$passkux', ".
84+
"passwordx2 = '$passku', ".
85+
"aktif = 'true', ".
86+
"aktif_postdate = '$today' ".
87+
"WHERE kd = '$kdx'");
88+
89+
90+
91+
92+
93+
94+
//profil
95+
$qx = mysqli_query($koneksi, "SELECT * FROM siswa ".
96+
"WHERE kd = '$kdx'");
97+
$rowx = mysqli_fetch_assoc($qx);
98+
$tx = mysqli_num_rows($qx);
99+
$e_nis = balikin($rowx['nis']);
100+
$e_nisn = balikin($rowx['nisn']);
101+
$e_nama = balikin($rowx['nama']);
102+
$e_user = balikin($rowx['usernamex']);
103+
$e_pass = balikin($rowx['passwordx2']);
104+
$e_kelas = balikin($rowx['kelas']);
105+
$e_lahir_tmp = balikin($rowx['lahir_tmp']);
106+
$e_lahir_tgl = balikin($rowx['lahir_tgl']);
107+
$e_user = balikin($rowx['username']);
108+
$e_passx2 = balikin($rowx['passwordx2']);
109+
110+
111+
112+
113+
114+
115+
116+
117+
//image
118+
$pdf-> Image('../../img/logo.jpg',11,11,8); //logo
119+
120+
121+
122+
123+
124+
//bikin kotak garis luar
125+
$pdf->Cell(70,50,'',1,0,'L');
126+
127+
128+
129+
$baris_tebal = 5;
130+
$pdf->SetY(10);
131+
$pdf->SetX(20);
132+
$pdf->SetFont('Times','B',10);
133+
$pdf->Cell(70,$baris_tebal,'KARTU UJIAN',0,0,'L');
134+
$pdf->SetY(10+$baris_tebal);
135+
$pdf->SetX(20);
136+
$pdf->Cell(70,$baris_tebal,$sek_nama,0,0,'L');
137+
138+
//garis
139+
$pdf->Ln();
140+
$baris_tebal2 = 0.1;
141+
$pdf->Cell(70,$baris_tebal2,'',1,0,'C');
142+
143+
144+
//set posisi
145+
$pdf->SetY(10+(3 * $baris_tebal));
146+
147+
$pdf->SetFont('Times','',10);
148+
$pdf->Cell(20,5,'NIS ',0,0,'L');
149+
$pdf->SetFont('Times','B',10);
150+
$pdf->Cell(30,5,': '.$e_nis.'',0,0,'L');
151+
$pdf->Ln();
152+
153+
$pdf->SetFont('Times','',10);
154+
$pdf->Cell(20,5,'NISN ',0,0,'L');
155+
$pdf->SetFont('Times','B',10);
156+
$pdf->Cell(30,5,': '.$e_nisn.'',0,0,'L');
157+
$pdf->Ln();
158+
159+
160+
$pdf->SetFont('Times','',10);
161+
$pdf->Cell(20,5,'Nama ',0,0,'L');
162+
$pdf->SetFont('Times','B',10);
163+
$pdf->Cell(30,5,': '.$e_nama.'',0,0,'L');
164+
$pdf->Ln();
165+
166+
167+
$pdf->SetFont('Times','',10);
168+
$pdf->Cell(20,5,'Kelas ',0,0,'L');
169+
$pdf->SetFont('Times','B',10);
170+
$pdf->Cell(30,5,': '.$e_kelas.'',0,0,'L');
171+
$pdf->Ln();
172+
173+
$pdf->SetFont('Times','',10);
174+
$pdf->Cell(20,5,'Username ',0,0,'L');
175+
$pdf->SetFont('Times','B',10);
176+
$pdf->Cell(30,5,': '.$e_nis.'',0,0,'L');
177+
$pdf->Ln();
178+
179+
$pdf->SetFont('Times','',10);
180+
$pdf->Cell(20,5,'Password ',0,0,'L');
181+
$pdf->SetFont('Times','B',10);
182+
$pdf->Cell(30,5,': '.$e_passx2.'',0,0,'L');
183+
$pdf->Ln();
184+
185+
186+
187+
188+
189+
190+
191+
192+
//output-kan ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
193+
$pdf->Output("siswa-$e_nis.pdf",I);
194+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
195+
196+
?>

adm/cp/jadwal.php

+34-54
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@
3030

3131

3232

33-
34-
require '../../inc/class/phpofficeexcel/vendor/autoload.php';
35-
36-
37-
38-
use PhpOffice\PhpSpreadsheet\Spreadsheet;
39-
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
40-
41-
42-
43-
4433

4534

4635
//PROSES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -204,19 +193,37 @@
204193
$i_filename = "jadwal.xls";
205194
$i_judul = "Jadwal";
206195

196+
197+
//require
198+
require('../../inc/class/excel/OLEwriter.php');
199+
require('../../inc/class/excel/BIFFwriter.php');
200+
require('../../inc/class/excel/worksheet.php');
201+
require('../../inc/class/excel/workbook.php');
207202

208203

204+
//header file
205+
function HeaderingExcel($i_filename)
206+
{
207+
header("Content-type:application/vnd.ms-excel");
208+
header("Content-Disposition:attachment;filename=$i_filename");
209+
header("Expires: 0");
210+
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
211+
header("Pragma: public");
212+
}
209213

214+
210215

211-
$spreadsheet = new Spreadsheet();
212-
$sheet = $spreadsheet->getActiveSheet();
213-
$sheet->setCellValue('A1', 'NO');
214-
$sheet->setCellValue('B1', 'WAKTU');
215-
$sheet->setCellValue('C1', 'PUKUL');
216-
$sheet->setCellValue('D1', 'DURASI');
217-
$sheet->setCellValue('E1', 'MAPEL');
218-
$sheet->setCellValue('F1', 'TINGKAT');
219216

217+
//bikin...
218+
HeaderingExcel($i_filename);
219+
$workbook = new Workbook("-");
220+
$worksheet1 =& $workbook->add_worksheet($i_judul);
221+
$worksheet1->write_string(0,0,"NO.");
222+
$worksheet1->write_string(0,1,"WAKTU");
223+
$worksheet1->write_string(0,2,"PUKUL");
224+
$worksheet1->write_string(0,3,"DURASI");
225+
$worksheet1->write_string(0,4,"MAPEL");
226+
$worksheet1->write_string(0,5,"TINGKAT");
220227

221228

222229

@@ -227,9 +234,6 @@
227234
"pukul ASC");
228235
$rdt = mysqli_fetch_assoc($qdt);
229236

230-
$i = 2;
231-
$no = 1;
232-
233237

234238
do
235239
{
@@ -243,43 +247,19 @@
243247
$dt_tingkat = balikin($rdt['tingkat']);
244248

245249

246-
247250
//ciptakan
248-
$sheet->setCellValue('A'.$i, $no++);
249-
$sheet->setCellValue('B'.$i, $dt_waktu);
250-
$sheet->setCellValue('C'.$i, $dt_pukul);
251-
$sheet->setCellValue('D'.$i, $dt_durasi);
252-
$sheet->setCellValue('E'.$i, $dt_mapel);
253-
$sheet->setCellValue('F'.$i, $dt_tingkat);
254-
$i++;
251+
$worksheet1->write_string($dt_nox,0,$dt_nox);
252+
$worksheet1->write_string($dt_nox,1,$dt_waktu);
253+
$worksheet1->write_string($dt_nox,2,$dt_pukul);
254+
$worksheet1->write_string($dt_nox,3,$dt_durasi);
255+
$worksheet1->write_string($dt_nox,4,$dt_mapel);
256+
$worksheet1->write_string($dt_nox,5,$dt_tingkat);
255257
}
256258
while ($rdt = mysqli_fetch_assoc($qdt));
257259

260+
//close
261+
$workbook->close();
258262

259-
260-
261-
//tulis
262-
$targetfileku = "../../filebox/excel/$i_filename";
263-
$writer = new Xlsx($spreadsheet);
264-
$writer->save($targetfileku);
265-
266-
267-
268-
269-
270-
//download
271-
header('Content-Type: Application/vnd.ms-excel');
272-
header('Content-Disposition: attachment; filename="'.$i_filename.'"');
273-
$writer->save('php://output');
274-
275-
276-
//hapus file, jika telah import
277-
$path1 = "../../filebox/excel/$i_filename";
278-
chmod($path1,0777);
279-
unlink ($path1);
280-
281-
282-
283263

284264
//re-direct
285265
xloc($filenya);

0 commit comments

Comments
 (0)