PHP Master CSS BOT
<?php
$pro="simpan";
$gambar0="avatar.jpg";
$status="Aktif";
?>
<link type="text/css" href="<?php echo "$PATH/base/";?>ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo "$PATH/";?>jquery-1.3.2.js"></script>
<script type="text/javascript" src="<?php echo "$PATH/";?>ui/ui.core.js"></script>
<script type="text/javascript" src="<?php echo "$PATH/";?>ui/ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo "$PATH/";?>ui/i18n/ui.datepicker-id.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#tgllahir").datepicker({
dateFormat : "dd MM yy",
changeMonth : true,
changeYear : true
});
});
</script>
<script type="text/javascript">
function PRINT(){
win=window.open('admin/print.php','win','width=1000, height=400, menubar=0, scrollbars=1, resizable=0, location=0, toolbar=0, status=0'); }
</script>
<script language="JavaScript">
function buka(url) {window.open(url, 'window_baru', 'width=800,height=600,left=320,top=100,resizable=1,scrollbars=1');}
</script>
<?php
$sql="select * from `$tbadmin` order by `kode_admin` desc";
$q=mysql_query($sql);
$jum=mysql_num_rows($q);
$kd="ADM";
if($jum > 0){
$d=mysql_fetch_array($q);
$idmax=$d["kode_admin"];
$urut=substr($idmax,3,2)+1;//01
if($urut<10){$idmax="$kd"."0".$urut;}
else{$idmax="$kd".$urut;}
}
else{$idmax="$kd"."01";}
$kode_admin=$idmax;
?>
<?php
if($_GET["pro"]=="ubah"){
$kode_admin=$_GET["kode"];
$s="select * from `$tbadmin` where `kode_admin`='$kode_admin'";
$q=mysql_query($s);
$d=mysql_fetch_array($q);
$kode_admin=$d["kode_admin"];
$kode_admin0=$d["kode_admin"];
$username=$d["username"];
$password=$d["password"];
$telepon=$d["telepon"];
$email=$d["email"];
$status=$d["status"];
$gambar=$d["gambar"];
$gambar0=$d["gambar"];
$pro="ubah";
}
?>
<?php
if($_GET["pro"]=="tambah" ||$_GET["pro"]=="ubah" ){
?>
<form action="" method="post" enctype="multipart/form-data">
<table class="table" width="40%" >
<tr class="th">
<th width="66"><label for="kode_admin">kode_admin</label>
<th width="9">:
<th colspan="2"><b><?php echo $kode_admin;?></b></tr>
<tr>
<td><label for="username">username</label>
<td>:<td width="213"><input name="username" type="text" id="username" value="<?php echo $username;?>" size="20" />
</td>
<td width="81" rowspan="4">
<center>
<?php
echo"<a href='#' onclick='buka(\"admin/zoom.php?id=$kode_admin\")'>
<img src='$YPATH/$gambar0' width='77' height='80' />
</a>
";
?>
</center>
</td>
</tr>
<tr>
<td height="24"><label for="password">password</label>
<td>:<td><input name="password" type="password" id="password" value="<?php echo $password;?>" size="20" /></td>
</tr>
<tr>
<td height="24"><label for="telepon">telepon</label>
<td>:<td><input name="telepon" type="text" id="telepon" value="<?php echo $telepon;?>" size="15" />
</td>
</tr>
<tr>
<td height="24"><label for="email">email</label>
<td>:<td><input name="email" type="text" id="email" value="<?php echo $email;?>" size="25" />
</td>
</tr>
<tr>
<td><label for="status">status</label>
<td>:<td colspan="2">
<input type="radio" name="status" id="statusya" checked="checked" value="Aktif" <?php if($status=="Aktif"){echo"checked";}?>/>Aktif
<input type="radio" name="status" id="statustidak" value="Tidak Aktif" <?php if($status=="Tidak Aktif"){echo"checked";}?>/>Tidak Aktif
</td></tr>
<tr>
<td height="24">gambar
<td>:<td colspan="2"><label for="gambar"></label>
<input name="gambar" type="file" id="gambar" size="20" />
=> <a href='#' onclick='buka("admin/zoom.php?id=<?php echo $kode_admin;?>")'><?php echo $gambar0;?></a></td>
</tr>
<tr>
<td>
<td>
<td colspan="2"> <input name="Simpan" type="submit" id="Simpan" value="Simpan" />
<input name="pro" type="hidden" id="pro" value="<?php echo $pro;?>" />
<input name="gambar0" type="hidden" id="gambar0" value="<?php echo $gambar0;?>" />
<input name="kode_admin" type="hidden" id="kode_admin" value="<?php echo $kode_admin;?>" />
<input name="kode_admin0" type="hidden" id="kode_admin0" value="<?php echo $kode_admin0;?>" />
<a class="green" href="?mnu=admin"><img src="ypathicon/button-cancel.png">Batal</a>
</td></tr>
</table>
</form>
<?php
if(isset($_POST["Simpan"])){
$pro=strip_tags($_POST["pro"]);
$kode_admin=strip_tags($_POST["kode_admin"]);
$kode_admin0=strip_tags($_POST["kode_admin0"]);
$username=strip_tags($_POST["username"]);
$password=strip_tags($_POST["password"]);
$telepon=strip_tags($_POST["telepon"]);
$email=strip_tags($_POST["email"]);
$status=strip_tags($_POST["status"]);
$gambar0=strip_tags($_POST["gambar0"]);
if ($_FILES["gambar"] != "") {
@copy($_FILES["gambar"]["tmp_name"],"$YPATH/".$_FILES["gambar"]["name"]);
$gambar=$_FILES["gambar"]["name"];
}
else {$gambar=$gambar0;}
if(strlen($gambar)<1){$gambar=$gambar0;}
if($pro=="simpan"){
$sql=" INSERT INTO `$tbadmin` (
`kode_admin` ,
`username` ,
`password` ,
`telepon` ,
`email` ,
`status` ,
`gambar`
) VALUES (
'$kode_admin',
'$username',
'$password',
'$telepon',
'$email',
'$status',
'$gambar'
)";
$simpan=mysql_query($sql);
if($simpan) {die("<script>location.href='?mnu=admin'</script>");}
else{echo "<ul class='box-info'><li class='bError'>Maaf, Data Anda gagal Di Proses, mohon coba lagi!</li></ul>";}
}
else{
$sql="update `$tbadmin` set `username`='$username',`password`='$password',`telepon`='$telepon' ,`email`='$email',`status`='$status',
`gambar`='$gambar' where `kode_admin`='$kode_admin'";
$ubah=mysql_query($sql);
if($ubah) {die("<script>location.href='?mnu=admin'</script>");}
else{echo "<ul class='box-info'><li class='bError'>Maaf, Data Anda gagal Di Proses, mohon coba lagi!</li></ul>";}
}
}
}//if tambah /ubah
?>
<?php
if($_GET["pro"]=="hapus"){
$kode_admin=$_GET["kode"];
$s="delete from `$tbadmin` where `kode_admin`='$kode_admin'";
$delete=mysql_query($s);
if($delete) {die("<script>location.href='?mnu=admin'</script>");}
else{echo "<ul class='box-info'><li class='bError'>Maaf, Data Anda gagal Di Proses, mohon coba lagi!</li></ul>";}
}
?>
<?php
if(empty($_GET["pro"])){?>
<a class="blue" href="?mnu=admin&pro=tambah"><img src="ypathicon/menu5.png">Tambah Data</a>
<table class="table" width="100%" border="0">
<tr class="th">
<th width="3%">No</td>
<th width="10%">kode_admin</td>
<th width="20%">username</td>
<th width="30%">email</td>
<th width="20%">telepon</td>
<th width="10%">gambar</td>
<th width="15%">Menu</td>
</tr>
<?php
$s="select * from `$tbadmin` order by `kode_admin` desc";
$q=mysql_query($s);
$jum=mysql_num_rows($q);
if($jum > 0){
//--------------------------------------------------------------------------------------------
$batas = 10;
$page = $_GET['page'];
if(empty($page)){$posawal = 0;$page = 1;}
else{$posawal = ($page-1) * $batas;}
$s2 = $s." LIMIT $posawal,$batas";
$q2 = mysql_query($s2);
$no = $posawal+1;
//--------------------------------------------------------------------------------------------
while($d=mysql_fetch_array($q2)){
$kode_admin=$d["kode_admin"];
$username=$d["username"];
$password=$d["password"];
$telepon=$d["telepon"];
$email=$d["email"];
$status=$d["status"];
$gambar=$d["gambar"];
$gambar0=$d["gambar"];
$color="#FFFFFF";
if($no %2==0){$color="#EEE";}
echo"<tr class='td' bgcolor='$color'>
<td>$no</td>
<td>$kode_admin</td>
<td>$username</td>
<td>$email</td>
<td>$telepon</td>
<td><div align='center'>";
echo"<a href='#' onclick='buka(\"admin/zoom.php?id=$kode_admin\")'>
<img src='$YPATH/$gambar' width='40' height='40' /></a></div>";
echo"</td>
<td><div align='center'>
<a href='?mnu=admin&pro=ubah&kode=$kode_admin'><img src='ypathicon/u.png' alt='ubah'></a>
<a href='?mnu=admin&pro=hapus&kode=$kode_admin'><img src='ypathicon/h.png' alt='hapus'
onClick='return confirm(\"Apakah Anda benar-benar akan menghapus $nama pada data admin ?..\")'></a></div></td>
</tr>";
$no++;
}//while
}//if
else{echo"<tr><td colspan='6'><blink>Maaf, Data admin belum tersedia...</blink></td></tr>";}
?>
</table>
<?php
$tampil2 = mysql_query($s);
$jmldata = mysql_num_rows($tampil2);
if($jmldata>0){
if($batas<1){$batas=1;}
$jmlhal = ceil($jmldata/$batas);
echo "<div class=paging>";
if($page > 1){
$prev=$page-1;
echo "<span class=prevnext><a href='$_SERVER[PHP_SELF]?page=$prev&mnu=admin'>« Prev</a></span> ";
}
else{echo "<span class=disabled>« Prev</span> ";}
for($i=1;$i<=$jmlhal;$i++)
if ($i != $page){echo "<a href='$_SERVER[PHP_SELF]?page=$i&mnu=admin'>$i</a> ";}
else{echo " <span class=current>$i</span> ";}
if($page < $jmlhal){
$next=$page+1;
echo "<span class=prevnext><a href='$_SERVER[PHP_SELF]?page=$next&mnu=admin'>Next »</a></span>";
}
else{ echo "<span class=disabled>Next »</span>";}
}//if jmldata
?>
Data Admin:
| <a href="admin/pdf.php"><img src='ypathicon/pdf.png' alt='PDF'></a>
| <a href="admin/xls.php"><img src='ypathicon/xls.png' alt='XLS'></a>
| <a href="admin/xml.php"><img src='ypathicon/xml.png' alt='XML'></a>
| <img src='ypathicon/print.png' alt='PRINT' OnClick="PRINT()"> |
<?php
echo "</div>";
$tampil2 = mysql_query($s);
$jmldata = mysql_num_rows($tampil2);
echo "<p align=center>Total admin <b>$jmldata</b> data</p>";
}//if tambah data
?>
$pro="simpan";
$gambar0="avatar.jpg";
$status="Aktif";
?>
<link type="text/css" href="<?php echo "$PATH/base/";?>ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo "$PATH/";?>jquery-1.3.2.js"></script>
<script type="text/javascript" src="<?php echo "$PATH/";?>ui/ui.core.js"></script>
<script type="text/javascript" src="<?php echo "$PATH/";?>ui/ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo "$PATH/";?>ui/i18n/ui.datepicker-id.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#tgllahir").datepicker({
dateFormat : "dd MM yy",
changeMonth : true,
changeYear : true
});
});
</script>
<script type="text/javascript">
function PRINT(){
win=window.open('admin/print.php','win','width=1000, height=400, menubar=0, scrollbars=1, resizable=0, location=0, toolbar=0, status=0'); }
</script>
<script language="JavaScript">
function buka(url) {window.open(url, 'window_baru', 'width=800,height=600,left=320,top=100,resizable=1,scrollbars=1');}
</script>
<?php
$sql="select * from `$tbadmin` order by `kode_admin` desc";
$q=mysql_query($sql);
$jum=mysql_num_rows($q);
$kd="ADM";
if($jum > 0){
$d=mysql_fetch_array($q);
$idmax=$d["kode_admin"];
$urut=substr($idmax,3,2)+1;//01
if($urut<10){$idmax="$kd"."0".$urut;}
else{$idmax="$kd".$urut;}
}
else{$idmax="$kd"."01";}
$kode_admin=$idmax;
?>
<?php
if($_GET["pro"]=="ubah"){
$kode_admin=$_GET["kode"];
$s="select * from `$tbadmin` where `kode_admin`='$kode_admin'";
$q=mysql_query($s);
$d=mysql_fetch_array($q);
$kode_admin=$d["kode_admin"];
$kode_admin0=$d["kode_admin"];
$username=$d["username"];
$password=$d["password"];
$telepon=$d["telepon"];
$email=$d["email"];
$status=$d["status"];
$gambar=$d["gambar"];
$gambar0=$d["gambar"];
$pro="ubah";
}
?>
<?php
if($_GET["pro"]=="tambah" ||$_GET["pro"]=="ubah" ){
?>
<form action="" method="post" enctype="multipart/form-data">
<table class="table" width="40%" >
<tr class="th">
<th width="66"><label for="kode_admin">kode_admin</label>
<th width="9">:
<th colspan="2"><b><?php echo $kode_admin;?></b></tr>
<tr>
<td><label for="username">username</label>
<td>:<td width="213"><input name="username" type="text" id="username" value="<?php echo $username;?>" size="20" />
</td>
<td width="81" rowspan="4">
<center>
<?php
echo"<a href='#' onclick='buka(\"admin/zoom.php?id=$kode_admin\")'>
<img src='$YPATH/$gambar0' width='77' height='80' />
</a>
";
?>
</center>
</td>
</tr>
<tr>
<td height="24"><label for="password">password</label>
<td>:<td><input name="password" type="password" id="password" value="<?php echo $password;?>" size="20" /></td>
</tr>
<tr>
<td height="24"><label for="telepon">telepon</label>
<td>:<td><input name="telepon" type="text" id="telepon" value="<?php echo $telepon;?>" size="15" />
</td>
</tr>
<tr>
<td height="24"><label for="email">email</label>
<td>:<td><input name="email" type="text" id="email" value="<?php echo $email;?>" size="25" />
</td>
</tr>
<tr>
<td><label for="status">status</label>
<td>:<td colspan="2">
<input type="radio" name="status" id="statusya" checked="checked" value="Aktif" <?php if($status=="Aktif"){echo"checked";}?>/>Aktif
<input type="radio" name="status" id="statustidak" value="Tidak Aktif" <?php if($status=="Tidak Aktif"){echo"checked";}?>/>Tidak Aktif
</td></tr>
<tr>
<td height="24">gambar
<td>:<td colspan="2"><label for="gambar"></label>
<input name="gambar" type="file" id="gambar" size="20" />
=> <a href='#' onclick='buka("admin/zoom.php?id=<?php echo $kode_admin;?>")'><?php echo $gambar0;?></a></td>
</tr>
<tr>
<td>
<td>
<td colspan="2"> <input name="Simpan" type="submit" id="Simpan" value="Simpan" />
<input name="pro" type="hidden" id="pro" value="<?php echo $pro;?>" />
<input name="gambar0" type="hidden" id="gambar0" value="<?php echo $gambar0;?>" />
<input name="kode_admin" type="hidden" id="kode_admin" value="<?php echo $kode_admin;?>" />
<input name="kode_admin0" type="hidden" id="kode_admin0" value="<?php echo $kode_admin0;?>" />
<a class="green" href="?mnu=admin"><img src="ypathicon/button-cancel.png">Batal</a>
</td></tr>
</table>
</form>
<?php
if(isset($_POST["Simpan"])){
$pro=strip_tags($_POST["pro"]);
$kode_admin=strip_tags($_POST["kode_admin"]);
$kode_admin0=strip_tags($_POST["kode_admin0"]);
$username=strip_tags($_POST["username"]);
$password=strip_tags($_POST["password"]);
$telepon=strip_tags($_POST["telepon"]);
$email=strip_tags($_POST["email"]);
$status=strip_tags($_POST["status"]);
$gambar0=strip_tags($_POST["gambar0"]);
if ($_FILES["gambar"] != "") {
@copy($_FILES["gambar"]["tmp_name"],"$YPATH/".$_FILES["gambar"]["name"]);
$gambar=$_FILES["gambar"]["name"];
}
else {$gambar=$gambar0;}
if(strlen($gambar)<1){$gambar=$gambar0;}
if($pro=="simpan"){
$sql=" INSERT INTO `$tbadmin` (
`kode_admin` ,
`username` ,
`password` ,
`telepon` ,
`email` ,
`status` ,
`gambar`
) VALUES (
'$kode_admin',
'$username',
'$password',
'$telepon',
'$email',
'$status',
'$gambar'
)";
$simpan=mysql_query($sql);
if($simpan) {die("<script>location.href='?mnu=admin'</script>");}
else{echo "<ul class='box-info'><li class='bError'>Maaf, Data Anda gagal Di Proses, mohon coba lagi!</li></ul>";}
}
else{
$sql="update `$tbadmin` set `username`='$username',`password`='$password',`telepon`='$telepon' ,`email`='$email',`status`='$status',
`gambar`='$gambar' where `kode_admin`='$kode_admin'";
$ubah=mysql_query($sql);
if($ubah) {die("<script>location.href='?mnu=admin'</script>");}
else{echo "<ul class='box-info'><li class='bError'>Maaf, Data Anda gagal Di Proses, mohon coba lagi!</li></ul>";}
}
}
}//if tambah /ubah
?>
<?php
if($_GET["pro"]=="hapus"){
$kode_admin=$_GET["kode"];
$s="delete from `$tbadmin` where `kode_admin`='$kode_admin'";
$delete=mysql_query($s);
if($delete) {die("<script>location.href='?mnu=admin'</script>");}
else{echo "<ul class='box-info'><li class='bError'>Maaf, Data Anda gagal Di Proses, mohon coba lagi!</li></ul>";}
}
?>
<?php
if(empty($_GET["pro"])){?>
<a class="blue" href="?mnu=admin&pro=tambah"><img src="ypathicon/menu5.png">Tambah Data</a>
<table class="table" width="100%" border="0">
<tr class="th">
<th width="3%">No</td>
<th width="10%">kode_admin</td>
<th width="20%">username</td>
<th width="30%">email</td>
<th width="20%">telepon</td>
<th width="10%">gambar</td>
<th width="15%">Menu</td>
</tr>
<?php
$s="select * from `$tbadmin` order by `kode_admin` desc";
$q=mysql_query($s);
$jum=mysql_num_rows($q);
if($jum > 0){
//--------------------------------------------------------------------------------------------
$batas = 10;
$page = $_GET['page'];
if(empty($page)){$posawal = 0;$page = 1;}
else{$posawal = ($page-1) * $batas;}
$s2 = $s." LIMIT $posawal,$batas";
$q2 = mysql_query($s2);
$no = $posawal+1;
//--------------------------------------------------------------------------------------------
while($d=mysql_fetch_array($q2)){
$kode_admin=$d["kode_admin"];
$username=$d["username"];
$password=$d["password"];
$telepon=$d["telepon"];
$email=$d["email"];
$status=$d["status"];
$gambar=$d["gambar"];
$gambar0=$d["gambar"];
$color="#FFFFFF";
if($no %2==0){$color="#EEE";}
echo"<tr class='td' bgcolor='$color'>
<td>$no</td>
<td>$kode_admin</td>
<td>$username</td>
<td>$email</td>
<td>$telepon</td>
<td><div align='center'>";
echo"<a href='#' onclick='buka(\"admin/zoom.php?id=$kode_admin\")'>
<img src='$YPATH/$gambar' width='40' height='40' /></a></div>";
echo"</td>
<td><div align='center'>
<a href='?mnu=admin&pro=ubah&kode=$kode_admin'><img src='ypathicon/u.png' alt='ubah'></a>
<a href='?mnu=admin&pro=hapus&kode=$kode_admin'><img src='ypathicon/h.png' alt='hapus'
onClick='return confirm(\"Apakah Anda benar-benar akan menghapus $nama pada data admin ?..\")'></a></div></td>
</tr>";
$no++;
}//while
}//if
else{echo"<tr><td colspan='6'><blink>Maaf, Data admin belum tersedia...</blink></td></tr>";}
?>
</table>
<?php
$tampil2 = mysql_query($s);
$jmldata = mysql_num_rows($tampil2);
if($jmldata>0){
if($batas<1){$batas=1;}
$jmlhal = ceil($jmldata/$batas);
echo "<div class=paging>";
if($page > 1){
$prev=$page-1;
echo "<span class=prevnext><a href='$_SERVER[PHP_SELF]?page=$prev&mnu=admin'>« Prev</a></span> ";
}
else{echo "<span class=disabled>« Prev</span> ";}
for($i=1;$i<=$jmlhal;$i++)
if ($i != $page){echo "<a href='$_SERVER[PHP_SELF]?page=$i&mnu=admin'>$i</a> ";}
else{echo " <span class=current>$i</span> ";}
if($page < $jmlhal){
$next=$page+1;
echo "<span class=prevnext><a href='$_SERVER[PHP_SELF]?page=$next&mnu=admin'>Next »</a></span>";
}
else{ echo "<span class=disabled>Next »</span>";}
}//if jmldata
?>
Data Admin:
| <a href="admin/pdf.php"><img src='ypathicon/pdf.png' alt='PDF'></a>
| <a href="admin/xls.php"><img src='ypathicon/xls.png' alt='XLS'></a>
| <a href="admin/xml.php"><img src='ypathicon/xml.png' alt='XML'></a>
| <img src='ypathicon/print.png' alt='PRINT' OnClick="PRINT()"> |
<?php
echo "</div>";
$tampil2 = mysql_query($s);
$jmldata = mysql_num_rows($tampil2);
echo "<p align=center>Total admin <b>$jmldata</b> data</p>";
}//if tambah data
?>
Posting Komentar untuk "PHP Master CSS BOT"