include "koneksi_detik.php";
$login=mysql_query("select * from reporter where user='$dinul' and pass='$furqon' ");
$data=mysql_fetch_array($login);
//apabila benar
if(!empty($data["user"]==$dinul) && !empty($data["pass"]==$furqon))
{
session_start();
var_dump($_SESSION);
//daftar variabel user dan pass
session_register("mouse");
session_register("keyboard");
//nilai user dan pass
$_SESSION["mouse"]=$data["user"];
$_SESSION["keyboard"]=$data["pass"];
header("location:form_berita.php");
// echo "Nama Kamu adalah : $mouse <br> Password kamu adalah : $keyboard ";
}
else {
echo "Gagal! username&password tidak benar<br>
<a href='form_login.php'>Ke Halaman Utama</a>"; }
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
function combo(){
include"koneksi.php";
$result = mysql_query("select * from barang");
$jsArray = "var prdName = new Array();\n";
echo '<tr><td><select name="prdId[0]" onchange="changeValue(this.value)">';
echo '<option>-------</option>';
while ($row = mysql_fetch_array($result)) {
echo '<option value="' . $row['0'] . '">' . $row['0'] . '</option>';
$jsArray .= "prdName['" . $row['0'] . "'] = {name:'" . addslashes($row[1]) . "',desc:'".addslashes($row['2'])."'};\n";
}
echo '</select></td>';
?>
<td><input type="text" name="prod_name" id="prd_name"/></td>
<td><input type="text" name="prod_desc" id="prd_desc"/></td></tr>
<script type="text/javascript">
<?php echo $jsArray; ?>
<? echo" function changeValue(id){
document.getElementById('prd_name').value = prdName[id].name;
document.getElementById('prd_desc').value = prdName[id].desc;
};
</script>";
}
?>
<?
include"koneksi.php";
$query = "SELECT max(no_pembelian) AS akhir FROM detailpembelian WHERE no_pembelian like'$no%'";
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
$lastNo = $data['akhir'];
// baca nomor urut transaksi dari id transaksi terakhir
$lastNoUrut = substr($lastNo,6,1);
// nomor urut ditambah 1
$nextNoUrut = $lastNoUrut + 1;
// membuat format nomor transaksi berikutnya
$nextNo = TB."-".sprintf('%04s', $nextNoUrut);
echo"<form action=simpanpembelian.php method=post>
<table>
<tr><td>No Pembelian : <input type=text name=nop><input type =button value ='Auto No' onClick =this.form.nop.value='$nextNo'></td></tr>";?>
<?php
$result = mysql_query("select * from supplier");
$jsArray = "var nama_sup = new Array();\n";
echo '<tr><td><select name="kode_sup[0]" onchange="document.getElementById(\'name_sup\').value = nama_sup [this.value]">';
echo '<option>-------</option>';
while ($row = mysql_fetch_array($result)) {
echo '<option value="' . $row[0] . '">' . $row[0] . '</option>';
$jsArray .= "nama_sup ['" . $row[0] . "'] = '" . addslashes($row[1]) . "';\n";
}
echo '</select></td>';
?>
<td><input type="text" name="nama_supplier" id="name_sup"/></td>
<?echo combo();
?>
<script type="text/javascript">
<?php echo $jsArray;
?>
</script><td><button type="button" class="del">Del</button></td>
</tr>
<tr id="last">
<td colspan="4" align="right"><button type="button" id="addRow">Add</button></td>
</tr>
</table>
<input type="submit" value="Simpan"/>
</form>
<?php
include"koneksi.php";
//mengambil kode barang yang ada di database
$kode = mysql_query("SELECT *FROM barang");
while($p=mysql_fetch_array($kode)){
echo "<option value=$p[1]>$p[1]</option>";
$h=$p[0];
}
?>
</select>
<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
var i = 1;
$(function(){
$("#addRow").click(function(){
row = '<tr>'+
'<td></td>'+
'<td><button type="button" class="del">Del</button></td>'+
'</tr>';
$(row).insertBefore("#last");
i++;
});
});
$(".del").live('click', function(){
$(this).parent().parent().remove();
});
</script>
</body>
</html>
terima kasih sebelum'a... <form name=bk method=post action=?hasil=tabel/b_keluar/input_bkeluar>
<table>
<tr><td>Jumlah Item</td><td> : <input type=text name=Jmlitem size=5 readonly='true' value=$tot><td>Total</td><td> : <input type='text' name='Total' readonly='true' value=$Total></td>
<input type=hidden name=NoJual readonly='NoJual' id=NoJual value='$newIDB'>
<input type=hidden name=TglKlr value='$TglKlr'></td></tr>
<tr><td>Quantity</td> <td> : <input type='text' name='Quantity' size='5' readonly='true' value=" . ($r['jml']) . "></td>
<td>Bayar</td> <td> : <input type='text' name='Bayar' onkeyup='jml3()'></td></tr>
<tr><td>Total Harga</td><td> : <input type='text' name='TotalHarga' readonly='true' value=" . ($t['uang']) . "></td>
<td>Kembali</td> <td> : <input type='text' name='Kembali' value=$Kembali></td></tr>
<tr><td>Jenis Perbaikan</td><td> : <select name=jasa onclick=\"document.getElementById('Biaya').value =prdB[this.value]\">;
<option value=0 selected>- Jenis Pekerjaan -</option>";
$result=mysql_query("SELECT * FROM jasa ORDER BY IdJasa");
$jjArray = "var prdB = new Array();\n";
while ($row = mysql_fetch_array($result)) {
echo '<option value="' . $row['IdJasa'] . '">' . $row['NmJasa'] . '</option>';
$jjArray .= "prdB['" . $row['IdJasa'] . "'] = '" . addslashes($row['Biaya']) . "';\n";
}
echo "</select></td></tr>
<tr><td>Biaya Perbaikan</td> <td> : <input type='text' name=\"Biaya\" id=\"Biaya\" onmousemove='jml2()'></td></tr>
</tr>
</tr>
</tr>
<tr><td colspan=3>
<input type=submit value=SIMPAN>
<input type=button value=KELUAR onclick=JavaScript:timedRedirect()>
</tr>
</table>
</form>
jadi setelah klik tombol simpan muncul popup preview laporannya mas.. itu gmn caranya ya mas..??? mohon bantuannya mas... <?php
session_start();
//mastiin bahwa variabel session username dan password terdaftar di server
if (!empty($_SESSION["$mouse"]) and !empty($_SESSION["$keyboard"]))
{
echo "<h1>Input Berita</h1>
<form action='input_berita.php' method='post'>
<table align='center' border='0' >
<tr>
<td>Judul</td>
<td>: <input type='text' size='60' name='judul_berita'></td>
</tr>
<tr>
<td>katagori</td>
<td>: <select name='no_katagori'>
<option value=0 selected>--Pilih Katagori--";
include "koneksi_detik.php";
$tampil=mysql_query("select * from katagori order by nama_katagori");
while ($data=mysql_fetch_array($tampil))
{
echo "<option value=$data[no_katagori]>$data[nama_katagori]";
}
echo "</option></select></td>
</tr>
<tr>
<td>Headline Berita</td>
<td>: <textarea name='headline_berita' cols='60' rows='5'> </textarea></td>
</tr>
<tr>
<td>Isi Berita</td>
<td>: <textarea name='isi_berita' cols='60' rows='10'></textarea></td>
</tr>
<tr>
<td><input type='submit' value='Kirim'></td>\
</tr>
</form>";
}
else {
echo "untuk si berita,anda harus login<br>
<a href='form_login.php'>Login</a>"; }
?>