if(move_uploaded_file($_FILES['filegambar']['tmp_name'],$namafilebaru)==true)
if(move_uploaded_file($_FILES['filegambar']['tmp_name'],'tempatgambar/$namafilebaru')==true) //tepatgambar => nama folder tempat meletakkan gambar yg di move dari folder temporari.
<?php
include("lib_func.php");
?>
<?php
if($_FILES['filegambar']['error']==0){
$link=koneksi_db();
$no_urut=$_POST['no_urut'];
$jenis_surat=$_POST['jenis_surat'];
$index=$_POST['index'];
$pengirim=$_POST['pengirim'];
$no_surat=$_POST['no_surat'];
$tanggal_surat=$_POST['tanggal_surat'];
$kode=$_POST['kode'];
$perihal=$_POST['perihal'];
$lampiran=$_POST['lampiran'];
$isi_ringkasan=$_POST['isi_ringkasan'];
$pengolah=$_POST['pengolah'];
$diteruskan_kepada=$_POST['diteruskan_kepada'];
$tanggal_diteruskan=$_POST['tanggal_diteruskan'];
$tanda_terima=$_POST['tanda_terima'];
$photo=$_FILES['filegambar']['name'];
$namafilebaru="scan/".$photo;
if(move_uploaded_file($_FILES['filegambar']['tmp_name'],
$namafilebaru)==true)
$sql="UPDATE surat_masuk set
`jenis_surat`='$jenis_surat',
`index`='$index',
`pengirim`='$pengirim',
`no_surat`='$no_surat',
`tanggal_surat`='$tanggal_surat',
`kode`='$kode',
`perihal`='$perihal',
`lampiran`='$lampiran',
`isi_ringkasan`='$isi_ringkasan',
`pengolah`='$pengolah',
`tanggal_diteruskan`='$tanggal_diteruskan',
`tanda_terima`='$tanda_terima',
`photo`='$photo'
WHERE `no_urut`= '$no_urut'";
mysql_query($sql);
header("Location:inputsuccess.php");
}
else{
echo "Data produk baru gagal disimpan dengan kesalahan ".mysql_error();
}
?>
<?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="" />Edit Surat Masuk
</h2>
<div class="cleared"></div>
<div class="art-postcontent">
<p>
<?php
$no_urut = $_REQUEST['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)){
?>
<form action="updateprogress.php" method="post">
<table border=0 width="100%" bgcolor="WHITE" align="center">
<tr>
<td colspan=4 align="center" bgcolor="#CCCCCC"> </td>
</tr>
<tr>
<td width="20%">No Urut </td>
<td width="1%">:</td>
<td width="50%"><input type="text" class="tb2" name="no_urut" value="<?php $i++; echo $data['no_urut']; ?>" readonly/></td>
<td colspan="1" style="border:solid 1px;" rowspan="10"><img src="scan/<?php echo $data['photo']; ?>" width="200" height="250" border="0"/></td>
<tr>
<td>Jenis Surat </td>
<td>:</td>
<td><select name="jenis_surat" class="tb2">
<option value="<?php $i++; echo $data['jenis_surat']; ?>"><?php $i++; echo $data['jenis_surat']; ?></option>
<option value="Sangat Rahasia">Sangat Rahasia</option>
<option value="Rahasia">Rahasia</option>
<option value="Umum">Umum</option>
</select></td>
</tr>
<tr>
<td>No Surat </td>
<td>:</td>
<td><input type="text" class="tb2" name="no_surat" value="<?php $i++; echo $data['no_surat']; ?>" /></td>
</tr>
<tr>
<td>Kode Surat</td>
<td>:</td>
<td><input type="text" class="tb2" name="kode" value="<?php $i++; echo $data['kode']; ?>" /></td>
</tr>
<tr>
<td>Index</td>
<td>:</td>
<td><input type="text" class="tb2" name="index" value="<?php $i++; echo $data['index']; ?>" /></td>
</tr>
<tr>
<td>Perihal</td>
<td>:</td>
<td><input type="text" class="tb2" name="perihal" value="<?php $i++; echo $data['perihal']; ?>" /></td>
</tr>
<tr>
<td>Isi Ringkas</td>
<td>:</td>
<td><input type="text" class="tb2" name="isi_ringkasan" value="<?php $i++; echo $data['isi_ringkasan']; ?>" /></td>
</tr>
<tr>
<td>Pengirim</td>
<td>:</td>
<td><input type="text" class="tb2" name="pengirim" value="<?php $i++; echo $data['pengirim']; ?>" /></td></tr>
<tr>
<td>Tanggal Surat </td>
<td>:</td>
<td><input type="text" class="tb2" name="tanggal_surat" value="<?php $i++; echo $data['tanggal_surat']; ?>" /></td>
</tr>
<tr>
<td>Lampiran</td>
<td>:</td>
<td><select name="lampiran" class="tb2" >
<option value="<?php $i++; echo $data['lampiran']; ?>"><?php $i++; echo $data['lampiran']; ?></option><option value="0">-</option><?php
for($a=1;$a<101;$a++){
echo ('<option value='.$a.'>'.$a.' </option>');
}
?>
</select></td>
</tr>
<tr>
<td>Pengolah</td>
<td>:</td>
<td><input type="text" class="tb2" name="pengolah" value="<?php $i++; echo $data['pengolah']; ?>" />
<td><input type="file" name="filegambar1" class="tb2"/>
</td></td>
</tr>
<tr>
<td>Tanggal diteruskan </td>
<td>:</td>
<td><input type="text" class="tb2" name="tanggal_diteruskan" value="<?php $i++; echo $data['tanggal_diteruskan']; ?>" /></td>
</tr>
<tr>
<td>Tanda terima </td>
<td>:</td>
<td><select name="tanda_terima" class="tb2">
<option value="<?php $i++; echo $data['tanda_terima']; ?>"><?php $i++; echo $data['tanda_terima']; ?></option>
<option value="Ya">Ya</option>
<option value="Tidak">Tidak</option>
</select></td>
</tr>
<tr>
<td colspan="5" bgcolor="#CCCCCC"><center><input type="submit" name="btn_submit2" value="Buat">
<input type="reset" name="reset" value="Batal"></</td>
</tr>
</table>
</tr>
<?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");
?>