<?php
session_start();
include_once 'function.php';


if ($_GET['action'] == 'delete') {
$id  = $_GET['nwsevnt_id'];
$sql = "DELETE FROM donations WHERE donation_id = $id;";
$query = mysqli_query($connect,$sql) or die("There was a problem while deleting: " . mysqli_error());
echo "<div style='width: 350px; text-align: center; margin: 20% auto 0px; font-family: arial; font-size: 14px; border: 1px solid #ddd; padding: 20px 40px;'>Please wait while we update the record loading...</div>";
echo "<script type='text/javascript'>window.location = 'contactus.php?msg=deleted&action=list'</script>";
}
// `donation_id`, `donation_date`, `user_id`, `payment_type`, `amount`, `remarks`SELECT * FROM `donations` WHERE 1
if ($_POST['add'] == 'Create') {
  // Retrieve form data from POST
  $donation_date = $_POST['donation_date'];
  $user_id = $_POST['user_id'];
  $payment_type = $_POST['payment_type'];
  $amount = $_POST['amount'];
  $remarks = $_POST['remarks'];
  $ref_no = $_POST['ref_no'];
  

  // Insert query using mysqli_query
  $query = "INSERT INTO donations (`donation_date`, `user_id`, `payment_type`, `amount`, `remarks`,`ref_no`) 
            VALUES ('$donation_date', '$user_id', '$payment_type', '$amount', '$remarks','$ref_no')";

  mysqli_query($connect, $query) or die(mysqli_error($connect));

  echo "Record added successfully.";




echo "<div style='width: 350px; text-align: center; margin: 20% auto 0px; font-family: arial; font-size: 14px; border: 1px solid #ddd; padding: 20px 40px;'> 
Please wait while we update loading...</div>";
echo "<script type='text/javascript'>window.location = 'contactus.php?msg=added&action=list'</script>";
}


//Edit

// Edit
if ($_POST['update_donation'] == 'Update') {
  // Retrieve form data from POST




  $donation_id = $_GET['nwsevnt_id'];

  $donation_id1 = base64_decode($donation_id);

  $donation_date = $_POST['donation_date'];
  $user_id = $_POST['user_id'];
  $payment_type = $_POST['payment_type'];
  $amount = $_POST['amount'];
  $remarks = $_POST['remarks'];

  // Update query using mysqli_query
  $query = "UPDATE donations 
            SET `donation_date` = '$donation_date', 
                `user_id` = '$user_id', 
                `payment_type` = '$payment_type', 
                `amount` = '$amount', 
                `remarks` = '$remarks' 
            WHERE `donation_id` = '$donation_id1'";

            // echo  $query;
            // exit();

  // Execute the query and handle errors
  mysqli_query($connect, $query) or die(mysqli_error($connect));

  echo "Record updated successfully.";

  echo "<div style='width: 350px; text-align: center; margin: 20% auto 0px; font-family: arial; font-size: 14px; border: 1px solid #ddd; padding: 20px 40px;'> 
  Please wait while we update...loading...</div>";
  echo "<script type='text/javascript'>window.location = 'contactus.php?msg=updated&action=list'</script>";
}


