Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.32 KB | None | 0 0
  1. <?php
  2. // Connection
  3. require_once('../config/connection.php');
  4. // Helper
  5. require_once('../config/helper.php');
  6.  
  7. // Authentication user
  8. if (authentication() === false) {
  9. // Redirect to dashboard
  10. header('Location: ' . BASE_URL);
  11. exit;
  12. }
  13.  
  14. ?>
  15.  
  16. <!DOCTYPE html>
  17. <html lang="en">
  18.  
  19. <head>
  20. <!-- Load head.php -->
  21. <?php include_once("../templates/head.php") ?>
  22.  
  23. <style>
  24. /* Set height iframe in modal */
  25. .embed-responsive {
  26. height: 500px !important;
  27. }
  28.  
  29. /* Highlight new data in tableForm */
  30. .highlight {
  31. animation: fade 2s forwards;
  32. background-color: rgba(242, 245, 169, 1);
  33. }
  34.  
  35. @keyframes fade {
  36. from {
  37. background-color: rgba(242, 245, 169, 1);
  38. }
  39.  
  40. to {
  41. background-color: #fff;
  42. }
  43. }
  44.  
  45. .back:hover {
  46. text-decoration: none;
  47. }
  48. </style>
  49. </head>
  50.  
  51. <body>
  52. <div class="container-fluid" id="wrapper">
  53. <div class="row">
  54. <!-- Load sidebar.php -->
  55. <?php include_once("../templates/sidebar.php") ?>
  56.  
  57. <main class="col-xs-12 col-sm-8 col-lg-9 col-xl-10 pt-3 pl-4 ml-auto">
  58. <!-- Load header.php -->
  59. <header class="page-header row justify-center">
  60. <div class="col-md-6 col-lg-8">
  61. <h1 class="float-left text-center text-md-left" style="text-transform: uppercase; letter-spacing: .1rem;">Ruang</h1>
  62. </div>
  63. <div class="dropdown user-dropdown col-md-6 col-lg-4 text-center text-md-right"><a class="btn btn-stripped dropdown-toggle" href="#" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  64. <img src="<?= BASE_URL; ?>assets/images/profile/default.png" alt="profile photo" class="circle float-left profile-photo" width="50" height="auto">
  65. <div class="username mt-1 buttonAnimation" data-animation="pulse">
  66. <h4 class="mb-1"><?= getMyName(); ?>
  67. <?php
  68. // // Warning for member new (status : 2)
  69. if (getMyStatusActive() == 2) {
  70. ?>
  71. <span class="badge badge-dark">1</span>
  72. <?php
  73. }
  74. ?>
  75. </h4>
  76. <h6 class="text-muted">
  77. <?= myLevelName(); ?>
  78. </h6>
  79. </div>
  80. </a>
  81. <div class="dropdown-menu dropdown-menu-right" style="margin-right: 1.5rem;" aria-labelledby="dropdownMenuLink">
  82. <a class="dropdown-item" href="<?= BASE_URL . 'profile'; ?>">
  83. <em class="fa fa-user-circle mr-1"></em> Lihat Profil
  84. <?php
  85. // // Warning for member new (status : 2)
  86. if (getMyStatusActive() == 2) {
  87. ?>
  88. <span class="badge badge-dark">1</span>
  89. <?php
  90. }
  91. ?>
  92. </a>
  93. <a class="dropdown-item" href="<?= BASE_URL . 'config/functions/logout.php'; ?>">
  94. <em class="fa fa-power-off mr-1"></em> Keluar
  95. </a>
  96. </div>
  97. </div>
  98. <div class="clear"></div>
  99. </header>
  100.  
  101. <section class="row">
  102. <div class="col-sm-12">
  103. <section class="row">
  104. <div class="col-lg-12">
  105. <div class="card mb-4 animated zoomIn" data-appear="appear" data-animation="zoomIn">
  106. <div class="card-block">
  107. <div class="row">
  108. <h3 class="card-title ml-3">Data Ruang</h3>
  109. <div class="col-1 text-right p-1 ml-3">
  110. <button type="button" class="btn btn-sm btn-primary margin" data-toggle="modal" data-target="#modalAddRuang"><span class="fa fa-plus"></span> Ruang Baru</button>
  111. </div>
  112. </div>
  113.  
  114. <table id="table_id" class="table table-striped table-bordered" cellspacing="0" width="100%">
  115. <thead>
  116. <tr>
  117. <th class="w-1 pl-4" width="5%">No</th>
  118. <th width="10%">Kode</th>
  119. <th width="20%">Nama Ruangan</th>
  120. <th width="15%">Kapasitas</th>
  121. <th width="20%">Ruang Cadangan</th>
  122. <th width="20%">Program Studi</th>
  123. <th width="10%">Aksi</th>
  124. </tr>
  125. </thead>
  126. <tbody>
  127. <?php
  128. $no = 1;
  129.  
  130. // Get data m_ruang
  131. $getMRuang = mysqli_query($link, "SELECT m_ruang.kode, m_ruang.name, m_ruang.capacity, m_ruang.is_backup, m_prodi.name AS prodi, m_users.fullname AS user, m_ruang.registered_date FROM m_ruang INNER JOIN m_prodi ON m_ruang.prodi_id = m_prodi.id INNER JOIN m_users ON m_ruang.user_id = m_users.id ORDER BY m_ruang.registered_date DESC");
  132.  
  133. while ($row = mysqli_fetch_assoc($getMRuang)) {
  134. // New data highlight
  135. echo "<tr class='data_" . $row['kode'];
  136. if ($no == 1 && isset($_SESSION['newRuang'])) {
  137. echo "highlight";
  138. }
  139. echo "'>";
  140. echo '<td class="text-center">' . $no . '</td>';
  141. echo '<td class="kodeRuang">' . $row['kode'] . '</td>';
  142. echo '<td class="nameRuang">' . $row['name'] . '</td>';
  143. echo '<td class="capacityRuang">' . $row['capacity'] . '</td>';
  144. echo '<td class="backupRuang">';
  145. if ($row['is_backup'] == 1) {
  146. echo 'Tidak';
  147. } else {
  148. echo 'Iya';
  149. }
  150. echo '</td>';
  151. echo '<td class="prodiRuang">' . $row['prodi'] . '<span class="d-none prodi">' . $row['prodi'] . '</span><span class="d-none regDate">' . $row['registered_date'] . '</span><span class="d-none byUser">' . $row['user'] . '</span></td>';
  152. echo '<td class="text-center"><button type="button" class="btn btn-secondary btn-sm detail-ruang" item="' . $row['kode'] . '" data-toggle="modal" data-target="#exampleModal1" id="' . $row['kode'] . '">Lihat</button></td>';
  153. echo "</tr>";
  154. $no++;
  155. }
  156.  
  157. ?>
  158. </tbody>
  159. </table>
  160. </div>
  161. </div>
  162.  
  163. <!-- Modal Add Ruang -->
  164. <div class="modal fade" id="modalAddRuang" tabindex="-1" role="dialog" aria-labelledby="modalAddRuang" aria-hidden="true">
  165. <div class="modal-dialog" role="document">
  166. <div class="modal-content">
  167. <div class="modal-header modal-add">
  168. <h5 class="modal-title" id="modalAddRuang">Tambah Ruang</h5>
  169. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" style="color: white">&times;</span></button>
  170. </div>
  171. <form action="<?= BASE_URL . 'config/functions/ruang_add.php'; ?>" method="POST" id="formAddRuang">
  172. <div class="modal-body">
  173. <div class="row">
  174. <div class="col-4">
  175. <div class="form-group">
  176. <label for="iKode" style="font-size: 14px;">Kode</label>
  177. <input type="text" class="form-control" maxlength="20" id="iKode" name="iKode" autocomplete="off" style="font-size: 14px;">
  178. <small id="kodeInfo" class="form-text text-danger" style="display: none;">Kode tidak boleh kosong!</small>
  179. </div>
  180. </div>
  181. <div class="col-8">
  182. <div class="form-group">
  183. <label for="iNameRuang" style="font-size: 14px;">Nama Ruangan</label>
  184. <input type="text" class="form-control" id="iNameRuang" name="iNameRuang" autocomplete="off" style="font-size: 14px;">
  185. <small id="ruangInfo" class="form-text text-danger" style="display: none;">Nama Ruangan tidak boleh kosong!</small>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="row">
  190. <div class="col-6">
  191. <div class="form-group">
  192. <label for="iKapasitas" style="font-size: 14px;">Kapasitas</label>
  193. <input type="text" class="form-control" id="iKapasitas" name="iKapasitas" autocomplete="off" style="font-size: 14px;">
  194. <small id="kapasitasInfo" class="form-text text-danger" style="display: none;">Kapasitas tidak boleh kosong!</small>
  195. </div>
  196. </div>
  197. <div class="col-6">
  198. <div class="form-group">
  199. <label for="iJenis" style="font-size: 14px;">Ruang Cadangan</label>
  200. <div class="custom-control custom-radio">
  201. <input type="radio" id="checkAllow" name="jenis" class="custom-control-input" value="0">
  202. <label class="custom-control-label" for="checkAllow" style="font-size: 14px;">Iya</label>
  203. </div>
  204. <div class="custom-control custom-radio">
  205. <input type="radio" id="checkNotAllow" name="jenis" class="custom-control-input" value="1" checked>
  206. <label class="custom-control-label" for="checkNotAllow" style="font-size: 14px;">Tidak</label>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="form-group">
  212. <label for="iProdi" style="font-size: 14px;">Program Studi</label>
  213. <select class="form-control custom-select status" id="iProdi" name="iProdi" style="font-size: 14px;" required>
  214. <option value="">--[Pilih]--</option>
  215. <?php
  216. // Get data program studi
  217. $getProdi = mysqli_query($link, "SELECT * FROM m_prodi");
  218. while ($row = mysqli_fetch_assoc($getProdi)) {
  219. echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
  220. }
  221. ?>
  222. </select>
  223. <small id="prodiInfo" class="form-text text-danger" style="display: none;">Program Studi tidak boleh kosong!</small>
  224. </div>
  225. </div>
  226. <div class="modal-footer">
  227. <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
  228. <button type="button" id="addRuang" class="btn btn-primary">Simpan</button>
  229. </div>
  230. </form>
  231. </div>
  232. </div>
  233. </div>
  234. <!-- End Modal -->
  235.  
  236. <!-- Modal Preview Ruang -->
  237. <div class="modal fade" id="exampleModal1" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel1" aria-hidden="true">
  238. <div class="modal-dialog modal-lg" role="document">
  239. <div class="modal-content">
  240. <div class="modal-header modal-add">
  241. <h5 class="modal-title" id="exampleModalLabel1"><span id="detailRuangHeader"></span></h5>
  242. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" style="color: white">&times;</span></button>
  243. </div>
  244. <div class="modal-body p-0">
  245. <div class="row">
  246. <div class="col-md-2"></div>
  247. <div class="col-md-8 p-5 pl-0 ml-0">
  248. <table class="table table-hover table-sm">
  249. <tbody>
  250. <tr class="table-secondary">
  251. <td colspan="3" class="text-center"><b>Detail Ruang</b></td>
  252. </tr>
  253. <tr>
  254. <td width="40%">Kode</td>
  255. <td>:</td>
  256. <td id="dKode"></td>
  257. </tr>
  258. <tr>
  259. <td>Nama Ruangan</td>
  260. <td>:</td>
  261. <td id="dNameRuang"></td>
  262. </tr>
  263. <tr>
  264. <td>Kapasitas</td>
  265. <td>:</td>
  266. <td id="dCapacity"></td>
  267. </tr>
  268. <tr>
  269. <td>Jenis Ruangan</td>
  270. <td>:</td>
  271. <td id="dBackup"></td>
  272. </tr>
  273. <tr>
  274. <td>Program Studi</td>
  275. <td>:</td>
  276. <td id="dProdi"></td>
  277. </tr>
  278. <tr>
  279. <td>Ditambahkan oleh</td>
  280. <td>:</td>
  281. <td id="dByUser"></td>
  282. </tr>
  283. <tr>
  284. <td>Ditambahkan pada</td>
  285. <td>:</td>
  286. <td id="dAddDate"></td>
  287. </tr>
  288. </tbody>
  289. </table>
  290. </div>
  291. <div class="col-md-2">
  292. </div>
  293. </div>
  294.  
  295. </div>
  296. <div class="modal-footer" style="justify-content: flex-end;">
  297. <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
  298. <?php
  299. if ($_SESSION['level'] == 1) {
  300. ?>
  301. <button type="button" class="btn btn-danger" id="deleteRuang">Hapus Ruang</button>
  302. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#showModalEdit" id="showEditRuang">Ubah Data Ruang</button>
  303. <?php
  304. }
  305. ?>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <!-- End modal -->
  311.  
  312. <!-- Update Ruang -->
  313. <div class="modal fade" id="showModalEdit" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  314. <div class="modal-dialog" role="document">
  315. <div class="modal-content">
  316. <div class="modal-header modal-add">
  317. <h5 class="modal-title" id="exampleModalLabel">Edit MK : <span id="detailRuangHeaderEdit">-</span></h5>
  318. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" style="color:white">&times;</span>
  319. </button>
  320. </div>
  321. <form action="<?= BASE_URL . 'config/functions/ruang_update.php'; ?>" method="POST" id="formEditRuang">
  322. <div class="modal-body p-0">
  323. <div class="card-body pt-2">
  324. <b>Data Ruang</b>
  325. <div class="alert alert-icon alert-warning mt-2" style="font-size: 12px;" role="alert">
  326. <i class="fa fa-exclamation-triangle mr-2" aria-hidden="true"></i> <b>Mohon Perhatian : </b> Segala perubahan yang dilakukan tidak merubah data jadwal yang sudah dibuat.
  327. </div>
  328. <div class="row">
  329. <div class="col-4">
  330. <div class="form-group">
  331. <label class="form-label" for="iEKode" style="font-size: 14px; font-weight: normal;">Kode</label>
  332. <input type="text" class="form-control" name="iEKode" id="iEKode" style="font-size: 14px;" readonly>
  333. </div>
  334. </div>
  335. <div class="col-8">
  336. <div class="form-group">
  337. <label class="form-label" for="iENameRuang" style="font-size: 14px; font-weight: normal;">Nama Ruangan</label>
  338. <input type="text" class="form-control" id="iENameRuang" name="iENameRuang" style="font-size: 14px;">
  339. </div>
  340. </div>
  341. </div>
  342. <div class="row">
  343. <div class="col-6">
  344. <div class="form-group">
  345. <label for="iECapacity" style="font-size: 14px;">Kapasitas</label>
  346. <input type="number" min="1" class="form-control" id="iECapacity" name="iECapacity" autocomplete="off" style="font-size: 14px;">
  347. </div>
  348. </div>
  349. <div class="col-6">
  350. <div class="form-group">
  351. <label for="iEBackup" style="font-size: 14px;">Ruang Cadangan</label>
  352. <div class="custom-control custom-radio">
  353. <input type="radio" id="checkAllow" name="iEBackup" class="custom-control-input" value="0">
  354. <label class="custom-control-label" for="checkAllow" style="font-size: 14px;">Iya</label>
  355. </div>
  356. <div class="custom-control custom-radio">
  357. <input type="radio" id="checkNotAllow" name="iEBackup" class="custom-control-input" value="1" checked>
  358. <label class="custom-control-label" for="checkNotAllow" style="font-size: 14px;">Tidak</label>
  359. </div>
  360. </div>
  361. </div>
  362. </div>
  363. <div class="form-group">
  364. <label for="iEProdi" style="font-size: 14px;">Program Studi</label>
  365. <select class="form-control custom-select" name="iEProdi" id="iEProdi" style="font-size: 14px;">
  366. <?php
  367. // Get data m_prodi
  368. $getMProdi = mysqli_query($link, "SELECT * FROM m_prodi");
  369. $listNo = 0;
  370. while ($row = mysqli_fetch_assoc($getMProdi)) {
  371. echo '<option value="' . $row['id'] . '" class="list_' . $listNo . '">' . $row['name'] . '</option>';
  372. $listNo++;
  373. }
  374. ?>
  375. </select>
  376. </div>
  377. </div>
  378. </div>
  379. <div class="modal-footer">
  380. <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
  381. <!-- <input type="hidden" name="lab_id" value="<?= $labs['id']; ?>"> -->
  382. <button type="button" id="editMk" class="btn btn-primary">Simpan Perubahan</button>
  383. </div>
  384. </form>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. <!-- End modal -->
  390. </div>
  391. </section>
  392. </div>
  393. </section>
  394. </main>
  395. </div>
  396. </div>
  397. <?php include_once("../templates/foot.php") ?>
  398.  
  399. <script>
  400. $(document).ready(function() {
  401. // Datatables
  402. $('#table_id').DataTable({
  403. "oLanguage": {
  404. "sInfo": "Total _TOTAL_ data, menampilkan data (_START_ sampai _END_)",
  405. "sInfoFiltered": " - filtering from _MAX_ records",
  406. "sSearch": "Pencarian :",
  407. "sInfoEmpty": "Belum ada data untuk saat ini",
  408. "sLengthMenu": "Menampilkan _MENU_",
  409. "oPaginate": {
  410. "sPrevious": "Sebelumnya",
  411. "sNext": "Selanjutnya"
  412. },
  413. "sZeroRecords": "Tidak ada data"
  414. }
  415. });
  416.  
  417. // Add MK
  418. $('#addRuang').click(function(e) {
  419. var isValid = true;
  420. // Validation add Mk
  421. if ($('#iKode').val() == '') {
  422. $('#iKode').css('borderColor', 'red');
  423. $('#kodeInfo').fadeIn();
  424. isValid = false;
  425. e.preventDefault();
  426. }
  427. if ($('#iNameRuang').val() == '') {
  428. $('#iNameRuang').css('borderColor', 'red');
  429. $('#ruangInfo').fadeIn();
  430. isValid = false;
  431. e.preventDefault();
  432. }
  433. if ($('#iKapasitas').val() == '') {
  434. $('#iKapasitas').css('borderColor', 'red');
  435. $('#kapasitasInfo').fadeIn();
  436. isValid = false;
  437. e.preventDefault();
  438. }
  439. if ($('#jenis').val() == '') {
  440. $('#jenis').css('borderColor', 'red');
  441. isValid = false;
  442. e.preventDefault();
  443. }
  444. if ($('#iProdi').val() == '') {
  445. $('#iProdi').css('borderColor', 'red');
  446. $('#prodiInfo').fadeIn();
  447. isValid = false;
  448. e.preventDefault();
  449. }
  450.  
  451. // Mk action and remove border red
  452. $('#iKode').focus(function() {
  453. $(this).css('borderColor', '#D2D2D2');
  454. $('#kodeInfo').fadeOut();
  455. });
  456. $('#iKode').keyup(function() {
  457. $('#kodeInfo').fadeOut();
  458. });
  459. $('#iNameRuang').focus(function() {
  460. $(this).css('borderColor', '#D2D2D2');
  461. $('#ruangInfo').fadeOut();
  462. });
  463. $('#iNameRuang').keyup(function() {
  464. $('#ruangInfo').fadeOut();
  465. });
  466. $('#iKapasitas').focus(function() {
  467. $(this).css('borderColor', '#D2D2D2');
  468. $('#kapasitasInfo').fadeOut();
  469. });
  470. $('#iKapasitas').keyup(function() {
  471. $('#kapasitasInfo').fadeOut();
  472. });
  473. $('#jenis').focus(function() {
  474. $(this).css('borderColor', '#D2D2D2');
  475. });
  476. $('#iProdi').focus(function() {
  477. $(this).css('borderColor', '#D2D2D2');
  478. $('#prodiInfo').fadeOut();
  479. });
  480. $('#iProdi').keyup(function() {
  481. $('#prodiInfo').fadeOut();
  482. });
  483.  
  484. // Check validate if mk empty
  485. if ($('#iKode').val() != '') {
  486. $.post("<?= BASE_URL . 'config/functions/ruang_addCheckKode.php'; ?>", {
  487. kode_ruang: $('#iKode').val()
  488. },
  489. function(data, status) {
  490. if (data > 0) {
  491. $('#iKode').css('borderColor', 'red');
  492. swal('Terjadi Kesalahan', 'Maaf, Kode sudah digunakan Ruangan lain', 'error');
  493. } else if (data == 0 && isValid === true) {
  494. $('#formAddRuang').submit();
  495. }
  496. });
  497. }
  498. });
  499.  
  500. // Detail Mk
  501. $(document).on('click', '.detail-ruang', function() {
  502. var getIdItem = $(this).attr('item');
  503. var rowUnique = 'tr.data_' + getIdItem;
  504.  
  505. $('#detailRuangHeader').text($(rowUnique + ' td.nameRuang').text() + ' (' + $(rowUnique + ' td.kodeRuang').text() + ')');
  506. $('#dKode').text($(rowUnique + ' td.kodeRuang').text());
  507. $('#dNameRuang').text($(rowUnique + ' td.nameRuang').text());
  508. $('#dCapacity').text($(rowUnique + ' td.capacityRuang').text());
  509. $('#dBackup').text($(rowUnique + ' td.backupRuang').text());
  510. $('#dProdi').text($(rowUnique + ' .prodiMk').text());
  511. $('#dByUser').text($(rowUnique + ' .by_user').text());
  512. $('#dAddDate').text($(rowUnique + ' .regDate').text());
  513. $('#showEditRuang').attr('item', getIdItem);
  514. $('#deleteRuang').attr('item', getIdItem);
  515. });
  516.  
  517. // Edit Mk
  518. $('#showEditRuang').click(function() {
  519. $('#exampleModal1').modal('toggle');
  520. var getIdItem = $(this).attr('item');
  521. var rowUnique = 'tr.data_' + getIdItem;
  522.  
  523. $('#detailRuangHeaderEdit').text($(rowUnique + ' td.nameRuang').text() + ' (' + $(rowUnique + ' td.kodeRuang').text() + ')');
  524. $('#iEKode').val($(rowUnique + ' td.kodeRuang').text());
  525. $('#iENameRuang').val($(rowUnique + ' td.nameRuang').text());
  526. $('#iECapacity').val($(rowUnique + ' td.capacityRuang').text());
  527. $('#checkAllow').val($(rowUnique + ' td.backupRuang').text());
  528. $('#checkNotAllow').val($(rowUnique + ' td.backupRuang').text());
  529. // $('#iEProdi').val($(rowUnique + ' .prodiMk').text());
  530.  
  531. for (var i = 1; i < $('#labs option').length; i++) {
  532. if ($('#iEProdi').text() == $('#labs option')[i].label) {
  533. $('#labs option.list_' + i).attr('selected', 'selected');
  534. }
  535. }
  536. });
  537.  
  538. // Action edit Mk
  539. $('#editMk').click(function(e) {
  540. // Validation form
  541. if ($('#iEKode').val() == '') {
  542. $(this).css('borderColor', 'red');
  543. e.preventDefault();
  544. }
  545. if ($('#iENameRuang').val() == '') {
  546. $(this).css('borderColor', 'red');
  547. e.preventDefault();
  548. }
  549. if ($('#iECapacity').val() == '') {
  550. $(this).css('borderColor', 'red');
  551. e.preventDefault();
  552. }
  553. if ($('#iEProdi').val() == '') {
  554. $(this).css('borderColor', 'red');
  555. e.preventDefault();
  556. }
  557.  
  558. $('#iEKode').focus(function() {
  559. $(this).css('borderColor', '#D2D2D2');
  560. });
  561. $('#iENameRuang').focus(function() {
  562. $(this).css('borderColor', '#D2D2D2');
  563. });
  564. $('#iECapacity').focus(function() {
  565. $(this).css('borderColor', '#D2D2D2');
  566. });
  567. $('#iEProdi').focus(function() {
  568. $(this).css('borderColor', '#D2D2D2');
  569. });
  570.  
  571. $('#formEditRuang').submit();
  572. });
  573.  
  574. // Delete Mk
  575. $('#deleteMk').click(function() {
  576. swal({
  577. title: "Apakah Anda yakin Menghapus?",
  578. text: "Menghapus Mata Kuliah ini membuat Mata Kuliah ini tidak tersedia pada proses pembuatan Jadwal. Seluruh transaksi dengan Mata Kuliah ini juga akan dihapus secara otomatis.",
  579. icon: "warning",
  580. buttons: true,
  581. dangerMode: true,
  582. });
  583. });
  584.  
  585. <?php
  586. // Message success update form
  587. if (isset($_SESSION['updateSucessfully'])) {
  588. echo "setTimeout(function(){ swal('Berhasil', 'Perubahan data telah disimpan!', 'success'); $('tr.data_" . $_SESSION['updateSucessfully'] . "').addClass('highlight'); }, 500); ";
  589. unset($_SESSION['updateSucessfully']);
  590. }
  591. ?>
  592.  
  593. <?php
  594. // Message success for new data
  595. if (isset($_SESSION['newRuang'])) {
  596. echo "swal('Berhasil', 'Data Dosen telah ditambahkan', 'success')";
  597. unset($_SESSION['newRuang']);
  598. }
  599.  
  600. ?>
  601. });
  602. </script>
  603.  
  604. </body>
  605.  
  606. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement