mohon bantuannya mas saya sangat bingung pada di bagian script data_siswa.php adalah bagian dari input siswa disini masalah yang tidak mengerti kali pada penggunaan tanggal yg sy gunakan format date sehingga pada script p_i_siswa.php pada tanggal nya masih error jadi begitu data diinput dan dismpan tidak mau menyimpan dan berhasil karena, pada p_i_siswa.php dibagian elseif ($tanggal_lahir=="") {
echo"<script>alert('Maaf tanggal lahir belum terisi dengan benar',document.location.href='javascript:history.back(0)')</script>";
masih error dan saya tidak mengerti  untuk menambahkan coding selanjutnya dari $tanggal_lahir = "$tgl_lahir, $bln_lahir, $thn_lahir" ..... mohon bantuannya ya mas informasi anda sangat saya butuhkan.... mohon dibalas dengan cepat ya mas...HAnya Allah SWT yg membalas kebaikan anda trims


data_siswa.php
<?
session_start();
$id = $_COOKIE['id'];
$username = $_COOKIE['username'];
$hak_akses=$_COOKIE['hak_akses'];
$last_login = $_COOKIE['last_login'];
if(!isset($_COOKIE['username'])) {
header("location:index.php");
}
?>
<!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=iso-8859-1" />
<title>SMP SWASTA MUHAMMADIYAH 03 MEDAN</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #858585;
}
a:link {
font-family: Arial, Helvetica, sans-serif;
color: #A2B1C3;
text-decoration: none;
font-size: 11px;
}
a:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #A2B1C3;
text-decoration: none;
font-weight: bold;
}
a:visited {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #A2B1C3;
text-decoration: none;
}
a:active {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #A2B1C3;
text-decoration: none;
}
.style6 {color: #FFFFFF}
-->
</style>
<link href="cpanel_css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style8 {color: #FFFFFF; font-size: 10px; }
.style9 {font-size: 11px}
.style10 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style11 {font-size: 10px}
.style7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; }
.style12 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; }
.style13 {font-size: 12px}
-->
</style>
</head>