?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="ta" xml:lang="ta">
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />   
  <head>
    <meta charset="utf-8" />
    <title>Buy Business Enquiry | 
      <?php echo $site_title; ?>
    </title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">    
    <link rel="stylesheet" href="assets/font-awesome/font-awesome.min.css"> 
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&amp;subset=all" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <link href="assets/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN THEME GLOBAL STYLES -->
    <link href="assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
    <link href="assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
    <!-- END THEME GLOBAL STYLES -->
    <!-- BEGIN THEME LAYOUT STYLES -->
    <link href="assets/layouts/layout/css/layout.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/layouts/layout/css/themes/darkblue.min.css" rel="stylesheet" type="text/css" id="style_color" />
    <link href="assets/layouts/layout/css/custom.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css" rel="stylesheet" type="text/css" />
    <link href="assets/layouts/customer.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">


    <link href="../css/receipt.css" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL PLUGINS -->
    <style type="text/css">
      .dt-buttons {
        display: none;
      }
    </style>
    <script type="text/javascript">
      function delete_menu(idurl)
      {
        go_on = confirm("Are you sure ? ");
        if(go_on)
        {
          document.location.href=idurl;
        }
      }
    </script>
  </head>
  <!-- END HEAD -->
  <body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
    <div class="page-wrapper">
      <!-- BEGIN HEADER -->
      <?php include("header.php");?>
      <!-- END HEADER -->
      <!-- BEGIN HEADER & CONTENT DIVIDER -->
      <div class="clearfix"> 
      </div>
      <!-- END HEADER & CONTENT DIVIDER -->
      <!-- BEGIN CONTAINER -->
      <div class="page-container">
        <!-- BEGIN SIDEBAR -->
        <?php include("menu.php");?>
        <!-- END SIDEBAR -->
        <!-- BEGIN CONTENT -->
        <div class="page-content-wrapper">
          <!-- BEGIN CONTENT BODY -->
          <div class="page-content">
            <!-- END THEME PANEL -->
            <!-- BEGIN PAGE BAR -->
            <div class="page-bar">
              <ul class="page-breadcrumb">
                <li>
                  <a href="index.php">Home
                  </a>
                  <i class="fa fa-circle">
                  </i>
                </li>
                <li>
                  <span>Contact 
                  </span>
                </li>
              </ul>
              <div class="page-toolbar">
                <div id="dashboard-report-range" class="pull-right tooltips btn btn-sm" data-container="body" data-placement="bottom" data-original-title="Change dashboard date range">
                  <i class="icon-calendar">
                  </i>&nbsp;
                  <span class="thin uppercase hidden-xs">
                  </span>&nbsp;
                  <i class="fa fa-angle-down">
                  </i>
                </div>
              </div>
            </div>
            <!-- END PAGE BAR -->
            <!-- BEGIN PAGE TITLE-->
            <?php
