update sebagian

k1dc00l · Aug 9, 2011
mohon bantuanya saya memiliki form detail.php yang berisi tampilan detail seluruh data,yang dimana akan di disposisi dengan mengupdate sebagian field dari table yaitu field diteruskan_kepada,instruksi,catatan dengan kode sebagai berikut
<?php
	session_start();
	if(isset($_SESSION['sudahlogin']))
	{
?>

<!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" dir="ltr" lang="en-US" xml:lang="en">
<head>
<?php 
	include("lib_func.php");
?>

    <!--
    Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional"
    -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>E-Letters</title>
    <meta name="description" content="Description" />
    <meta name="keywords" content="Keywords" />


    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="script.js"></script>
</head>
<body>
<div id="art-page-background-glare">
    <div id="art-page-background-glare-image"> </div>
</div>
<div id="art-main">
    <div class="art-header">
    <div class="art-header-wrapper">
    <div class="art-header-inner">
        <div class="art-logo">
                 <h1 class="art-logo-name"><a href="menu_admin.php">E-letters</a></h1>
                         <h2 class="art-logo-text">aplikasi surat digital bkd</h2>
                </div>
    </div>
    </div>
    </div>
    <div class="cleared reset-box"></div>
    <div class="art-sheet">
        <div class="art-sheet-tl"></div>
        <div class="art-sheet-tr"></div>
        <div class="art-sheet-bl"></div>
        <div class="art-sheet-br"></div>
        <div class="art-sheet-tc"></div>
        <div class="art-sheet-bc"></div>
        <div class="art-sheet-cl"></div>
        <div class="art-sheet-cr"></div>
        <div class="art-sheet-cc"></div>
        <div class="art-sheet-body">
<div class="art-nav">
<div class="art-nav-outer">
	<ul class="art-hmenu">
			<div><font size="3">Selamat datang, <?php echo $_SESSION['jabatan']; ?></font></div>
	</ul>
</div>
</div>
<div class="cleared reset-box"></div>
<div class="art-content-layout">
                <div class="art-content-layout-row">
                    <div class="art-layout-cell art-sidebar1">
<div class="art-block">
    <div class="art-block-body">
                <div class="art-blockheader">
                    <div class="l"></div>
                    <div class="r"></div>
                    <h3 class="t">SURAT MASUK</h3>
                </div>
                <div class="art-blockcontent">
                    <div class="art-blockcontent-tl"></div>
                    <div class="art-blockcontent-tr"></div>
                    <div class="art-blockcontent-bl"></div>
                    <div class="art-blockcontent-br"></div>
                    <div class="art-blockcontent-tc"></div>
                    <div class="art-blockcontent-bc"></div>
                    <div class="art-blockcontent-cl"></div>
                    <div class="art-blockcontent-cr"></div>
                    <div class="art-blockcontent-cc"></div>
                    <div class="art-blockcontent-body">

<div>
<p class="menu_list"><a href="menu_admin.php"><b>Buat Surat Masuk</b></a></p>
</div>

<div>
<p class="menu_list"><a href="view_lettersin.php"><b>Lihat Surat Masuk</b></a></p>
</div>

<div>
<p class="menu_list"><a href="detailupdate_lettersin.php"><b>Edit Surat Masuk</b></a></p>
</div>
                                		<div class="cleared"></div>
                    </div>
                </div>
		<div class="cleared"></div>
    </div>
    
    <div class="art-block-body">
                <div class="art-blockheader">
                    <div class="l"></div>
                    <div class="r"></div>
                    <h3 class="t">SURAT keluar</h3>
                </div>
                <div class="art-blockcontent">
                    <div class="art-blockcontent-tl"></div>
                    <div class="art-blockcontent-tr"></div>
                    <div class="art-blockcontent-bl"></div>
                    <div class="art-blockcontent-br"></div>
                    <div class="art-blockcontent-tc"></div>
                    <div class="art-blockcontent-bc"></div>
                    <div class="art-blockcontent-cl"></div>
                    <div class="art-blockcontent-cr"></div>
                    <div class="art-blockcontent-cc"></div>
                    <div class="art-blockcontent-body">

<div>
<p class="menu_list"><a href="maintenance.php"><b>Buat Surat Keluar</b></a></p>
</div>
 
<div>
<p class="menu_list"><a href="maintenance.php"><b>Lihat Surat Keluar</b></a></p>
</div> 
                                		<div class="cleared"></div>
                    </div>
                </div>
		<div class="cleared"></div>
    </div>
    
       <div class="art-block-body">
                <div class="art-blockheader">
                    <div class="l"></div>
                    <div class="r"></div>
                    <h3 class="t"><a href="search.php">Cari</a></h3>
                </div>
                <div class="art-blockcontent">
                    <div class="art-blockcontent-tl"></div>
                    <div class="art-blockcontent-tr"></div>
                    <div class="art-blockcontent-bl"></div>
                    <div class="art-blockcontent-br"></div>
                    <div class="art-blockcontent-tc"></div>
                    <div class="art-blockcontent-bc"></div>
                    <div class="art-blockcontent-cl"></div>
                    <div class="art-blockcontent-cr"></div>
                  <div class="art-blockcontent-cc"></div>
                </div>
    </div>
    
    <div class="art-block-body">
                <div class="art-blockheader">
                    <div class="l"></div>
                    <div class="r"></div>
                    <h3 class="t"><a href="logout.php">LOGOUT</a></h3>
                </div>
                <div class="art-blockcontent">
                    <div class="art-blockcontent-tl"></div>
                    <div class="art-blockcontent-tr"></div>
                    <div class="art-blockcontent-bl"></div>
                    <div class="art-blockcontent-br"></div>
                    <div class="art-blockcontent-tc"></div>
                    <div class="art-blockcontent-bc"></div>
                    <div class="art-blockcontent-cl"></div>
                    <div class="art-blockcontent-cr"></div>
                  <div class="art-blockcontent-cc"></div>
                </div>
    </div>
    
</div>

                      <div class="cleared"></div>
                    </div>
                    <div class="art-layout-cell art-content">
<div class="art-post">
    <div class="art-post-body">
<div class="art-post-inner art-article">
                                <h2 class="art-postheader">
                <img src="./images/favicon.ico" width="23" height="25" alt="" />VIEW Surat Masuk
                                </h2>
                <div class="cleared"></div>
                                                <div class="art-postcontent">

<p>
<?php
	$no_urut = $_GET['no_urut'];
	$link=koneksi_db();
	$sql="SELECT * FROM
	      surat_masuk where no_urut = $no_urut
 	      ORDER BY no_urut"; 
	$res=mysql_query($sql,$link) or die(mysql_error()); 
	
	?>
    
    <?php

	$i=0;
	while($data=mysql_fetch_array($res)){
	
	
		?> 
      <table border=0 width="100%"  bgcolor="WHITE" align="center">
			<tr>
			  <td colspan=4 align="center" bgcolor="#CCCCCC">&nbsp;</td>
			</tr>
			<tr>
			  <td width="20%">No Urut </td>
			  <td width="1%">:</td>
			  <td width="50%"><?php $i++; echo $data['no_urut'] ?></td>
			  <td colspan="1" style="border:solid 1px;" rowspan="14"><img src="scan/<?php echo $data['photo']; ?>" width="200" height="250" border="0"/></td>

			<tr>
			  <td>Jenis Surat </td>
			  <td>:</td>
			  <td><?php echo $data['jenis_surat'] ?></td>
			  </tr>
			<tr>
			  <td>No Surat </td>
			  <td>:</td>
			  <td><?php echo $data['no_surat'] ?></td>
		  </tr>
			<tr>
			  <td>Kode Surat</td>
			  <td>:</td>
			  <td><?php echo $data['kode'] ?></td>
              </tr>
			<tr>
			  <td>Index</td>
			  <td>:</td>
			  <td><?php echo $data['index'] ?></td>
			</tr>
			<tr>
			  <td>Perihal</td>
			  <td>:</td>
			  <td><?php echo $data['perihal'] ?></td>
			</tr>
			<tr>
		    <td>Isi Ringkas</td>
		    <td>:</td>
		    <td><?php echo $data['isi_ringkasan'] ?></td>
			</tr>
			<tr>
			  <td>Pengirim</td>
			  <td>:</td>
			  <td><?php echo $data['pengirim'] ?></td></tr>
			<tr>
			  <td>Tanggal Surat </td>
			  <td>:</td>
			  <td><?php echo $data['tanggal_surat'] ?></td>
</tr>
			
			<tr>
			  <td>Lampiran</td>
			  <td>:</td>
			  <td><?php echo $data['lampiran'] ?></td>
			  </tr>
			<tr>
			  <td>Pengolah</td>
			  <td>:</td>
			  <td><?php echo $data['pengolah'] ?></td>
			  </tr>
			<tr>
			  <td>Tanggal diteruskan </td>
			  <td>:</td>
			  <td><?php echo $data['tanggal_diteruskan'] ?></td>
			  </tr>
			<tr>
			  <td>Tanda terima </td>
			  <td>:</td>
			  <td><?php echo $data['tanda_terima'] ?></td>
</tr>
<tr>
			  <td>Keberadaan surat</td>
			  <td>:</td>
			  <td><?php echo $data['diteruskan_kepada'] ?></td>
              </tr>
			<tr align="center">
			  <td colspan="5" bgcolor="#CCCCCC">&nbsp;</td>
		  </tr>
		</table>

<form action="updateprogress.php" method="post" enctype="multipart/form-data">

<table  border=0  width="100%"  bgcolor="WHITE" align="center">
  <tr>
    <td colspan="6" bgcolor="#CCCCCC"><b>BUAT DISPOSISI</b></td>
    </tr>
      <tr>
    <td>Diteruskan kepada</td>
    <td>:</td>
    <td><select name="diteruskan" class="tb2">
      <option value="kepala BKD">Kepala BKD</option>
      <option value="sekretaris">Sekretaris</option>
      <option value="Kasubbag Perencanaan dan Program">Kasubbag Perencanaan dan Program</option>
      </select></td>
  </tr>
  <tr>
    <td width="20%">Tanggal Penyelesaian</td>
    <td width="1%">:</td>
    <td width="30%"><input type="text" name="tanggal_penyelsaian" class="tb2" /></td>
  </tr>
  <tr>
    <td width="20%">Instruksi</td>
    <td width="1%">:</td>
    <td width="30%"><textarea name="instruksi" style="resize:none" class="tb2"></textarea></td>
    <td rowspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td>Catatan</td>
    <td>:</td>
    <td><textarea name="catatan" style="resize:none" class="tb2"></textarea></td>
  </tr>
  <tr>
    <td colspan="6" bgcolor="#CCCCCC"><center><input type="submit" name="btn_submit2" value="Buat">
			    <input type="reset" name="reset" value="Batal"></center></td>
  </tr>
</table>

</form>
  <?php } ?>
</p>

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

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

                      <div class="cleared"></div>
                    </div>
                </div>
            </div>
            <div class="cleared"></div>
            <div class="art-footer">
                <div class="art-footer-t"></div>
                <div class="art-footer-b"></div>
                <div class="art-footer-body">
                            <div class="art-footer-text">
                                
<p>Copyright of API Team © 2011. All Rights Reserved.</p>


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

</body>
</html>

<?php
	}
	else
		header("Location:loginfailure.php");