<body>
<div align="center">
<table background="../images/bawah.gif" width="800" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="800" height="138" valign="top"><table background="../images/admin_01.gif" width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="9" height="94">&nbsp;</td>
<td width="773">&nbsp;</td>
<td width="18">&nbsp;</td>
</tr>
<tr>
<td height="28"></td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="773" height="28" align="center"><? include"link.php" ?></td>
</tr>
</table> </td>
<td></td>
</tr>
<tr>
<td height="16"></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="387" valign="top"><table background="../../ta_agus1/images/back.gif"width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="800" height="387" valign="top"><table width="705" border="0" align="center">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="center" class="font1 style6 style13"><strong>DATA SISWA </strong></div></td>
</tr>
<tr>
<td><hr /></td>
</tr>
<tr>
<td><form id="form1" name="form1" method="post" action="p_i_siswa.php" enctype="multipart/form-data">
<table width="714" border="0" align="center">
<tr>
<td colspan="3"><table width="762" border="0" align="center">
<tr>
<td width="101" class="font1"><div align="left" class="style8 style9">NIS</div></td>
<td width="10" class="font1"><div align="left" class="style6 style11">:</div></td>
<td width="295" class="font1"><div align="left" class="style6 style11">
<input name="nis" type="text" class="style10" id="nis" tabindex="1" size="25" />
</div></td>
<td width="18" class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td width="90" class="font1"><div align="left" class="style6 style11">PEKERJAAN</div></td>
<td width="11" class="font1"><div align="left" class="style6 style11">:</div></td>
<td width="207" class="font1"><div align="left" class="style6 style11">
<input name="pekerjaan" type="text" class="style10" id="pekerjaan" tabindex="12" size="25" />
</div></td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">NAMA SISWA </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="nama_siswa" type="text" class="style10" id="nama_siswa" tabindex="2" size="25" />
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left" class="style6 style11">NAMA WALI SISWA </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="nm_wali" type="text" class="style10" id="nm_wali" tabindex="13" size="25" />
</div></td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">TEMPAT LAHIR </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="tpt_lahir" type="text" class="style10" id="tpt_lahir" tabindex="3" size="25" />
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left" class="style6 style11">ALAMAT WALI </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="alamat_wali" type="text" class="style10" id="alamat_wali" tabindex="14" size="25" />
</div></td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">TANGGAL LAHIR </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="font1 style11">
<select name="tgl_lahir" class="style10" id="tgl_lahir" tabindex="1" size="1" >
<option selected="selected"> [PILIH]</option>
<?php
for ($i=1;$i<=31;$i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
<select name="bln_lahir" class="style10" id="bln_lahir" tabindex="1" size="1" >
<option selected="selected">[PILIH]</option>
<?php
$bulan=array("","Januari","Pebruari","Maret","April","Mei","Juni","Juli","Agustus","September", "Oktober","November","Desember");
for ($i=1;$i<=12;$i++)
{
echo "<option value=".$i.">".$bulan[$i]."</option>";
}
?>
</select>
<select name="thn_lahir" type="text" class="style10" id="thn_lahir" size="1" />
<option selected="selected">[PILIH]</option>
<?php
for ($i=1985;$i<=2002;$i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left" class="style6 style11">TAHUN MASUK </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="thn_masuk" type="text" class="style10" id="thn_masuk" tabindex="15" size="25" />
</div></td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">JENIS KELAMIN </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<select name="jen_kel" class="style10" id="jen_kel" tabindex="7" >
<option selected="selected">[ PILIH ]</option>
<option>Pria</option>
<option>Wanita</option>
</select>
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left" class="style6 style11">KELAS</div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<select name="kd_kelas" class="style10" id="kd_kelas" tabindex="16" >
<option selected="selected">[ PILIH ]</option>
<?php include"../koneksi.php";
$query=mysql_query("select * from tb_kelas");
while($baris=mysql_fetch_array($query))
{
?>
<option value="<? echo"$baris[kd_kelas]" ?>"><? echo"$baris[nm_kelas]" ?>
<? } ?>
</option>
</select>
</div></td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">AGAMA</div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<select name="agama" class="style10" id="agama" tabindex="8" >
<option selected="selected">[ PILIH ]</option>
<option>Islam</option>
<option>Kristen Katolik</option>
<option>Kristen Protestan</option>
<option>Hindu</option>
<option>Budha</option>
</select>
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1">&nbsp;</td>
<td class="font1">&nbsp;</td>
<td class="font1">&nbsp;</td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">ALAMAT </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="alamat" type="text" class="style10" id="alamat" tabindex="9" size="25" />
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left" class="style6 style11">PASSWORD</div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="password" type="password" class="style10" id="password" tabindex="18" size="25" />
</div></td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">NAMA ORANG TUA </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="nm_ortu" type="text" class="style10" id="nm_ortu" tabindex="10" size="25" />
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left" class="style6 style11">FOTO</div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="foto" type="file" class="font1" id="foto" />
</div></td>
</tr>
<tr>
<td class="font1"><div align="left" class="style6 style11">ALAMAT ORG TUA </div></td>
<td class="font1"><div align="left" class="style6 style11">:</div></td>
<td class="font1"><div align="left" class="style6 style11">
<input name="alamat_ortu" type="text" class="style10" id="alamat_ortu" tabindex="11" size="25" />
</div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
<td class="font1"><div align="left"><span class="style6"><span class="style9"><span class="style11"><span class="style9"><span class="style11"><span class="style11"></span></span></span></span></span></span></div></td>
</tr>
<tr>
<td colspan="7" class="font1">&nbsp;</td>
</tr>
<tr>
<td colspan="7" class="font1"><div align="center" class="style6 style11">
<input name="Submit" type="submit" class="tombol_sibmit" tabindex="20" value="Simpan" />
<input name="Submit2" type="reset" class="tombol_sibmit" tabindex="21" value="Reset" />
</div></td>
</tr>
</table></td>
</tr>

<tr>
<td colspan="3"><hr /></td>
</tr>
<tr>
<td width="131">&nbsp;</td>
<td width="264">&nbsp;</td>
<td width="284">&nbsp;</td>
</tr>
</table>
</form> </td>
</tr>
<tr>
<td><table width="765" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr>
<td width="85" height="20" bgcolor="#DDDDDD" class="style7"><div align="center">NIS</div></td>
<td width="235" height="20" bgcolor="#DDDDDD" class="style7">NAMA SISWA </td>
<td width="258" height="20" bgcolor="#DDDDDD" class="style7">TPT/TGL LAHIR </td>
<td height="20" colspan="3" bgcolor="#DDDDDD" class="style7"><div align="center">ACTION</div></td>
</tr>
<?php
include "../koneksi.php";
$query = mysql_query("select * from tb_siswa");
while($baris=mysql_fetch_array($query))
{
?>
<tr>
<td height="20" class="style7"><div align="center" class="style6"><? echo"$baris[nis]" ?></div></td>
<td height="20" class="style7"><span class="style6"><? echo"$baris[nama_siswa]" ?></span></td>
<td height="20" class="style12"><? echo"$baris[tpt_lahir]" ?>, <? echo"$baris[tanggal_lahir]" ?> </td>
<td width="57" height="20" class="style7"><div align="center" class="style6"><? echo"<a href=\"tampil_siswa.php?nis=$baris[nis]\">Tampil</a>" ?></div></td>
<td width="52" class="style7"><div align="center" class="style6"><? echo"<a href=\"edit_siswa.php?nis=$baris[nis]\">Ubah</a>" ?></div></td>
<td width="52" class="style7"><div align="center" class="style6"><a href="hapus_siswa.php"><? echo"<a href=\"p_hapus_siswa.php?nis=$baris[nis]\">Hapus</a>" ?></a></div></td>
</tr>
<? } ?>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="100" valign="top"><table background="../images/bawah1.gif"width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="800" height="100">&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>

p_i_siswa.php
<?
include"koneksi.php";
$nis=$_POST['nis'];
$nama_siswa=$_POST['nama_siswa'];
$tpt_lahir=$_POST['tpt_lahir'];
$tanggal_lahir = $_POST['tgl_lahir']."-".$_POST['bln_lahir']."-".$_POST['thn_lahir'];
$jen_kel=$_POST['jen_kel'];
$agama=$_POST['agama'];
$alamat=$_POST['alamat'];
$nm_ortu=$_POST['nm_ortu'];
$alamat_ortu=$_POST['alamat_ortu'];
$pekerjaan=$_POST['pekerjaan'];
$nm_wali=$_POST['nm_wali'];
$alamat_wali=$_POST['alamat_wali'];
$thn_masuk=$_POST['thn_masuk'];
$kd_kelas=$_POST['kd_kelas'];
$password=$_POST['password'];
$foto=$_FILES['foto']['name'];

if($nis == $baris[nis]){
echo"<script>alert('Maaf NIS Siswa dengan No : $nis sudah ada',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($nis == ""){
echo"<script>alert('Maaf anda belum mengisi NIS Siswa',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($nama_siswa == ""){
echo"<script>alert('Maaf anda belum mengisi Nama Siswa',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($tpt_lahir == ""){
echo"<script>alert('Maaf anda belum mengisi Tempat Lahir',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($tanggal_lahir=="") {
echo"<script>alert('Maaf tanggal lahir belum terisi dengan benar',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($agama == "[ PILIH ]"){
echo"<script>alert('Maaf anda belum memilih Agama',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($alamat == ""){
echo"<script>alert('Maaf anda belum mengisi Alamat Mahasiswa',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($nm_ortu == ""){
echo"<script>alert('Maaf anda belum mengisi Nama Orangtua',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($alamat_ortu == ""){
echo"<script>alert('Maaf anda belum mengisi Alamat Orangtua',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($pekerjaan == ""){
echo"<script>alert('Maaf anda belum mengisi Pekerjaan Orangtua',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($kd_kelas == "[ PILIH ]"){
echo"<script>alert('Maaf anda belum memilih Kelas',document.location.href='javascript:history.back(0)')</script>";
}
elseif ($password == ""){
echo"<script>alert('Maaf anda belum mengisi Password Siswa',document.location.href='javascript:history.back(0)')</script>";
}
elseif($foto == "none"){
$foto="0";
mysql_query("insert into tb_siswa(nis,nama_siswa,tpt_lahir,tanggal_lahir,jen_kel,agama,alamat,nm_ortu,alamat_ortu,pekerjaan,nm_wali,alamat_wali,thn_masuk,kd_kelas,password,foto)"." values('$nis','$nama_siswa','$tpt_lahir','$tanggal_lahir','$jen_kel','$agama','$alamat','$nm_ortu','$alamat_ortu','$pekerjaan','$nm_wali','$alamat_wali','$thn_masuk','$kd_kelas','$password','$foto')");
echo"<script>alert('Data Siswa berhasil disimpan ke database, Tidak Ada File Yang di Upload ',document.location.href='data_siswa.php')</script>";
}
else
{
$folderupload='../foto/';
$uploadfile = $folderupload . basename($_FILES['foto']['name']);
move_uploaded_file($_FILES['foto']['tmp_name'],$uploadfile);
mysql_query("insert into tb_siswa(nis,nama_siswa,tpt_lahir,tanggal_lahir,jen_kel,agama,alamat,nm_ortu,alamat_ortu,pekerjaan,nm_wali,alamat_wali,thn_masuk,kd_kelas,password,foto)"." values('$nis','$nama_siswa','$tpt_lahir','$tanggal_lahir','$jen_kel','$agama','$alamat','$nm_ortu','$alamat_ortu','$pekerjaan','$nm_wali','$alamat_wali','$thn_masuk','$kd_kelas','$password','$foto')");
echo"<script>alert('Data Siswa berhasil disimpan ke database, Upload Dile Sukses',document.location.href='data_siswa.php')</script>";
}
?>
Silahkan login untuk menjawab!
gan saya mau tanya Cara tampilin isi textboxt dinamis sesuai dengan combobox yg dipilh codingnya sperti dibawah ini gan, ketika saya pilih nama unit, kalau datanya udh di simpan di database secara otomatis texboxtnya diisi jika belum data masih kosong dan di insertkan dulu, ini scriptnya gan

<?php
include('cek-login.php');
?>
<?php

$host = 'localhost';
$user = 'root';
$pass = '';
$dbname = 'direktori';
$connect = mysql_connect($host, $user, $pass) or die(mysql_error());

$dbselect = mysql_select_db($dbname);
?>
<html>
<head>
<title> Pengisian Data </title>
<script src=”jquery.js”></script>
<script src=”bawaan/ui/jquery.ui.core.js”></script>
<script src=”bawaan/ui/jquery.ui.widget.js”></script>
<script src=”bawaan/ui/jquery.ui.datepicker.js”></script>
<link rel=”stylesheet” href=”bawaan/themes/base/jquery.ui.all.css”>
<link rel=”stylesheet” href=”jquery/bawaan/demos/demos.css”>
<link rel="stylesheet" href="admin.css" type="text/css" />
</head>
<body>

<div id="header">
<div class="logo"> Admin Data Direktori </div>
</div>

<div id="menu">
<ul>
<li><a href="http://localhost/Direktori_its"> Direktori</a>
<ul>
<li><a href="logout.php">Logout</a></li>
</ul>
</li>
<li><a href="#">User</a>
<ul>
<li><a href="http://localhost/Direktori_its/admin/index_admin.php">New User</a></li>
<li><a href="http://localhost/Direktori_its/admin/view.php">View Data User</a></li>
</ul>
</li>
<li><a href="#">Data</a>
<ul>
<li><a href="http://localhost/Direktori_its/admin/data.php">New Data</a>
<li><a href="http://localhost/Direktori_its/admin/view_data.php">View Data Direktori</a></li>
</ul>
</li>
<li><a href="#"> Unit </a>
<ul>
<li><a href="http://localhost/Direktori_its/admin/satker.php">New Unit</a>
<li><a href="http://localhost/Direktori_its/admin/view_data_unit.php">View Data Unit</a></li>
</ul>
</li>
</ul>
</div>
<?php
if (!empty($_GET) && $_GET == 'success') {
echo '<h3>Berhasil menambah data!</h3>';
}
?>
<div id="wraper">

<table border="0" cellpadding="3" cellspacing="0" align="center" class="data_input" >
<tbody>
<form action="proses.php" method="post" enctype="multipart/form-data">
<tr>
<td><div align="left">Nama Unit</div></td>
<td width="0"><div align="center">:</div></td>
<td><label for="textfield" ></label>

<?php echo "<select name='nama_unit'>
<option value=0 selected>- Pilih satker -</option>";

$tampil=mysql_query("SELECT * FROM satker ORDER BY nama");
while ($qtabel = mysql_fetch_assoc($tampil))
{
echo '<option value="'.$qtabel.'">'.$qtabel.'</option>';
}
echo "</select>"; ?>
</td>
</tr>
<tr>
<td width="200">Kepala Unit/Ketua</td>
<td><div align="center">:</div></td>
<td><input type="text" name="kepala_badan" id="kepala_badan" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Alamat</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="alamat" id="alamat" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Kota</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="kota" id="kota" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Kode Pos</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="kode_pos" id="kode_pos" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Telepon</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="telepon" id="telepon" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Fax</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="fax" id="fax" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">PABX</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="pabx" id="pabx" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Email</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="email" id="email" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Website</div></td>
<td><div align="center">:</div></td>
<td><input type="text" name="website" id="website" required="required" value="<?php echo $data; ?>"/></td>
</tr>

<tr>
<td><div align="left">Upload Peta</div></td>
<td><div align="center">:</div></td>
<td><input type="file" name="foto" id="foto" value="<?php echo $data; ?>"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="submit" value="Simpan" /></td>
</tr>
</tbody>
</table>
</div>
<div id="footer"> </div>
</body>
</html>

Mohon bantunya ya gan ?? Terimakasih banyak
Silahkan login untuk menjawab!

footer rows dan json

Ony · Aug 19, 2013
apakah bisa *.json melakukan perkalian ato penjumlahan?
apakah bisa *.json menampilkan isi database?
maaf sy msh blm begitu paham mengenai json ... :) mohon tutorialnya :)
Terimakasih :)