//`product_id`, `product_img`, `product_price`, `product_HI`, `product_DI`, `product_TI`, `product_cycle`, `product_Des`SELECT * FROM `product` WHERE 1
if(isset($_GET['action']) =='' || $_GET['action'] == 'list') {
    //`newsid`, `newsdate`, `newshead`, `newscontent`, `newsimg1`, `newsimg2`SELECT * FROM `news` WHERE 1
?>
            <br>
            <div class="row">
              <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->
                <div class="portlet box red">
                  <div class="portlet-title">
                    <div class="caption">
                      <i class="fa fa-globe">
                      </i>Donation Details
                    </div>
                    <div class="actions">
                    <a href="?action=add" class="btn btn-default btn-sm">
                        <i class="fa fa-plus">
                        </i> Add 
                      </a>
                    
                    </div>
                  </div>
                  <div class="portlet-body" style="overflow: scroll;">
                    <?php 
                    // pageStatus($status); 
                    ?>
                    <table class="table table-striped table-bordered table-hover" id="sample_2">
                      <thead>
                        <tr class="">
                          <th> S.NO 
                          </th>
                          
                           <th>
                        Date
                          </th>
                         <th>
                       User ID
                          </th>
                              <th>
                      Payment Type
                          </th>
                          <th>
                      Amount
                          </th>
                          <th>
                      Remarks
                          </th>
                          <th>
                      Ref no
                          </th>
                          
                     
                       
                              
                         
                            
                          <th>Modify
                          </th>
                        </tr>
                      </thead>
                      <tbody>
                        <?php
$sno =0;

// /`donation_id`, `donation_date`, `user_id`, `payment_type`, `amount`, `remarks`SELECT * FROM `donations` WHERE 1
$get_organic = mysqli_query($connect,"SELECT * FROM `donations`") or die(mysqli_error());
while($get_value = mysqli_fetch_array($get_organic)) 
{
$sno++;
$donation_id = $get_value['donation_id'];
$donation_date = $get_value['donation_date'];
$user_id = $get_value['user_id'];
$payment_type = $get_value['payment_type'];
$amount = $get_value['amount'];
$remarks = $get_value['remarks'];


$ref_no = $get_value['ref_no'];


?>
                        <tr>
                          <td>
                            <?php echo $sno;?> 
                              
                          </td>
                          
                            
                          
                        
                          
                           <td>
                          
                             <?php echo date('d-m-Y',strtotime($donation_date));?> 
                          </td>

                         
                            <td>
                                
                               
                           <?php
                   
                        $get_sorganic = mysqli_query($connect,"SELECT * FROM `users` WHERE userid='$user_id'") or die(mysqli_error());
                        while($get_value1 = mysqli_fetch_array($get_sorganic)) 
                        {
                        $userid = $get_value1['userid'];
                        echo $username = $get_value1['username'];
                        }
                           ?>
                 
                          </td> 
                          <td>
                                
                               
                           
                            <?php echo $payment_type;?> 
                          </td>
                          <td>
                                
                               
                           
                            <?php echo $amount;?> 
                          </td> 
                          <td>
                                
                               
                           
                            <?php echo $remarks ;?> 
                          </td> 
                          <td>
                                
                               
                           
                                <?php echo $ref_no ;?> 
                              </td> 

              

                        
                          <td>
                              
                  
                          <a class="btn btn-warning  btn-xs" href="contactus.php?action=edit&nwsevnt_id=<?php echo base64_encode($donation_id); ?>">
                              <i class="fa fa-pencil" aria-hidden="true">
                              </i> Edit
                            </a>
                              <a class="btn btn-success  btn-xs" href="receiptprint.php?id=<?php echo $donation_id; ?>" target="_blank">
                              <i class="fa fa-print" aria-hidden="true">
                              </i> Print
                            </a>
                            <a class="btn btn-xs red"  onClick="delete_menu('contactus.php?action=delete&nwsevnt_id=<?php echo $donation_id; ?>')" href="javascript:;">
                              <i class="icon-trash">
                              </i> Delete
                            </a>
                                  <!-- whatsapp button -->
            <!-- <button class="mt-2 btn btn-success" onclick="sendReceiptViaWhatsApp()" style="padding: 5px 10px; font-size: 14px;">
        <i class="fab fa-whatsapp" style="margin-right: 5px;"></i>Send via WhatsApp
    </button> -->
    <a class='wp-share' href='https://api.whatsapp.com/send?text=https://nesackkarangal.org/admin/printreceipt.php?id=11' target="_blank">
Share On Whatsapp</a>
                          </td>
                         
        
                          
                          
  

                        </tr>
                        <?php
}
?>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>   
            <?php
}
if($_GET['action'] == 'add')
{

//`idd`, `full_name`, `employment_type`, `pan`, `dob`, `state`, `pin_code`, 
//`mobile_no`, `email`, `aadhar_no`, `gender`, `city`, `loan_amount`SELECT * FROM `apply_from` WHERE 1

//`donation_id`SELECT * FROM `donations` WHERE 1


$get_editlastvalue = mysqli_query($connect,"select * from donations ORDER BY donation_id DESC Limit 0,1") or die(mysqli_error());

while($get_valuelast = mysqli_fetch_array($get_editlastvalue)) {

$donation_id = $get_valuelast['donation_id'];

}
$reciptno = $donation_id + 1;
?>
            <div class="row">
              <div class="col-md-12">
                <!-- BEGIN VALIDATION STATES-->
                <div class="portlet light portlet-fit portlet-form bordered">
                  <div class="portlet-title">
                    <div class="caption">
                      <i class="fa fa-list  font-red" aria-hidden="true">
                      </i>
                      <span class="caption-subject font-red sbold uppercase">ADD 
                      </span>
                    </div>
                  </div>
                  <div class="portlet-body">
      




                    <form action="" id="form_sample_1" method="post" class="form-horizontal" novalidate="novalidate">

<div id="inv-broder1">

    <div class="receipt-header">

    <div class="col-xs-3 text-center" style="padding: 0px">

       <!--  <img src="assets/images/jayam logo_1.jpg" style="width: 150px">
-->
    </div>

    <!-- <div class="col-xs-9 text-left" style="padding: 0px">                                         -->

        <!-- <h2 class="text-light text-uppercase margin5" ><span class="text-accent-dark" id="store-name">JAYAM COMPUTERS</span></h2> -->
        <center> <img src="https://nesackkarangal.org/images/logo.png" style="width: 80%;height: 100px;"><br><br>

       <!--  <h5 class="bold" id="IRON">COMPUTER Sales & Service</h5> -->

        <h5 class="bold in-address" style="color:black;">1/157, Vanniyar Nagar, Opp Vidya Mandir School, Meiyyanoor Main Road, Salem - 636004</h5>

        <h5 class="bold in-address" style="color:black;">Ph: 99655 - 81007 , 99655 - 82007</h5></center>

    <!-- </div> -->

    

</div>

    <!-- receipt-header -->

    

    <div class="col-xs-4">

      <h4>No : <input type="text" value="<?php echo $reciptno; ?>" readonly style="border: none;height: 30px;"></h4>

    </div>

    <div class="col-xs-4 text-center"> 

      <h4 id="RECEIPT"><strong><u>RECEIPT</u></strong></h4>

    </div>

    <div class="col-xs-4">

      <h4>Date : <input type="date" name="donation_date" style="border: none;height: 30px;" required></h4>

      <h4>Ref No : <input type="number" name="ref_no" style="border: none;height: 30px;"></h4>

    </div>

    <!-- <span class="header-border"></span> -->

    <div class="row">

        <div class="col-xs-12" style="padding:0px 0px 5px 70px;">

            <!-- receipt address -->

            <div class="receipt-address1">

                <strong><p>Sir /M/s.</p></strong>

            </div>

            <div class="receipt-address2">

                <p id="content">

                  <select data-plugin-selectTwo class="form-control populate" name="user_id" >

              <option value="OnCustmer">Select a Customer  </option>

              <?php

$get_user = mysqli_query($connect,"SELECT * FROM `users`") or die(mysqli_error());
while($get_userid = mysqli_fetch_array($get_user)) 
{
  $userid = $get_userid['userid'];
$username = $get_userid['username'];
            ?>


                      ?>

                          <option value="<?php echo $userid; ?>">

                            <?php echo $username; ?> 

                          </option>

                      <?php

                  }   

                      ?>





          </select>



                    

                </p>

            </div>

            <!-- End receipt address -->

            <!-- Amount text -->

            <div class="receipt-amount1">

                <strong><p>the sum of Rupees</p></strong>

            </div>

            <div class="receipt-amount2">

                <p id="content">

                    <!-- Fifity Thousand four hundred and twenty repees only -->

                    --------------------------------------------------------

                </p>

            </div>

            <!-- End Amount text -->

            

            <!-- Cash text -->

            <div class="receipt-cash1">

                <strong><p>by Cash / Cheques/ Draft No</p></strong>

            </div>

            <div class="receipt-cash2">

                <p id="content">

                    <select name="payment_type" style="width: 90%;border: none;height: 30px;padding: 0;">

                        <option value="Cash">Cash</option>

                        <option value="Cheques">Cheques</option>

                        <option value="NEFT/RTGS">NEFT/RTGS</option>

                        <option value="NEFT/RTGS">Online Payment</option>

                    </select>

                </p>

            </div>

            <!-- End Cash text -->

            <!-- receipt towards -->

            <div class="receipt-towards1">

                <strong><p>Towards</p></strong>

            </div>

            <div class="receipt-towards2">

                <p id="content">

                   <input type="text" name="remarks" value="Sales" style="width: 100%; border: none;height: 30px;">

                </p>

            </div>

            <!-- End receipt towards -->

            <!-- receipt Footer -->

            <div class="receipt-footer1">

                <div id="rs"><strong>Rs.  <input type="number" name="amount" style="width: 70%; border: none;height: 30px;"> /-</strong></div>

                <p>(Cheque Subject to Realisation)</p>

            </div>

            <div class="receipt-footer2">

                <p id="sign">For <strong>NESACKKARANGAL</strong></p>

            </div>

            <!-- End Footer -->

            

            

        </div>

    </div>

    

    <div class="form-actions">

<div class="row">

    <div class="col-md-offset-3 col-md-9">

        <button type="submit" class="btn green" name="add" value="Create">Submit</button>

        <button type="reset" value="Reset" class="btn grey-salsa btn-outline">Reset</button>

    </div>

</div>

</div>

</div>

</div>



</form>










                  </div>
                </div>
                <!-- END VALIDATION STATES-->
              </div>
            </div>
<?php 
}
//edit


