<?php include ("../core/kfunctions.php");?>
<html>

<head>
<?php kheader(); ?>

</head>

<body>

    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
          <?php ktopbar(); ?>
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
        <?php kleftbar(); ?>

            <!-- /.navbar-collapse -->
        </nav>


        <!-- Navigation -->
   

        <div id="page-wrapper">

          <div class='col-lg-12'><br> &nbsp </div>

            <div class="container-fluid">
      

<div class='col-lg-12'>
<div class='panel panel-yellow'><!--Initiative-->
<div class='panel-heading'><h3 class='panel-title'>Add Expense Category</h3></div>
<div class='panel-body'>


<section class="content">
      <div class="container-fluid">
        <div class="row">
          <section class="col-lg-4 connectedSortable">
<div class="card card-info">
              <div class="card-header">
                <h3 class="card-title"> Add New Expense Category</h3>
              </div>
              <div class="card-body">
<?php
if(isset($_POST["submit_category"])){
$category=$_POST["category"];

$yy=date("Y"); $fyy=substr($yy,2,2);
$mm=date("m"); $dd=date("d");
$hi=date("h"); $mi=date("i");
$sa=date("sa"); $sa=date("s");
$categoryid="cat".$rolenumber.$fyy.$mm.$dd.$hi.$mi.$sa;

$insert_scrap=$dbh->prepare("insert into scrap (item,item2,type) values('$categoryid','$category','expense')");
$insert_scrap->execute();
echo "<div class='col-lg-12 alert alert-success'>New Category Added: </div>";
}
?>
<form method="post">
 <div class="row">
<div class='col-lg-12'>
<input type='text' class='form-control' name='category' placeholder='Category' required>
</div>
</div><br>
<div class='form-group'>
<input type="submit" class="btn btn-sm btn-primary col-lg-12" name="submit_category" value="Submit">
</div>

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




</div>
<!--the body-->

      </div>
    </div>                         


                
                <!-- /.row -->
<div style="margin-top: 20px;">.</div>

                  </div>
                <!-- /.row -->

            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->

    <!-- jQuery -->
    <script src="../js/input_down.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../js/bootstrap.min.js"></script>
     <script type="text/javascript" src="../js/jquery-1.8.3.min.js" charset="UTF-8"></script>
</body>

</html>
