<tr>
<td>Tindakan</td>
<td>
<?
$sql = "SELECT kode_tarif, nama_tarif, harga FROM jenis_tarif";
$result = mysql_query($sql);
echo "<select name='kode_tarif'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['kode_tarif'] . "'>" . $row['nama_tarif'] ." - Rp.".$row['harga']. "</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td>Harga</td>
<td><input type="text" name="harga" id="harga"/></td>
</tr>
pada input harga ketika di klik nama tarif?? <?php
session_start();
if (session_is_registered('id_admin'))
{
?>
<div class="post">
<div class="entry">
<form action="?<?php echo paramEncrypt('page=./laporan/buku_jurnal')?>" method="post" name="postform">
<table width="531" border="0">
<tr>
<td width="48"><strong>Masukan Nama Sales</strong></td>
<td colspan="2"><input type="text" name="sales" size="15" value=""/>
<td width="77"><input type="submit" name="report" value="Tampilkan" /></td>
</tr>
</table>
</form>
</div>
</div>
<div class="post">
<div class="entry">
<p>
<?php
//untuk menyelesaikan transaksi
if(isset($_POST['report'])){
//tanggal periode laporan
$sales=$_POST['sales'];
$query_transaksi=mysql_query("select * from data where sales=$sales order by notel asc");
}else{
$query_transaksi=mysql_query("select * from data order by notel asc");
unset($_POST['report']);
}
?>
<h2 align="center"><strong>Laporan Data Penjualan Sales : </strong></h2>
<p align="center"> </p>
<table class="datatable" border="1">
<tr>
<th>Notel</th><th>Nama</th><th>Alamat</th><th>Sales</th><th>Paket</th>
</tr>
<?php
while($row_tran=mysql_fetch_array($query_transaksi)){
?>
<tr>
<td><div align="center"><?php echo $row_tran['notel'];?></div></td>
<td><div align="center"><?php echo $row_tran['nama'];?></div></td>
<td><?php echo $row_tran['alamat'];?></td>
<td><?php echo $row_tran['sales'];?></td>
<td><?php echo $row_tran['paket'];?></td>
</tr>
<?php
}
?>
</table>
</p>
</div>
</div>
<?php
}else{
echo "Forbidden Access!";
}
?>
<form id="form1" name="form1" method="get" action="tampilcari.php">
Tahun
<select name="tahun">
<?php
$mulai= date('Y') - 50;
for($i = $mulai;$i<$mulai + 100;$i++){
$sel = $i == date('Y') ? ' selected="selected"' : '';
echo '<option value="'.$i.'"'.$sel.'>'.$i.'</option>';
}
?>
</select>
<input type="text" name="kd_keahlian" id="kd_keahlian" />
<input type="submit" name="button" id="button" value="Submit" />
</form>
<?php (require"konek.php");?>
<? $tanggal= $_POST['tanggal'];
$tahun = $_POST['tahun'];
$sql = "SELECT calon_siswa.no_daftar,calon_siswa.namalengkap,calon_siswa.tempatlahir,calon_siswa.tgllahir,calon_siswa.jk,calon_siswa.agama,calon_siswa.asalsekolah,calon_siswa.alamat,calon_siswa.namaortu,calon_siswa.pekerjaanortu,keahlian.nm_keahlian,keahlian.kd_keahlian,calon_siswa.tanggal FROM calon_siswa INNER JOIN keahlian ON calon_siswa.kd_keahlian = keahlian.kd_keahlian
WHERE keahlian.kd_keahlian and year(calon_siswa.tanggal) = '$tahun'";
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0){
?>
</p>
<p><strong>Data Di Temukan</strong></p>
<table border="1" align="left">
<tr>
<td width="57" bgcolor="#CCCCCC" >Kode Keahlian</td>
<td width="125" bgcolor="#CCCCCC" >Pilihan Keahlian</td>
<td width="67" bgcolor="#CCCCCC" >No daftar</td>
<td width="86" bgcolor="#CCCCCC" >Nama Lengkap</td>
<td width="90" bgcolor="#CCCCCC" >Tempat/Tgl Lahir</td>
<td width="25" bgcolor="#CCCCCC" >JK</td>
<td width="88" bgcolor="#CCCCCC" >Alamat</td>
<td width="125" bgcolor="#CCCCCC" >Asal Sekolah</td>
<td width="122" bgcolor="#CCCCCC" >Nama Ortu</td>
<td width="83" bgcolor="#CCCCCC" >Pekerjaan ortu</td>
<td width="104" bgcolor="#CCCCCC" >Tanggal daftar</td>
<td colspan="2" align="center" bgcolor="#CCCCCC">Aksi</td>
</tr>
<?php
while($data = mysql_fetch_array($result)){?>
<tr>
<td><?php echo $data['kd_keahlian'];?></td>
<td><?php echo $data['nm_keahlian'];?></td>
<td><?php echo $data['no_daftar'];?></td>
<td><?php echo $data['namalengkap'];?></td>
<td><?php echo $data['tempatlahir'];?>, <?php echo $data['tgllahir'];?></td>
<td><?php echo $data['jk'];?></td>
<td><?php echo $data['alamat'];?></td>
<td><?php echo $data['asalsekolah'];?></td>
<td><?php echo $data['namaortu'];?></td>
<td><?php echo $data['pekerjaanortu'];?></td>
<td><?php echo $data['tanggal'];?></td>
<td width="84" style="border-bottom:1px solid #000"><?php echo "<a href='edit.php?id=$data[no_daftar]'>Edit</a>"; ?> </td>
<td width="84" style="border-bottom:1px solid #000"> </td>
</tr>
<?php }?>
</table>
<?php
}else{
echo 'Data not found!';
}
?>
</td>
</tr>
<tr>
</tr>
</table>
</body>
</html>
Mulai dari tanggal
<select name="tgl">
<?php
for ($i=1; $i<=31; $i++) {
$tg = ($i<10) ? "0$i" : $i;
echo "<option value='$tg'>$tg</option>";
}
?>
</select>
-
<select name="bln">
<?php
for ($i=1; $i<=12; $i++) {
$bl = ($i<10) ? "0$i" : $i;
echo "<option value='$bl'>$bl</option>";
}
?>
</select>
-
<select name="thn" >
<?php
for ($i=1970; $i<=2000; $i++) {
echo "<option value='$i'>$i</option>";
}
?>
</select>
Sampai tanggal
<select name="tgl">
<?php
for ($i=1; $i<=31; $i++) {
$tg = ($i<10) ? "0$i" : $i;
echo "<option value='$tg'>$tg</option>";
}
?>
</select>
-
<select name="bln">
<?php
for ($i=1; $i<=12; $i++) {
$bl = ($i<10) ? "0$i" : $i;
echo "<option value='$bl'>$bl</option>";
}
?>
</select>
-
<select name="thn" >
<?php
for ($i=1970; $i<=2000; $i++) {
echo "<option value='$i'>$i</option>";
}
?>
</select>
Than'x before..