footer.php
<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>Footer Rows</title>
       <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
       <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
       <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
       <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
       <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<table class="easyui-datagrid" style="width:700px;height:350px" data-options="url:'data.json', fitColumns:true, singleSelect:true, rownumbers:true, showFooter:true">
		<thead>
			<tr>
				<th data-options="field:'kantor',width:80">Kantor</th>
				<th data-options="field:'brg',width:250">Barang</th>
				<th data-options="field:'tahun',width:80,align:'center'">Tahun</th>
				<th data-options="field:'jmlh',width:80,align:'right'">Jumlah</th>
				<th data-options="field:'harga',width:80,align:'right'">Harga</th>
				<th data-options="field:'total',width:80,align:'right'">Total</th>
			</tr>
		</thead>
	</table>
</body>
</html>

data.json
{"total":28,"rows":[
	{"kantor":"Kantor-01","brg":"Buku kwitansi","tahun":"2013","jmlh":5,"harga":1000,"total":0},
	{"kantor":"Kantor-02","brg":"Kertas HVS F4 70gr warna","tahun":"2013","jmlh":2,"harga":2000,"total":0},
	{"kantor":"Kantor-03","brg":"Buku kwitansi","tahun":"2013","jmlh":4,"harga":5000,"total":0},
	{"kantor":"Kantor-04","brg":"Snelhecter map","tahun":"2013","jmlh":8,"harga":1500,"total":0},
	{"kantor":"Kantor-05","brg":"Tinta refill printer hitam","tahun":"2013","jmlh":5,"harga":3000,"total":0},
	{"kantor":"Kantor-06","brg":"Amplop polos 90 APS PPL","tahun":"2013","jmlh":3,"harga":2500,"total":0},
	{"kantor":"Kantor-07","brg":"Isi staples","tahun":"2013","jmlh":5,"harga":1000,"total":0},
	{"kantor":"Kantor-08","brg":"Double Klip","tahun":"2013","jmlh":2,"harga":1500,"total":0},
	{"kantor":"Kantor-09","brg":"Ordner","tahun":"2013","jmlh":1,"harga":2000,"total":0},
	{"kantor":"Kantor-10","brg":"Tinta refill printer hitam","tahun":"2013","jmlh":3,"harga":4000,"total":0}
],"footer":[
	{"tahun":"SubTotal","jmlh":0,"harga":0,"total":0},
	{"tahun":"Total","jmlh":0,"harga":0,"total":0}
]}
Silahkan login untuk menjawab!
bli putu, mo tanya nie..
sy mo bljr ttg cara mbuat online shop nie. nah, dari contoh2 yg sempet sy liat itu ada yg pake array dan session (mngkn it saja yg bs mengerti krn yg lain basis objek/OOP semua)..
bisa diterangin+kasi contoh dikit gk cara memasukkan belanjaan ke cart dan kemudian nyimpen ke databasenya..
sy bingung banget nie.. dah sy baca berX2 tp gk ngerti2 juga. tp dari sebelum2nya, bli putu yg bisa buat sy mengerti..
suksma bli putu..
#oy gm caranya melihat pertanyaan2 sy seblumnya diforum ini. cm bs ampe 10 post a yg tampil..
http://www.myphptutorials.com/sangkep#1 dah ^_^

