<? include 'header.php';?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="header-icon">
<i class="fa fa-user-plus"></i>
</div>
<div class="header-title">
<h1>Category Management</h1>
<small>List of Menu</small>
</div>
</section>
<?
include 'connection.php';
$id = @$_GET["id"];
$sql = "select * from category where id='".$id."'";
$exc = $mysqli->query($sql);
$row = $exc->fetch_assoc();
?>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-bd lobidrag">
<div class="panel-heading">
<div class="btn-group" id="buttonexport">
<a href="#">
<h4>Category Details</h4>
</a>
</div>
</div>
<div class="panel-body">
<!-- Plugin content:powerpoint,txt,pdf,png,word,xl -->
<div class="row">
<div class="col-md-12">
<form class="form-horizontal" id="category">
<fieldset>
<!-- Text input-->
<div class="col-md-6 form-group" style="display: none;">
<label class="control-label">Add Type</label>
<select id="type" name="type" class="form-control">
<? if(empty($row["id"])){?>
<option value="Any">Any</option>
<? } else {
if($row["type"]=="1"){?>
<option value="1">LeaderShip</option>
<? } else {?>
<option value="2">Gallery</option>
<? } } ?>
<option value="1">LeaderShip</option>
<option value="2">Gallery</option>
</select>
</div>
<div class="col-md-6 form-group">
<label class="control-label">Name</label>
<input type="hidden" name="slno" id="slno" value="<? echo $row["id"];?>">
<input type="text" id="cname" name="cname" placeholder="Name" class="form-control" value="<? echo $row["name"];?>">
</div>
<!-- Text input-->
<!-- Text input-->
</fieldset>
</form>
<div class="col-md-12 form-group user-form-group" style="margin-left: -12px;">
<div class="pull-left">
<button type="button" onclick="send();" class="btn btn-add btn-sm">Submit</button>
<button type="button" onclick="empty();" class="btn btn-danger btn-sm">Cancel</button>
</div>
</div>
</div>
</div>
<!-- ./Plugin content:powerpoint,txt,pdf,png,word,xl -->
</div>
</div>
</div>
</div>
<!-- User Modal1 -->
<!-- /.modal -->
<!-- Modal -->
<!-- User Modal1 -->
<!-- /.modal -->
<!-- Modal -->
<!-- delete user Modal2 -->
<!-- /.modal -->
</section>
<!-- /.content -->
</div>
<? include 'footer.php';?>
<script type="text/javascript">
function send(){
var pdata = new FormData(document.getElementById("category"));
$.ajax({
url: "controls/category.php",
type: "POST",
data: pdata,
contentType: false,
cache: false,
processData:false,
success: function(data)
{
alert(data.trim());
location.reload();
},
error: function()
{
}
});
}
function empty(){
// alert('test');
location.reload();
}
</script> |