if(isset($_GET['action']) == 'edit' && isset($_GET['nwsevnt_id'])) {   
 
                   
  $NewsID = base64_decode($_GET["nwsevnt_id"]);
  
  $get_about_edit = mysqli_query($connect,"SELECT * FROM `donations` where donation_id = '$NewsID'") or die(mysqli_error());
  while($get_edit = mysqli_fetch_array($get_about_edit)) 
  {
    $sno++;
    $donation_id = $get_edit['donation_id'];
    $donation_date = $get_edit['donation_date'];
    $user_id = $get_edit['user_id'];
    $payment_type = $get_edit['payment_type'];
    $amount = $get_edit['amount'];
    $remarks = $get_edit['remarks'];
  }
  ?>
?>
<div class="row">
              <div class="col-md-12">
                <!-- BEGIN VALIDATION STATES-->
                <div class="portlet light portlet-fit portlet-form bordered">
                  <div class="portlet-title">
                    <div class="caption">
                      <i class="fa fa-list  font-red" aria-hidden="true">
                      </i>
                      <span class="caption-subject font-red sbold uppercase">ADD 
                      </span>
                    </div>
                  </div>
                  <div class="portlet-body">
                    <!-- BEGIN FORM-->
          <form action="" id="form_sample_1" method="post" class="form-horizontal" novalidate="novalidate" enctype="multipart/form-data" onsubmit="return CheckFormData();">
                      <div class="form-body">


                                   <div class="form-group">
                                                    <label class="control-label col-md-3">User Name
                                                        <span class="required" aria-required="true"> * </span>
                                                    </label>
                                                    <!-- `donation_id`, `donation_date`, `user_id`, `payment_type`, `amount`, `remarks`SELECT * FROM `donations` WHERE 1 -->
                                                    <div class="col-md-4">
                                                    <select name="user_id" id="user_id"  class="form-control" required>
            <option value="">Select user</option>
            <?php
$get_user = mysqli_query($connect,"SELECT * FROM `users`") or die(mysqli_error());
while($get_userid = mysqli_fetch_array($get_user)) 
{
  $userids = $get_userid['userid'];
$username = $get_userid['username'];
            ?>

            <option value="<?php echo $userids; ?>" <?php if($user_id == $userids){ echo "selected"; } ?>><?php echo $username; ?></option>
            <?php
}
            ?>
            <!-- Add more roles as needed -->
        </select>
                                  
                               </div>

                               
                               
                               </div>

                               
                               

                               

                               <div class="form-group">
                                                    <label class="control-label col-md-3">Date
                                                        <span class="required" aria-required="true"> * </span>
                                                    </label>
                                                    
                                                    <div class="col-md-4">
                                                        <input type="date" name="donation_date" value="<?php echo $donation_date; ?>" id="category_name" data-required="1" class="form-control">
                                  
                               </div>

                               
                               
                               </div>

                               <div class="form-group">
                                                    <label class="control-label col-md-3">Payment Type
                                                        <span class="required" aria-required="true"> * </span>
                                                    </label>
                                                    
                                                    <div class="col-md-4">
                                                        <input type="text" name="payment_type" value="<?php echo $payment_type; ?>" id="category_name" data-required="1" class="form-control">
                                  
                               </div>

                               
                               
                               </div>

                               <div class="form-group">
                                                    <label class="control-label col-md-3">Amount
                                                        <span class="required" aria-required="true"> * </span>
                                                    </label>
                                                    
                                                    <div class="col-md-4">
                                                        <input type="text" name="amount" value="<?php echo $amount; ?>" id="category_name" data-required="1" class="form-control">
                                  
                               </div>

                               
                               
                               </div>

                               <div class="form-group">
                                                    <label class="control-label col-md-3">Remarks
                                                        <span class="required" aria-required="true"> * </span>
                                                    </label>
                                                    
                                                    <div class="col-md-4">
                                                        <input type="text" name="remarks" value="<?php echo $remarks; ?>"  id="category_name" data-required="1" class="form-control">
                                  
                               </div>

                               
                               
                               </div>
                           

                      
                              
                               
                               

                      </div>
                      <div class="form-actions">
                        <div class="row">
                          <div class="col-md-offset-3 col-md-9">
                            <button type="submit" class="btn green" name="update_donation" value="Update">Submit
                            </button>
                            <button type="reset" value="Reset" class="btn grey-salsa btn-outline">Reset
                            </button>
                          </div>
                        </div>
                      </div>
                    </form>
                    <!-- END FORM-->
                  </div>
                </div>
                <!-- END VALIDATION STATES-->
              </div>
            </div>
            <?php
}

