Selamat siang....database yang buat di laptop ingin saya pindah di komputer, bisa kasih tahu cara mindahnya. Karena laptop saya mau saya ganti dari windows ke linux ubuntu. Mungkin ada cara lain supaya database dan data yang lain tidak hilang. mohon bantuanya, mungkin ada yang sudah master di database mau sharing ilmu, informasi dan pengalaman buat saya dan teman-teman yang membutuhkan. terima kasih....

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
selamat malam bli, saya ada kesulitan dalam masalah insert table relasi pada form registrasi bli.
mohon bantuannya bli, sebelum dan sesudahnya saya ucapkan terima kasih bli.
berikutadalah scriptnya.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Register</title>
</head>

<body>
<?php
	include "./inc/config.php";
?>
<table width="100%">
<?php
							if($_POST['btntambah'] == "Daftar")
							{
								$reg = $_POST['no_reg'];
								$noid = $_POST['no_id'];
								$nama = $_POST['nama'];
								$alamat = $_POST['alamat'];
								$kota = $_POST['kota'];
								$propinsi = $_POST['propinsi'];
								$negara = $_POST['negara'];
								$fax = $_POST['fax'];
								$telp = $_POST['telp'];
								$email = $_POST['email'];
								
								if (trim($nama)=="") {
									echo "<script>alert('Nama masih kosong, ulangi kembali.');</script>";
								}elseif (trim($alamat)=="") {
									echo "<script>alert('Address masih kosong, ulangi kembali.');</script>";
								}
								elseif (trim($kota)=="") {
									echo "<script>alert('Kota masih kosong, ulangi kembali.');</script>";
								}
								elseif (trim($propinsi)=="") {
									echo "<script>alert('Propinsi masih kosong, ulangi kembali.');</script>";
								}
								elseif (trim($negara)=="") {
									echo "<script>alert('Negara masih kosong, ulangi kembali.');</script>";
								}
								elseif (trim($telp)=="") {
									echo "<script>alert('No Telp masih kosong, ulangi kembali.');</script>";
								}
								elseif (trim($email)=="") {
									echo "<script>alert('Email masih kosong, ulangi kembali.');</script>";
								}
								else {
									$reg = strtolower($reg);
									$sql_cek="SELECT * FROM registration WHERE noreg='$reg'";
									$qry_cek=mysql_query($sql_cek, $koneksi);
									$jum_cek=mysql_num_rows($qry_cek);
									if ($jum_cek >= 1) {
										echo "<script>alert('No Reg : <b>$reg</b> SUDAH ADA.');</script>";
										echo "<script>location.href = 'dashboard.php?page=reg' </script>";
										exit;
									}
									
									$sql = "INSERT INTO registration SET 
										noreg ='$reg',
										noid ='$noid',
										nama ='$nama',
										alamat ='$alamat',
										kota ='$kota',
										propinsi ='$propinsi',
										negara ='$negara',
										fax ='$fax',
										telp ='$telp',
										email ='$email'";
										mysql_query($sql, $koneksi) 
										or die ("SQL Error: ".mysql_error());
																			   
									echo "<script>alert('DATA REGISTRATION SUDAH BERHASIL DI TAMBAHKAN.');</script>";
								}
							}							
						?>
                    	
<form action="" method="post">
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>
  <tr>
    <td width="15%">NO.Reg</td>
    <td width="25%">
    <?php
														$query1 = "SELECT max(noreg) AS last FROM registration WHERE noreg LIKE '$today%'";
														$hasil1 = mysql_query($query1);
														$data1  = mysql_fetch_array($hasil1);
														$lastNoReg = $data1['last'];
														$noakhir = $lastNoReg; 
														
														$urut1 = "0000";
														$kode = "NKN-";
														$year1 = date('ymd');
														$noreg = substr($noakhir, 11, 4);
														$noreg = (int)$noreg + 1;
														$noreg = $kode . $year1 . substr($urut1, 0, 4 - strlen($noreg)) . $noreg;
														
													?>
                                                    <input class="wawan-textinput" style="width:100%;" name="no_reg" type="text" width="100%" readonly value="<?php echo $noreg ?>"/>
    </td>
    <td width="6%">&nbsp;</td>
    <td width="15%">NO. ID</td>
    <td width="39%">
    <?php
														$query2 = "SELECT max(noid) AS last FROM registration WHERE noid";
														$hasil2 = mysql_query($query2);
														$data2  = mysql_fetch_array($hasil2);
														$lastNoId = $data2['last'];
														$noakhirid = $lastNoId;
														
														$urut2 = "0000";
														$year2 = date('y');
														$nomor = substr($noakhirid, 3, 4);
														$nomor = (int)$nomor + 1;
														$nomor = $year2 . substr($urut2, 0, 4 - strlen($nomor)) . $nomor;
														
													?> 
                                                   <input style="width:100%;" name="no_id" type="text" width="100px" readonly value="<?php echo $nomor ?>" />
    </td>
  </tr>
  <tr>
    <td>Nama</td>
    <td colspan="4"><input style="width:80%;" name="nama" type="text" /></td>
  </tr>
  <tr>
    <td valign="top">Alamat</td>
    <td colspan="4" valign="top"><textarea style="width:80%;" name="alamat" rows="20%" cols="50%"></textarea></td>
  </tr>
  <tr>
    <td>Kota</td>
    <td><input style="width:100%;" name="kota" type="text" width="20px" /></td>
    <td>&nbsp;</td>
    <td>Propinsi</td>
    <td><select style="width:100%;" name="propinsi">
														<option> - Pilih Salah Satu - </option>																
														<?php
															$sql = "SELECT * FROM n_propinsi ORDER BY prop";
															$qry = mysql_query($sql, $koneksi) or die ("SQL Error".mysql_error());
															while ($data=mysql_fetch_array($qry)) {
															$no++;
														?>
														<option value="<?php echo $data['prop']; ?>"><?php echo $data['prop']; ?></option>
														<?php
															}
														?>
													</select></td>
  </tr>
  <tr>
    <td>fax</td>
    <td><input style="width:100%;" name="fax" type="text" width="20px" /></td>
    <td>&nbsp;</td>
    <td>Telp</td>
    <td><input style="width:100%;" name="telp" type="text" width="20px" /></td>
  </tr>
  <tr>
    <td>Email</td>
    <td colspan="4"><input style="width:80%;" name="email" type="email" /></td>
  </tr>
  <tr align="center" valign="middle">
    <td colspan="5">
    <table width="100%">
      <tr>
        <td colspan="4"><strong>Kegiatan</strong></td>
        </tr>
      <tr>
        <td colspan="4"><strong>Workshop</strong></td>
        </tr>
        <script type="text/javascript">
            var total = 0 ;
 
            function calculate ( checkbox )
            {
                var resultLabel = document.getElementById ( "result_label" ) ;
                var value = parseInt ( checkbox.value ) ;
 
                if ( checkbox.checked )
                    total += value ;
                else
                    total -= value ;
 
                resultLabel.innerHTML = total ;
            }
        </script>
        <?php
															$sql = "SELECT * FROM n_event ORDER BY id";
															$qry = mysql_query($sql, $koneksi) or die ("SQL Error".mysql_error());
															while ($data=mysql_fetch_array($qry)) {
														?>
      <tr>
        <td width="4%"><input type="checkbox" value="<?php echo $data['l_before']; ?>" id="checkbox1" onclick="calculate( this )" /></td>
        <td width="60%"><?php echo $data['nama_event']; ?></td>
        <td width="18%">Rp. <?php echo $data['l_before']; ?></td>
        <td width="18%">Rp. <?php echo $data['l_after']; ?></td>
      </tr>
      	<?php
			}
		?>
      <tr>
        <td colspan="2"><strong>TOTAL</strong></td>
        <td colspan="2"><strong><label id="result_label">0</label></strong></td>
        </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5">
        <table width="100%">
      <tr>
        <td colspan="3"><strong>Penginapan</strong></td>
        </tr>
      <tr>
        <td colspan="3"><strong>Hotel</strong></td>
        </tr>
        <script type="text/javascript">
            var total = 0 ;
 
            function calculate ( checkbox )
            {
                var resultLabel = document.getElementById ( "result_label" ) ;
                var value = parseInt ( checkbox.value ) ;
 
                if ( checkbox.checked )
                    total += value ;
                else
                    total -= value ;
 
                resultLabel.innerHTML = total ;
            }
        </script>
        <?php
															$sql = "SELECT * FROM n_hotel ORDER BY id";
															$qry = mysql_query($sql, $koneksi) or die ("SQL Error".mysql_error());
															while ($data=mysql_fetch_array($qry)) {
														?>
      <tr>
        <td width="4%"><input type="checkbox" value="<?php echo $data['l_hrg']; ?>" id="checkbox1" onclick="calculate( this )" /></td>
        <td width="60%"><?php echo $data['nama_hotel']; ?></td>
        <td>Rp. <?php echo $data['l_before']; ?></td>
        </tr>
      	<?php
			}
		?>
      <tr>
        <td colspan="2"><strong>TOTAL</strong></td>
        <td><strong><label id="result_label">0</label></strong></td>
        </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td colspan="5">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4"><input type="reset" value="Reset" />
                    			<input type="submit" name="btntambah" value="Daftar" /></td>
    <td>&nbsp;</td>
  </tr>
	</form>
</table>

</body>
</html>

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
<html>
<head>
<title>Delima pinglogistra</title>
   <link href="jquery/bigrid/bigrid.css" type="text/css" rel="Stylesheet" />
    <script language="javascript" src="jquery/jquery.js"></script>
    <script language="javascript" src="jquery/bigrid/bigrid.js"></script>
    <script language="javascript">
        $(document).ready(function(){
           $("#BIGrid1").bigrid({fixedrow:2, fixedcolumn:1, visiblerow: 4, visiblecolumn: 3});
           
           $("#BiGrid2").bigrid({fixedrow:2, fixedcolumn:1, visiblerow: 4, visiblecolumn: 2});
        });

    </script>
	
    <style>
        body, td, div
        {
        	font-family: Verdana;
        	font-size:10px;
        }
        h1
        {
        	font-family: Verdana;
        }
        .header
        {
        	text-decoration:underline;
        }
