本文整理汇总了PHP中custom_query函数的典型用法代码示例。如果您正苦于以下问题:PHP custom_query函数的具体用法?PHP custom_query怎么用?PHP custom_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了custom_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ambilAlamat
function ambilAlamat()
{
$nama_karyawan = $_POST['nama_karyawan'];
$qry2 = "SELECT * FROM tbl_karyawan WHERE nama_karyawan = '{$nama_karyawan}'";
$sql2 = custom_query($qry2);
while ($array2 = mysqli_fetch_array($sql2)) {
echo $array2['alamat'];
}
}
示例2: custom_query
$update1 = custom_query($tblupdate1);
while ($r1 = mysqli_fetch_array($update1)) {
$hasil1 = $r1['jumlah'];
}
if ($jumlah > $hasil) {
$ok = $hasil1 + ($jumlah - $hasil);
$sqlupdate = "UPDATE tbl_barang SET jumlah = '{$ok}' WHERE part_number = '{$part_number}'";
$jmlupdate = custom_query($sqlupdate);
$dbinput = "UPDATE `tbl_det_masuk` SET part_number = '{$part_number}', description = '{$deskripsi}', jumlah = '{$jumlah}', tgl_masuk = '{$tgl_masuk}', username = '{$username}', keterangan = '{$keterangan}', id_cabang = '{$id_cabang}', id_dasar = '{$id_dasar}' WHERE no_form_m = '{$noform}'";
$input = custom_query($dbinput);
echo '<div align="center" style="color:green; font-size:15px;"><b>Data barang masuk berhasil di edit. silakan klik <a href="detbrgmasuk.php">disini </a>untuk melihat perubahan</b></div><br />';
}
if ($jumlah < $hasil) {
$ok1 = $hasil1 - ($hasil - $jumlah);
$sqlupdate1 = "UPDATE tbl_barang SET jumlah = '{$ok1}' WHERE part_number = '{$part_number}'";
$jmlupdate1 = custom_query($sqlupdate1);
$dbinput = "UPDATE `tbl_det_masuk` SET part_number = '{$part_number}', description = '{$deskripsi}', jumlah = '{$jumlah}', tgl_masuk = '{$tgl_masuk}', username = '{$username}', keterangan = '{$keterangan}', id_cabang = '{$id_cabang}', id_dasar = '{$id_dasar}' WHERE no_form_m = '{$noform}'";
$input = custom_query($dbinput);
echo '<div align="center" style="color:green; font-size:15px;"><b>Data barang masuk berhasil di edit. silakan klik <a href="detbrgmasuk.php">disini </a>untuk melihat perubahan</b></div><br />';
} else {
$dbinput = "UPDATE `tbl_det_masuk` SET part_number = '{$part_number}', description = '{$deskripsi}', jumlah = '{$jumlah}', tgl_masuk = '{$tgl_masuk}', username = '{$username}', keterangan = '{$keterangan}', id_cabang = '{$id_cabang}', id_dasar = '{$id_dasar}' WHERE no_form_m = '{$noform}'";
$input = custom_query($dbinput);
if ($input) {
echo "<script>alert('Selamat, data barang masuk telah terupdate');javascript:window.location='status.php';</script>";
} else {
// echo $dbinput;
echo "<script>alert('Maaf, data barang masuk gagal terupdate');javascript:window.location='status.php';</script>";
}
}
}
die;
示例3: custom_query
<div id="main_content">
<?php
include "atas.php";
?>
<p align="center"><strong>Master Data keterangan</strong></p>
<table align="center" width="801" border="0">
<tr>
<td><div align="center"><strong>No.</strong></div></td>
<td><div align="center"><strong>Nama keterangan</strong></div></td>
<td colspan="2"><div align="center"><strong>Aksi</strong></div></td>
</tr>
<?php
$sql = custom_query("SELECT * FROM tbl_keterangan");
while ($r = mysqli_fetch_array($sql)) {
$no++;
?>
<tr>
<td><div align="center"><?php
echo $no;
?>
</div></td>
<td><div align="center"><?php
echo $r['nama_keterangan'];
?>
</div></td>
示例4: custom_query
<option value="Bank DKI">DKI</option>
<option value="Bank Jateng">JTG</option>
<option value="Bank Mandiri">MDR</option>
<option value="Bank Pundi">PUN</option>
<option value="Bank Saudara">SDR</option>
<option value="Sinarmas">SIN</option>
</select><br>
Cabang
<select name="id_cabang" id="id_cabang">
<?php
$query = "SELECT * FROM tbl_cabang";
if ($_SESSION[level] == "operator") {
$query .= " WHERE id_cabang = " . $_SESSION['id_cabang'];
}
// echo $query;
$sql1 = custom_query($query);
while ($r1 = mysqli_fetch_array($sql1)) {
?>
<option value="<?php
echo $r1['id_cabang'];
?>
"><?php
echo $r1['nama_cabang'];
?>
</option><?php
}
?>
</select>
<input type="submit" name="pilih" id="pilih" value="Pilih">
</form></div></p>
示例5: custom_query
//validasi
$pn = $_POST['pn'];
$description = $_POST['description'];
$jumlah = $_POST['jumlah'];
$query = "SELECT part_number FROM tbl_barang WHERE part_number = '{$pn}'";
$a = custom_query($query);
if (trim($pn) == '') {
$error[] = '- Part Number harus diisi';
}
if (trim(mysqli_num_rows($a) > 0)) {
$error[] = '- Part Number sudah ada, silakan ulangi kembali.';
}
if (trim($description) == '') {
$error[] = '- Deskripsi harus dipilih';
}
if (trim($jumlah) == '') {
$error[] = '- Jumlah barang harus diisi';
}
//dan seterusnya
if (isset($error)) {
echo '<div align="center" style="color:red; font-size:20px;"><b>Error</b>: <br /></div><div style="color:red;">' . implode('<br />', $error) . '</div>';
} else {
/*
jika data mau dimasukkan ke database,
maka perintah SQL INSERT bisa ditulis di sini
*/
$query1 = "INSERT INTO tbl_barang (part_number,description,jumlah) VALUES ('{$pn}','{$description}', '{$jumlah}')";
$input = custom_query($query1);
echo '<div align="center" style="color:green; font-size:15px;"><b>Data Sparepart Baru berhasil di tambah. silakan klik <a href="listbarang.php">disini</a> untuk melihat perubahan:</b></div><br />';
}
die;
示例6: custom_query
<h1 align="center">
<b>Status Barang Return</b>
</h1>
<table align="center" width="1335" border="0" bordercolor="#FFFFFF">
<tr>
<td width="90"><div align="center"><strong>No. Form</strong></div></td>
<td width="174"><div align="center"><strong>Part Number</strong></div></td>
<td width="215"><div align="center"><strong>Description</strong></div></td>
<td width="53"><div align="center"><strong>Jumlah</strong></div></td>
<td width="300"><div align="center"><strong>Alasan Direturn</strong></div></td>
<td width="150"><div align="center"><strong>Tanggal Return</strong></div></td>
<td width="98"><div align="center"><strong>Operator</strong></div></td>
<td width="212"><div align="center"><strong>Keterangan</strong></div></td>
</tr>
<?php
$sql = custom_query("select * from tbl_det_return where tgl_return >= '{$startdate}' and tgl_return <= '{$enddate}' order by no_form_r desc");
while ($r = mysqli_fetch_array($sql)) {
?>
<tr>
<td><div align="center"><?php
echo $r['no_form_r'];
?>
</div></td>
<td><div align="center"><?php
echo $r['part_number'];
?>
</div></td>
<td><?php
echo $r['description'];
?>
示例7: custom_query
}
</style>
</head>
</html>
<body>
<div id="header">
</div>
<div id="main_content">
<?php
include "atas.php";
?>
<p align="center"><strong>Silahkan edit form dibawah ini untuk mengedit Cabang</strong></p>
<?php
$id = $_GET['id'];
$sql = custom_query("SELECT * FROM tbl_cabang WHERE id_cabang='{$id}'");
while ($r = mysqli_fetch_array($sql)) {
?>
<form action="prosescabang.php?task=edit" method="post" id="update">
<div align="center">
<table width="400" border="6">
<input type="hidden" name="idcabang" value="<?php
echo $id;
?>
" />
<tr>
<td width="123"><strong>Nama Cabang :</strong></td>
<td class="field" width="255" bgcolor="#FFFFFF"><label for="username"></label>
<input name="nmcabang" type="text" id="nmcabang" value="<?php
echo $r['nama_cabang'];
示例8: custom_query
<h1 align="center">
<b>Status Barang Return</b>
</h1>
<table align="center" width="1335" border="0" bordercolor="#FFFFFF">
<tr>
<td width="90"><div align="center"><strong>No. Form</strong></div></td>
<td width="174"><div align="center"><strong>Part Number</strong></div></td>
<td width="215"><div align="center"><strong>Description</strong></div></td>
<td width="53"><div align="center"><strong>Jumlah</strong></div></td>
<td width="250"><div align="center"><strong>Alasan Direturn</strong></div></td>
<td width="212"><div align="center"><strong>Tanggal Masuk</strong></div></td>
<td width="98"><div align="center"><strong>Operator</strong></div></td>
<td width="212"><div align="center"><strong>Keterangan</strong></div></td>
</tr>
<?php
$sql = custom_query("SELECT * \nFROM `tbl_det_return` \nORDER BY `tbl_det_return`.`no_form_r` DESC");
while ($r = mysqli_fetch_array($sql)) {
?>
<tr>
<td><div align="center"><?php
echo $r['no_form_r'];
?>
</div></td>
<td><div align="center"><?php
echo $r['part_number'];
?>
</div></td>
<td><?php
echo $r['description'];
?>
示例9: session_start
session_start();
// koneksi ke database
include "koneksi.php";
//membaca inputan user
$pwdlama = $_POST['pwdlama'];
$pwdbaru = $_POST['pwdbaru'];
$repwdbaru = $_POST['repwdbaru'];
//mencari benar tidaknya password yang lama
$sql = custom_query("SELECT * FROM tbl_user WHERE username = '{$_SESSION['username']}'");
$data = mysqli_fetch_array($sql);
if (trim($data['password']) != $pwdlama) {
$error[] = '- Password lama tidak sesuai';
}
//jika password yang lama benar, maka selanjutnya cek kesesuaian password baru dan konfirmasi password
if (trim($repwdbaru) != $pwdbaru) {
$error[] = '- Konfirmasi password tidak sama, harap ulangi kembali';
}
if (strlen($pwdbaru) <= 5) {
$error[] = '- Password minimal 6 karakter';
}
if (isset($error)) {
echo '<div align="center"><b>Error</b>: <br /></div>' . implode('<br />', $error);
} else {
// jika password baru dan konfirmasi password benar, maka akan di lakukan update password ke database
$query = "UPDATE tbl_user SET password = '{$pwdbaru}' WHERE username = '{$_SESSION['username']}'";
$update = custom_query($query);
echo '<div class="result" align="center"><b>Password berhasil di ubah. password baru anda adalah : ';
echo $pwdbaru;
'</b></div><br />';
}
示例10: session_start
<?php
session_start();
include "koneksi.php";
if (empty($_SESSION['username']) and empty($_SESSION['password'])) {
echo print "<script>alert('Maaf anda tidak memiliki akses untuk melihat halaman ini, silakan login terlebih dahulu.');javascript:window.location='formlogin.php';</script>";
} else {
if ($password = "" || ($nama_karyawan = "" || ($id_karyawan = ""))) {
echo print "<script>alert('Terjadi kesalahan, field tidak boleh kosong. Harap ulangi kembali');javascript:window.location='edituser.php';</script>";
} else {
if (isset($_POST['simpan'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$nama_karyawan = $_POST['nama_karyawan'];
$level = $_POST['level'];
$id_karyawan = $_POST['id_karyawan'];
$id_cabang = $_POST['id_cabang'];
$dquery = "UPDATE tbl_user SET password='{$password}', nama_karyawan='{$nama_karyawan}', level='{$level}', id_karyawan='{$id_karyawan}', id_cabang = '{$id_cabang}' WHERE username='{$username}'";
$sql = custom_query($dquery);
if ($sql) {
echo "<script>alert('Selamat, data user telah terupdate');javascript:window.location='user.php';</script>";
} else {
echo "<script>alert('Maaf, data user gagal terupdate');javascript:window.location='user.php';</script>";
}
}
}
}
示例11: time
<?php
include "koneksi.php";
$waktu = time() + 25200;
$expired = 30;
$username = $_POST['username'];
$username = htmlentities(str_replace("'", '', $username));
$password = $_POST['password'];
$password = htmlentities(str_replace("'", '', $password));
$login = custom_query("SELECT * FROM tbl_user WHERE username='" . $username . "' AND password='" . $password . "'");
$hasil = mysqli_num_rows($login);
$r = mysqli_fetch_array($login);
if ($hasil > 0) {
session_start();
isset($_SESSION['username']);
isset($_SESSION['password']);
isset($_SESSION['password']);
$_SESSION['id_karyawan'] = $r['user_id'];
$_SESSION['username'] = $r['username'];
$_SESSION['password'] = $r['password'];
$_SESSION['level'] = $r['level'];
$_SESSION['id_cabang'] = $r['id_cabang'];
$_SESSION['timeout'] = $waktu + $expired;
header('location:/simdatindo');
} else {
echo print "<script>alert('Username atau password salah. Silakan mencoba kembali.');javascript:window.location='formlogin.php';</script>";
}
示例12: session_start
<?php
session_start();
include "koneksi.php";
if (empty($_SESSION['username']) and empty($_SESSION['password'])) {
echo print "<script>alert('Maaf anda tidak memiliki akses untuk melihat halaman ini, silakan login terlebih dahulu.');javascript:window.location='formlogin.php';</script>";
} else {
$username = $_GET['username'];
$sql = custom_query("DELETE FROM tbl_user WHERE username='{$username}'");
if ($sql) {
echo print "<script>alert('Selamat, data user telah dihapus');javascript:window.location='user.php';</script>";
} else {
echo print "<script>alert('Maaf, data user gagal dihapus');javascript:window.location='user.php';</script>";
}
}
示例13: custom_query
}
</style>
</head>
</html>
<body>
<div id="header">
</div>
<div id="main_content">
<?php
include "atas.php";
?>
<p align="center"><strong>Silahkan edit form dibawah ini untuk mengedit user</strong></p>
<?php
$username = $_GET['username'];
$sql = custom_query("SELECT * FROM tbl_user WHERE username='{$username}'");
while ($r = mysqli_fetch_array($sql)) {
?>
<form action="updateuser.php" method="post" id="update">
<div align="center">
<table width="400" border="6">
<tr>
<td width="123"><strong>Username :</strong></td>
<td class="field" width="255" bgcolor="#FFFFFF"><label for="username"></label>
<input name="username" type="text" id="username" value="<?php
echo $r['username'];
?>
" readonly></td>
</tr>
<tr>
示例14: custom_query
<td width="90"><div align="center"><strong>No. Form</strong></div></td>
<td width="174"><div align="center"><strong>Part Number</strong></div></td>
<td width="215"><div align="center"><strong>Description</strong></div></td>
<td width="215"><div align="center"><strong>Dasar Barang masuk</strong></div></td>
<td width="53"><div align="center"><strong>Jumlah</strong></div></td>
<td width="53"><div align="center"><strong>Cabang</strong></div></td>
<td width="212"><div align="center"><strong>Tanggal Masuk</strong></div></td>
<td width="98"><div align="center"><strong>Operator</strong></div></td>
<td width="212"><div align="center"><strong>Keterangan</strong></div></td>
</tr>
<?php
$where = "";
if ($_SESSION[level] == "operator") {
$where = " WHERE tbl_det_masuk.id_cabang = " . $_SESSION['id_cabang'];
}
$sql = custom_query("SELECT * \nFROM `tbl_det_masuk` LEFT JOIN tbl_keterangan on keterangan = id_keterangan \nLEFT JOIN tbl_cabang on tbl_det_masuk.id_cabang = tbl_cabang.id_cabang\nLEFT JOIN tbl_dasar on tbl_det_masuk.id_dasar = tbl_dasar.id_dasar\n{$where}\nORDER BY `tbl_det_masuk`.`no_form_m` DESC");
while ($r = mysqli_fetch_array($sql)) {
?>
<tr>
<td><div align="center"><?php
echo $r['no_form_m'];
?>
</div></td>
<td><div align="center"><?php
echo $r['part_number'];
?>
</div></td>
<td><?php
echo $r['description'];
?>
示例15: custom_query
}
?>
</table>
<?php
} else {
?>
<h1 align="center"><strong>Maaf, Tidak Ditemukan hasil pencarian dengan kata kunci " <?php
echo $cari;
?>
"</strong></h1>
<?php
}
}
if ($status == "brgret") {
$query7 = "SELECT * FROM tbl_det_return WHERE no_form_r LIKE '%{$cari}%' OR part_number LIKE '%{$cari}%' OR description LIKE '%{$cari}%' OR alasan LIKE '%{$cari}%' OR username LIKE '%{$cari}%' OR tgl_return LIKE '%{$cari}%' OR keterangan LIKE '%{$cari}%' ORDER BY no_form_r DESC";
$sql7 = custom_query($query7);
$total7 = mysqli_num_rows($sql7);
if ($total7 > 0) {
?>
<style>
table{
width:1180px;
margin-bottom:10px;
border-top-width: medium;
border-right-width: medium;
border-bottom-width: medium;
border-left-width: medium;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;