Lihat semua 4 jawaban

Silahkan login untuk menjawab!

cari data

Ony · Aug 19, 2013
didalam isi kolom nmkantor ada kantor1, kantor2, kantor3 dst ...
bgmn klo mrnampilkan hanya, semisal kantor2 sj? terimakasih :)
<?php
include '../db.php';

$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
$sort = isset($_POST['sort']) ? strval($_POST['sort']) : 'id_atk';
$order = isset($_POST['order']) ? strval($_POST['order']) : 'asc';
$cari = isset($_POST['cari']) ? mysql_real_escape_string($_POST['cari']) : '';

$offset = ($page-1) * $rows;
$where = " WHERE nmkantor LIKE '%$cari%' OR brgatk LIKE '%$cari%' OR tribulan LIKE '%$cari%' OR tahun LIKE '%$cari%' ";
$text = "SELECT * FROM atk $where ORDER BY $sort $order LIMIT $rows OFFSET $offset";
$result = array();
$result[' '] = mysql_num_rows(mysql_query("SELECT * FROM atk $where"));
$row = array();	

$criteria = mysql_query($text);
while($data=mysql_fetch_array($criteria))
{	
	$row[] = array(
		'id_atk' => $data['id_atk'],
		'kdskpd' => $data['kdskpd'],		
		'nmkantor' => $data['nmkantor'],
		'brgatk' => $data['brgatk'],
		'tribulan' => $data['tribulan'],				
		'tahun' => $data['tahun'],		
		'jmlhsaldoawal' => $data['jmlhsaldoawal'],
		'hrgsaldoawal' => $data['hrgsaldoawal'],
		'totalsaldoawal' => $data['totalsaldoawal'],
		'jmlhtambah' => $data['jmlhtambah'],
		'hrgtambah' => $data['hrgtambah'],		
		'totaltambah' => $data['totaltambah'],
		'jmlhkurang' => $data['jmlhkurang'],		
		'jmlhsaldoakhir' => $data['jmlhsaldoakhir'],		
		'hrgsaldoakhir' => $data['hrgsaldoakhir'],		
		'totalsaldoakhir' => $data['totalsaldoakhir']			
	);
}
$result=array_merge($result,array('rows'=>$row));
echo json_encode($result);
?>

Lihat semua 2 jawaban

Silahkan login untuk menjawab!
mas mau tanya misalkan ada contoh TABEL A

kode nama user nomor
1A james M 20
1B robert james 10
1C M robert 5

nah misalkan user diminta update tapi ada ketentuan:

1.Seandainya nama akan diganti tidak boleh sama dengan record yang lain, dengan kata lain cuma boleh ada 1 JAMES
2.Seandainya user akan diganti tidak boleh sama dengan record yang lain, dengan kata lain cuma boleh ada 1 M

 $cek2 = mysql_num_rows(mysql_query("select nama from tabel where nama ='$nama'"));
 
  if ($cek2 > 0) {
  }else{
  }


itu gimana ya, kalo aku biasa pake mysql_num_rows masih terganjal kalo mau ganti nomor nama juga harus ganti...

semoga paham

Lihat semua 3 jawaban

Silahkan login untuk menjawab!