?>

dan dibawah merupakan kode dari dispotitionprogres.php
<?php
include("lib_func.php");
?>

<?php
	$link=koneksi_db();
	$no_urut=$_POST['no_urut'];
	$diteruskan_kepada=$_POST['diteruskan_kepada'];
	$tanggal_penyelsaian=$_POST['tanggal_penyelsaian'];
	$instruksi=$_POST['instruksi'];
	$catatan=$_POST['catatan'];
	$sql="UPDATE surat_masuk set
	 diteruskan_kepada='$diteruskan_kepada',
	 tanggal_penyelsaian='$tanggal_penyelsaian',
	 instruksi='$instruksi',
	 catatan='$catatan'  
	 WHERE no_urut= '$no_urut'";
 			$res=mysql_query($sql);
			if($res){
				header("Location:menu_client.php");
			}		
			else{
				echo "Data gagal disimpan dengan kesalahan ".mysql_error();
				}
?>

ketika di tekan tombol masuk ke menu_client.php tetapi tidak mengupdate data.

terima kasih atas bantuanya.....
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Aug 9, 2011 · 0 Suka · 0 Tidak Suka
kok kode yang diatas dengan bawah tidak nyambung? kamu bilang kode yang bawah dispotitionprogres.php sedangkan pada kode yang atas form disubmit ke updateprogress.php
jika kamu salah tulis, di kode bawah
$_POST;
$_POST;
diperoleh dari mana? karena di kode atas tidak ada element form dengan nama itu?

pelajari: Cara Memproses HTML Form yang Benar
0
Loading...
k1dc00l · Aug 10, 2011 · 0 Suka · 0 Tidak Suka
human error mas yg slah penulisan.hehe
jadi gini mas kami membuat berisi field semua data yang ditampilkan diatas serta diteruskan kepada,tanggal penyelesaian,instruksi,catatan.nah untuk inputan pertama field diteruskan kepada,tanggal penyelesaian,instruksi,catatan kami null kan untuk di isikan ketika akan di disposisi,disposisi disini mengupdate field diteruskan kepada dan field2 yang inputan pertama di nullkan,,,
begto mas...terimakasih
0
Loading...
Ellyx Christian · Aug 10, 2011 · 0 Suka · 0 Tidak Suka