Mini Shell
<!doctype html>
<html lang="en">
<!-- head -->
<?php include 'head.php';
$formulaID = $_GET['formulaID'];
$sql_formula = "SELECT * FROM formula WHERE formulaID='$formulaID'";
$res_formula = mysqli_query($link, $sql_formula );
$row_formula = mysqli_fetch_assoc($res_formula);
?>
<body>
<div class="wrapper">
<!-- เมนูด้านซ้าย -->
<?php include 'leftside.php'; ?>
<div class="main-panel">
<!-- ส่วนหัว -->
<?php include 'header.php'; ?>
<div class="content">
<div class="container-fluid">
<div class="col-md-6">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="home.php">หน้าหลัก</a></li>
<li class="breadcrumb-item"><a href="formula.php">จัดการสูตรปุ๋ยผสม</a></li>
<li class="breadcrumb-item active" aria-current="page">แก้ไขสูตรปุ๋ยผสม</li>
</ol>
</nav>
<!-- เนื้อหา -->
<div class="card">
<div class="card-header card-header-icon" data-background-color="rose">
<i class="material-icons"><i class="far fa-edit"></i></i>
</div>
<div class="card-content">
<h4 class="card-title">แก้ไขสูตรปุ๋ยผสม</h4>
<form class="form-horizontal" id="formformula_edit" action="edit_formula.php" method="post" novalidate>
<div class="row">
<input type="hidden" name="formulaID" id="formulaID" value="<?php echo $row_formula['formulaID'] ?>">
<label class="col-md-3 label-on-left">ชื่อสูตรปุ๋ยผสม</label>
<div class="col-md-9">
<div class="form-group label-floating is-empty">
<label class="control-label"></label>
<input name="name_formula" id="name_formula" type="text" value="<?php echo $row_formula['name_formula']; ?>" class="form-control" data-smk-msg="กรุณากรอกชื่อสูตรปุ๋ยผสม" required>
</div>
</div>
</div>
<div class="row">
<label class="col-md-3 label-on-left">แม่ปุ๋ย(46-0-0)</label>
<div class="col-md-9">
<div class="form-group label-floating is-empty">
<label class="control-label"></label>
<input name="46-0-0" id="46-0-0" type="decimal" value="<?php echo $row_formula['46-0-0']; ?>" class="form-control" data-smk-msg="กรุณากรอกแม่ปุ๋ย(46-0-0)" required>
</div>
</div>
</div>
<div class="row">
<label class="col-md-3 label-on-left">แม่ปุ๋ย(18-46-0)</label>
<div class="col-md-9">
<div class="form-group label-floating is-empty">
<label class="control-label"></label>
<input name="18-46-0" id="18-46-0" type="decimal" value="<?php echo $row_formula['18-46-0']; ?>" class="form-control" data-smk-msg="กรุณากรอกแม่ปุ๋ย(18-46-0)" required>
</div>
</div>
</div>
<div class="row">
<label class="col-md-3 label-on-left">แม่ปุ๋ย(0-0-60)</label>
<div class="col-md-9">
<div class="form-group label-floating is-empty">
<label class="control-label"></label>
<input name="0-0-60" id="0-0-60" type="decimal" value="<?php echo $row_formula['0-0-60']; ?>" class="form-control" data-smk-msg="กรุณากรอกแม่ปุ๋ย(0-0-60)" required>
</div>
</div>
</div>
<div class="row">
<label class="col-md-3"></label>
<div class="col-md-9">
<div class="form-group form-button">
<button type="submit" class="btn btn-fill btn-rose">บันทึก</button>
<a href="formula.php" class="btn btn-primary">
เรียกดูข้อมูล
</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div id="spin"></div>
</div>
</div>
<!-- footer1 -->
<?php include 'footer1.php'; ?>
</div>
</div>
<!-- footer2 -->
<?php include 'footer2.php'; ?>
<script>
$(document).ajaxStart(function () {
$("#spin").show();
}).ajaxStop(function () {
$("#spin").hide();
});
$(document).ready(function () {
$("#name_formula").focus();
//select2
var spinner = new Spinner().spin();
$("#spin").append(spinner.el);
$("#spin").hide();
$('#formformula_edit').on("submit", function (e) {
if ($('#formformula_edit').smkValidate()) {
//upload file via ajax setting
$.ajax({
url: 'edit_formula.php',
type: 'POST',
data: new FormData(this),
processData: false,
contentType: false,
dataType: 'json'
}).done(function (data) {
if (data.status === "success") {
$(location).attr('href', 'formula.php');
} else {
$.smkAlert({text: data.message, type: data.status});
}
$('#formformula_edit')[0].reset();
$("#name_formula").focus();
});
e.preventDefault();
}
e.preventDefault();
});
});
</script>
<!-- Mirrored from demos.creative-tim.com/material-dashboard-pro/examples/dashboard.html by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 20 Mar 2017 21:32:16 GMT -->
</html>
Zerion Mini Shell 1.0