saya mau menampilkan data dari tabel jasa, berdasrkan combobox yang ada..saya make method post..disini ada 5 combobox, sebelum dipilih combobox yg awa, combobox selanjutnya nonaktif.. nah jd klo saya cuma pilih beberapa combobox untuk menampilkan data, dia muncul error karena combobox yg nonaktif itu saya panggil method post nya...harusnya seprti apa ya codingannya ??
  1. <!DOCTYPE html>
  2. <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
  3. <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
  4. <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
  5. <!--[if gt IE 8]><!-->
  6. <html class="no-js">
  7. <!--<![endif]-->
  8.  
  9. <head>
  10. <!-- BASICS -->
  11. <meta charset="utf-8">
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  13. <title>Price List</title>
  14. <meta name="description" content="">
  15. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  16. <link rel="stylesheet" type="text/css" href="css/isotope.css" media="screen" />
  17. <link rel="stylesheet" href="js/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
  18. <link rel="stylesheet" href="css/bootstrap.css">
  19. <link rel="stylesheet" href="css/bootstrap-theme.css">
  20. <link rel="stylesheet" href="css/style.css">
  21. <!-- skin -->
  22. <link rel="stylesheet" href="skin/default.css">
  23. <!-- =======================================================
  24. Theme Name: Amoeba
  25. Theme URL: https://bootstrapmade.com/free-one-page-bootstrap-template-amoeba/
  26. Author: BootstrapMade
  27. Author URL: https://bootstrapmade.com
  28. class="navbar-brand"
  29. ======================================================= -->
  30. </head>
  31.  
  32. <body>
  33. <section id="header" class="appear"></section>
  34. <div class="navbar navbar-fixed-top" role="navigation" data-0="line-height:100px; height:100px; background-color:rgba(0,0,0,0.3);" data-300="line-height:60px; height:60px; background-color:rgba(0,0,0,1);">
  35. <div class="container">
  36. <div class="navbar-header">
  37. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  38. <span class="fa fa-bars color-white"></span>
  39. </button>
  40. <h1><a href="pricelist.php" data-0="line-height:90px;" data-300="line-height:50px;"><i class="fa fa-flask fa-2x mar-bot20"></i> TABELKU
  41. </a></h1>
  42. </div>
  43. <div class="navbar-collapse collapse">
  44. <ul class="nav navbar-nav" data-0="margin-top:20px;" data-300="margin-top:5px;">
  45. <!--<li class="active"><a href="index.html">Home</a></li>
  46. <li><a href="#section-about">About</a></li>
  47. <li><a href="#section-works">Portfolio</a></li>
  48. <li><a href="#section-contact">Contact</a></li>-->
  49. </ul>
  50. </div>
  51. <!--/.navbar-collapse -->
  52. </div>
  53. </div>
  54.  
  55. <section class="featured" color="#000000">
  56. <div class="container" color="#000000">
  57. <div class="row mar-bot40">
  58. <div class="col-md-100 col-md-offset-0">
  59.  
  60. <div class="align-center" margin-left="10px" >
  61. <!--<i class="fa fa-flask fa-5x mar-bot20"></i>
  62. <h2 class="slogan">TABELKU</h2>-->
  63. <p>
  64.  
  65.  
  66. <html>
  67. <?php
  68. // koneksi ke database
  69. //mysql_connect('localhost', 'username', 'password');
  70. //mysql_select_db('belajar');
  71. include "config.php";
  72. ?>
  73. <form method="post">
  74.  
  75. <!--sbu-->
  76. SBU :
  77. <select class='Menu' style="width:200px" id="sbu" name="sbu">
  78. <option value=''>Please Select</option>
  79. <?php
  80. $query = mysqli_query($db, "SELECT * FROM sbu ORDER BY nm_sbu");
  81. while ($row = mysqli_fetch_array($query)) {
  82. ?>
  83. <option value="<?php echo $row['kd_sbu']; ?>">
  84. <?php echo $row['nm_sbu']; ?>
  85. </option>
  86. <?php
  87. }
  88. ?>
  89. </select>
  90.  
  91. <!--bid-->
  92. BIDANG :
  93. <select class='Menu' style="width:200px" id="bid" name="bid">
  94. <option value=''>Please Select</option>
  95. <?php
  96. $query = mysqli_query($db, "SELECT * FROM bid
  97. INNER JOIN sbu ON bid.kd_sbu = sbu.kd_sbu where bid.operasional = 1 ORDER BY nm_bid");
  98. while ($row = mysqli_fetch_array($query)) {
  99. ?>
  100. <option id="kota" class="<?php echo $row['kd_sbu']; ?>" value="<?php echo $row['kd_bid']; ?>">
  101. <?php echo $row['nm_bid']; ?>
  102. </option>
  103. <?php
  104. }
  105. ?>
  106. </select>
  107.  
  108. <!--subbid-->
  109. SUB BIDANG :
  110. <select class='Menu' style="width:200px" id="subbid" name="subbid">
  111. <option value=''>Please Select</option>
  112. <?php
  113. $query = mysqli_query($db, "SELECT * FROM subbid
  114. INNER JOIN bid ON subbid.kd_bid = bid.kd_bid ORDER BY nm_subbid");
  115. while ($row = mysqli_fetch_array($query)) {
  116. ?>
  117. <option id="subbid" class="<?php echo $row['kd_bid']; ?>" value="<?php echo $row['kd_subbid']; ?>">
  118. <?php echo $row['nm_subbid']; ?>
  119. </option>
  120. <?php
  121. }
  122. ?>
  123. </select>
  124.  
  125. <!--gkom-->
  126. GRUP KOMODITI :
  127. <select class='Menu' style="width:200px" id="gkom" name="gkom">
  128. <option value=''>Please Select</option>
  129. <?php
  130. $query = mysqli_query($db, "SELECT * FROM gkom
  131. INNER JOIN subbid ON gkom.kd_subbid = subbid.kd_subbid ORDER BY nm_gkom");
  132. while ($row = mysqli_fetch_array($query)) {
  133. ?>
  134. <option id="gkom" class="<?php echo $row['kd_subbid']; ?>" value="<?php echo $row['kd_gkom']; ?>">
  135. <?php echo $row['nm_gkom']; ?>
  136. </option>
  137. <?php
  138. }
  139. ?>
  140. </select>
  141.  
  142. <!--kom-->
  143. KOMODITI :
  144. <select class='Menu' style="width:200px" id="kom" name="kom">
  145. <option value=''>Please Select</option>
  146. <?php
  147. $query = mysqli_query($db, "SELECT * FROM komoditi
  148. INNER JOIN gkom ON komoditi.kd_gkom = gkom.kd_gkom ORDER BY nm_komoditi_ind");
  149. while ($row = mysqli_fetch_array($query)) {
  150. ?>
  151. <option id="kom" class="<?php echo $row['kd_gkom']; ?>" value="<?php echo $row['kd_komoditi']; ?>">
  152. <?php echo $row['nm_komoditi_ind']; ?>
  153. </option>
  154. <?php
  155. }
  156. ?>
  157. </select>
  158.  
  159. <td>SEARCH :</td>
  160. <td><input class='search' type="text" name="txtsearch" style="width:200px" value="" /> </td>
  161. <td><input class='cari' type="submit" value="Cari" name="submit" style="width:70px"/></td>
  162. <br></br>
  163.  
  164. </form>
  165.  
  166. <script src="jquery-1.10.2.min.js"></script>
  167. <script src="jquery.chained.min.js"></script>
  168. <script>
  169. $("#bid").chained("#sbu");
  170. $("#subbid").chained("#bid");
  171. $("#gkom").chained("#subbid");
  172. $("#kom").chained("#gkom");
  173. //$("#subbid").chained("#kom");
  174. </script>
  175.  
  176.  
  177. <!-- tabel -->
  178.  
  179.  
  180. <?php
  181. if (isset($_POST['submit'])) {
  182. $search = $_POST['txtsearch'];
  183. $sbunya = $_POST['sbu'];
  184. $bidnya = $_POST['bid'];
  185. $subbidnya = $_POST['subbid'];
  186. $gkomnya = $_POST['gkom'];
  187. $komnya = $_POST['kom'];
  188.  
  189.  
  190. if ($bidnya == ''){
  191. if ($search == ''){
  192. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya'";
  193. } else {
  194. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and nm_jasa_ind like '%$search%'";
  195. }
  196. } else if ($subbidnya == ''){
  197. if ($search == ''){
  198. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya'";
  199. } else {
  200. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya' and nm_jasa_ind like '%$search%'";
  201. }
  202. } else if ($gkomnya == ''){
  203. if ($search == ''){
  204. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya' and kd_subbid = '$subbidnya'";
  205. } else {
  206. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya' and kd_subbid = '$subbidnya' and nm_jasa_ind like '%$search%'";
  207. }
  208. } else if ($komnya == ''){
  209. if ($search == ''){
  210. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya' and kd_subbid = '$subbidnya' and kd_gkom = '$gkomnya'";
  211. } else {
  212. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya' and kd_subbid = '$subbidnya' and kd_gkom = '$gkomnya' and nm_jasa_ind like '%$search%'";
  213. }
  214. } else {
  215. if ($search == ''){
  216. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya' and kd_subbid = '$subbidnya' and kd_gkom = '$gkomnya' and kd_komoditi = '$komnya'";
  217. } else {
  218. $sql = "SELECT * FROM jasa WHERE kd_sbu = '$sbunya' and kd_bid = '$bidnya' and kd_subbid = '$subbidnya' and kd_gkom = '$gkomnya' and kd_komoditi = '$komnya' and nm_jasa_ind like '%$search%'";
  219. }
  220. }
  221.  
  222. $i=1;
  223. $result = mysqli_query($db, $sql) or die('Error, list jasa failed. ' . mysqli_error());
  224.  
  225. if (mysqli_num_rows($result) == 0) {
  226. echo '<p></p><p>Pencarian tidak ditemukan</p>';
  227. } else {
  228. //echo '<p></p>';
  229.  
  230. echo '<table style="table-layout: fixed" border="2" width="1200px">';
  231. echo '<tr><td width="50px">No.</td>';
  232. echo '<td width="600px">Nama Jasa</td>';
  233. echo '<td width="150px">Methode</td>';
  234. echo '<td width="150px">Persyaratan</td>';
  235. echo '<td width="70px">Sat Harga</td>';
  236. echo '<td width="100px">Harga</td></tr>';
  237.  
  238. while ($row = mysqli_fetch_array($result)) {
  239. extract($row);
  240. $harga = $row['hrg'];
  241. $hargaa = number_format($harga,0,',','.');
  242.  
  243. echo '<tr><td align="top">'.$i.'</td>';
  244. echo '<td align="left">'.$nm_jasa_ind.'</td>';
  245. echo '<td align="top">'.$methode.'</td>';
  246. echo '<td align="top">'.$persyaratan.'</td>';
  247. echo '<td align="top">'.$sat_hrg.'</td>';
  248. echo '<td align="right">'.$hargaa.'</td></tr>';
  249. $i++;
  250. }
  251. echo '</table>';
  252. echo '<p></p>';
  253. }
  254. }
  255. ?>
  256. <!--</form>-->
  257.  
  258.  
  259. </p>
  260. </div>
  261. </div>
  262. </div>
  263. </div>
  264. </section>
  265. </body>
  266.  
  267. </html>
Please login to answer!
haloo..saya buat combobox bercabang di php dari mysql, kayanya data dari field yg saya akan tampilkan ke combobox itu kepanjangan deh, jd dia gamau tampil..gimana cara nya supaya bisa tampil yah ? kalau harus dipotong karakternya ntar jd ga kebaca semua donng..mohon bantuannya.. terima kasih. *saya lampirkan kodingan saya..
  1. <script language='javascript'>
  2.  
  3. function showKom()
  4.  
  5. {
  6.  
  7. <?php
  8.  
  9. include"config.php";
  10.  
  11. // membaca semua propinsi
  12.  
  13. $query = "SELECT * FROM gkom";
  14.  
  15. $hasil = mysqli_query($db, $query);
  16.  
  17. // membuat if untuk masing-masing pilihan propinsi beserta isi option untuk combobox kedua
  18.  
  19. while ($data = mysqli_fetch_array($hasil))
  20.  
  21. {
  22.  
  23. $gkom = $data['kd_gkom'];
  24. // membuat IF untuk masing-masing propinsi
  25.  
  26. echo "if (document.form1.gkom.value == \"".$gkom."\")";
  27.  
  28. echo "{";
  29.  
  30. // membuat option kota untuk masing-masing propinsi
  31.  
  32. $query2 = "SELECT * FROM komoditi WHERE kd_gkom = '$gkom'";
  33.  
  34. $hasil2 = mysqli_query($db, $query2);
  35.  
  36. $content = "document.getElementById('kom').innerHTML = \"";
  37.  
  38. while ($data2 = mysqli_fetch_array($hasil2))
  39.  
  40. //$nm_kom = substr($data2['nm_komoditi_ind'],0);
  41. {
  42. $content .= "<option value='".$data2['kd_komoditi']."'>".$data2['nm_komoditi_ind']."</option>";
  43. }
  44.  
  45. $content .= "\"";
  46.  
  47. echo $content;
  48.  
  49. echo "}\n";
  50.  
  51. }
  52.  
  53. ?>
  54.  
  55. }
  56.  
  57. </script>
Please login to answer!
  1. <?php
  2. include "../../config/koneksi.php";
  3.  
  4. $barcode =$_POST['barcode'];
  5. $tglscn =$_POST['tgl'];
  6. $user =$_POST['user'];
  7. $kndsi =$_POST['kndsi'];
  8. $tgl = substr($barcode,4,6);
  9. $tgl = date('d-m-Y', strtotime($tgl));
  10.  
  11.  
  12. $query = mysql_query("INSERT INTO scan_nrb (barcode,tgl_scan,user,kondisi) VALUES ('$barcode','$tglscn','$user','$kndsi')");
  13. if ($query)
  14. {
  15.  
  16. $query2 = mysql_query("UPDATE scan_nrb SET toko=LEFT(barcode,4),tgl='$tgl',NO=RIGHT(barcode,4) where barcode='$barcode';") or die(mysql_error());
  17. echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=../../media.php?module=reg-nrb'>";
  18. }
  19. else
  20. {
  21. echo "gagal ...";
  22. }
  23. ?>
master mau tanya dong, gimana ya caranya supaya data tgl yg ada di db menjadi tanggal indo.

contoh barcode nya TEST2811171234 yg 281117 itu adalah tanggal.
kode yg saya buat seperti di atas, terimakasih:)
Please login to answer!
Salam kenal gan, saya mau tanya saya lg coba buat ambil photo dari webcam dan juga menginput keterangan gambar, tetapi yang masuk hanya gambar kedalam database sedangkan untuk keterangan tidak masuk apa ada yg salah ya? trima kasih
Please login to answer!
salam.
mau bertanya nih . untuk konfigursi file .htaccess yang benar bagaimana yah. supaya ketika membuka web addondomain tidak jadi www.domainutama.com/addondomain.com. harusnya linknya www.addondomain.com.

code .htaccess saat ini :
  1. <IfModule mod_rewrite.c>
  2. Options -Indexes
  3. RewriteEngine on
  4. DirectoryIndex index.php
  5. RewriteCond %{HTTPS} off
  6. RewriteCond %{HTTP_HOST} !^www\. [NC]
  7. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  8. RewriteCond %{REQUEST_FILENAME} !-f
  9. RewriteCond %{REQUEST_FILENAME} !-d
  10. <IfModule mod_php5.c>
  11. RewriteRule ^(.*)$ index.php/$1 [L]
  12. </IfModule>
  13. <IfModule !mod_php5.c>
  14. RewriteRule ^(.*)$ index.php?/$1 [L]
  15. </IfModule>
  16. </IfModule>
  17. <IfModule !mod_rewrite.c>
  18. ErrorDocument 404 /index.php
  19. </IfModule>
  20.  

fungsi di atas : meredict web utama ke https://www. kasusnya sub dommain/addon domain juga ngikutin ke https & www. bagaimana ya kode yang benar ??
Terimakasih.
Please login to answer!
Selamat malam ka,
Saya mau tanya.. saya punya tabel verifikasi yang atribut nya : no_verif, id_lembaga, nphd, sptjb, cpy_buku_rekening, dok_legalitas, status.

Pas di form verifikasi nya, nphd, sptjb, cpy_buku_rekening, dok_legalitas nya saya menggunakan checkbox.
Jika checkbox nya di pilih semua, maka otomatis status nya "lolos", jika checkbox nya hanya dipilih beberapa, maka statusnya "tidak lolos".

Mohon pencerahannya ka, saya baru belajar.😉👍
Please login to answer!
User Paling Aktif Bulan Lalu

fahmi

Point Bulan Lalu: 6