<title>Tes</title>
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type='text/javascript' src="js/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery.autocomplete.css" />
<script type="text/javascript">
$(document).ready(function() {
$("#nama").autocomplete("autoCompleteMain.php", {
width: 300
});
});
</script>
</head>
<body>
<form autocomplete>
<p>
Enter Name <label>:</label>
<input name="nama" id="nama" />
<input name="alamat" id="alamat" readonly="readonly" />
</p>
<input type="submit" value="Submit" />
</form>
<?php
// Ini untuk AutoCompleteMain.php
$dbhost = 'localhost'; // Database Host
$dbuser = 'root'; // Database Username
$dbpass = ''; // Database Password
$dbname = 'dbdata'; // Database Name
$con = mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$q = $_GET['q'];
$sql = "SELECT * FROM tbpeg WHERE nama like '%$q%'";
$hasil = mysql_query($sql);
while($data = mysql_fetch_array($hasil))
{
$qnama = $data['nama'].' - '.$data['alamat'];
echo "$qnama\n";
}
<?php
session_start();
?>
<html lang="en">
<head>
<title>Update</title>
</head>
<body>
<?php
include 'koneksi.php';
$data = mysql_query("SELECT * FROM admin WHERE user = '".$_SESSION['user']."'");
$hasil = mysql_fetch_array($data);
?>
<form class="block-content form" method="post" action="http:update.php" name="myform">
<legend>Profile</legend>
<table cellpadding="3" class="table-padding">
<tr title="Required">
<td><b>Full name</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="nama" id="nama" validation="isNotEmpty" title="nama" style="width:300px" value="<?php echo $hasil['nama']; ?>" /></td>
</tr>
<tr title="Required">
<td><b>Telephone</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="telephone" id="telephone" validation="isNotEmpty,isEmail" title="Email" style="width:300px;" value="<?php echo $hasil['telephone']; ?>" /></td>
</tr>
<tr title="Required">
<td><b>Status</b><span class="required">*</span></td>
<td>:</td>
<td><input type="text" name="status" validation="isNotEmpty,isEmail" title="Email" style="width:300px;" value="<?php echo $hasil['status']; ?>" readonly=""/></td>
</tr>
</table>
</div>
</div>
</form>
<?php
session_start();
include 'koneksi.php';
$arrayCurrentPath = explode('?',$_SERVER['REQUEST_URI']);
$url = substr($arrayCurrentPath[0], strlen(BASE_URL));
$dataurl = mysql_fetch_array(mysql_query("select * from aksi where url='".$url."'"));
$akses = mysql_query("select * from tipe_user_aksi where id_aksi='".$dataurl['id']."' and id_user='".$_SESSION['user']."'");
if(mysql_num_rows($akses) <= 0){
echo 'Forbidden';
exit;
}
?>
<?php
$data = mysql_query("SELECT * FROM user WHERE user = '$akses['user']'");
$hasil = mysql_fetch_array($data);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>English Lesson Of Grammar</title>
<link href="css/rheyank_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js">
/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
ddsmoothmenu.init({
mainmenuid: "menu", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script>
<style type="text/css">
<!--
.style1 {color: #75a62c}
.style2 {
color: #333;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div id="body">
<div id="header"></div>
<!-- end of header -->
<div id="menu" class="ddsmoothmenu"></div>
<!-- end of menu -->
<div id="main">
<h2>Masukan Data Diri Anda !!! </h2>
<div class="col_2 float_l">
<br class="cleaner h20" />
<div id="data_form">
<form action="simpansiswa.php" method="post" NAME="input">
<label for="id">ID</label> <input type="text" id="id" name="id" class="input" />
<div class="cleaner h10"></div>
<label for="nama">Nama</label> <input type="text" id="nama" name="nama" class="input" />
<div class="cleaner h10"></div>
<label for="kelas">Kelas</label> <input type="text" id="kelas" name="kelas" class="input" />
<div class="cleaner h10"></div>
<label for="alamat">Alamat</label> <input type="text" id="alamat" name="alamat" class="input" />
<div class="cleaner h10"></div>
<label for="username">Username</label> <input type="text" id="username" name="username" class="input" />
<div class="cleaner h10"></div>
<label for="password">Password</label> <input type="password" id="password" name="password" class="input" />
<div class="cleaner h10"></div>
<input type="submit" value="Daftar" id="submit" name="submit" class="submit_btn float_l" />
<input type="reset" value="Reset" id="reset" name="reset" class="submit_btn float_r" />
</form>
</div>
</div>
<div class="col_2 float_l">
<h4 class="style1">Petunjuk ..</h4>
<p align="justify">Sebelum anda mengakses Aplikasi ini, Anda diharuskan untuk mengisi data diri anda pada form yang ada disebelah kiri tersebut. Setelah itu tekan <span class="style2">"Daftar"</span>. Maka anda akan dapat mengakses aplikasi ini dengan bebas kapanpun. </p>
<p align="justify">Jika anda sudah terdaftar, silakan <span class="style2">"Login"</span> untuk mengakses aplikasi ini.</p>
<p align="justify">terdapat materi yang dapat dibaca, dan didownload. Terdapat juga soal latihan untuk mengukur kemampuan anda mengenai materi grammar. </p>
<p align="justify">Selamat mencoba !!! </p>
<div class="cleaner h10"></div>
<form method="post" action="login.php">
<table width="329" height="198" border="0" align="center" background="backgroud.png">
<tr>
<th width="24" rowspan="3" scope="row"> </th>
<th height="35%" colspan="3" scope="row"> </th>
<td width="22" rowspan="3"> </td>
</tr>
<tr>
<th width="85" height="45" scope="row"> <div align="left">Username</div></th>
<td width="15">:</td>
<td width="161">
<input type="text" name="username" /> </td>
</tr>
<tr>
<th height="47" scope="row"><div align="left">Password</div></th>
<td>:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<th height="45" colspan="5" scope="row">
<input type="submit" name="Submit" value="Login" />
<input name="reset" type="reset" value="Reset" /></th>
</tr>
<tr>
<th height="27" colspan="5" scope="row"> </th>
</tr>
</table>
</form>
<a href="#" class="more">Lanjut</a>
</div>
<br class="cleaner" />
</div> <!-- end of main -->
<div id="footer"></div>
<div class="cleaner"></div>
</div> <!-- end of footer -->
<div id="cr_bar_wrapper">
<div id="cr_bar">
Copyright © 2013 Designed by <a href="http://www.facebook.com/rheyank.iwan">Rheyank Iwan</a> </div>
</div>
</body>
</html>
<?
//Cek Tombol
if ($_POST){
//Kirimkan Variabel
$id = $_POST['id'];
$nama = $_POST['nama'];
$kelas = $_POST['kelas'];
$alamat = $_POST['alamat'];
$username = $_POST['username'];
$password = $_POST['password'];
//validasi data jika pesan kosong
if (empty($_POST['id'])|| empty($_POST['nama'])|| empty($_POST['kelas'])|| empty($_POST['alamat'])|| empty($_POST['username'])|| empty($_POST['password']))
{
?>
<script language="JavaScript">
alert('Data Harap Dilengkapi');
document.location='inputsiswa.php';
</script>
<?
}
//Jika Validasi Terpenuhi
else
{
//Memanggil File Koneksi Database
mysql_connect("localhost", "root", "12345");
mysql_select_db("english");
//Masukan data ke Table user
$query ="INSERT INTO user VALUES('$id','$nama','$kelas','$alamat','$username','$password')";
$hasil = mysql_query($query);
if($hasil){
//Jika Sukses
//echo "Data telah diinput";
?>
<script language="JavaScript">
alert('Data Berhasil diinput');
document.location='index.php';
</script>
<?
}
else
{
//Jika Gagal
//echo "Data gagal diinput, Silakan Ulangi";
}
}
}
?>
<script language="JavaScript">
alert('Data Gagal diinput,, Silakan ulangi');
document.location='inputsiswa.php';
</script>
<style type="text/css" media="all">
/*
* Splitter container. Set this to the desired width and height
* of the combined left and right panes.
*/
#MySplitter {
height: 300px;
width: 600px;
border: 4px solid #cca;
/* No padding allowed */
}
/*
* Top element of the splitter. Use pixel units for the
* min-height and max-height; the splitter plugin parses them to
* determine the splitter movement limits. Set the height to
* the desired initial height of the element; the plugin changes
* the height of this element dynamically.
*/
#TopPane {
background: #6C91C0;
overflow: auto;
/* Initial/min/max height for this pane */
height: 20px;
min-height: 10px;
max-height: 150px;
/* No margin or border allowed */
}
#MidPane {
background: #CDCDCD;
overflow: auto;
/* Initial/min/max height for this pane */
height: 120px;
min-height: 10px;
max-height: 150px;
/* No margin or border allowed */
}
/*
* Bottom element of the splitter; the plugin changes the top
* position and height of this element dynamically.
*/
#BottomPane {
background: #ffd;
overflow: auto;
height: 400px;
min-height: 10px;
max-height: 400px;
/* No margin or border allowed */
}
#FooterPane {
background: #6C91C0;
overflow: auto;
/* Initial/min/max height for this pane */
height: 300px;
min-height: 10px;
max-height: 150px;
/* No margin or border allowed */
}
/*
* Splitter bar style; the .active class is added when the
* mouse is over the splitter or the splitter is focused
* via the keyboard taborder or an accessKey.
*/
#MySplitter .hsplitbar {
height: 6px;
background: #cca url(hgrabber.gif) no-repeat center;
/* No margin, border, or padding allowed */
}
#MySplitter .hsplitbar.active, #MySplitter .hsplitbar:hover {
background: #e88 url(hgrabber.gif) no-repeat center;
}
</style>
<script type="text/javascript">
$().ready(function() {
$("#MySplitter").splitter({
type: "h",
sizeTop: true, /* use height set in stylesheet */
accessKey: "P"
});
});
</script>
<?php
include 'lib/koneksi.php';
$mysql = mysql_connect($dbconf['host'],$dbconf['dbuser'],$dbconf['dbpass']);
$link = mysql_select_db($dbconf['dbname'],$mysql);
$dbnya =$dbconf['dbname'];
$koneksi = new mysqli($dbconf['host'],$dbconf['dbuser'],$dbconf['dbpass'],$dbconf['dbname']);
$namatabeltemp = 'temppembelian';
?>
<h1>Transaksi Pembelian</h1>
<div id="TopPane">
</div>
<div id="MidPane">
[b]<?php[/b]
[b]if ($_POST['kode']) {[/b]
[b] $kode = $_POST['kode'];[/b]
[b] $sqlsearch = "SELECT tbarang.id_barang, tbarang.nama_barang, tstock.harga_beli FROM tbarang, tstock WHERE tbarang.kode_barang=".$kode." AND tstock.id_barang=tbarang.id_barang";[/b]
[b] $query = $koneksi->query($sqlsearch);[/b]
[b] if ($query) {[/b]
[b] $data=$query->fetch_array(MYSQL_ASSOC);[/b]
[b] $nama=$data['nama_barang'];[/b]
[b] $harga=$data['harga_beli'];[/b]
[b] $id=$data['id_barang'];[/b]
[b] $stat='';[/b]
[b] }[/b]
[b]} else {[/b]
[b] $nama='';[/b]
[b] $harga='';[/b]
[b] $kode='';[/b]
[b] $stat='disabled';[/b]
[b]}[/b]
[b]?>[/b]
[b]<table style="margin:10px 10px;">[/b]
[b] <tr>[/b]
[b] <td width="300px">[/b]
[b] <form method="POST" action="<?php $_SERVER['PHP_SELF'].'?hal=pembelian'?>" >[/b]
[b] <label>Kode</label><input type="text" name="kode" value="<?php echo $kode; ?>"><br>[/b]
[b] <label>Nama</label><input type="text" name="nama" value="<?php echo $nama; ?>" disabled ><br>[/b]
[b] <label>Harga Beli</label><input type="text" name="harga" value="<?php echo $harga; ?>" disabled ><br>[/b]
[b] </form>[/b]
</td>
<td valign="top" width="100px">
<a href="./page/transaksi/pembelian/ref.php?width=500&height=500" class="thickbox">Referensi</a>
</td>
<td>
<form method="POST" action="<?php $_SERVER['PHP_SELF'].'?hal=pembelian'?>" >
<label>Diskon</label><input type="text" name="diskon" value="0"><br>
<label>QTY</label><input type="text" name="qty" value="0"><br>
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="hidden" name="codes" value="<?php echo $kode; ?>">
<input type="hidden" name="harganya" value="<?php echo $harga; ?>">
<input type="submit" name="insert" value="insert" <?php echo $stat; ?>>
</form>
</td>
</tr>
</table>
</div>
<div id="BottomPane">
<p>
<div style="margin:10px">
<?php
$kode = $_POST['codes'];
$nama = $_POST['id'];
$diskon = $_POST['diskon'];
$qty = $_POST['qty'];
$harganya = $_POST['harganya'];
if ($diskon=='0' OR $diskon==null ) {
$jumlah = $harganya * $qty;
}else{
$jumlah = ($harganya * $qty )-$diskon;
}
function cektabel($tablename) {
GLOBAL $dbnya;
$result = mysql_list_tables($dbnya);
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
if(mysql_tablename($result, $i) == $tablename) {
return true;
break;
}
}
return false;
}
if(cektabel($namatabeltemp)){
$allowsave ='';
} else {
$allowsave ='disabled';
}
if ($_POST['insert']) {
if ($qty == '0' OR $qty == null) {
?>
<script language="javascript">
alert("Nilai QTY Tidak sesuai");
</script>
<script language="javascript" src="./lib/js/jquery.js"></script>
<script language="javascript" src="./lib/js/thickbox.js"></script>
<link href="./themes/thickbox.css" rel="stylesheet" type="text/css" />
<?php
}else{
$sqlinsert = "insert into ".$namatabeltemp." (nama_barang,diskon,qty,jumlah) VALUES ('".$nama."','".$diskon."','".$qty."','".$jumlah."')";
if (cektabel($namatabeltemp)) {
$queryinsert = mysql_query($sqlinsert);
}else{
$sqltmp = "CREATE TABLE ".$namatabeltemp."
(
id_temp INT(15) UNSIGNED NOT NULL auto_increment,
nama_barang VARCHAR(100) NOT NULL,
diskon INT(10) NOT NULL,
qty INT(10) NOT NULL,
jumlah INT(250) NOT NULL,
PRIMARY KEY(id_temp)
)";
$querytemp = mysql_query($sqltmp);
if ($querytemp) {
$queryinsert = mysql_query($sqlinsert);
$allowsave ='';
}
}
}
} else {
?>
<script language="javascript" src="./lib/js/jquery.js"></script>
<script language="javascript" src="./lib/js/thickbox.js"></script>
<link href="./themes/thickbox.css" rel="stylesheet" type="text/css" />
<?php
}
//VIEW DATA
$sqlview = "SELECT ".$namatabeltemp.".id_temp, tbarang.kode_barang, tbarang.nama_barang,tstock.harga_beli, ".$namatabeltemp.".diskon,
".$namatabeltemp.".qty,".$namatabeltemp.".jumlah FROM ".$namatabeltemp.",tbarang,tstock WHERE tbarang.id_barang=".$namatabeltemp.".nama_barang AND tstock.id_barang=".$namatabeltemp.".nama_barang";
$link = new mysqli($dbconf['host'],$dbconf['dbuser'],$dbconf['dbpass'],$dbconf['dbname']);
$self = $_SERVER['PHP_SELF'].'?hal=pendapatanlain';
$delete = '//page/transaksi/pembelian/deltemp.php';
$update = array('url'=>'page/transaksi/pembelian/updatetemp.php','lebar'=>'500','tinggi'=>'520');
$pg = new paginasi($link,$sqlview,$self,300,3);
$paging = $pg->paging();
$list = new generatorTable($paging,$update,$delete);
$list->showTable();
$pg->showPaging();
if(cektabel($namatabeltemp)){
$sqljumlah = "SELECT SUM(jumlah) as 'jumlahnya', SUM(diskon) as 'diskonnya' FROM ".$namatabeltemp." ";
$qjumlah = $koneksi->query($sqljumlah)->fetch_array(MYSQL_ASSOC);
echo 'Jumlah Diskon :<b>'.$qjumlah['diskonnya'].'</b>, Jumlah Nilai Pembelian:<b>'.$qjumlah['jumlahnya'].'</b>';
}
?>
</div>
</p>
</div>
<div id="FooterPane">
<!-- CRAZY -->
<div>
<form method="POST" action="./page/transaksi/pembelian/action.php">
<table cellspacing="10px">
<tr>
<td width="290px"><b><label>Nomor Bukti</label></b>
<input type="text" name="no_bukti"><br>
</td>
<td><b>Tanggal</b>
<select name="tgl">
<option selected value="<?php echo date(d) ?>"><?php echo date(d) ?></option>
<?php for($i=1;$i<=31;$i++) {
echo "<option value='".$i."'>".$i."</option>";
}
?>
</select>
<b>Bulan</b>
<select name="bulan">
<option selected value="<?php echo date('m') ?>"><?php echo date('m') ?></option>
<?php for($b=1;$b<=12;$b++) {
echo "<option value='".$b."'>".$b."</option>";
}
?>
</select>
<b>Tahun</b>
<select name="tahun">
<option selected value="<?php echo date('Y') ?>"><?php echo date('Y') ?></option>
<?php for($t=2000;$t<=2030;$t++) {
echo "<option value='".$t."'>".$t."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>
<b><label>Nama Supplier</label></b>
<select name="supplier">
<option selected value="">-SEMUA-</option>
<?php
$sql1 = "SELECT * FROM tsupplier";
$query1 = $koneksi->query($sql1);
while ($row = $query1->fetch_array(MYSQL_ASSOC)) {
echo '<option value="'.$row['id_supplier'].'">'.$row['nama_supplier'].'</option>';
}
?>
</select>
</td>
<td>
<b><label>Nomor Nota</label></b>
<input type="text" name="no_nota"><br>
</td>
</tr>
</table>
<div style="margin-left:10px;">
<input type="submit" name="simpan" value="simpan" <?php echo $allowsave; ?>>
<input type=hidden name="tabel" value="<?php echo $namatabeltemp ?>">
<input type=hidden name="id" value="<?php echo $nama ?>">
<input type=hidden name="diskonnya" value="<?php echo $qjumlah['diskonnya'] ?>">
<input type=submit name="reset" value="Reset" <?php echo $allowsave; ?>>
</div>
</form>
</div>
<!-- CRAZY -->
<div class="footermenu">
<ul>
<li><a href="#"style=" border: 1px solid #666666; background-color:#000 ">PDF</a></li>
<li><a href="index.php"style=" border: 1px solid #666666; background-color:#000 ">Tutup</a></li>
</ul>
</div>
</div>
<?php
if ($_POST['kode']) {
$kode = $_POST['kode'];
$sqlsearch = "SELECT tbarang.id_barang, tbarang.nama_barang, tstock.harga_beli FROM tbarang, tstock WHERE tbarang.kode_barang=".$kode." AND tstock.id_barang=tbarang.id_barang";
$query = $koneksi->query($sqlsearch);
if ($query) {
$data=$query->fetch_array(MYSQL_ASSOC);
$nama=$data['nama_barang'];
$harga=$data['harga_beli'];
$id=$data['id_barang'];
$stat='';
}
} else {
$nama='';
$harga='';
$kode='';
$stat='disabled';
}
?>
<table style="margin:10px 10px;">
<tr>
<td width="300px">
<form method="POST" action="<?php $_SERVER['PHP_SELF'].'?hal=pembelian'?>" >
<label>Kode</label><input type="text" name="kode" value="<?php echo $kode; ?>"><br>
<label>Nama</label><input type="text" name="nama" value="<?php echo $nama; ?>" disabled ><br>
<label>Harga Beli</label><input type="text" name="harga" value="<?php echo $harga; ?>" disabled ><br>
</form>
</td>
<td valign="top" width="100px">
<a href="./page/transaksi/pembelian/ref.php?width=500&height=500" class="thickbox">Referensi</a>
</td>
<td>
<form method="POST" action="<?php $_SERVER['PHP_SELF'].'?hal=pembelian'?>" >
<label>Diskon</label><input type="text" name="diskon" value="0"><br>
<label>QTY</label><input type="text" name="qty" value="0"><br>
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="hidden" name="codes" value="<?php echo $kode; ?>">
<input type="hidden" name="harganya" value="<?php echo $harga; ?>">
<input type="submit" name="insert" value="insert" <?php echo $stat; ?>>
</form>
</td>
</tr>
</table>