<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();
include('config/koneksi.php');
$pass=$_POST['password'];
$userid =$_POST['userid'];
$nama =$_POST['nama'];
$email =$_POST['email'];
$email =$_POST['userid'];
$level =$_POST['level'];
$notelpadm =$_POST['notelpadm'];
$admin="admin";
$user="user";
$sql="select * from tbuser where userid='$userid'";
$perintah=mysql_query($sql);
$hasil=mysql_fetch_array($perintah);
if($hasil==false)
{
echo ("<script language=\"javascript\">
alert(\"masukkan userid dengan benar\");
window.history.back();
</script>");
}
elseif($hasil['password']!=$_POST['password'])
{
echo ("<script language=\"javascript\">
alert(\"masukkan password dengan benar\");
window.history.back();
</script>");
}
elseif($hasil['level']!=$_POST['level'])
{
echo ("<script language=\"javascript\">
alert(\"level anda tidak sesuai\");
window.history.back();
</script>");
}
elseif($hasil==true and $hasil['password']==$pass and $hasil['level']==$admin)
{
$_SESSION['adminid']=$hasil['userid'];
header("location:home_admin.php");
}
elseif($hasil==true and $hasil['password']==$pass and $hasil['level']==$user)
{
$_SESSION['userid']=$hasil['userid'];
header("location:home_kasir.php");
}
?>
dan tabel untuk menampilkan user seperti ini=<?php
$userid = $_POST['userid'];
if(!isset($_SESSION['adminid'])){
die("Anda belum login");//jika belum login jangan lanjut..
}
include('config/koneksi.php');
?>
<table width="164" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="164">
<form action="?hasil=tabel/adm/form_user" method="post">
<input type="submit" value="TAMBAH USER">
</form>
</td>
</tr>
</table>
<div style="width:680; height:350;" align="center">
<?php
echo "
<table width=\"100%\" border='1' cellpadding='0' cellspacing='0'>
<tr>
<td colspan=7><b>MANAJEMEN USER</b></td>
<tr>
<tr bgcolor=#f4eef4>
<th>no</th>
<th>userid</th>
<th>nama</th>
<th>email</th>
<th>level</th>
<th>aksi</th>
</tr>";
$tampil=mysql_query("select * from tbuser where userid='$userid'");
$no=1;
//$pass=md5($_POST[password]);
while ($r=mysql_fetch_array($tampil)){
echo "<tr><td align='center'>$no</td>
<td align='center'>$r[userid]</td>
<td align='center'>$r[nama]</td>
<td align='center' width=160><a href=mailto:$r[email]>$r[email]</a></td>
<td align='center'>$r[level]</td>
<td align='center' width=80>
<a href=?hasil=tabel/adm/edit_user&id=$r[userid]>Edit</a> |
<a href=?hasil=tabel/adm/hapus_user&id=$r[userid]>hapus</a></td>
</tr>";
$no++;
}
echo "
</table>";
?>
</div>
pertanyaan saya, gimana caranya supaya ketika login, pada tabel tampil login tersebut keluarnya sesuai ID dan password ketika login.. itu gmn mas...?apa di proses login di kasih session register/gimana mas....??? <?php
session_start();
include('config/koneksi.php');
$pass=$_POST['password'];
$userid =$_POST['userid'];
$nama =$_POST['nama'];
$email =$_POST['email'];
$email =$_POST['userid'];
$level =$_POST['level'];
$notelpadm =$_POST['notelpadm'];
$admin="admin";
$user="user";
$sql="select * from tbuser where userid='$userid'";
$perintah=mysql_query($sql);
$hasil=mysql_fetch_array($perintah);
if($hasil==false)
{
echo ("<script language=\"javascript\">
alert(\"masukkan userid dengan benar\");
window.history.back();
</script>");
}
elseif($hasil['password']!=$_POST['password'])
{
echo ("<script language=\"javascript\">
alert(\"masukkan password dengan benar\");
window.history.back();
</script>");
}
elseif($hasil['level']!=$_POST['level'])
{
echo ("<script language=\"javascript\">
alert(\"level anda tidak sesuai\");
window.history.back();
</script>");
}
elseif($hasil==true and $hasil['password']==$pass and $hasil['level']==$admin)
{
$_SESSION['adminid']=$hasil['userid'];
header("location:home_admin.php");
}
elseif($hasil==true and $hasil['password']==$pass and $hasil['level']==$user)
{
$_SESSION['userid']=$hasil['userid'];
header("location:home_kasir.php");
}
?>
<?
ob_start();
include "include/koneksi.php";
$un=$_POST['un'];
$pw=$_POST['pw'];
$go=$_POST['go'];
$type=$_COOKIE['type'];
$sel=$_GET['sel'];
$query="SELECT password,type FROM user WHERE username='".$un."';";
$hasil=mysql_query($query,$con);
$password=mysql_fetch_array($hasil);
$ty=$password[1];
if ($un&&$go){
if ($password[0]==$pw){
$expire=time()+3600;
setcookie("user",$un, $expire);
setcookie("log", true, $expire);
setcookie("type",$ty, $expire);
header('Refresh: 0.2; URL=index_'.($ty == 'ADMIN' ? 'admin' : 'user').'.php');
}
}
$p=$_GET['p'];
?>