sisfokampus /sysfo/ujjadwal.php

Language PHP Lines 652
MD5 Hash 6584923488927d4fb4e5d8e890e57a9c Estimated Cost $14,339 (why?)
Repository https://bitbucket.org/justmyfreak/sisfokampus View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
<?php
	$a=$_SESSION['level'];
	$b=$_GET['syxec'];
	$c=$_SESSION ['uid'];
	
	//echo"level = $a <br>";
	//echo"syxec = $b<br>";
	//echo"id = $c<br>";
	
	//deskripsi kajur
	$que_jur ="SELECT description FROM kajur WHERE id='$c'";
	$jal_jur = mysql_query($que_jur);
	$hasil = mysql_fetch_array($jal_jur);
	//echo"kajur = $hasil[0]<br>";
	$potong = substr($hasil[0],6,30);
	//echo"desc kajur = $potong<br>";
	
	//kode jurusan
	$per_id_jur = "SELECT kode FROM jurusan WHERE nama_indonesia='$potong'";
	$jalankan = mysql_query($per_id_jur);
	$hasil_id_jur = mysql_fetch_array($jalankan);
	//echo"kode jurusan = $hasil_id_jur[0]<br>";
	
	//deskripsi karyawan jurusan
	$que_jur2 ="SELECT description FROM karyawan_jurusan WHERE id='$c'";
	$jal_jur2 = mysql_query($que_jur2);
	$hasil2 = mysql_fetch_array($jal_jur2);
	//echo"kajur = $hasil2[0]<br>";
	$potong2 = substr($hasil2[0],9,30);
	//echo"desc kajur = $potong2<br>";
	
	//kode jurusan2
	$per_id_jur2 = "SELECT kode FROM jurusan WHERE nama_indonesia='$potong2'";
	$jalankan2 = mysql_query($per_id_jur2);
	$hasil_id_jur2 = mysql_fetch_array($jalankan2);
	//echo"kode jurusan = $hasil_id_jur2[0]<br>";
	
	//kode dosen
	$que_dosen ="SELECT kodejurusan FROM dosen WHERE id='$c'";
	$jal_dosen = mysql_query($que_dosen);
	$hasil_dosen = mysql_fetch_array($jal_dosen);
	//echo"kode dosen = $hasil_dosen[0]<br>";
	
	//kode mahasiswa
	$que_mhs ="SELECT kodejurusan FROM mhsw WHERE id='$c'";
	$jal_mhs = mysql_query($que_mhs);
	$hasil_mhs = mysql_fetch_array($jal_mhs);
	//echo"kode mhs = $hasil_mhs[0]<br>";
	
	//nim mhs
	$per_sel_mah = "SELECT nim FROM mhsw WHERE id='$c'";
	$jalan_sel_mah = mysql_query($per_sel_mah);
	$hasil_sel_mah = mysql_fetch_array($jalan_sel_mah);
	//echo"NIM mhs = $hasil_sel_mah[0]<br>";
	
	echo"<center><h1>Jadwal Ujian Proposal<h1></center>";
	switch($_GET['aksi']){
		default:
			if($a=='Kajur'){
				echo "
					<form method='post' name='formjadwal' action=''>
						<table border='1' align='center'>
							<tr>
								<td colspan='13' align='left'>
									<input type='button' onclick=window.location.href='?syxec=$b&aksi=tambah' name='tambah' value='Tambah'/>
								</td>
							</tr>
							<tr>
								<th>Id Jadwal</th>
								<th>No Reg</th>
								<th>Id Ruang</th>
								<th>Hari</th>
								<th>Tanggal</th>
								<th>Jam</th>
								<th>Dosen Penguji 1</th>
								<th>Dosen Penguji 2</th>
								<th>Dosen Penguji 3</th>
								<th>Aksi</th>
							</tr>";
								$perintah = "SELECT * FROM uj_jadwal WHERE jurusan='$hasil_id_jur[0]'";
								$jalan = mysql_query($perintah);
								while($hasil=mysql_fetch_array($jalan)){
									echo"
										<tr>
											<td>$hasil[0]</td>
											<td>$hasil[1]</td>";
											$perintah = "SELECT Nama FROM ruang WHERE Kode='$hasil[2]'";
											$jalankan = mysql_query($perintah);
											$hasil_nama_ruang = mysql_fetch_array($jalankan);
											echo"
											<td>$hasil_nama_ruang[0]</td>
											<td>$hasil[3]</td>
											<td>$hasil[4]</td>
											<td>$hasil[5]</td>";
											$per_dos1 = "SELECT ID,Name FROM dosen WHERE id='$hasil[6]'";
											$jal_dos1 = mysql_query($per_dos1);
											$has_dos1 = mysql_fetch_array($jal_dos1);
											
											$per_dos2 = "SELECT ID,Name FROM dosen WHERE id='$hasil[7]'";
											$jal_dos2 = mysql_query($per_dos2);
											$has_dos2 = mysql_fetch_array($jal_dos2);
											
											$per_dos3 = "SELECT ID,Name FROM dosen WHERE id='$hasil[8]'";
											$jal_dos3 = mysql_query($per_dos3);
											$has_dos3 = mysql_fetch_array($jal_dos3);
											echo"
											<td>$has_dos1[1]</td>
											<td>$has_dos2[1]</td>
											<td>$has_dos3[1]</td>
											<td><a href='?syxec=$b&aksi=edit&id=$hasil[0]'>Edit</a> | <a href='?syxec=$b&aksi=hapus&id=$hasil[0]'>Hapus</a></td>
										<tr>
									";
								}
							echo"
						</table>
					</form>
				";
			}
			else if($a=='Karyawan Jurusan'){
				echo "
					<table border='1' align='center'>
						<tr>
							<th>Id Jadwal</th>
							<th>No Reg</th>
							<th>Id Ruang</th>
							<th>Hari</th>
							<th>Tanggal</th>
							<th>Jam</th>
							<th>Dosen Penguji 1</th>
							<th>Dosen Penguji 2</th>
							<th>Dosen Penguji 3</th>
							<th>Aksi</th>
						</tr>";
						$qwe = mysql_query("SELECT * FROM uj_jadwal WHERE jurusan='$hasil_id_jur2[0]'  ORDER BY id_jadwal");
						while($has = mysql_fetch_array($qwe)){
							echo"
								<tr>
									<td>$has[0]</td>
									<td>$has[1]</td>
									<td>$has[2]</td>
									<td>$has[3]</td>
									<td>$has[4]</td>
									<td>$has[5]</td>
									<td>$has[6]</td>
									<td>$has[7]</td>
									<td>$has[8]</td>
									<td>$has[9]</td>
								</tr>
							";
						}
						echo"
					</table>
				";
			}
			else if($a=='Dosen'){
				echo "
					<table border='1' align='center'>
						<tr>
							<th>Id Jadwal</th>
							<th>No Reg</th>
							<th>Id Ruang</th>
							<th>Hari</th>
							<th>Tanggal</th>
							<th>Jam</th>
							<th>Dosen Penguji 1</th>
							<th>Dosen Penguji 2</th>
							<th>Dosen Penguji 3</th>
							<th>Aksi</th>
						</tr>";
						$qwe = mysql_query("SELECT * FROM uj_jadwal WHERE jurusan='$hasil_dosen[0]'  ORDER BY id_jadwal");
						while($has = mysql_fetch_array($qwe)){
							echo"
								<tr>
									<td>$has[0]</td>
									<td>$has[1]</td>
									<td>$has[2]</td>
									<td>$has[3]</td>
									<td>$has[4]</td>
									<td>$has[5]</td>
									<td>$has[6]</td>
									<td>$has[7]</td>
									<td>$has[8]</td>
									<td>$has[9]</td>
								</tr>
							";
						}
						echo"
					</table>
				";
			}
			else if($a=='Mahasiswa'){
				echo "
					<table border='1' align='center'>
						<tr>
							<th>Id Jadwal</th>
							<th>No Reg</th>
							<th>Id Ruang</th>
							<th>Hari</th>
							<th>Tanggal</th>
							<th>Jam</th>
							<th>Dosen Penguji 1</th>
							<th>Dosen Penguji 2</th>
							<th>Dosen Penguji 3</th>
						</tr>";
						$qwe = mysql_query("SELECT * FROM uj_jadwal WHERE jurusan='$hasil_mhs[0]'  ORDER BY id_jadwal");
						while($has = mysql_fetch_array($qwe)){
							echo"
								<tr>
									<td>$has[0]</td>
									<td>$has[1]</td>
									<td>$has[2]</td>
									<td>$has[3]</td>
									<td>$has[4]</td>
									<td>$has[5]</td>
									<td>$has[6]</td>
									<td>$has[7]</td>
									<td>$has[8]</td>
								</tr>
							";
						}
						echo"
					</table>
				";
			}
		break;

		case('tambah'):
			$perintah = "SELECT max(id_jadwal) from uj_jadwal";
			$jalankan = mysql_query($perintah);
			$hasil = mysql_fetch_array($jalankan);
			$id_sekarang = $hasil[0]+1;
			echo "
				<form method='post' name='formskjdwl' action='?syxec=$b&aksi=insert'>
					<table align='center'>
						<tr>
							<td>
								<label>ID Jadwal</label>
							</td>
							<td>
								: <input type='text' name='id_jadwal' value='$id_sekarang'/>
							</td>
						</tr>
						<tr>
							<td>
								<label>No Reg</label>
							</td>
							<td>
								: 
								<select name='no_reg'>
									<option value='0'>- Pilih No Reg -</option>";
										$per_nim_jur = "SELECT nim FROM mhsw WHERE kodejurusan ='$hasil_id_jur[0]'";
										$jal_nim_jur = mysql_query($per_nim_jur);
										while($has_nim_jur = mysql_fetch_array($jal_nim_jur)){
											$per_reg_jur = "SELECT no_reg FROM uj_peserta WHERE nim ='$has_nim_jur[0]' and acc_pembimbing!=0";
											$jal_reg_jur = mysql_query($per_reg_jur);
											while($has_reg_jur = mysql_fetch_array($jal_reg_jur)){
												echo "<option name='no_reg' value=$has_reg_jur[0]>$has_reg_jur[0]</option>";
											}
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>id_ruang</label>
							</td>
							<td>
								: 
								<select name='id_ruang'>
									<option value='0'>- Pilih Ruang -</option>";
										$perintah = "SELECT Kode,Nama FROM ruang ORDER BY Kode";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='id_ruang' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Hari</label>
							</td>
							<td>
								: 
								<select name='hari'>
									<option value='0' selected>- Pilih Hari -</option>
									<option name='hari' value='senin'>senin</option>
									<option name='hari' value='selasa'>selasa</option>
									<option name='hari' value='rabu'>rabu</option>
									<option name='hari' value='kamis'>kamis</option>
									<option name='hari' value='jumat'>jumat</option>
									<option name='hari' value='sabtu'>sabtu</option>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Tanggal</label>
							</td>
							<td>
								: <input type='text' name='tanggal'/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Jam</label>
							</td>
							<td>
								: <input type='text' name='jam'/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Dosen Penguji 1</label>
							</td>
							<td>
								: 
								<select name='dosen_penguji1'>
									<option value='0' selected>- Pilih Dosen Penguji -</option>";
										$perintah = "SELECT ID,Name FROM dosen WHERE kodejurusan='$hasil_id_jur[0]' ORDER BY ID";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='dosen_penguji1' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Dosen Penguji 2</label>
							</td>
							<td>
								: 
								<select name='dosen_penguji2'>
									<option value='0' selected>- Pilih Dosen Penguji -</option>";
										$perintah = "SELECT ID,Name FROM dosen WHERE kodejurusan='$hasil_id_jur[0]' ORDER BY ID";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='dosen_penguji2' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Dosen Penguji 3</label>
							</td>
							<td>
								: 
								<select name='dosen_penguji3'>
									<option value='0' selected>- Pilih Dosen Penguji -</option>";
										$perintah = "SELECT ID,Name FROM dosen WHERE kodejurusan='$hasil_id_jur[0]' ORDER BY ID";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='dosen_penguji3' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td colspan='2' align='center'>
								<input type='reset' name='submit2' value='Reset' />
								<input type='submit' name='submit' value='Simpan' />
							</td>
						</tr>
					</table>
				</form>
			";
		break;
		
		case('edit'):
			$id_ne=$_GET['id'];
			$perintah = "SELECT * from uj_jadwal where id_jadwal='$id_ne'";
			$jalankan = mysql_query($perintah);
			$hasil_cari = mysql_fetch_array($jalankan);
			echo "
				<form method='post' name='formskjdwl' action='?syxec=$b&aksi=update'>
					<table align='center'>
						<tr>
							<td>
								<label>No Reg</label>
							</td>
							<td>
								: 
								<select name='no_reg'>
									<option value='0'>$hasil_cari[1]</option>";
										$per_nim_jur = "SELECT nim FROM mhsw WHERE kodejurusan ='$hasil_id_jur[0]'";
										$jal_nim_jur = mysql_query($per_nim_jur);
										while($has_nim_jur = mysql_fetch_array($jal_nim_jur)){
											$per_reg_jur = "SELECT no_reg FROM uj_peserta WHERE nim ='$has_nim_jur[0]'";
											$jal_reg_jur = mysql_query($per_reg_jur);
											while($has_reg_jur = mysql_fetch_array($jal_reg_jur)){
												echo "<option name='no_reg' value=$has_reg_jur[0]>$has_reg_jur[0]</option>";
											}
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>id_ruang</label>
							</td>
							<td>
								: 
								<select name='id_ruang'>
									<option value='0'>$hasil_cari[2]</option>";
										$perintah = "SELECT Kode,Nama FROM ruang ORDER BY Kode";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='id_ruang' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Hari</label>
							</td>
							<td>
								: 
								<select name='hari'>
									<option value='0' selected>$hasil_cari[3]</option>
									<option name='hari' value='senin'>senin</option>
									<option name='hari' value='selasa'>selasa</option>
									<option name='hari' value='rabu'>rabu</option>
									<option name='hari' value='kamis'>kamis</option>
									<option name='hari' value='jumat'>jumat</option>
									<option name='hari' value='sabtu'>sabtu</option>
								</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Tanggal</label>
							</td>
							<td>
								: <input type='text' name='tanggal' value='$hasil_cari[4]'/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Jam</label>
							</td>
							<td>
								: <input type='text' name='jam' value='$hasil_cari[5]'/>
							</td>
						</tr>
						<tr>
							<td>
								<label>Dosen Penguji 1</label>
							</td>
							<td>
								: 
								<select name='dosen_penguji1'>";
									$perintah = "SELECT ID,Name FROM dosen where ID='$hasil_cari[6]'";
									$jalan_kel = mysql_query($perintah);
									$hasil_kel = mysql_fetch_array($jalan_kel);
									echo"
										<option value='$hasil_kel[0]'>$hasil_kel[1]</option>
									";
										$perintah = "SELECT ID,Name FROM dosen WHERE kodejurusan='$hasil_id_jur[0]' ORDER BY ID";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='dosen_penguji1' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Dosen Penguji 2</label>
							</td>
							<td>
								: 
								<select name='dosen_penguji2'>";
									$perintah = "SELECT ID,Name FROM dosen where ID='$hasil_cari[7]'";
									$jalan_kel = mysql_query($perintah);
									$hasil_kel = mysql_fetch_array($jalan_kel);
									echo"
										<option value='$hasil_kel[0]'>$hasil_kel[1]</option>
									";
									
										$perintah = "SELECT ID,Name FROM dosen WHERE kodejurusan='$hasil_id_jur[0]' ORDER BY ID";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='dosen_penguji2' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td>
								<label>Dosen Penguji 3</label>
							</td>
							<td>
								: 
								<select name='dosen_penguji3'>";
									$perintah = "SELECT ID,Name FROM dosen where ID='$hasil_cari[8]'";
									$jalan_kel = mysql_query($perintah);
									$hasil_kel = mysql_fetch_array($jalan_kel);
									echo"
										<option value='$hasil_kel[0]'>$hasil_kel[1]</option>
									";
										$perintah = "SELECT ID,Name FROM dosen WHERE kodejurusan='$hasil_id_jur[0]' ORDER BY ID";
										$jalan = mysql_query($perintah);
										while($hasil = mysql_fetch_array($jalan)){
											echo "<option name='dosen_penguji3' value=$hasil[0]>$hasil[1]</option>";
										}
								echo "</select>
							</td>
						</tr>
						<tr>
							<td colspan='2' align='center'>
								<input type='reset' name='submit2' value='Reset' />
								<input type='submit' name='submit' value='Simpan' />
							</td>
						</tr>
					</table>
				</form>
			";
		break;
		
		case('insert'):
			$id_jadwal = $_POST['id_jadwal'];
			$no_reg = $_POST['no_reg'];
			$id_ruang = $_POST['id_ruang'];
			$hari = $_POST['hari'];
			$tanggal = $_POST['tanggal'];
			$jam = $_POST['jam'];
			$dosen_penguji1 = $_POST['dosen_penguji1'];
			$dosen_penguji2 = $_POST['dosen_penguji2'];
			$dosen_penguji3 = $_POST['dosen_penguji3'];
			//echo"$id_jadwal','$no_reg','$id_ruang','$hari','$tanggal','$jam','$dosen_penguji1','$dosen_penguji2','$dosen_penguji3','$hasil_id_jur[0]'";
			
			$que_feed1 = mysql_query("SELECT no_reg FROM uj_jadwal WHERE no_reg='$no_reg'");
			$que_feed2 = mysql_query("SELECT id_ruang,hari,tanggal,jam FROM uj_jadwal WHERE id_ruang='$id_ruang'");
			$que_feed3 = mysql_query("SELECT tanggal,jam,penguji1 FROM uj_jadwal WHERE tanggal='$tanggal'");
			$que_feed4 = mysql_query("SELECT tanggal,jam,penguji2 FROM uj_jadwal WHERE tanggal='$tanggal'");
			$que_feed5 = mysql_query("SELECT tanggal,jam,penguji3 FROM uj_jadwal WHERE tanggal='$tanggal'");
			
			if($has_feed1 = mysql_fetch_array($que_feed1)){
				echo"Mahasiswa sudah terdaftar";
			}
			else if($has_feed2 = mysql_fetch_array($que_feed2)){
				echo"Jadwal bentrok";
			}
			else if($has_feed3 = mysql_fetch_array($que_feed3)){
				echo"Jadwal bentrok";
			}
			else if($has_feed4 = mysql_fetch_array($que_feed4)){
				echo"Jadwal bentrok";
			}
			else if($has_feed5 = mysql_fetch_array($que_feed5)){
				echo"Jadwal bentrok";
			}
			else{
				$per_ins = "INSERT INTO uj_jadwal VALUES ('$id_jadwal','$no_reg','$id_ruang','$hari','$tanggal','$jam','$dosen_penguji1','$dosen_penguji2','$dosen_penguji3','$hasil_id_jur[0]')";
				$has_ins = mysql_query($per_ins);
				
				$que = mysql_query("SELECT nim FROM uj_peserta WHERE no_reg='$no_reg'");
				$has_quw = mysql_fetch_array($que);
				
				$ins_to_brt_acr = "INSERT INTO uj_beritaacara(id_jadwal,nim,terima_tidak) VALUES ('$id_jadwal','$has_quw[0]','0')";
				$has_ins_to_brt_acr = mysql_query($ins_to_brt_acr);
				/*
				//cek dosen 1
				$perintah_cek_dp1 = "SELECT * FROM uj_jmlmenguji WHERE nip='$dosen_penguji1'";
				$jalankan_cek_dp1 = mysql_query($perintah_cek_dp1);
				
				if($hasil_cek_dp1 = mysql_fetch_array($jalankan_cek_dp1)){
					$akhir_jml_menguji = $hasil_cek_dp1[2]+1;
					$perintah_update_dp1 = "UPDATE uj_jmlmenguji SET jumlahmenguji='$akhir_jml_menguji' WHERE nip='$dosen_penguji1'";
					mysql_query($perintah_update_dp1);
				}
				else{
					$perintah_cek_inc = "SELECT max(id) FROM uj_jmlmenguji";
					$jalankan_cek_inc = mysql_query($perintah_cek_inc);
					$hasil_cek_inc = mysql_fetch_array($jalankan_cek_inc);
					$auto_inc = $hasil_cek_inc[0]+1;
					
					//echo"$auto_inc";
					$perintah_insert_dp1 = "INSERT INTO uj_jmlmenguji VALUES ('$auto_inc','$dosen_penguji1','1')";
					mysql_query($perintah_insert_dp1);
				}
				
				//cek dosen 2
				$perintah_cek_dp2 = "SELECT * FROM uj_jmlmenguji WHERE nip='$dosen_penguji2'";
				$jalankan_cek_dp2 = mysql_query($perintah_cek_dp2);
				
				if($hasil_cek_dp2 = mysql_fetch_array($jalankan_cek_dp2)){
					$akhir_jml_menguj2 = $hasil_cek_dp2[2]+1;
					$perintah_update_dp2 = "UPDATE uj_jmlmenguji SET jumlahmenguji='$akhir_jml_menguji' WHERE nip='$dosen_penguji2'";
					mysql_query($perintah_update_dp2);
				}
				else{
					$perintah_cek_inc = "SELECT max(id) FROM uj_jmlmenguji";
					$jalankan_cek_inc = mysql_query($perintah_cek_inc);
					$hasil_cek_inc = mysql_fetch_array($jalankan_cek_inc);
					$auto_inc = $hasil_cek_inc[0]+1;
					
					//echo"$auto_inc";
					$perintah_insert_dp2 = "INSERT INTO uj_jmlmenguji VALUES ('$auto_inc','$dosen_penguji2','1')";
					mysql_query($perintah_insert_dp2);
				}
				
				//cek dosen 3
				$perintah_cek_dp3 = "SELECT * FROM uj_jmlmenguji WHERE nip='$dosen_penguji3'";
				$jalankan_cek_dp3 = mysql_query($perintah_cek_dp3);
				
				if($hasil_cek_dp3 = mysql_fetch_array($jalankan_cek_dp3)){
					$akhir_jml_menguji = $hasil_cek_dp3[2]+1;
					$perintah_update_dp3 = "UPDATE uj_jmlmenguji SET jumlahmenguji='$akhir_jml_menguji' WHERE nip='$dosen_penguji3'";
					mysql_query($perintah_update_dp3);
				}
				else{
					$perintah_cek_inc = "SELECT max(id) FROM uj_jmlmenguji";
					$jalankan_cek_inc = mysql_query($perintah_cek_inc);
					$hasil_cek_inc = mysql_fetch_array($jalankan_cek_inc);
					$auto_inc = $hasil_cek_inc[0]+1;
					
					//echo"$auto_inc";
					$perintah_insert_dp3 = "INSERT INTO uj_jmlmenguji VALUES ('$auto_inc','$dosen_penguji3','1')";
					mysql_query($perintah_insert_dp3);
				}
				*/
				echo"<center>Data telah berhasil di tambahkan<br>Kembali ke <a href='?syxec=$b'>INDEX</a></center>";
			}
		break;
		
		case'update':
			$id = $_GET['id'];
			$no_reg = $_POST['no_reg'];
			$id_ruang = $_POST['id_ruang'];
			$hari = $_POST['hari'];
			$tanggal = $_POST['tanggal'];
			$jam = $_POST['jam'];
			$dosen_penguji1 = $_POST['dosen_penguji1'];
			$dosen_penguji2 = $_POST['dosen_penguji2'];
			$dosen_penguji3 = $_POST['dosen_penguji3'];
			
			$que_upd = "UPDATE uj_jadwal SET no_reg='$no_reg', id_ruang='$id_ruang',hari='$hari',tanggal='$tanggal',jam='$jam',penguji1='$dosen_penguji1',penguji2='$dosen_penguji2',penguji3='$dosen_penguji3' WHERE id_jadwal='$id'";
			$jal_upd = mysql_query($que_upd);
		break;
		
		case('hapus'):
			$id=$_GET['id'];
			$per_hapus1 = mysql_query("DELETE FROM uj_jadwal WHERE id_jadwal=$id");
			$per_hapus2 = mysql_query("DELETE FROM uj_beritaacara WHERE id_jadwal=$id");
			echo"<center>Data telah terhapus<br>Kembali ke <a href='?syxec=$b'>INDEX</a></center>";
		break;
	}
?>
Back to Top