<script language='javascript'>
function showKom()
{
<?php
include"config.php";
// membaca semua propinsi
$query = "SELECT * FROM gkom";
$hasil = mysqli_query($db, $query);
// membuat if untuk masing-masing pilihan propinsi beserta isi option untuk combobox kedua
while ($data = mysqli_fetch_array($hasil))
{
$gkom = $data['kd_gkom'];
// membuat IF untuk masing-masing propinsi
echo "if (document.form1.gkom.value == \"".$gkom."\")";
echo "{";
// membuat option kota untuk masing-masing propinsi
$query2 = "SELECT * FROM komoditi WHERE kd_gkom = '$gkom'";
$hasil2 = mysqli_query($db, $query2);
$content = "document.getElementById('kom').innerHTML = \"";
while ($data2 = mysqli_fetch_array($hasil2))
//$nm_kom = substr($data2['nm_komoditi_ind'],0);
{
$content .= "<option value='".$data2['kd_komoditi']."'>".$data2['nm_komoditi_ind']."</option>";
}
$content .= "\"";
echo $content;
echo "}\n";
}
?>
}
</script>
<?php
include "../../config/koneksi.php";
$barcode =$_POST['barcode'];
$tglscn =$_POST['tgl'];
$user =$_POST['user'];
$kndsi =$_POST['kndsi'];
$tgl = substr($barcode,4,6);
$tgl = date('d-m-Y', strtotime($tgl));
$query = mysql_query("INSERT INTO scan_nrb (barcode,tgl_scan,user,kondisi) VALUES ('$barcode','$tglscn','$user','$kndsi')");
if ($query)
{
$query2 = mysql_query("UPDATE scan_nrb SET toko=LEFT(barcode,4),tgl='$tgl',NO=RIGHT(barcode,4) where barcode='$barcode';") or die(mysql_error());
echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=../../media.php?module=reg-nrb'>";
}
else
{
echo "gagal ...";
}
?>
master mau tanya dong, gimana ya caranya supaya data tgl yg ada di db menjadi tanggal indo.<IfModule mod_rewrite.c>
Options -Indexes
RewriteEngine on
DirectoryIndex index.php
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>