<script language="JavaScript" type="text/JavaScript" src='jquery.js'>
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<?php
//melakukan koneksi ke database
include('koneksi.php');
?>
<title>Tamu</title><body>
<form id="Form1" name="Form1" method="post" action="simpantamu.php">
<p align="justify"> </p>
<div align="justify">
<table width="557" height="369" border="0" align="center" bordercolor="#6699CC" bgcolor="#FF0000">
<tr bordercolor="#00CC66" bgcolor="#00CC66">
<td height="63"><font color="#FFFF66"> </font></td>
<td rowspan="2" bordercolor="#999999" bgcolor="#A4A4A4"><font color="#FFFF66" size="+2" face="Algerian"><img src="../images/Logo.png"width="189" height="66"></font></td>
<td rowspan="2"><div align="center"><font color="#FFFF66"><a href="User/indexa.php"><font size="+2" face="Algerian">MENU
UTAMA</font></a></font></div>
<div align="center"><a href="User/indexa.php"></a></div>
<div align="center"></div></td>
</tr>
<tr>
<td width="17" rowspan="10" bgcolor="#00FF00">
<div align="center"></div>
<div align="left">
<?php include('kalenderjadi.php')?>
</div></td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="26" bordercolor="#FFFFFF">Nomor Ktp</td>
<td bordercolor="#FFFFFF"><input name="ktp" type="text" id="ktp" size="16" maxlength="16"></td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="28" bordercolor="#FFFFFF"><font color="#000000">Nama Tamu</font></td>
<td bordercolor="#FFFFFF"><div align="left">
<input name="nama" type="text" id="nama" size="30" maxlength="30">
</div></td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td width="190" height="28" bordercolor="#FFFFFF"><font color="#000000">Nomor/Jenis
Kamar</font></td>
<td width="328" bordercolor="#FFFFFF"> <div align="left">
<select name="no" size="1" id="select3">
<?php
for ($i=1;$i<=31;$i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
<select name="kamar" id="select">
<?php
$baris=mysql_query("select * from fasilitas where kamar='$kamar'");
$hasil=mysql_fetch_array($baris);
if (!empty($kamar))
{
echo "<option value='$hasil[kamar]'>$hasil[$harga]</option>";
}
else
{
echo "<option value=''></option>";
$xkamar=mysql_query('select * from fasilitas order by kamar') or die ("mysql salah");
while ($kamar=mysql_fetch_array($xkamar))
{
echo "<option value='$kamar[kamar]'>$harga[harga]$kamar[kamar]</option>";
}
}
?>
</select>
</div></td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="28" bordercolor="#FFFFFF"><font color="#000000">Chek In</font></td>
<td bordercolor="#FFFFFF"> <div align="left">
<select name="tgl" size="1" id="tgl">
<?php
for ($i=1;$i<=31;$i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
<select name="bln" id="select2">
<option value="01">January</option>
<option value="02">Februari</option>
<option value="03">Maret</option>
<option value="04">April</option>
<option value="05">Mei</option>
<option value="06">Juni</option>
<option value="07">Juli</option>
<option value="08">Agustus</option>
<option value="09">September</option>
<option value="10">Oktober`</option>
<option value="11">November</option>
<option value="12">Desember</option>
</select>
<select name="thn" id="select4">
<?php
$tahun=date("Y");
for ($thn=1960; $thn<=$tahun; $thn++)
{
echo "<option value=$thn selected>$thn</option>";
}
?>
</select>
<a href="tani_maju/index2.php"><strong> </strong></a></div></td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="26" bordercolor="#FFFFFF"><font color="#000000">Chek Out</font></td>
<td bordercolor="#FFFFFF"><div align="left">
<select name="select" size="1" id="select7">
<?php
for ($i=1;$i<=31;$i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
<select name="select" id="select8">
<option value="01">January</option>
<option value="02">Februari</option>
<option value="03">Maret</option>
<option value="04">April</option>
<option value="05">Mei</option>
<option value="06">Juni</option>
<option value="07">Juli</option>
<option value="08">Agustus</option>
<option value="09">September</option>
<option value="10">Oktober`</option>
<option value="11">November</option>
<option value="12">Desember</option>
</select>
<select name="select" id="select9">
<?php
$tahun=date("Y");
for ($thn=1960; $thn<=$tahun; $thn++)
{
echo "<option value=$thn selected>$thn</option>";
}
?>
</select>
<a href="tani_maju/index2.php"><strong> </strong></a></div></td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="28" bordercolor="#FFFFFF">Harga Kamar/ Hari</td>
<td bordercolor="#FFFFFF">
<input name="harga" type="text" id="harga3" maxlength="10"> </td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="28" bordercolor="#FFFFFF">Lama Inap</td>
<td bordercolor="#FFFFFF"> <input name="lama" type="text" id="lama3" size="5" maxlength="2">
Hari
<input name="hitung" type="button" id="hitung" onClick="hitung()" value="hitung"/>
</td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="28" bordercolor="#FFFFFF">Total Pembayaran</td>
<td bordercolor="#FFFFFF"><input name="total" type="text" id="total2" maxlength="10">
</td>
</tr>
<tr bordercolor="#FF0000" bgcolor="#FF0000">
<td height="28" bordercolor="#FFFFFF"><font color="#FFFFFF">
<input type="submit" name="submit" value="Proses" />
<input name="BATAL" type="reset" id="BATAL" value="Batal" />
</font></td>
<td bordercolor="#FFFFFF"><div align="left"> </div></td>
</tr>
<tr bordercolor="#00CC66" bgcolor="#00CC66">
<td height="26" colspan="3"> <div align="center">
<?php include('lapfasilitas.php')?>
</div></td>
</tr>
</table>
</div>
<p align="justify"> </p>
</form>
</body>
</html>
<?php
$barangSql = "SELECT * FROM barang";
$barangQuery=mysql_query($barangSql,$connectDb) or die("Gagal Query Barang ".mysql_error());
class PDF extends FPDF
{
//header dokumen
function Header()
{
//logo
// $this->Image('logo1.jpg',2.5,1,'C');
//font
$this->SetFont('Times','B',18);
//judul
$this->Cell(0,0,'Tabel',0,1,'C');
//garis
$this->Line(0,1.5,28,1.5);
//font
$this->Ln(0.5);
$x=$this->GetY();
$this->SetY($x+1);
}
//footer dokumen
function Footer()
{
//posisi 1.5 cm dari bawah
$this->SetY(-15);
//arial italic 8
$this->SetFont('Times','I',8);
//halaman dokumen
$this->Cell(0,28,'Hal '.$this->PageNo().'/{nb}',0,0,'C');
}
}
//deklarasi format kertas
$pdf=new PDF('P','cm','A4');
$pdf->AliasNbPages();
$pdf->AddPage();
//setting margin kertas
$pdf->SetMargins(1.5,1,1);
$pdf->SetFont('Times','',12);
//membuat kop tabel
// $x=$pdf->GetY();
// $pdf->SetY($x+1);
$pdf->Ln(20);
$pdf->SetFont('Times','B',12);
// $pdf->SetX(1);
$pdf->Cell(1.2,0.5,'No',1,0,'C');
$pdf->Cell(11.5,0.5,'Uraian',1,0,'C');
$pdf->Cell(2.2,0.5,'Volume',1,0,'C');
$pdf->Cell(3,0.5,'Satuan',1,1,'C');
// $pdf->Cell(4,0.5,'Keterangan',1,1,'C');
$pdf->Cell(1.2,0.5,'A',1,0,'C');
$pdf->Cell(11.5,0.5,'Komponen Barang',1,0,'L');
$pdf->Cell(2.2,0.5,'',1,0,'C');
$pdf->Cell(3,0.5,'',1,1,'C');
// $pdf->Cell(4,0.5,'',1,1,'C');
$pdf->SetFont('Times','',12);
$no=1;
while($barangRow=mysql_fetch_array($barangQuery))
{
$pdf->SetFont('Times','',12);
$y_awal=$pdf->GetY();
$pdf->SetXY(2.7,$y_awal);
$pdf->MultiCell(11.5,0.5,''.$no++.'.'.ucwords($barangRow['nama_barang'])."\n".''.ucwords($barangRow['merk']).', '.ucwords($barangRow['tipe']).', '.$barangRow['no_seri'].', Ket: sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa sulit sekali kenapa oh kenapa'.$barangRow['keterangan_barang'],1);
$y_akhir=$pdf->GetY();
$tinggi=$y_akhir-$y_awal;
// $tinggi=$pdf->GetY()-$y_awal; // langsung begini juga boleh, jadi tidak perlu var $y_akhir
$pdf->SetXY(1.5,$y_awal);
$pdf->MultiCell(1.2,$tinggi,'',1,'C');
$pdf->SetXY(14.2,$y_awal);
$pdf->MultiCell(2.2,$tinggi,''.$barangRow['jumlah_barang'],1,'C');
$pdf->SetXY(16.4,$y_awal);
$pdf->MultiCell(3,$tinggi,''.$barangRow['nama_satuan'],1);
$pdf->Output('barang'.$no_st.'.pdf','I');
?>
<div class="form-group">
<label class="col-sm-4 control-label" for="user">Username :</label>
<div class="col-sm-6">
<input type="text" name="username" id="username" class="form-control" required onclick="cek(document.getElementById('username'), this);">
</div>
</div>
<script>
function cek(user)
{
<?php
$n = $_GET['username']))
$query = "SELECT username from user where username ='$n'";
$result= mysqli_query($link, $query);
while ($data= mysqli_fetch_array($result,MYSQLI_BOTH))
{
$p= $data['username'];
echo "if (username.value == \"".$p."\")";
echo "{";
echo "username.setCustomValidity('usernamesudah ada')";
echo "} else {";
echo "username.setCustomValidity('')";
echo "}";
}
}
?>
}
</script>
// JavaScript Document
$(document).ready(function(){
$("#kode").keyup(function(e){
var isi = $(e.target).val();
$(e.target).val(isi.toUpperCase());
});
$("#nomortelpon").keypress(function(data){
if (data.which!=8 && data.which!=0 && (data.which<48 || data.which>57)) {
return false;
}
});
$("#nomorfax").keypress(function(data){
if (data.which!=8 && data.which!=0 && (data.which<48 || data.which>57)) {
return false;
}
});
$(".data").flexigrid({
url : 'pages/master/post-json-supplier.php',
dataType : 'json',
colModel : [{display : 'No',name : 'no',width : 40,sortable : false,align : 'center'},
{display : 'Kode',name : 'kode_supplier',width : 60,sortable : true,align : 'center'},
{display : 'Nama supplier',name : 'nama_supplier',width : 200,sortable : true,align : 'left'},
{display : 'Alamat Supplier',name : 'alamat_supplier',width : 220,sortable : true,align : 'left'},
{display : 'Nomor Telpon',name : 'telp_supplier',width : 80,sortable : true,align : 'left'},
{display : 'Nomor fax',name : 'fax_supplier',width : 80,sortable : true,align : 'left'},
{display : 'Email',name : 'email_supplier',width : 230,sortable : true,align : 'left'}
],
buttons : [{name : 'Add',bclass : 'add',onpress : test},
{name : 'Edit',bclass : 'edit',onpress : test},
{name : 'Delete',bclass : 'delete',onpress : test},
{separator : true} ,
{name : 'Refresh',bclass : 'refresh',onpress : test}
],
searchitems : [
{display : 'Kode',name : 'kode_supplier',isdefault : true},
{display : 'Nama Supplier',name : 'nama_supplier' }
],
sortname : "kode_supplier",
sortorder : "asc",
singleSelect : true,
usepager : true,
title : 'Daftar Supplier',
useRp : true,
rp : 10,
showTableToggleBtn : false,
height : 350,
width : 1000,
pagetext: 'Hal ',
outof: 's.d'
});
function test(com, grid) {
if (com == 'Delete') {
//confirm('Delete ' + $('.trSelected', grid).length + ' items?')
if ($('.trSelected',grid).length == 1) {
$('.trSelected',grid).each(function() {
var id = $(this).attr('id');
id = id.substring(id.lastIndexOf('row')+3); // ambil data kolom id
var pilih = confirm('Data yang akan dihapus = '+id+ '?');
if (pilih==true) {
HapusData(id);
}
});
} else {
alert('Silahkan pilih salah satu baris yang ingin di Hapus');
return false;
}
} else if (com == 'Add') {
//alert('Add New Item');
Tambah();
$('#form').dialog('open');
}else if (com == 'Edit') {
//alert('Add New Item');
if ($('.trSelected',grid).length == 1) {
$('.trSelected',grid).each(function() {
var id = $(this).attr('id');
id = id.substring(id.lastIndexOf('row')+3); // ambil data kolom id
EditData(id);
});
} else {
alert('Silahkan pilih salah satu baris yang ingin di edit');
return false;
}
}else if (com == 'Refresh') {
window.location.replace('dashboard.php?cat=master&page=data_supplier_tambah');
}
}
$('#form').dialog({
autoOpen: false,
width: 600,
buttons: {
"Simpan": function() {
simpan();
},
"Tambah": function() {
Tambah();
},
"Kembali": function() {
$(this).dialog("close");
$('.data').flexReload();
}
}
});
function Tambah(){
$(".input").val('');
$("#kode").attr("disabled",false);
$("#kode").val('');
$("#kode").focus();
}
function EditData(e){
var id = e;
$.ajax({
type : "POST",
url : "pages/master/cari_supplier.php",
data : "id="+id,
dataType : "json",
success : function(data){
$("#kode").val(id);
$("#namasupplier").val(data.namasupplier);
$("#alamatsupplier").val(data.alamatsupplier);
$("#nomortelpon").val(data.nomortelpon);
$("#nomorfax").val(data.nomorfax);
$("#email").val(data.email);
// supaya field kode tidak bisa di edit
$("#kode").attr("disabled",true);
//
$('#form').dialog('open');
}
});
}
function HapusData(e){
var id = e;
$.ajax({
type : "POST",
url : "pages/master/hapus_supplier.php",
data : "id="+id,
success : function(data){
alert(data);
$('.data').flexReload();
}
});
}
function simpan(){
var kode = $("#kode").val();
var namasupplier = $("#namasupplier").val();
var alamatsupplier = $("#alamatsupplier").val();
var nomortelpon = $("#nomortelpon").val();
var nomorfax = $("#nomorfax").val();
var email = $("#email").val();
/*if(kode.length==0){
alert('Maaf, Kode supplier tidak boleh kosong');
$("#kode").focus();
return false();
}*/
if(namasupplier.length==0){
alert('Maaf, Nama supplier tidak boleh kosong');
$("#namasupplier").focus();
return false();
}
if(alamatsupplier.length==0){
alert('Maaf, Anda belum mengisi alamat supplier');
$("#alamatsupplier").focus();
return false();
}
if(nomortelpon.length==0){
alert('Maaf, Anda belum mengisi nomor telpon');
$("#nomortelpon").focus();
return false();
}
if(nomorfax.length==0){
alert('Maaf, Anda belum mengisi nomor fax');
$("#nomorfax").focus();
return false();
}
if(email.length==0){
alert('Maaf, Anda belum mengisi email');
$("#email").focus();
return false();
}
$.ajax({
type : "POST",
url : "pages/master/simpan_supplier.php",
data : "kode="+kode+"&namasupplier="+namasupplier+"&alamatsupplier="+alamatsupplier+"&nomortelpon="+nomortelpon+"&nomorfax="+nomorfax+"&email="+email,
success : function(data){
alert(data);
$('.data').flexReload();
}
});
}
});