<?php 
include 'header1.php';
include 'connection.php';

if (isset($_POST['save'])) {

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

    if ($name != "") {
        mysqli_query($conn, "INSERT INTO talley_category_master (talley_category_name) VALUES ('$name')");
    }

    header("Location: view_all_talley_category.php");
    exit;
}
?>

<div class="content-page">
    <div class="content">
        <div class="container">
                                    <div class="page-header-title">

            <button type="button" class="btn btn-dark" onclick="location.href='view_all_talley_category.php'">BACK</button>                                <div class="clearfix"></div>

</div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="panel panel-success">
                        <div class="panel-heading">
                            <h3 class="panel-title">Add New Talley Category</h3>
                        </div>

                        <div class="panel-body">
                            <form method="post">

                                <div class="form-group">
                                    <label>Talley Category Name</label>
                                    <input type="text" class="form-control" required name="talley_category_name">
                                </div>

                                <button type="submit" name="save" class="btn btn-success">Save</button>
                                <button type="reset" class="btn btn-warning">Clear</button>

                            </form>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
