Setelah buntu beberapa hari mau download dari App store gagal melulu, akhirnya berhasil intall Xcode Version 11.1 (11A1027) pada os Catalina, begini stepnya. download langsung…
Tulisan ini hanya mencoba penggunaan Crayon Syntax Highlighter pada wordpress.
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 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 |
<section class="content-header"> <h1> <?php echo $judul?> </h1> </section> <!-- Main content --> <section class="content"> <!-- SELECT2 EXAMPLE --> <div class="box box-info"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $judul?></h3> <div class="box-tools pull-right"> <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button> </div> </div> <!-- /.box-header --> <div class="box-body"> <?php $no_pendaftaran = str_pad($all[0]->no_pendaftaran, 5, '0', STR_PAD_LEFT); ?> <div class="row"> <div class="col-sm-6"> <div class="col-sm-4">No.Pendaftaran </div> <div class="col-sm-8"><input type="text" class="form-control" name="no_pendaftaran_x" id="no_pendaftaran_x" readonly="readonly" value="<?php echo $no_pendaftaran?>"> </div> <div style="clear:both"></div><br> <div class="col-sm-4">NAMA </div> <div class="col-sm-8"> <input type="text" class="form-control" name="nama" id="nama" disabled="" value="<?php echo $all[0]->nama?>"> </div> <div style="clear:both"></div><br> <div class="col-sm-4">No.BPJS </div> <div class="col-sm-8"><input type="text" class="form-control" name="no_bpjs" id="no_bpjs" readonly="" value="<?php echo $all[0]->no_bpjs?>"> </div> <div style="clear:both"></div><br> <div class="col-sm-4">USIA </div> <div class="col-sm-8"><input type="text" class="form-control" name="usia" id="usia" readonly="" value="<?php echo $all[0]->usia?>"> </div> <div style="clear:both"></div><br> </div> <form action ="home/edit_profil" method="post" id="v_edituser"> <input type="hidden" name="no_pendaftaran" id="no_pendaftaran" value="<?php echo $no_pendaftaran?>"> <input type="hidden" name="id_kunjungan" id="id_kunjungan" value="<?php echo $all[0]->id_kunjungan?>"> <div class="col-sm-6"> <div class="col-sm-4">Tanggal </div> <div class="col-sm-8"><input type="text" class="form-control" name="tgl_mulai" id="tgl_mulai" value="<?php echo date('Y-m-d')?>" disabled> </div> <div style="clear:both"></div><br> <div class="col-sm-4">Jam Mulai </div> <div class="col-sm-8"><input type="time" class="form-control" name="jam_mulai" id="jam_mulai" value="<?php echo date('H:i')?>" readonly> </div> <div style="clear:both"></div><br> <div class="col-sm-4">Jam Selesai </div> <div class="col-sm-8"><input type="time" class="form-control" name="jam_selesai" id="jam_selesai" readonly> </div> <div style="clear:both"></div><br> <div class="col-sm-4">lama pemeriksaan </div> <div class="col-sm-4"><input type="number" class="form-control" name="lama_pemeriksaan" id="lama_pemeriksaan" readonly> </div> <div class="col-sm-4"> menit</div> <div style="clear:both"></div><br> </div> <div style="clear:both"></div><br> <div class="col-sm-2">Keluhan Utama </div> <div class="col-sm-10"><textarea disabled="" class="form-control"><?php echo $all[0]->keluhan_umum?></textarea></div> <div style="clear:both"></div><br> <hr> <div class="col-sm-4"><b>SUBJECTIF</b></div><div style="clear: both;"></div> <div class="col-sm-4">Autonamnesis/Alloanamnesis</div> <br> <hr> <div class="col-sm-2">KU </div> <div class="col-sm-10"><textarea type="text" class="form-control" name="ku" ><?php echo $all[0]->ku?></textarea> </div> <div style="clear:both"></div><br> <div class="col-sm-2">KT </div> <div class="col-sm-10"><textarea type="text" class="form-control" name="kt" ><?php echo $all[0]->kt?></textarea> </div> <div style="clear:both"></div><br> <div class="col-sm-2">RPT </div> <div class="col-sm-10"><textarea type="text" class="form-control" name="rpt" ><?php echo $all[0]->rpt?></textarea> </div> <div style="clear:both"></div><br> <div class="col-sm-2">RPO </div> <div class="col-sm-10"><textarea type="text" class="form-control" name="rpo" ><?php echo $all[0]->rpo?></textarea> </div> <div style="clear:both"></div><br> <div class="col-sm-2">RPK </div> <div class="col-sm-10"><textarea type="text" class="form-control" name="rpk" ><?php echo $all[0]->rpk?></textarea> </div> <div style="clear:both"></div><br> <div style="clear:both"></div><br> <hr> <div class="col-sm-4"><b>OBJECTIF</b></div><div style="clear: both;"></div> <br> <div class="col-sm-2">TD </div> <div class="col-sm-4"><input type="text" class="form-control" name="td" value="<?php echo $all[0]->td?>"> </div> <div class="col-sm-4">mmhg</div> <div style="clear:both"></div><br> <div class="col-sm-2">HR </div> <div class="col-sm-4"><input type="text" class="form-control" name="hr" value="<?php echo $all[0]->hr?>"> </div> <div class="col-sm-2">x/menit</div> <div style="clear:both"></div><br> <div class="col-sm-2">RR </div> <div class="col-sm-4"><input type="text" class="form-control" name="rr" value="<?php echo $all[0]->rr?>"> </div> <div class="col-sm-2">x/menit</div> <div style="clear:both"></div><br> <div class="col-sm-2">T </div> <div class="col-sm-4"><input type="text" class="form-control" name="t" value="<?php echo $all[0]->t?>"> </div> <div class="col-sm-4">° C</div> <div style="clear:both"></div><br> <div class="col-sm-2">BERAT BADAN </div> <div class="col-sm-4"><input type="number" class="form-control" name="berat_badan" value="<?php echo $all[0]->berat_badan?>"> </div> <div class="col-sm-4">Kg</div> <div style="clear:both"></div><br> <div class="col-sm-2">TINGGI BADAN </div> <div class="col-sm-4"><input type="number" class="form-control" name="tinggi_badan" value="<?php echo $all[0]->tinggi_badan?>"> </div> <div class="col-sm-4">cm</div> <div style="clear:both"></div><br> <div class="col-sm-2">LINGKAR PERUT </div> <div class="col-sm-4"><input type="number" class="form-control" name="lingkar_perut" value="<?php echo $all[0]->lingkar_perut?>"> </div> <div class="col-sm-4">cm</div> <div style="clear:both"></div><br> <div class="col-sm-2">PEMERIKSAAN FISIK</div> <div class="col-sm-8"><input type="text" class="form-control" name="pemeriksaan_fisik" value="<?php echo $all[0]->pemeriksaan_fisik?>"> </div> <div style="clear:both"></div> <br> <div style="clear:both"></div> <br> <div class="col-sm-4">Pemeriksaan penunjang</div> <div class="col-sm-8"> <select class="form-control" name="pemeriksaan_penunjang" id="pemeriksaan_penunjang"> <option value="">--- pilih ---</option> <option value="rujukan_internal">Rujukan Internal</option> <option value="labotatorium">Laboratorium</option> <option value="ruang_gizi">Ruang Gizi</option> <option value="resep">Lanjut Resep</option> </select> <div id="t4_select_kedua"></div> </div> <br> <div style="clear:both"></div> <br> <!--hide pertama mulai--> <div id="t4_hide_pertama"> <hr> <div class="col-sm-4"><b>ASSESMENT</b></div><div style="clear: both;"></div> <br> <div class="col-sm-2">DIAGNOSA </div> <div class="col-sm-6"> <div id="t4_input_diagnosa_lagi"></div> </div> <div class="col-sm-2"> <span class="fa fa-plus" id="tambah_diag"></span> </div> <br> <div class="col-sm-12"> <table width="100%" class="table table-bordered"> <?php foreach ($diag as $key) { echo " <tr> <td>$key->code_diagnosa</td><td>$key->diagnosa</td> </tr> "; } ?> </table> </div> <div style="clear:both"></div> <br> <hr> <hr> <div class="col-sm-4"><b>PLANNING</b></div><div style="clear: both;"></div> <br> <div class="col-sm-4">Rencana Terapi</div> <div class="col-sm-8"> <!--<textarea class="form-control" name="rencana_terapi"></textarea>--> </div> <br> <div style="clear:both"></div><br> <!---resep dokter---> <div class=" " style="border:5px solid green"> <div class="col-sm-4"><b>Resep Dokter</b></div><div style="clear: both;"></div> <br> <div style="clear:both"></div><br> <div class="col-sm-3">Cari Obat </div> <div class="col-sm-7"> <input type='text' class='form-control obat' id='id_obat' value='' placeholder='Obat' > </div> <div style="clear:both"></div><br> <div class="col-sm-3">Tabel Order Obat </div> <div class="col-sm-12"> <table class="table table-bordered" id="table_order_obat"> <thead> <tr> <th>Obat</th> <th>Stok</th> <th>Satuan</th> <th>Kategori</th> <th>Jumlah</th> <th>Aturan Pakai</th> <th>Waktu Konsumsi</th> <th>Keterangan</th> <th>-</th> </tr> </thead> <tbody id="t4_order"> <?php foreach ($obat_terpakai as $ot) { echo " <tr> <td> <input type='hidden' name='id_obat[]' value='$ot->id_obat' disabled>$ot->obat </td> <td>$ot->stok</td> <td>$ot->satuan</td> <td>$ot->kategori</td> <td> <input class='form-control jum' autofocus name='jumlah_obat[]' value='$ot->jumlah' disabled> </td> <td> <input class='form-control aturan_pakai' name='aturan_pakai[]' id='aturan_pakai' value='$ot->aturan_pakai' disabled> </td> <td> <input class='form-control waktu_konsumsi' name='waktu_konsumsi[]' value='$ot->waktu_konsumsi' disabled> </td> <td> <input class='form-control' name='keterangan[]' value='$ot->waktu_konsumsi' disabled> </td> <td> <!--<button class='btn btn-danger btn-xs' id='remove_order_obat' type='button'>Hapus</button>--> </td> </tr> "; } ?> </tbody> </table> </div> <div style="clear:both"></div> <!---resep dokter---> <br> <hr style="border:2.5px solid green"> <!-------obat lain--------> <div style="clear:both"></div><br> <div class="col-sm-3">Tabel Obat Lainnya</div> <div class="col-sm-12"> <button type="button" id="tambah_obat_lain" class="btn btn-primary">Tambah</button> <table class="table table-bordered" id="table_order_obat_lain"> <thead> <tr> <th>Obat</th> <th>Satuan</th> <th>Jumlah</th> <th>Aturan Pakai</th> <th>Waktu Konsumsi</th> <th>Keterangan</th> <th>-</th> </tr> </thead> <tbody id="t4_order_obat_lain"> <?php foreach ($obat_lain as $ol) { echo " <tr> <td><input class='form-control ' type='text' name='nama_obat_lain[]' value='$ol->nama_obat_lain' disabled></td> <td><input class='form-control ' type='text' name='satuan_obat_lain[]' value='$ol->satuan_obat_lain' disabled></td> <td><input class='form-control ' autofocus name='jumlah_obat_lain[]' value='$ol->jumlah_obat_lain' disabled></td> <td><input class='form-control aturan_pakai' name='aturan_pakai_obat_lain[]' value='$ol->aturan_pakai_obat_lain' id='aturan_pakai' disabled></td> <td><input class='form-control waktu_konsumsi' name='waktu_konsumsi_obat_lain[]' value='$ol->waktu_konsumsi_obat_lain' disabled></td> <td><input class='form-control' name='keterangan_obat_lain[]' value='keterangan_obat_lain' disabled></td> <td><!--<button class='btn btn-danger btn-xs' id='remove_order_obat_lain' type='button'>Hapus</button>--></td></tr> "; } ?> </tbody> </table> </div> <div style="clear:both"></div> <!-------obat lain--------> <hr style="border:2.5px solid green"> <!-------obat racikan--------> <div style="clear:both"></div><br> <div class="col-sm-3">Tabel Obat Racikan</div> <div class="col-sm-12"> <table class="table table-bordered"> <?php if(count($obat_racikan)>0) { echo " <tr> <td><b>Obat</b></td> <td><b>PULV</b></td> <td><b>Aturan Pakai</b></td> <td><b>Waktu Konsumsi</b></td> <td><b>Keterangan</b></td> </tr> "; } foreach ($obat_racikan as $or) { echo " <tr> <td>"; $comma_obat = $this->m_kunjungan->ambil_obat_racikan_by_comma_id($or->id); echo "<table class='table table-bordered'>"; foreach ($comma_obat as $co ) { echo " <tr> <td>$co->obat</td> <td>$co->satuan</td> <td>$co->jumlah</td> </tr> "; } echo "</table>"; echo "</td> <td>$or->pulv </td> <td>$or->aturan_pakai</td> <td>$or->waktu_konsumsi</td> <td>$or->keterangan</td> </tr> "; } ?> </table> </div> <div class="col-sm-12"> <button type="button" id="tambah_racikan" class="btn btn-primary">Tambah</button> <table class="table table-bordered" id="table_order_obat_racikan"> <tbody id="t4_group_racikan"> </tbody> </table> </div> <div style="clear:both"></div> <!-------obat racikan--------> </div> <div style="clear:both"></div> <br> <div class="col-sm-4">KIE</div> <div class="col-sm-8"> <textarea class="form-control" name="kie"><?php echo $all[0]->kie?></textarea> </div> <br> <div style="clear:both"></div> <br> <div class="col-sm-4">Rencana Rujukan</div> <div class="col-sm-8"> <textarea class="form-control" name="rencana_rujukan"><?php echo $all[0]->rencana_rujukan?></textarea> </div> <br> <div style="clear:both"></div> <br> <div class="col-sm-4">DOKTER </div> <div class="col-sm-8"> <select type="text" class="form-control" name="id_dokter" id="id_dokter"> <option value="">--- Pilih Dokter ---</option> <?php foreach ($dokter as $dok) { $sel_d = $dok->id_pegawai==$all[0]->id_dokter?"selected":""; echo "<option value='$dok->id_pegawai' $sel_d>$dok->nama</option>"; } ?> </select> </div> <div style="clear:both"></div><br> <div id="info_edit"></div> <br> <div style="clear:both"></div> <br> </div> <!--hide pertama end--> <div class="col-sm-12"> <input type="submit" name="save" value="SIMPAN" class="btn btn-block btn-primary" id="btn_simpan" /> </div> </form> </div> </section> <script> var code_timeline = "<?php echo $all[0]->code_timeline?>"; var id_kunjungan = "<?php echo $all[0]->id_kunjungan?>"; if(code_timeline=='1' || code_timeline=='5') { }else{ hide_tombol(id_kunjungan); } if(code_timeline=='1') { $("#t4_hide_pertama").hide(); } function hide_tombol(id_kunjungan) { $("#info_edit").html("<div class='alert alert-success'>Telah Tersimpan... <button onclick='print_diagnosa("+id_kunjungan+")' class='btn btn-danger' type='button'>Cetak</button></div>"); $("#btn_simpan").fadeOut(); } $("#pemeriksaan_penunjang").on("change",function(){ var x = $(this).val(); cek_hide_pertama(x); }) function cek_hide_pertama(value) { if(value=="resep") { $("#t4_hide_pertama").fadeIn(); }else if(value=="rujukan_internal"){ if(confirm("Anda Yakin Rujukan Internal?")) { //eksekusi_controller("index.php/keluhan/form_edit_keluhan/"+id_kunjungan); var poli = JSON.parse('<?php echo $poli?>'); var x = "<br>Pilih Poli Rujukan <select class='form-control' name='id_poli' id='id_poli' required>"; $.each(poli,function(a,b){ console.log(b); x += "<option value='"+b.id_poli+"'>"+b.poli+"</option>"; }) x += "</select>"; $("#t4_select_kedua").html(x); } return false; }else if(value=="ruang_gizi") { var r_gizi = JSON.parse('<?php echo $r_gizi?>'); var x = "<br>Pilih Ruang Gizi<select class='form-control' name='id_ruang_gizi' id='id_ruang_gizi' required>"; $.each(r_gizi,function(a,b){ console.log(b); x += "<option value='"+b.id+"'>"+b.ruang_gizi+"</option>"; }) x += "</select>"; $("#t4_select_kedua").html(x); }else{ $("#t4_hide_pertama").fadeOut(); } } $("#v_edituser").submit(function(){ if(confirm("Apakah data diagnosa sudah selesai?")) { $.post("index.php/kunjungan/go_simpan/",$(this).serialize(),function(e){ hide_tombol(id_kunjungan); }) return false; } return false; }); <?php $a=''; foreach($tbl_master_diagnosa as $diagnosa) { $a.='{value:"'.$diagnosa->code.'",label:"'.htmlentities($diagnosa->code).' | '.htmlentities($diagnosa->diagnosa).'"},'; } ?> var availableTags = [ <?php echo $a?> ]; tambah_diag(); function tambah_diag() { //var $input = $("<input>", {name: "code_diagnosa[]","class": "code_diagnosa form-control"}); var input = $("<div><input name='code_diagnosa[]' class='form-control'><span>-</span></div><br>"); input.appendTo("div#t4_input_diagnosa_lagi").find("input").focus().autocomplete({ source: availableTags, minLength: 2, select: function(event, ui) { console.log($(this).parent().find("span").html(ui.item.label)); } }); } $("#tambah_diag").click(function(){ tambah_diag(); }) function pad_with_zeroes(number, length) { var my_string = '' + number; while (my_string.length < length) { my_string = '0' + my_string; } return my_string; } $("#jam_selesai").on("input",function(){ jam(); }) function jam() { var startDate = new Date("<?php echo date('Y-m-d')?> "+$("#jam_mulai").val()+":00"); // Do your operations var endDate = new Date("<?php echo date('Y-m-d')?> "+$("#jam_selesai").val()+":00"); var seconds = (endDate.getTime() - startDate.getTime()) / 1000; //$("#lama_pemeriksaan").val(seconds); var minutes = Math.floor(seconds / 60); //console.log(minutes); $("#lama_pemeriksaan").val(minutes); } startTime(); function startTime() { var today = new Date(); var h = today.getHours(); h = ("0" + h).slice(-2); var m = today.getMinutes(); var s = today.getSeconds(); m = checkTime(m); s = checkTime(s); $("#jam_selesai").val(h + ":" + m + ":" + s); var t = setTimeout(startTime, 500); jam(); } function checkTime(i) { if (i < 10) {i = "0" + i}; // add zero in front of numbers < 10 return i; } function print_diagnosa(id_kunjungan) { window.open("<?php echo base_url()?>index.php/kunjungan/cetak_diagnosa/"+id_kunjungan); console.log(id_kunjungan); } <?php $o=''; foreach($tbl_obat as $obat) { $o.='{value:"'.$obat->id_obat.'",label:"'.htmlentities($obat->obat).'",stok:"'.htmlentities($obat->stok).'",satuan:"'.htmlentities($obat->satuan).'",kategori:"'.htmlentities($obat->kategori).'"},'; } ?> $( function() { var availableTags_obat = [ <?php echo $o?> ]; $( ".obat" ).autocomplete({ source: availableTags_obat, minLength: 2, select: function(event, ui) { console.log(ui); var template = "<tr>"+ "<td><input type='hidden' name='id_obat[]' value='"+ui.item.value+"'>"+ui.item.label+"</td><td>"+ui.item.stok+"</td><td>"+ui.item.satuan+"</td><td>"+ui.item.kategori+"</td>"+ "<td><input class='form-control jum' autofocus name='jumlah_obat[]' placeholder='jumlah'></td>"+ "<td><input class='form-control aturan_pakai' name='aturan_pakai[]' placeholder='aturan_pakai' id='aturan_pakai'></td>"+ "<td><input class='form-control waktu_konsumsi' name='waktu_konsumsi[]' placeholder='waktu_konsumsi'></td>"+ "<td><input class='form-control' name='keterangan[]' placeholder='keterangan'></td>"+ "<td><button class='btn btn-danger btn-xs' id='remove_order_obat' type='button'>Hapus</button></td></tr>" ; $("#t4_order").append(template); $("#id_obat").val(""); $("#id_obat").focus(); $(".aturan_pakai").autocomplete({ source: aturan_pakai, minLength: 0 }).focus(function(){ $(this).data("uiAutocomplete").search($(this).val()); }); $(".waktu_konsumsi").autocomplete({ source: waktu_konsumsi, minLength: 0 }).focus(function(){ $(this).data("uiAutocomplete").search($(this).val()); }); } }); var aturan_pakai = [ "3x1 Sehari", "2x1 Sehari", "1x1 Sehari" ]; var waktu_konsumsi = [ "Sebelum Makan", "Sesudah Makan", "1 Jam sebelum Makan" ]; }); $("#table_order_obat").on("click","tbody tr td button#remove_order_obat",function(x){ $(this).parent().parent().remove(); return false; }) $("#table_order_obat").on("click",function(){ $(".obat").val(""); //alert($(".obat").val()); }) $("#tambah_obat_lain").on("click",function(){ var template_obat_lain = "<tr>"+ "<td><input class='form-control ' type='text' name='nama_obat_lain[]' required></td>"+ "<td><input class='form-control ' type='text' name='satuan_obat_lain[]' required></td>"+ "<td><input class='form-control ' autofocus name='jumlah_obat_lain[]' placeholder='jumlah' required></td>"+ "<td><input class='form-control aturan_pakai' name='aturan_pakai_obat_lain[]' placeholder='aturan_pakai' id='aturan_pakai'></td>"+ "<td><input class='form-control waktu_konsumsi' name='waktu_konsumsi_obat_lain[]' placeholder='waktu_konsumsi'></td>"+ "<td><input class='form-control' name='keterangan_obat_lain[]' placeholder='keterangan'></td>"+ "<td><button class='btn btn-danger btn-xs' id='remove_order_obat_lain' type='button'>Hapus</button></td></tr>" ; $("#t4_order_obat_lain").append(template_obat_lain); var aturan_pakai = [ "3x1 Sehari", "2x1 Sehari", "1x1 Sehari" ]; var waktu_konsumsi = [ "Sebelum Makan", "Sesudah Makan", "1 Jam sebelum Makan" ]; $(".aturan_pakai").autocomplete({ source: aturan_pakai, minLength: 0 }).focus(function(){ $(this).data("uiAutocomplete").search($(this).val()); }); $(".waktu_konsumsi").autocomplete({ source: waktu_konsumsi, minLength: 0 }).focus(function(){ $(this).data("uiAutocomplete").search($(this).val()); }); }) $("#table_order_obat_lain").on("click","tbody tr td button#remove_order_obat_lain",function(x){ $(this).parent().parent().remove(); return false; }) $("#tambah_racikan").on("click",function(){ var group_racikan = "<tr><td><input class='form-control ' placeholder='PULV' type='text' name='pulv_racikan[]' id='pulv_racikan' required><button class='btn btn-primary btn-xs' id='tambah_order_obat_racikan' type='button'>+ Obat</button></td>"+ "<td><input class='form-control aturan_pakai' name='aturan_pakai_obat_racikan[]' placeholder='aturan_pakai' id='group_aturan_pakai'></td>"+ "<td><input class='form-control waktu_konsumsi' name='waktu_konsumsi_obat_racikan[]' placeholder='waktu_konsumsi' id='group_waktu_konsumsi'></td>"+ "<td><input class='form-control' name='keterangan_obat_racikan[]' placeholder='keterangan' id='group_keterangan'><button class='btn btn-danger btn-xs' id='remove_order_obat_racikan' type='button'>- Hapus</button></td>"+ "</tr>"; $("#t4_group_racikan").append(group_racikan); var aturan_pakai = [ "3x1 Sehari", "2x1 Sehari", "1x1 Sehari" ]; var waktu_konsumsi = [ "Sebelum Makan", "Sesudah Makan", "1 Jam sebelum Makan" ]; $(".aturan_pakai").autocomplete({ source: aturan_pakai, minLength: 0 }).focus(function(){ $(this).data("uiAutocomplete").search($(this).val()); }); $(".waktu_konsumsi").autocomplete({ source: waktu_konsumsi, minLength: 0 }).focus(function(){ $(this).data("uiAutocomplete").search($(this).val()); }); }) $("#table_order_obat_racikan").on("click","tr td button#remove_order_obat_racikan",function(x){ $(this).parent().parent().remove(); //alert($(this).parent().parent().html()); return false; }) $("#table_order_obat_racikan").on("click","tr td button#tambah_order_obat_racikan",function(x){ //$(this).parent().parent().remove(); var pulv_racikan = $(this).parent().parent().find("#pulv_racikan").val(); var group_aturan_pakai = $(this).parent().parent().find("#group_aturan_pakai").val(); var group_waktu_konsumsi = $(this).parent().parent().find("#group_waktu_konsumsi").val(); var group_keterangan = $(this).parent().parent().find("#group_keterangan").val(); if(pulv_racikan=="") { alert("Isi dulu PULV"); $(this).parent().parent().find("#pulv_racikan").focus(); return false; } if(group_aturan_pakai=="") { alert("Isi dulu Aturan Pakai"); $(this).parent().parent().find("#group_aturan_pakai").focus(); return false; } if(group_waktu_konsumsi=="") { alert("Isi dulu Aturan Konsumsi"); $(this).parent().parent().find("#group_waktu_konsumsi").focus(); return false; } if(group_keterangan=="") { alert("Isi dulu Keterangan"); $(this).parent().parent().find("#group_keterangan").focus(); return false; } $(this).parent().parent().find("#group_keterangan").attr("readonly","readonly"); $(this).parent().parent().find("#pulv_racikan").attr("readonly","readonly"); $(this).parent().parent().find("#group_aturan_pakai").attr("readonly","readonly"); $(this).parent().parent().find("#group_waktu_konsumsi").attr("readonly","readonly"); var template_obat_racikan = "<tr>"+ "<td><input name='group_pulv[]' id='group_pulv' value='"+pulv_racikan+"' type='hidden'><input name='group_aturan_pakai[]' id='group_aturan_pakai' value='"+group_aturan_pakai+"' type='hidden'><input name='group_waktu_konsumsi[]' id='group_waktu_konsumsi' value='"+group_waktu_konsumsi+"' type='hidden'><input name='group_keterangan[]' id='group_keterangan' value='"+group_keterangan+"' type='hidden'>"+ "<input class='form-control ob_racikan' placeholder='nama obat' type='text' name='id_obat_racikan[]' required><span id='label_obat' style='font-size:10;font-style:italic;'></span></td>"+ "<td><input class='form-control ' placeholder='satuan' type='text' name='satuan_obat_racikan[]' id='satuan_obat_racikan' disabled></td>"+ "<td><input class='form-control ' autofocus name='jumlah_obat_racikan[]' placeholder='jumlah' required><span id='label_stok' style='font-size:10;font-style:italic;'></span></td>"+ "<td colspan='2'><button class='btn btn-danger btn-xs' id='remove_order_obat_racikan' type='button'>Hapus</button></td></tr>" ; $(this).parent().append(template_obat_racikan); var availableTags_obat = [ <?php echo $o?> ]; $(".ob_racikan").autocomplete({ source: availableTags_obat, minLength: 0, select: function(event, ui) { console.log(ui.item.satuan); $(this).parent().find("#label_obat").html(ui.item.label); $(this).parent().parent().find("#label_stok").html("stok:"+ui.item.stok); $(this).parent().parent().find("#satuan_obat_racikan").val(ui.item.satuan); } }).focus(function(){ $(this).data("uiAutocomplete").search($(this).val()); }); return false; }) </script> |
Welcome to WordPress. This is your first post. Edit or delete it, then start writing!