<?php include 'header1.php';
$category_id = $_GET['category_id'] ?? 0;

if ($category_id == 0) {
    header("Location: view_all_talley_category.php");
    exit;
}

// Fetch category name
$sql = "SELECT * FROM talley_category_master WHERE category_id = '$category_id'";
$res = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($res);

$talley_category_name = $row['talley_category_name'] ?? "";

// Update code
if (isset($_POST['update'])) {

    $name = trim($_POST['talley_category_name']);

    if ($name != "") {
        mysqli_query($conn, "UPDATE talley_category_master 
                             SET talley_category_name = '$name' 
                             WHERE category_id = '$category_id'");
    }

    header("Location: view_all_talley_category.php");
    exit;
}
?>
        <div class="content-page">
            <div class="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="page-header-title">
                               <button type="button" class="btn btn-dark  waves-effect waves-light" onclick="location.href='view_all_talley_category.php'">BACK</button>
						
                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="panel panel-primary">
                                <div class="panel-heading">
                                    <h3 class="panel-title">Edit </h3>
                                </div>
									
									
								<!-- Separate form for model details -->
								
								
<form method="post">


    <div class="panel-body">
        <div class="row">
            <!-- Model Number -->
            <div class="col-sm-12 col-xs-12">
                <div class="m-t-20">
                    <div class="form-group">
                        <label>Talley Category Name</label>
                        <input type="text" class="form-control" required name="talley_category_name"  value="<?php echo $talley_category_name?>" />
                    </div>
                </div>
            </div>

   
    <button type="submit" name="update" class="btn btn-primary waves-effect waves-light">Update</button>
    <a href="view_all_talley_category.php" class="btn btn-success  waves-effect waves-light">Cancel</a>
</form>
				

</form>


                            </div>
                        </div>
                    </div>
					
					
					
					<!------ View Start ---------------->
					
					
					
					
					
					
					<!--- View ends --------------->
					
					
					
					
					
                </div>
            </div>
<footer class="footer"> &copy; </footer>
</div>
</div>
<script src="vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="vendors/bower_components/moment/min/moment-with-locales.min.js"></script>
<script src="vendors/bower_components/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>
<script src="vendors/bower_components/switchery/dist/switchery.min.js"></script>
<script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
<script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<!-- Bootstrap Tagsinput JavaScript -->
<script src="vendors/bower_components/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
<!-- Bootstrap Touchspin JavaScript -->
<script src="vendors/bower_components/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.js"></script>
<!-- Multiselect JavaScript -->
<script src="vendors/bower_components/multiselect/js/jquery.multi-select.js"></script>
<!-- Bootstrap Switch JavaScript -->
<script src="vendors/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
<!-- Bootstrap Datetimepicker JavaScript -->
<script type="text/javascript" src="vendors/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<!-- Form Advance Init JavaScript -->
<script src="dist/js/form-advance-data.js"></script>
<!-- Slimscroll JavaScript -->
<script src="dist/js/jquery.slimscroll.js"></script>
<!-- Fancy Dropdown JS -->
<script src="dist/js/dropdown-bootstrap-extended.js"></script>
<!-- Owl JavaScript -->
<script src="vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>
<!-- Init JavaScript -->
<script src="dist/js/init.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- Select2 JavaScript -->
<script src="vendors/bower_components/select2/dist/js/select2.full.min.js"></script>
<!-- Bootstrap Select JavaScript -->
<script src="vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/modernizr.min.js"></script>
<script src="assets/js/detect.js"></script>
<script src="assets/js/fastclick.js"></script>
<script src="assets/js/jquery.slimscroll.js"></script>
<script src="assets/js/jquery.blockUI.js"></script>
<script src="assets/js/waves.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/jquery.nicescroll.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/app.js"></script>
</body><!-- Mirrored from themesdesign.in/xadmino/form-elements.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Feb 2021 12:05:08 GMT -->
</html>