This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Memanggil Function dan Perintah Javascript pada HTML | |
| <a href="javascript:void(null)" onclick="nama_function()">Example</a> | |
| <a href="javascript:void(null)" onclick="alert('Example')">Example</a> | |
| //Mengambil URL yang sedang diakses | |
| alert(document.location.href); | |
| //Objek JSON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install lewat CMD | |
| c:\xampp\php\php.exe c:\xampp\htdocs\yii\framework\yiic webapp c:\xampp\htdocs\webmu | |
| Koneksi Oracle | |
| 'db'=>array( | |
| 'class'=>'CDbConnection', | |
| 'connectionString'=>'oci:dbname=127.0.0.1:1521/dbname', | |
| 'username'=>'dbuser', | |
| 'password'=>'dbpass', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Koneksi Pada PHP | |
| $hostname = "localhost"; | |
| $username = "root"; | |
| $password = "usbw"; | |
| $database = "sisfo_klinik"; | |
| $koneksi = mysql_connect("$hostname", "$username", "$password"); | |
| if (!$koneksi) { | |
| die("Gagal melakukan koneksi ke database"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #SET PASSWORD UNTUK ROOT | |
| #AKTIFKAN WIFI | |
| #GANTI REPO LOKAL | |
| root@OpenWrt:~# vi /etc/opkg.conf | |
| src/gz packages http://192.168.1.2/backfire/10.03.1/ar71xx/packages | |
| dest root / | |
| dest ram /tmp | |
| lists_dir ext /var/opkg-lists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //configs.php | |
| date_default_timezone_set("Asia/Jakarta"); | |
| ini_set('memory_limit', '-1'); | |
| ini_set('max_execution_time', '3600'); | |
| $protocol = "http"; | |
| $host = "localhost"; | |
| $directory = "mystok5"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // $date = strtotime("2023-10-03 14:31:54"); | |
| // $bulan_tahun = date("Y/m/d", strtotime("+1 months", $date)); //2023/11/03 | |
| $nomor_bukti2 = $_POST["kode_project_laboratorium"]; | |
| $stmt = $db->prepare("SELECT kode_gudang, nama_gudang FROM gudang WHERE id_gudang=:1 AND status_gudang='1' LIMIT 1"); | |
| $stmt->execute(array(":1" => $id_gudang)); | |
| $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); | |
| $total_rows = count($rows); | |
| for ($i = 0; $i < $total_rows; $i++) { | |
| $kode_gudang = $rows[$i]['kode_gudang']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $date_beli = strtotime("2019-11-01"); | |
| $nominal_pembelian = 1684900; | |
| $persen_penyusutan = 50; | |
| $lama_tahun_penyusutan = 4; | |
| $string = ""; | |
| $sisa_nominal = $nominal_pembelian; | |
| if (date("d", $date_beli) <= 15) { | |
| $bulan_berjalan = 0; | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //INISIALISASI | |
| $id_perkiraan_array = []; | |
| $kode_perkiraan_array = []; | |
| //INSERT | |
| array_push($id_perkiraan_array, $id_perkiraan); | |
| array_push($kode_perkiraan_array, $kode_perkiraan); | |
| //MENCARI ID_PERKIRAAN DARI ARRAY ID BERDASARKAN PARAMETER KODE_PERKIRAAN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //MEMBUAT COMBOBOX BIASA YANG BISA DIPAKAI BERKALI-KALI PADA BANYAK MENU TANPA PERLU LOAD ULANG FUNCTION INI LAGI, CUKUP LOAD SEKALI SAJA, PADA SAAT LOGIN | |
| <?php | |
| header("Access-Control-Allow-Origin: *"); | |
| header("Content-Type: application/json; charset=UTF-8"); | |
| include "../configurations/configs.php"; | |
| try { | |
| $stmt2 = $db2->prepare("SELECT * FROM cabang WHERE status_cabang='1' ORDER BY id_cabang ASC"); | |
| $stmt2->execute(); | |
| $rows2 = $stmt2->fetchAll(PDO::FETCH_ASSOC); | |
| $data = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $hostname = "localhost"; | |
| $database = "mystok"; | |
| $username = "root"; | |
| $password = ""; | |
| $db = new PDO('mysql:host=' . $hostname . ';dbname=' . $database . ';charset=utf8mb4', '' . $username . '', '' . $password . ''); | |
| $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); | |
| $id_pembelian_array = []; |