?>











            <div class="clearfix">
            </div>
          </div>
          <!-- END CONTENT BODY -->
        </div>
        <!-- END CONTENT -->
        <!-- END QUICK SIDEBAR -->
      </div>
      <!-- END CONTAINER -->
      <!-- BEGIN FOOTER -->
      <?php include("footer.php");?>
      <!-- END FOOTER -->
    </div>
    <!-- BEGIN QUICK NAV -->
    <div class="quick-nav-overlay">
    </div>
    <!-- END QUICK NAV -->
    <!--[if lt IE 9]>
<script src="assets/global/plugins/respond.min.js"></script>
<script src="assets/global/plugins/excanvas.min.js"></script> 
<script src="assets/global/plugins/ie8.fix.min.js"></script> 
<![endif]-->
    <!-- BEGIN CORE PLUGINS -->
    <script src="//cdn.ckeditor.com/4.5.7/standard/ckeditor.js">
    </script>
    <script src="assets/global/plugins/jquery.min.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/js.cookie.min.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/jquery.blockui.min.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript">
    </script>
    <!-- END CORE PLUGINS -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script src="assets/global/scripts/datatable.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/datatables/datatables.min.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js" type="text/javascript">
    </script>
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN THEME GLOBAL SCRIPTS -->
    <script src="assets/global/scripts/app.min.js" type="text/javascript">
    </script>
    <!-- END THEME GLOBAL SCRIPTS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="assets/pages/scripts/table-datatables-colreorder.min.js" type="text/javascript">
    </script>
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script src="assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript">
    </script>
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="assets/pages/scripts/components-select2.min.js" type="text/javascript">
    </script>
    <!-- END PAGE LEVEL SCRIPTS -->
    <!-- END PAGE LEVEL SCRIPTS -->
    <!-- BEGIN THEME LAYOUT SCRIPTS -->
    <script src="assets/layouts/layout/scripts/layout.min.js" type="text/javascript">
    </script>
    <script src="assets/layouts/layout/scripts/demo.min.js" type="text/javascript">
    </script>
    <script src="assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript">
    </script>
    <script src="assets/layouts/global/scripts/quick-nav.min.js" type="text/javascript">
    </script>
    <script src="assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js" type="text/javascript">
    </script>
    <!-- END THEME LAYOUT SCRIPTS -->
    <!-- Password Check -->
    <script language="javascript">
      function pswcheck()
      {
        pass=document.getElementById("password").value;
        repassword=document.getElementById("repassword").value;
        if(pass!=repassword)
        {
          alert("password Mismatch");
          document.getElementById("password").value="";
          document.getElementById("repassword").value="";
          document.getElementById("password").focus();
        }
      }
    </script>
    <script language="javascript" type="text/javascript">
      function CheckFormData()
      {
        var organic_menu  = document.getElementById("organic_menu");
        var image  = document.getElementById("image");
        if(organic_menu.value == '')
        {
          alert('Please Fill Category.');
          organic_menu.focus();
          organic_menu.style.border = 'thin solid red';
          return false;
        }
        if(image.value == '')
        {
          alert('Please Select Image.');
          image.focus();
          image.style.border = 'thin solid red';
          return false;
        }
        return true;
      }
    </script>
  </body>
</html>
