| Server IP : 172.67.216.113 / Your IP : 172.71.28.145 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home2/cp648411/public_html/kainumber.com/wallpaper/backend/admin/ |
Upload File : |
<?php require_once("../include/class.php");?>
<?php require_once("../include/header.php");?>
<?php require_once("../include/nav_top.php");?>
<?php require_once("../include/sidebar.php");?>
<?php include('../include/sql_injection_get.php');?>
<?php include("table_name.php");?>
<?php
/*if(!is_numeric($_GET["id"]))
{
?>
<meta http-equiv="refresh" content="0;URL=../index.php">
<?php
}*/
?>
<div id="main-content">
<div class="container-fluid">
<ul class="breadcrumb">
<li><a href="../<?php echo $name_folder ?>/list.php"><?php echo ucfirst($name_table) ?></a><span class="divider">»</span></li>
<li class="active">Edit</li>
</ul>
<div class="row-fluid">
<div class="span12">
<div class="nonboxy-widget">
<div class="widget-head">
<h5><i class="black-icons blocks_images"></i> From </h5>
</div>
<script>
function checkform()
{
if(document.frm.user_c.value=="no"){alert("ขออภัยค่ะ ชื้อสมาชิกมีในระบบแล้วค่ะ");document.frm.username.focus();return false;}
}
</script>
<?php
$g_id = $_GET["id"];
if($_GET["id"] == '')
{
$g_id = $_SESSION["admin_cn_id"];
}
$sql = array('table'=>$name_table,'where'=>"id = '". $g_id."'");
$view_sql = $view_db->view($sql);
$row = $view_db->q($view_sql);
?>
<div class="widget-content">
<div class="widget-box">
<form class="form-horizontal well" id="signupform_customer" name="frm" onSubmit="return checkform();" action="edit_save.php" method="post" enctype="multipart/form-data">
<fieldset>
<div class="control-group">
<label class="control-label">name</label>
<div class="controls">
<input id="username" name="username" type="text" class="span8" value="<?php echo $row['username']?>" onChange="doCallAjax()"/>
<input id="username_old" name="username_old" type="hidden" class="span8" value="<?php echo $row['username']?>"/>
<span id="mySpan"></span><span id="mySpan"></span>
</div>
</div>
<div class="control-group">
<label class="control-label">ตำแหน่ง :</label>
<div class="controls">
<select name="type">
<?php
$s_ad = '';
$s_ad = 'id = '.$row["type"];
$list_at = array('table'=>'admin_type','where'=>$s_ad,'order'=> "ORDER BY id ASC");
$view_at = $view_db->view($list_at);
$result_at = $view_db->q_re($view_at);
while($row_at = $view_db->q_ro($result_at))
{
?><option value="<?php echo $row_at['id']; ?>"><?php echo $row_at['name']; ?></option><?php
}
?>
</select>
</div>
</div>
</fieldset>
<div class="form-actions">
<input type="hidden" name="id" value="<?php echo $row['id']; ?>">
<button class="btn btn-primary" type="submit">Save changes</button>
<a href="list.php" class="btn" role="button">Cancel</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function doCallAjax()
{
//twitter bootstrap script
var username = $("#username").val();
var username_old = $("#username_old").val();
$.ajax({
type: "POST",
url: "../include/ad_user_edit.php",
data: "username="+ username + "&username_old="+ username_old,
success: function(msg)
{
$("#mySpan").html(msg);
},
error: function()
{
alert("failure");
}
});
};
</script>
<?php require_once("../include/footer_js.php");?>
</body>
</html>