<?php
//Koneksi Ke Server Database
include_once "../librari/koneksi.php";
include_once "../librari/koneksi-auto.php";
include_once "../librari/librari.php";
?>
<?php
$koneksi = koneksi_db();
$sql =" select * from simpanan where no_anggota ='".$_POST['no_anggota']."'";
$query = mysql_query($sql,$koneksi);
$data=mysql_fetch_array($query);
if (isset($_POST['TbSimpan'])){
if ($data['simp_pokok'] > 0)
{ $totsim = $_POST['TxtSimWaj'];}
else
{$simpok = $_POST['TxtSimpok'];
$totsim = $_POST['TxtSimpok']+$_POST['TxtSimWaj'];}
//$totsaja = $data['total_simp'];
$nosimp = $_POST['no_simpan'];
$noangg = $_POST['no_anggota'];
$tglsimpan = $_POST['tanggal'];
$simwaj = $_POST['TxtSimWaj'];
$koneksi = koneksi_db();
$sql="insert into simpanan values('$nosimp',
'$noangg',
'$tglsimpan',
'$simpok',
'$simwaj',
'$totsim ')";
$hasil=mysql_query($sql,$koneksi);
echo"<script>alert('no anggota $_POST[no_anggota] Data Simpanan Berhasil disimpan');</script>";
echo "<script>window.location = '../Admin/menu.php?page=InputSimpanan'</script>";
}
?>
<html>
<head>
<!-- update jquery dan jqueryui dengan yang terbaru -->
<link type="text/css" href="js/jquery-ui-themes-1.9.2/themes/ui-lightness/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-183/jquery.min.1.8.3.js"></script>
<script type="text/javascript" src="js/jquery-183/jquery.form"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2/ui/minified/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#tanggal").datepicker({
dateFormat : 'yy-mm-dd',
changeMonth : true,
changeYear : true
});
//tambahkan auto complete
$('#no_anggota').autocomplete({
source: "get_data/getdata1.php",
minLength: 2,
select: function( event, ui ) {
$('#txtNm').val(ui.item.nama);
$('#TxtSimpok').val(ui.item.simpok);
}
});
$(document).ready(function() {
//aktifkan ajax di form
var options = {
success : showResponse,
resetForm : true,
clearForm : true,
dataType : 'json'
};
$('#frm').ajaxForm(options);
});
function showResponse(responseText, statusText) {
var data = responseText['data'];
var pesan = responseText['pesan'];
alert(pesan);
}
});
</script>
<script language="javascript">
function kondisi(form)
{
if(form.txtNm.value=="")
{
alert("No Anggota Belum Di Isi");
form.no_anggota.focus();
return(false);
}
if(form.tanggal.value=="")
{
alert("Tanggal Peminjaman Belum Di Isi");
form.tanggal.focus();
return(false);
}
if(form.TxtSimWaj.value=="")
{
alert("Simpanan Wajib Belum Di Isi");
form.TxtSimWaj.focus();
return(false);
}
return(true);
}
</script>
</head>
<body>
<form name="form1" method="post" action="" onSubmit="return kondisi(this)" id="frm" enctype="multipart/form-data">
<table width="500" border="0" cellspacing="2" cellpadding="0" class="keliling">
<tr bgcolor="#00CCFF">
<td colspan="2" bgcolor="#CCCCFF"><center><b> ENTRY DATA SIMPANAN</b></center></td>
</tr>
<tr>
<td width="300" align="right">Nomor Simpanan : </td>
<td width="300">
<input name="no_simpan" type="text" id="no_trans" value="<?php echo kdauto("simpanan","S"); ?>" disabled="disabled" />
<input name="no_simpan" type="hidden" id="no_trans" value="<?php echo kdauto("simpanan","S"); ?>" />
</tr>
<tr>
<td align="right">Nomor Anggota </td>
<td>
<input size="5" name="no_anggota" type="text" id="no_anggota"/>
<tr>
<td align="right">Nama Anggota : </td>
<td><input name="txtNm" type="text" id="txtNm" readonly /></td>
</tr>
<tr>
<td align="right">Tanggal Simpanan : </td>
<td><input id="tanggal" type="text" name="tanggal">
</tr>
<tr>
<td align="right">Simpanan Pokok : </td>
<td><input name="TxtSimpok" id="TxtSimpok" type="text"></td>
</tr>
</tr>
<td align="right">Simpanan Wajib : </td>
<td><input name="TxtSimWaj" type="text"></td>
</tr>
<tr>
<td> </td>
<td><input name="TbSimpan" type="submit" value="Tambah">
<input name="reset" type="reset" value="Cancel"></td>
</tr>
</table>
<br></br>
<?php
include_once "../librari/koneksi.php";
include_once "../librari/librari.php";
?>
<div style="border:1px solid rgb(238,238,238);padding:10px;overflow:auto;width:560px;height:autopx;">
<table width="700" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td colspan="9" bgcolor="#CCCCFF"><center><b>DAFTAR SIMPANAN SELURUH ANGGOTA</b></center></td>
</tr>
<tr>
<td width="15" align="center" bgcolor="#00FFCC"><b>No.</b></td>
<td width="47" align="center" bgcolor="#00FFCC"><b>No Simpan</b></td>
<td width="143" align="center" bgcolor="#00FFCC"><b>No Anggota</b></td>
<td width="200" align="center" bgcolor="#00FFCC"><b>Nm Anggota</b></td>
<td width="143" align="center" bgcolor="#00FFCC"><b>Tgl Simpanan</b></td>
<td width="143" align="center" bgcolor="#00FFCC"><b>Simp. Pokok</b></td>
<td width="143" align="center" bgcolor="#00FFCC"><b>Simp. Wajib</b></td>
<td width="145" align="center" bgcolor="#00FFCC"><b>Saldo Simp.</b></td>
</tr>
<?php
$koneksi = koneksi_db();
$sql = "SELECT simpanan.no_simpan,tgl_simpanan,simp_pokok,simp_wajib,total_simp,
anggota.no_anggota,nm_anggota FROM simpanan,anggota WHERE simpanan.no_anggota=anggota.no_anggota order by no_anggota";
$qry = mysql_query($sql,$koneksi);
while ($data = mysql_fetch_array($qry))
{
$no++;
//operator mencari jumlah keseluruhan simpanan
//$jumlah_SHU=$data[simp_pokok] + $data[simp_wajib];
$tot_keseluruhan=$tot_keseluruhan + $data['total_simp'];
?>
<tr bgcolor="#FFFFFF">
<td><?php echo $no;?></td>
<td><?php echo $data['no_simpan']; ?></td>
<td><?php echo $data['no_anggota']; ?></td>
<td><?php echo $data['nm_anggota']; ?></td>
<td><?php echo $data['tgl_simpanan']; ?></td>
<td><?php echo $data['simp_pokok']; ?></td>
<td><?php echo $data['simp_wajib']; ?></td>
<td><?php echo $data['total_simp']; ?></td>
<?php
}
?>
<tr>
<th colspan="7" align="center">Total Simpanan Keseluruhan</th>
<td bgcolor="#CCCCTF">Rp.<?php echo $tot_keseluruhan ?> </td>
</tr>
</table>
</div>
</body>
</html>
<br></br>
<br>
<tr>
<td>Ket :</td>
</tr>
</br>
<br>
<td>*) Pembayaran Simpanan Pokok Hanya Satu Kali Pada Wkatu Pendaftaran Pertama</td>
</br>
<script type="text/javascript" src="js/jquery-1.2.3.pack.js"></script>
<script type="text/javascript" src="js/jquery.validate.pack.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#formnilai").validate({
messages: {
email: {
required: "E-mail harus diisi",
email: "Masukkan E-mail yang valid"
}
},
errorPlacement: function(error, element) {
error.appendTo(element.parent("td"));
}
});
})
</script>
<style type="text/css">
* { font: 11px Verdana, sans-serif; }
h4 { font-size: 18px; }
input { padding: 3px; border: 1px solid #999; }
input.error, select.error { border: 1px solid red; }
label.error { color:red; margin-left: 10px; }
td { padding: 5px; }
</style>
<?php
if($_POST[Update])
{
mysql_connect("localhost", "root", "");
mysql_select_db("dbdinamis");
// membaca jumlah (n) dari submit.php
$Siswa = $_POST[n];
$mapel = $_POST[matapelalajaran];
// proses looping untuk membaca nilai serta menjalankan query update
for ($i=1; $i<=$Siswa; $i++)
{
// membaca nim ke-i, i = 1, 2, 3, ..., n
$nis = $_POST[siswa.$i];
// membaca nilai ke-i, i = 1, 2, 3, ..., n
$nilai = $_POST[nilaiMID.$i];
$nilai1 = $_POST[nilaiUAS.$i];
$ubah=mysql_query("UPDATE nilai SET nilaiMID = '$nilai', nilaiUAS='$nilai1' WHERE nis='$nis' AND kodematapelajaran = '$mapel'");
}
echo "<script language='javascript'>alert('Data Telah di Update');</script>";
}
?>
<form id="form1" name="form1" method="post" action="">
<table align="center" width="80%" border="0">
<tr>
<td colspan="2" align="center">Entry data Nilai</td>
</tr>
<tr>
<td colspan="2" bgcolor="#006633"> </td>
</tr>
<tr>
<td>Pilih Matapelajaran :</td>
<td><select name="matapelajaran">
<option value="PILIH">PILIHAN</option>
<?php
// query untuk menampilkan semua matakuliah dari tabel 'mk'
$query = "SELECT * FROM matapelajaran";
$hasil = mysql_query($query);
while ($data = mysql_fetch_array($hasil))
{
echo "<option value='".$data['kodematapelajaran']."'>".$data['namamatapelajaran']."</option>";
}
?>
<input type="submit" value="Submit" name="submit" />
</select></td>
</tr>
</table>
</form>
<?php if ($_POST[submit]){?>
<form method="post" action="">
<table align="center" width="80%" border="0">
<tr>
<td colspan="5" align="center">Update Nilai Siswa</td>
</tr>
<tr>
<td colspan="5" style="border-bottom:1px solid #000;"><hr /></td>
</tr>
<tr>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;border-left:1px solid #000">No</td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;">NISN</td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;">Nama Siswa</td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;">Nilai MID</td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;">NIlai UAS</td>
</tr>
<?php
// membaca kode matakuliah yang disubmit dari formnilai.php
$idmapel = $_POST[matapelajaran];
include("../library/koneksi.php");
$query1 = mysql_query("SELECT nilai.nis, nilai.kodematapelajaran, nilai.nilaiMID, nilai.nilaiUAS, siswa.namasiswa
FROM nilai,siswa
WHERE nilai.nis=siswa.nis AND kodematapelajaran = '".$_POST[matapelajaran]."'")or die ("Query failed with error: ".mysql_error());
$i = 1;
while($data = mysql_fetch_array($query1)){
?>
<tr>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;border-left:1px solid #000"><? echo $i; ?></td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;"><? echo $data[nis]; ?><input type='hidden' name="siswa" value="<? echo $data[nis]; ?>" /></td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;"><? echo $data[namasiswa]; ?></td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;"><input type="text" size='5' name="nilaiMID" id="nilaiMID" value="<? echo $data[nilaiMID]; ?>" /></td>
<td align="center" style="border-bottom:1px solid #000;border-right:1px solid #000;"><input type="text" size='5' name="nilaiUAS" id="nilaiUAS" value="<? echo $data[nilaiUAS]; ?>" /></td>
</tr>
<? $i++; $jumSiswa = $i-1; } ?>
<tr>
<td><input type="text" name="n" value="<?php echo $jumSiswa ?>" /></td>
<td><input type="text" name="matapelajaran" value="<?php echo $idmapel;?>"></td>
<td colspan="2" align="center"><input type="submit" value="Update" name="Update" id="Update" /></td>
<td> </td>
</tr>
</table>
</form>
<? }?>
No.Anggota = <input type="text" name="noanggota"><br>
Nama = <input type="text" name="nama"><br>
Lisensi Provider = <input type="text" name="lisensi"><br>
Pilihan Pulsa = <input type="radio" name="pilpulsa" value="elektrik">Elektrik
<input type="radio" name="pilpulsa" value="nonelektrik">Non Elektrik<br>
Paket Provider = <select name="provider">
<option>**___Pilihan___**</option>
<option>XL AXIATA</option>
<option>TELKOMSEL</option>
<option>INDOSAT</option>
<option>AXIS</option>
</select><br>
Harga Provider = <input type="text" name="hargaprovider"><br>
Banyaknya Pembelian = <input type="text" name="banyaknya"><br>
Diskon = <input type="text" name="diskon"><br>
Total = <input type="text" name="total"><br>
Bayar = <input type="text" name="bayar"><br>
Kembali = <input type="text" name="kembali"><br>
<input type="submit" name="simpan" value="Simpan"> <input type="reset" name="cancel" value="Cancel">
<input type="submit" name="tampil" value="Tampil">
<?php
//Koneksi Ke Server Database
include_once "../librari/koneksi.php";
include_once "../librari/koneksi-auto.php";
include_once "../librari/librari.php";
?>
<html>
<head>
<link type="text/css" href="js/jquery-ui-themes-1.9.2/themes/ui-lightness/jquery-ui.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-183/jquery.min.1.8.3.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2/ui/minified/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#tanggal").datepicker({
dateFormat : 'yy-mm-dd',
changeMonth : true,
changeYear : true
});
//tambahkan auto complete
$('#no_anggota').autocomplete({
source: "get_data/getdataPinjm.php",
minLength: 2,
select: function( event, ui ) {
$('#txtNm').val(ui.item.nama);
$('#tanggal').val(ui.item.tglpinj);
$('#order1').val(ui.item.jmlPinj);
$('#harga1').val(ui.item.lmAng);
$('#total1').val(ui.item.angpok);
$('#total2').val(ui.item.bungpinj);
$('#total3').val(ui.item.jumlang);
$('#total4').val(ui.item.totpinj);
}
});
});
</script>
<script language="javascript">
function kondisi(form)
{
if(form.no_anggota.value=="")
{
alert("No Anggota Belum Terdaftar");
form.no_anggota.focus();
return(false);
}
if(form.txtNm.value=="")
{
alert("No Anggota Belum Terdaftar");
form.no_anggota.focus();
return(false);
}
if(form.tanggal.value=="")
{
alert("Tanggal Peminjaman Belum Di Isi");
form.tanggal.focus();
return(false);
}
if(form.order1.value=="")
{
alert("Jumlah Pinjaman Belum Di isi");
form.order1.focus();
return(false);
}
if(form.harga1.value=="")
{
alert("Lama Angsuran Belum Di isi");
form.harga1.focus();
return(false);
}
return(true);
}
</script>
<script>
function startCalc(){
interval = setInterval("calc()",1);
}
function calc(){
one1 = document.form1.order1.value;
two1 = document.form1.harga1.value;
three1 = document.form1.bunga1.value;
four1 = document.form1.bunga2.value;
total1 = document.form1.total1.value;
total2 = document.form1.total2.value;
document.form1.total1.value = (one1 * 1) / (two1 * 1);
document.form1.total2.value = (one1 * 1) * (three1 * 1);
document.form1.total3.value = (total2 * 1) + (total1 * 1);
document.form1.total4.value = ((one1 * 1) * (four1 * 1) + (one1 * 1));
}
function stopCalc(){
clearInterval(interval);
}
</script>
</head>
<body>
<form name="form1" method="post" action="PinjamanTambahSim.php" onSubmit="return kondisi(this)" enctype="multipart/form-data">
<table width="500" border="0" cellspacing="2" cellpadding="0" class="keliling">
<tr bgcolor="#00CCFF">
<td colspan="5" bgcolor="#CCCCFF"><center><b> ENTRY DATA PINJAMAN</b></center></td>
</tr>
<tr>
<td width="300" align="right">Nomor Pinjaman : </td>
<td width="300">
<input name="no_pinj" type="text" id="no_pinj" value="<?php echo kdauto("pinjaman","P"); ?>" disabled="disabled" />
<input name="no_pinj" type="hidden" id="no_pinj" value="<?php echo kdauto("pinjaman","P"); ?>" />
</tr>
<tr>
<td align="right">Nomor Anggota :</td>
<td>
<input size="5" name="no_anggota" type="text" id="no_anggota"/>
</tr>
<tr>
<td align="right">Nama Anggota : </td>
<td><input name="txtNm" type="text" id="txtNm" readonly></td>
</tr>
<tr>
<td align="right">Tanggal Pinjam : </td>
<td><input id="tanggal" type="text" name="tanggal">
</tr>
<tr>
<td align="right">Jumlah Pinjaman : </td>
<td><input name="order1" type="text" id="order1" onfocus="startCalc();" onblur="stopCalc();" value="" size="25"></td>
</tr>
<tr>
<td align="right">Lama Angsuran : </td>
<td><input name="harga1" type="text" id="harga1" onfocus="startCalc();" onblur="stopCalc();" value="" size="5"></td>
</tr>
<tr>
<td align="right">Angsuran Pokok : </td>
<td><input name="total1" type="text" id="total1" size="25" readonly></td>
</tr>
<tr>
<td align="right">Bunga Pinjaman : </td>
<td><input name="total2" type="text" id="total2" size="25" readonly></td>
<td><input name="bunga1" type="hidden" id="bunga1" onfocus="startCalc();" onblur="stopCalc();" value="0.01" size="5"/></td>
</tr>
<tr>
<td align="right">jumlah Angsuran : </td>
<td><input name="total3" type="text" id="total3" size="25" readonly></td>
</tr>
<tr>
<td align="right">Total Pinjaman : </td>
<td><input name="total4" type="text" id="total4" size="25" readonly></td>
<td><input name="bunga2" type="hidden" id="bunga2" onfocus="startCalc();" onblur="stopCalc();" value="0.1" size="5"/></td>
</tr>
<tr>
<td> </td>
<td><input name="TbSimpan" type="submit" value="Tambah">
<input name="reset" type="reset" value="Cancel"></td>
</tr>
</table>
<br></br>
<?php
include_once "../librari/koneksi.php";
include_once "../librari/librari.php";
?>
<div style="border:1px solid rgb(238,238,238);padding:10px;overflow:auto;width:560px;height:autopx;">
<table width="700" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td colspan="13" bgcolor="#CCCCFF"><center><b>DAFTAR PINJAMAN SELURUH ANGGOTA</b></center></td>
</tr>
<tr>
<td width="15" align="center" bgcolor="#00FFCC"><b>No.</b></td>
<td width="47" align="center" bgcolor="#00FFCC"><b>No Pinjam</b></td>
<td width="143" align="center" bgcolor="#00FFCC"><b>No Anggota</b></td>
<td width="143" align="center" bgcolor="#00FFCC"><b>Nm Anggota</b></td>
<td width="200" align="center" bgcolor="#00FFCC"><b>Tgl Pinjam</b></td>
<td width="143" align="center" bgcolor="#00FFCC"><b>Jml Pinjam</b></td>
<td width="90" align="center" bgcolor="#00FFCC"><b>Lama Angsuran</b></td>
<td width="90" align="center" bgcolor="#00FFCC"><b>Angs Pokok</b></td>
<td width="90" align="center" bgcolor="#00FFCC"><b>Bunga Pinjam</b></td>
<td width="140" align="center" bgcolor="#00FFCC"><b>Jumlah Angs</b></td>
<td width="140" align="center" bgcolor="#00FFCC"><b>Total Pinjaman</b></td>
<td width="140" align="center" bgcolor="#00FFCC"><b>Sisa Hutang</b></td>
<td width="140" align="center" bgcolor="#00FFCC"><b>Status</b></td>
</tr>
<?php
$koneksi = koneksi_db();
$sql = "SELECT p.no_pinjam,p.tgl_pinjam,p.jml_pinjam,p.lm_ang,p.pokok_angs,p.bunga_pinjam,p.jml_angsuran,p.total_pinjaman,p.status,anggota.no_anggota,nm_anggota,MIN(angsuran.sisa_hutang)
FROM pinjaman p LEFT JOIN anggota ON anggota.no_anggota=p.no_anggota LEFT JOIN angsuran ON p.no_pinjam=angsuran.no_pinjam group by no_pinjam";
$qry = mysql_query($sql,$koneksi);
while ($data = mysql_fetch_array($qry))
{
$no++;
//operator mencari jumlah keseluruhan simpanan
$tot_keseluruhan= $tot_keseluruhan1 + $data[total_pinjaman];
?>
<tr bgcolor="#FFFFFF">
<td><?php echo $no;?></td>
<td><?php echo $data['no_pinjam']; ?></td>
<td><?php echo $data['no_anggota']; ?></td>
<td><?php echo $data['nm_anggota']; ?></td>
<td><?php echo $data['tgl_pinjam']; ?></td>
<td><?php echo $data['jml_pinjam']; ?></td>
<td><?php echo $data['lm_ang']; ?></td>
<td><?php echo $data['pokok_angs']; ?></td>
<td><?php echo $data['bunga_pinjam']; ?></td>
<td><?php echo $data['jml_angsuran']; ?></td>
<td><?php echo $data['total_pinjaman']; ?></td>
<td><?php echo $data['MIN(angsuran.sisa_hutang)']; ?></td>
<td><?php echo $data['status'];?></td>
</tr>
<?php
}
?>
<tr>
<th colspan="10" align="center">Total Pinjaman Keseluruhan</th>
<td bgcolor="#FPCCKF">Rp.<?php echo $tot_keseluruhan ?> </td>
</tr>
</table>
</div>
</form>
</body>
</html>
<br></br>
<br>
<tr>
<td>Ket :</td>
</tr>
</br>
<br>
<td>*) Bunga Perbulan = 1%</td>
</br>
<br>
<tr>
<td>*) Lama Angsuran Yang Ditetapkan yaitu 10 Kali Angsuran</td>
</tr>
</br>
CREATE TABLE IF NOT EXISTS `harga_tiket` (
`id` int(2) NOT NULL AUTO_INCREMENT,
`jenis` varchar(20) NOT NULL,
`dewasa` decimal(8,2) NOT NULL,
`anak` decimal(8,2) NOT NULL,
`lansia` decimal(8,2) NOT NULL,
`remaja` decimal(8,2) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `harga_tiket`
--
INSERT INTO `harga_tiket` (`id`, `jenis`, `dewasa`, `anak`, `lansia`, `remaja`) VALUES
(1, '1 hari', '1000', '500', '750', '600'),
(2, '2 hari', '2000', 1000', '1750', '1200'),
(3, '3 hari', '3000', '1500', '2500', '2200');
http://imageshack.us/photo/my-images/33/img1fh.jpg/
dari tabel diatas, apabila user klik tanda tambah berarti user pesan tiket.http://imageshack.us/photo/my-images/839/img2gw.jpg/
http://imageshack.us/photo/my-images/442/img3k.jpg/
http://imageshack.us/photo/my-images/824/img4jg.jpg/