.style6 {color: #0000FF; font-weight: bold; font-size: 12; }
.style7 {font-size: 12}
    .style8 {
	color: #0000FF;
	font-weight: bold;
}
    </style>
 <link href="thickbox/thickbox.css" rel="stylesheet" type="text/css" />
 <script language="javascript" src="js/jquery_ajax.js"></script>
 <script language="javascript" src="thickbox/thickbox.js"></script>
 <script language="javascript">
function selectPegawai(nik,no_dm){
  $('input[@name=nik]').val(nik);
  $('input[@name=nm_sopir]').val(no_dm);
  tb_remove(); // hilangkan dialog thickbox
}
$(document).ready(function(){
  $('input[@name=nik]').blur( // beri event pada saat onBlur inputan kode pegawai
	function(){				
	  var vNIP = $(this).val();
	  $.get('cari_akun_sopir.php',{nik: vNIP},
		function(nm_sopir){
		  // jika response tidak kosong nilainya maka masukkan nilai ke inputan nm_sopir pegawai
		  if(nm_sopir.length > 0){ 
			$('input[@name=nm_sopir]').val(nm_sopir);	   
			$('#divAlertPegawai').text(' ').css('color','blue');
		  } else $('#divAlertPegawai').text('NIK "'+vNIP+'" Tidak Ditemukan').css('color','red');

  		}
		
	  );
	}
  );
  // beri event pada saat keyup kode pegawai agar kode yang dimasukan font-nya UPPERCASE semua (optional)
  $('input[@name=pegawai]').keyup(
	function(){
	  $(this).val(String($(this).val()).toUpperCase());
	}
  );
});


function selectPegawai2(nik,no_dm){
  $('input[@name=nik]').val(nik);
  $('input[@name=no_ums]').val(no_dm);
  tb_remove(); // hilangkan dialog thickbox
}
$(document).ready(function(){
  $('input[@name=nik]').blur( // beri event pada saat onBlur inputan kode pegawai
	function(){				
	  var vNIP = $(this).val();
	  $.get('cari_no_ums.php',{nik: vNIP},
		function(no_ums){
		  // jika response tidak kosong nilainya maka masukkan nilai ke inputan nm_sopir pegawai
		  if(no_ums.length > 0){ 
			$('input[@name=no_ums]').val(no_ums);	   
			$('#divAlertPegawai').text(' ').css('color','blue');
		  } else $('#divAlertPegawai').text('NIK "'+vNIP+'" Tidak Ditemukan').css('color','red');

  		}
		
	  );
	}
  );
  // beri event pada saat keyup kode pegawai agar kode yang dimasukan font-nya UPPERCASE semua (optional)
  $('input[@name=pegawai]').keyup(
	function(){
	  $(this).val(String($(this).val()).toUpperCase());
	}
  );
});

function selectPegawai3(nik,no_dm){
  $('input[@name=nik]').val(nik);
  $('input[@name=Ztgl_ums]').val(no_dm);
  tb_remove(); // hilangkan dialog thickbox
}
$(document).ready(function(){
  $('input[@name=nik]').blur( // beri event pada saat onBlur inputan kode pegawai
	function(){				
	  var vNIP = $(this).val();
	  $.get('cari_tgl_ums.php',{nik: vNIP},
		function(Ztgl_ums){
		  // jika response tidak kosong nilainya maka masukkan nilai ke inputan nm_sopir pegawai
		  if(Ztgl_ums.length > 0){ 
			$('input[@name=Ztgl_ums]').val(Ztgl_ums);	   
			$('#divAlertPegawai').text(' ').css('color','blue');
		  } else $('#divAlertPegawai').text('NIK "'+vNIP+'" Tidak Ditemukan').css('color','red');

  		}
		
	  );
	}
  );
  // beri event pada saat keyup kode pegawai agar kode yang dimasukan font-nya UPPERCASE semua (optional)
  $('input[@name=pegawai]').keyup(
	function(){
	  $(this).val(String($(this).val()).toUpperCase());
	}
  );
});

function selectPegawai4(nik,no_dm){
  $('input[@name=nik]').val(nik);
  $('input[@name=bon]').val(no_dm);
  tb_remove(); // hilangkan dialog thickbox
}
$(document).ready(function(){
  $('input[@name=nik]').blur( // beri event pada saat onBlur inputan kode pegawai
	function(){				
	  var vNIP = $(this).val();
	  $.get('cari_jum_ums.php',{nik: vNIP},
		function(bon){
		  // jika response tidak kosong nilainya maka masukkan nilai ke inputan nm_sopir pegawai
		  if(bon.length > 0){ 
			$('input[@name=bon]').val(bon);	   
			$('#divAlertPegawai').text(' ').css('color','blue');
		  } else $('#divAlertPegawai').text('NIK "'+vNIP+'" Tidak Ditemukan').css('color','red');

  		}
		
	  );
	}
  );
  // beri event pada saat keyup kode pegawai agar kode yang dimasukan font-nya UPPERCASE semua (optional)
  $('input[@name=pegawai]').keyup(
	function(){
	  $(this).val(String($(this).val()).toUpperCase());
	}
  );
});

 </script>	
</head>
<body>
<p>&nbsp;</p>

<div align="center">
  <?php 
			
			$query_ord=mysql_fetch_array(mysql_query("SELECT max(no_id) FROM dt_tmp_bpkk ORDER BY tgl_bpkk DESC"));
			$nomor_so=$query_ord[0]+1;
			$no_skrg = sprintf('%04s', $nomor_so);
			$format = date("ymd");

			$tahun = substr($format,0,2);
			$bulan = substr($format,2,2);
			if ($bulan == '01' or $bulan == '1'){
			    $bln = 'I';
			} elseif ($bulan == '02' or $bulan == '2'){
			    $bln = 'II';
			} elseif ($bulan == '03' or $bulan == '3'){
			    $bln = 'III';
			} elseif ($bulan == '04' or $bulan == '4'){
			    $bln = 'IV';
			} elseif ($bulan == '05' or $bulan == '5'){
			    $bln = 'V';
			} elseif ($bulan == '06' or $bulan == '6'){
			    $bln = 'VI';
			} elseif ($bulan == '07' or $bulan == '7'){
			    $bln = 'VII';
			} elseif ($bulan == '08' or $bulan == '8'){
			    $bln = 'VIII';
			} elseif ($bulan == '09' or $bulan == '9'){
			    $bln = 'IX';
			} elseif ($bulan == '10' or $bulan == '10'){
			    $bln = 'X';
			} elseif ($bulan == '11' or $bulan == '11'){
			    $bln = 'XI';
			} elseif ($bulan == '12' or $bulan == '12'){
			    $bln = 'XII';
			} else {
			    $bln = 0;
			}  
			
			if ($_SESSION['area'] = 'JAKARTA'){
			    $kd_area = 'B';
			} elseif ($_SESSION['area'] = 'SEMARANG') {
			    $kd_area = 'H';
			} elseif ($_SESSION['area'] = 'SURABAYA') {	
			    $kd_area = 'L';
			} elseif ($_SESSION['area'] = 'YOGYAKARTA') {	
			    $kd_area = 'Y';
			} else {
			    $kd_area = '';
			}
					
			$no_bpkk= $no_skrg ."$kd_area"."/BPKK/"."$bln/"."$tahun";

			
			
			$Ptanggal = date("d-m-Y");
			
		?>
</div>
<div align="center">
  

<br>  

<?
$no_id = $_GET['no_id'];	
$query9 = mysql_query("SELECT * from dt_muat_so where Xid = '$no_id' ");
$Pdata9 = mysql_fetch_assoc($query9);
if(!$Pdata9['nik'] == '' and !$Pdata9['nik_krani'] == ''){
   $PXnik = $Pdata9['nik_krani'];
   $PXnama = $Pdata9['krani'];
} else {
   $PXnik = $Pdata9['nik'];
   $PXnama = $Pdata9['nm_sopir'];
}
   
?>		

<fieldset style="width:755px">
<legend class="style8">Bukti Pengeluaran Kas Kecil </legend>
<form action="isi_bpkk.php" method="post" name="form1" target="_self" id="form1"> 
<table width="642" border=1 align="center" cellpadding=2 cellspacing=0 borderColor="black" id="BIGrid2" style="width:642;border-collapse:collapse;">   
    <tr>
      <td rowspan="2">&nbsp;</td>
      <td><div align="left">No.BPKK</div></td>
      <td><div align="left">
        <input name="no_bpkk" type="text" id="no_bpkk" style="background-color:#FFFFCC" value="<?php echo $no_bpkk;?>" size="20" maxlength="20" readonly="true" />
      </div></td>
      <td><div align="left">Tanggal BPKK </div></td>
      <td><div align="left">
        <input name="tgl_bpkk" type="text" id="tgl_bpkk" style="background-color:#FFFFCC" value="<? echo $Ptanggal;?>" size="12" maxlength="12" readonly="true">
      </div></td>
    </tr>
    
    <tr>
      <td><div align="left">Dibayarkan kepada Sopir / Krani </div></td>
      <td colspan="3"><div align="left">
        <div align="left">
          <input name="nik" type="text" id="nik" size="10" value ="<? echo $PXnik; ?>"/>
          <input name="nm_sopir" type="text" id="nm_sopir" style="background-color:#FFFFCC" value="<? echo $PXnama; ?>" size="30" maxlength="30" readonly="readonly" />
        </div>
      </div></td>
    </tr>
   
	


      
    <tr>
      <td width="30"><div align="center" class="style6">No.</div></td>
      <td width="215"><div align="center" class="style6">Keterangan</div></td>
      <td width="140"><span class="style7"></span></td>
      <td width="110"><div align="center" class="style6">Debet</div></td>
      <td width="115"><div align="center" class="style6">Kredit</div></td>
    </tr>
<?
$query8 = mysql_query("SELECT p.*,DATE_FORMAT(d.tgl_muat,'%d-%m-%Y') as Ztgl_muat,DATE_FORMAT(d.tgl_kas,'%d-%m-%Y') as Ztgl_kas,d.no_kas,d.krani,d.nik_krani,d.no_sbm,d.no_pol_skrg,d.no_ship,d.nm_sopir,d.nik,d.nm_kernet,b.sangu from dt_order_tmp p LEFT JOIN dt_cust_rute b ON b.lokasi_asal = p.lokasi_asal and b.lokasi_tujuan = p.lokasi_tujuan and b.tipe_truk = p.tipe_truk2 LEFT JOIN dt_muat_so d ON d.Xid = p.no_id where p.no_id = '$no_id' ");
$Pdata = mysql_fetch_assoc($query8);
?>			
    
    <tr>
      <td rowspan="17"><strong>1.</strong></td>
      <td><div align="left">No.SO</div></td>
      <td><div align="left"><? echo $Pdata['no_so']; ?>
        <input name="no_so" type="hidden" id="no_so" value="<? echo $Pdata['no_so']; ?>"/>
      </div></td>
      <td rowspan="17" class="gridHeader"><input name="PXid" type="hidden" id="PXid" value="<?=$Pdata["no_id"];?>"></td>
      <td rowspan="17" class="gridHeader">&nbsp;</td>
    </tr>
    <tr>
      <td><div align="left">Customer Order </div></td>
      <td><div align="left"><? echo $Pdata['nm_cust']; ?>
            <input name="nm_cust" type="hidden" id="nm_cust" value="<? echo $Pdata['nm_cust']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">No.account customer </div></td>
      <td><div align="left"><? echo $Pdata['no_akun_cust']; ?>
            <input name="no_akun_cust" type="hidden" id="no_akun_cust" value="<? echo $Pdata['no_akun_cust']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">No.Polisi</div></td>
      <td><div align="left"><? echo $Pdata['no_pol_skrg']; ?>
            <input name="no_pol_skrg" type="hidden" id="no_pol_skrg" value="<? echo $Pdata['no_pol_skrg']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">Tipe truk </div></td>
      <td><div align="left"><? echo $Pdata['tipe_truk2']; ?>
        <input name="tipe_truk2" type="hidden" id="tipe_truk2" value="<? echo $Pdata['tipe_truk2']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">Equivalent</div></td>
      <td><div align="left"><? echo $Pdata['tipe_truk3']; ?></div></td>
    </tr>
    
    <tr>
      <td><div align="left">Sopir</div></td>
      <td><div align="left"><? echo $Pdata['nm_sopir']; ?>
        <input name="nm_sopir" type="hidden" id="nm_sopir" value="<? echo $Pdata['nm_sopir']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">NIK Sopir </div></td>
      <td><div align="left"><? echo $Pdata['nik']; ?>
        <input name="nik" type="hidden" id="nik" value="<? echo $Pdata['nik']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">Kernet</div></td>
      <td><div align="left"><? echo $Pdata['nm_kernet']; ?></div></td>
    </tr>
    <?
$total = $sangu - $bon;
$tab_claim = 0.1 * $total;
?>
    <tr>
      <td><div align="left">Krani</div></td>
      <td><div align="left"><? echo $Pdata['krani']; ?></div></td>
    </tr>
    <tr>
      <td><div align="left">NIK Krani </div></td>
      <td><div align="left"><? echo $Pdata['nik_krani']; ?></div></td>
    </tr>
    <tr>
      <td><div align="left">No.Shipment</div></td>
      <td><div align="left"><? echo $Pdata['no_ship']; ?></div></td>
    </tr>
    
    <tr>
      <td><div align="left">Jenis muatan (Produk) </div></td>
      <td><div align="left"><? echo $Pdata['jns_muatan']; ?></div></td>
    </tr>
    <tr>
      <td><div align="left">Lokasi asal</div></td>
      <td><div align="left"><? echo $Pdata['lokasi_asal']; ?>
        <input name="lok_asal" type="hidden" id="lok_asal" value="<? echo $Pdata['lokasi_asal']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">Lokasi tujuan </div></td>
      <td><div align="left"><? echo $Pdata['lokasi_tujuan']; ?>
        <input name="lok_tujuan" type="hidden" id="lok_tujuan" value="<? echo $Pdata['lokasi_tujuan']; ?>"/>
      </div></td>
    </tr>
    
    <tr>
      <td><div align="left">No.SBM</div></td>
      <td><div align="left"><? echo $Pdata['no_sbm']; ?>
        <input name="no_sbm" type="hidden" id="no_sbm" value="<? echo $Pdata['no_sbm']; ?>"/>
      </div></td>
    </tr>
    <tr>
      <td><div align="left">Tgl.Muat</div></td>
      <td><div align="left"><? echo $Pdata['Ztgl_muat']; ?></div></td>
    </tr>
    
    <tr>
      <td>&nbsp;</td>
	  
 
<?
$que1 = mysql_query("SELECT * from tabel_master where nama_rekening =  'BIAYA UANG JALAN' ");
$data1 = mysql_fetch_assoc($que1);
?>		  
      <td bgcolor="#FFCCFF"><div align="left"><strong>BIAYA UANG JALAN </strong></div></td>
      <td><div align="left"><? echo $data1['kode_rekening']; ?>
          <input name="no_akun_sangu" type="hidden" id="no_akun_sangu" value="<? echo $data1['kode_rekening']; ?>"/>
      </div></td>
      <td class="gridHeader"><div align="right"><? echo number_format($Pdata['sangu']); ?>
        <input name="sangu" type="hidden" id="sangu" size="10" value="<? echo $Pdata['sangu']; ?>"/>
      </div></td>
      <td class="gridHeader">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td bgcolor="#FFCCFF"><div align="left"><strong>HUTANG PREMI SOPIR  </strong></div></td>

<?
$que2 = mysql_query("SELECT * from tabel_master where nama_rekening =  'HUTANG PREMI SOPIR' ");
$data2 = mysql_fetch_assoc($que2);
?>	
      <td><div align="left"><? echo $data2['kode_rekening']; ?>
          <input name="no_akun_sangu2" type="hidden" id="no_akun_sangu2" value="<? echo $data2['kode_rekening']; ?>"/>
      </div></td>
      <td class="gridHeader">&nbsp;</td>
      <td class="gridHeader"><div align="right"><? echo number_format($Pdata['sangu']); ?>
        <input name="sangu2" type="hidden" id="sangu2" size="10" value="<? echo $Pdata['sangu']; ?>"/>
      </div></td>
    </tr>
  </table>
<?
$Zjudge = $_SESSION['judge'];

$strSQL = "SELECT *,DATE_FORMAT(tgl_ums,'%d-%m-%Y') as Ztgl_ums from dt_ums where cek_ums = '3' and lunas = '1' and nik = '$PXnik' and cek_bpkk = '' order by tgl_ums DESC";


$objQuery = mysql_query("SET SQL_BIG_SELECTS =1");
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");


?>  
<br>
<div align="left">
  <fieldset style="width:919px">
  <legend class="style8">BPKK</legend>
    <table width="919" border=1 align="center" cellpadding=2 cellspacing=0 borderColor="black" id="BIGrid2" style="width:910;border-collapse:collapse;">
      <tr>
        <th width="57" rowspan="2" align="center" bgcolor="#FFFFCC"><div align="center">No.</div></th>
        <th colspan="3" align="center" bgcolor="#FFFFCC"><div align="center">UMS</div></th>
        <th colspan="3" align="center" bgcolor="#FFFFCC"><div align="center">Penyelesaian  BPKK </div></th>
      </tr>
      <tr>
        <th width="124" align="center" bgcolor="#FFFFCC"><div align="center">Tanggal</div></th>
        <th width="168" align="center" bgcolor="#FFFFCC"><div align="center">No.</div></th>
        <th width="124" align="center" bgcolor="#FFFFCC"><div align="center">Jumlah</div></th>
        <th width="147" align="center" bgcolor="#FFFFCC"><div align="center">Tanggal </div></th>
        <th width="161" align="center" bgcolor="#FFFFCC"><div align="center">No.</div></th>
        <th width="76" align="center" bgcolor="#FFFFCC"><div align="center">Jumlah</div></th>
      </tr>
      <?
$i = 0;
while($rows=mysql_fetch_array($objQuery)){
$i++;

?>

      <tr>
        <td><div align="left"> <? echo $i; ?> </div></td>
        <td><div align="left"><? echo $rows['Ztgl_ums']; ?></div></td>
        <td><div align="left"><? echo $rows['no_ums']; ?></div></td>
        <td align="right"><? echo number_format($rows['bon']); ?></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	  </tr>
			<?php
			$rowset = mysql_query("select *,DATE_FORMAT(tgl_bpkk,'%d-%m-%Y') as Ztgl_bpkk from dt_bpkk where no_ums ='".$rows['no_ums']."' order by tgl_bpkk ASC");
			while($data = mysql_fetch_array($rowset)){
			?>		
<tr>			
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td align="right">&nbsp;</td>
		<td><div align="left">
		  <div align="left"><? echo $data['Ztgl_bpkk']; ?></div>
		</div></td>
		<td><div align="left"><? echo $data['no_bpkk']; ?></div></td>
		<td align="right"><? echo number_format($data['sangu']); ?></td>
      </tr>
<?
$Zjum_sangu = $Zjum_sangu + $data['sangu'];
}	  
}
?>	  
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="left">
  <div align="left"><? echo $Ptanggal; ?></div>
</div></td>
<td><div align="left">
  <div align="left"><? echo $no_bpkk; ?></div>
</div></td>	
<td align="right"><? echo number_format($Pdata['sangu']); ?></td>	  
      <tr>
        <td colspan="6"><div align="right">Total</div></td>
        <td align="right"><? echo number_format($Zjum_sangu + $Pdata['sangu']); ?></td>
      </tr>
      <tr>
        <td colspan="7" align="center"><input name="no_kwitansi" type="hidden" id="no_kwitansi" style="background-color:#FFFFCC" value="<?php echo $no_kwitansi;?>" size="15" readonly="true" />
            <input type="hidden" name="hdnCount2" value="<?=$i;?>"></td>
      </tr>
    </table>
</fieldset>
</div>	
    <br>

<div align="left">
  <fieldset style="width:755px">
  <legend class="style8">Uang Muka Sementara</legend>
  <table width="919" border=1 align="left" cellpadding=2 cellspacing=0 borderColor="black" id="BIGrid2" style="width:910;border-collapse:collapse;">
    <tr>
      <td width="62" rowspan="2"><div align="center">Cek pelunasan </div></td>
      <td width="31" rowspan="2"><div align="center">No.</div></td>
      <td colspan="2"><div align="center">UMS </div></td>
      <td colspan="2"><div align="center">Sopir</div></td>
      <td width="191" rowspan="2"><div align="center">Untuk order </div></td>
      <td colspan="2"><div align="center">Lokasi</div></td>
      <td width="67" rowspan="2"><div align="center">
        <div align="center">Jumlah</div>
      </div></td>
    </tr>
    <tr>
      <td width="78"><div align="center">Tanggal</div></td>
      <td width="90"><div align="center">No.</div></td>
      <td width="55"><div align="center">NIK</div></td>
      <td width="54"><div align="center">Nama</div></td>
      <td width="102"><div align="center">Asal</div></td>
      <td width="124"><div align="center">Tujuan</div></td>
    </tr>
    <?

$no = 1;
$sql2 = "SELECT *,DATE_FORMAT(tgl_ums,'%d-%m-%Y') as Ztgl_ums from dt_ums where nik = '$PXnik' and lunas = '1' and cek_ums = '3' and cek_bpkk = '' order by tgl_ums ASC";

$retval2 = mysql_query("SET SQL_BIG_SELECTS =1");
$retval2 = mysql_query($sql2) or die ("Error Query [".$sql2."]");

?>
    <?
$i = 0;
while($rows2=mysql_fetch_array($retval2)){
$i++;
?>
     <tr>
      <td><div align="center">
        <input type="checkbox" name="chkDel_adm[]" id="chkDel_adm<?=$i;?>" value="<?=$rows2["no_id"];?>" onClick="ClickMakeColorByTr(document.frmMain.chkDel_adm<?=$i;?>,'tr<?=$i;?>');">
        <input type="hidden" name="textfield" value="<?=$rows2["no_id"];?>">
      </div></td>
      <td><? echo $i; ?></td>
      <td><? echo $rows2['Ztgl_ums']; ?></td>
      <td><? echo $rows2['no_ums']; ?>
        <input name="no_ums" type="hidden" id="no_ums" value="<?=$rows2["no_ums"];?>"></td>
      <td colspan="-25"><? echo $rows2['nik']; ?></td>
      <td><? echo $rows2['nm_sopir']; ?></td>
      <td><? echo $rows2['nm_cust']; ?></td>
      <td><? echo $rows2['lokasi_asal']; ?></td>
      <td><? echo $rows2['lokasi_tujuan']; ?></td>
      <td><div align="right">
        <input name="bon" type="hidden" id="bon" value="<?php echo $rows2['bon'];?>" />
        <? echo number_format($rows2['bon']); ?></div></td>
    </tr>
    <?
$no++;
$Zjum_ums = $Zjum_ums + $rows2['bon'];
}
mysql_free_result($retval2); //tambahan
?>
    <tr>
      <td colspan="10"><div align="center">
        <input name="kode_bukti" type="hidden" id="kode_bukti" value="<?php echo $no_bpkk;?>" />
        <input type="hidden" name="hdnCount" value="<?=$i;?>">
        <input type="submit" onClick="return confirm('Simpan data ini dan Sisa uang jalan akan dibayarkan?')" value="Simpan" name="simpan"/>
      </div></td>
    </tr>
  </table>
  </fieldset>
</div>
</form>  


  <p>&nbsp;</p>

  <p>&nbsp;</p>
  <p><br>
    </p>
  <div align="left">
<p>Total BPKK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = <? echo number_format($Zjum_sangu + $Pdata['sangu']) ; ?> <br>
Total UMS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = <? echo number_format($Zjum_ums) ; ?> <br>
Kurang / Lebih bayar = <? echo number_format($Zjum_ums - $Zjum_sangu - $Pdata['sangu'] ) ; ?>
</p>
</div>

<div style="font-size:9px">
<?
include("footer2.php");
?>
</div>
</body>
</html>
Selamat pagi mas Ellyx
Mohon bantuannya,
1.Saya ingin ( tanpa submit )
Ada 2 atau 3 checxbox , dimana jika di checklist chechboxnya , maka data dari database akan muncul.Contohnya jika checkbox 1 di checklist , maka data dari database muncul dengan data dari checklist no.1 (misalnya no_id saja).
Jika di click checkbox 1 dan 2 maka muncul data dengan no_id = 1 dan 2
2.Saya ada masalah dengan :
dengan textfield
Yang saya inginkan , jika tidak ada isinya , maka data disebelahnya menjadi hidden.
tapi jika diisi dengan angka atau huruf apapun(tidak ada kaitannya dengan database yang muncul di hidden maka data disebelahnya menjadi tampil (show)
Contoh
..Input.. Nama Alamat (show)
..tidak diinput (diisi) hidden

Terima kasih Mas,mohon pencerahannya

Lihat semua 1 jawaban

Silahkan login untuk menjawab!

Format Report Design

Bella · Aug 30, 2012
mas ellyx, mohon pencerahan dong, atau referensi cara
Design Report berformat kayak disini :http://www.myphptutorials.com/questions/bentuk-laporan_791.html

Lihat semua 2 jawaban

Silahkan login untuk menjawab!
mas ellyx ak minta tolong, ak pengen input data dan save data ya berada dalam 1 hal/page, dan bagian nama scrip yg salah ini yg salh , mhon pencerahan y mas.... :(
<html>
	<head>
	    <style type="text/css">
<!--
.style2 {
	font-size: 12px;
	font-style: italic;
}
.style3 {
	font-size: 24px;
	font-weight: bold;
	color: #FF0000;
}
-->
        </style>
</head>
	   <?php
	   if($_POST){
include "config.php";
	  $tgltrans=$_POST['tgltransaksi'];
	  $tglacara= $_POST['tgl']."-".$_POST['bln']."-".$_POST['thn'];
	  $acara=$_POST['acara'];
	  $hari=$_POST['hari'];
	  $waktu=$_POST['mulai']."-".$_POST['selesai'];
	  $user=$_POST['user'];
	  $nama=$_POST['nama'];
	 $sql = "INSERT INTO pesan (username,instansi,tgltransaksi, acara, tglacara, jmlhari, waktu)
	  value ('$user','$nama','$tgltrans','$acara','$tglacara','$hari','$waktu')";	
	mysql_query($sql)
		or die ("Gagal query ubah : ".mysql_error()); }
		?>
	<?php
	 if($_POST){
include "config.php";
	  $std = $_POST['std'];
			$sqj=mysql_query("select * from pesan order by id desc limit 1");
			$ruk=mysql_fetch_array($sqj);
			$no_urut=$ruk[id];
			$tgltrans=$ruk[tgltransaksi];
			
						$qu=mysql_query("select * from fasilitas where ket='$std'");
						while($ruk=mysql_fetch_array($qu))
						{
						$idfasilitas=$ruk[psewa];
						$nama=$ruk[nama];
						$kate=$ruk[kategori];
						$nama=$ruk[nama];
						$jbarang=$ruk[jbarang];
						$subtotal=$ruk[harga];
 $SQL = "INSERT INTO temp_order (penyewa,psewa,tgltransaksi,nama,kategori,jbarang,jharga)
 	     VALUES ('$no_urut','$idfasilitas','$tgltrans','$nama','$kate','$jsewa','$subtotal')";
      mysql_query($SQL)
	or die ("Gagal query simpan : ".mysql_error());
	}}
?>
    <?php
    if($_POST){
    $op1 = explode('.',$_POST['op1']);
    $acara = $op1[1];
    }
    ?>
    <script type="text/javascript">
    function dik(){
    var a;
    a = document.getElementById('op1').value.split('.');
    document.getElementById('acara').value = a[0];
    }
    </script>
<script type="text/javascript">
function validateForm(){
oSel1 = document.getElementById('op1');
if(oSel1.selectedIndex == 0){return false;}
document.getElementById('form1').action = oSel1.value;
return true;
}
</script>
	<body>
 	<?php include "header.php" ?>
	<?php include "menuuser.php" ?>
	
	<div class="art-content">
	<div class="art-Post">
	<div class="art-Post-body">
	<div class="art-Post-inner" align="center">
		<h2 class="art-PostHeader">
		  <p align="center" class="art-Logo-text"> Data Reservasi </p>
		</h2>
	</div>
		<div class="cleared"></div>
	</div>
	</div>
	<div class="art-Post">
	<div class="art-Post-body">
	<div class="art-Post-inner">
	<div class="art-PostContent">
	
	<?php
	include "config.php";
	
	 $sql = "SELECT * FROM reservasi order by idreservasi desc limit 1";
	 $qry = mysql_query($sql, $koneksi)
		  or die ("Query Gagal ".mysql_error());
	 while($user=mysql_fetch_array($qry)){  ?>
	<form id="form1" name="form1" method="post" action="" target="_self"  onSubmit="return validateForm();">
	  <table width="448" border="0" align="center">
          <tr>
            <td height="26" colspan="2"><div align="center"><span class="style3">Isi Agenda Acara yg Akan dipesan </span> 
                <input name="user" type="hidden" id="user" value="<?php echo $user[username];?>">
                <label>
                <input type="hidden" name="nama" id="nama" value="<?php echo $user[nama];?>">
                </label>
            </div><br></td>
          </tr> <?php } ?>
          <tr>
            <td width="146" height="25"><strong>Acara</strong></td>
            <td width="292"><strong>:
                <label>
<select name="op1" onChange="dik()" id="op1">
  <option value="" selected="selected">.::Pilih Acara::.</option>
  <option value="pernikahan.php">Pernikahan</option>
  <option value="wisuda.php">wisuda</option>
  <option value="seminar.php">Seminar</option>
</select>
<input name="acara" id="acara" type="hidden" value="" size="5" maxlength="5" />
              </label>
            </strong></td>
          </tr>
          <tr>
            <td height="26"><strong>Tanggal</strong></td>
            <td><strong>:            
                <select name="tgl">
                  <option selected="selected">Tanggal</option>
                  <?php
										for($a=1; $a<=31; $a+=1){
										echo"<option value=$a> $a </option>";
										}
									?>
              </select>
                <select name="bln">
										  <option selected="selected">Bulan</option>
									      <?php
										for($a=1; $a<=12; $a+=1){
										echo"<option value=$a> $a </option>";
										}
									?>
              </select>
                <select name="thn">
									  <option selected="selected">Tahun</option>
									  <?php
									$t=date('Y');
										for($i=$t; $i>=1925; $i-=1){
										echo"<option value=$i > $i </option>";
										}
										?>
              </select>
            </strong></td>
          </tr>
          <tr>
            <td height="26"><strong>Jumlah Hari</strong> </td>
            <td><strong>:
              
              
                <select name="hari">
                  <option value="1" selected="selected">1</option>
                  <?php
										for($a=2; $a<=31; $a+=1){
										echo"<option value=$a> $a </option>";
										}
									?>
              </select>
            </strong>
              <label>
              <input name="std" type="hidden" id="std" value="standart" >
            </label></td>
          </tr>
          <tr>
            <td height="29"><strong>Mulai Acara </strong></td>
            <td><strong>:            
                <label>
                <select name="mulai">
                  <option selected >Mulai</option>
                  <option value="06.00 WIB">06.00 WIB</option>
                  <option value="09.00 WIB">09.00 WIB</option>
                  <option value="12.00 WIB">12.00 WIB</option>
                  <option value="15.00 WIB">15.00 WIB</option>
                  <option value="18.00 WIB">18.00 WIB</option>
                  <option value="21.00 WIB">21.00 WIB</option>
                </select>
                </label>
                <span class="style2">s/d</span></strong>            
              <strong>
              <select name="selesai">
                <option selected >Selesai</option>
                <option value="06.00 WIB">06.00 WIB</option>
                <option value="09.00 WIB">09.00 WIB</option>
                <option value="12.00 WIB">12.00 WIB</option>
                <option value="15.00 WIB">15.00 WIB</option>
                <option value="18.00 WIB">18.00 WIB</option>
                <option value="21.00 WIB">21.00 WIB</option>
                <option value="selesai">selesai</option>
              </select>
              </strong></td>
          </tr>
          <tr>
            <td height="26">&nbsp;</td>
            <td><label>
              <input name="tgltransaksi" type="hidden" id="tgltransaksi" value="<?php print date('d-m-Y'); ?>">
              <br>
            </label></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><div align="right">
              <input name="sub" id="sub" type="submit" value="Submit" />
            </div></td>
          </tr>
		 
          <tr>
            <td>&nbsp;</td>
            <td align="right"></td>
          </tr>
        </table>
      </form>

	  	<div class="cleared"></div>
	</div>
		<div class="cleared"></div>
	</div>
	</div>    
	</body>
	
</html>

Lihat semua 2 jawaban

Silahkan login untuk menjawab!
Salam sejahtera Pak Ellyx. Terima kasih atas tutorial pak Ellyx.
Saya setia mengikuti tutorial-tutorial dari bapak Ellyx Christian. Dari situs Anda saya beljar tentang kerjasama antara php dan mysql. Hasilnya, saat ini saya memberanikan diri untuk membuat sebuah website untuk gereja saya. Sudah hampir rampung, kendati sangat sederhana dan tidak kompleks, tapi sudah menggunakan CMS (*yang juga adalah CMS yang sangat sederhana tentunya). Mudah2an dalam waktu dekat bisa launching.
Tapi saya sedang nyangkut di satu persoalan pak...
Saya punya file artikel_baru.php yang berisikan sebuah form. Pada form ini saya membuat tag <select></select> untuk kategori dan subkategori.
*kategori dan subkategori sudah ditentukan dan masing2 memiliki tabel*
Demikian sehingga, kategori dan subkategori dapat dipilih.

Persoalannya adalah, apabila saya memilih salah satu kategori, pada pilihan subkategori tidak muncul pilihan subkategori yang berkaitan dengan kategori, melainkan semua subkategori ditampilkan pada tag <select></select> untuk subkategori.

Singkatnya, saya ingin membuat data yang ditampilkan pada option subkategori berubah seiring dengan perubahan pilihan pada option kategori.

Bagaimana caranya ya pak?
Terima kasih dan salam sejahtera...

Lihat semua 3 jawaban

Silahkan login untuk menjawab!