ok

Mini Shell

Direktori : /home2/selectio/www/lilyexpresslive/expense-invoice/
Upload File :
Current File : /home2/selectio/www/lilyexpresslive/expense-invoice/expense.php

<?php  include "header.php";?>
<div class="content-wrapper">
        <div class="col-lg-12 alerts">
            <div id="custom-alerts" style="display:none;">
                <div class="alert alert-dismissable">
                    <div class="custom-msg"></div>
                </div>
            </div>
            <?php if ($error)  { ?>
            <div class="alert alert-danger alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-ban"></i> Error</h4>
                <?= $error; ?>
            </div>
            <?php } if ($warning) { ?>
            <div class="alert alert-warning alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4><i class="icon fa fa-warning"></i> warning</h4>
                <?= $warning; ?>
            </div>
            <?php } if ($message) { ?>
            <div class="alert alert-success alert-dismissable">
                <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                <h4>    <i class="icon fa fa-check"></i> Success</h4>
                <?= $site_name; ?>
            </div>
            <?php } ?>
        </div>
        <div class="clearfix"></div>

<script type="text/javascript">
    $(document).ready(function() {        
        emp_data();
        function emp_data(){
            var location =$('#location').val(); 
            var payment_method =$('#payment_method').val(); 
            var start_date =$('#start_date').val(); 
            var end_date =$('#end_date').val(); 
            var search_table =$('#search_table').val();
            var category =$('#category').val();var expense_proof=$('#expense_proof').val();
            var table = $('#StData').DataTable({

                    'ajax' : { 
                        url: 'api/expense-data-table.php', 
                        data:{location:location,payment_method:payment_method,start_date:start_date,end_date:end_date,search:search_table,category:category,expense_proof:expense_proof}, 
                        type: 'POST'},
                        bDestroy: true,
                    "buttons": [
                    { extend: 'copyHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'excelHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'csvHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': false,
                    exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'colvis', text: 'Columns'},
                    ]

                });
        }
        
        $('#search_table').keyup(function() {
            var location =$('#location').val(); 
            var payment_method =$('#payment_method').val(); 
            var start_date =$('#start_date').val(); 
            var end_date =$('#end_date').val(); 
            var search_table =$('#search_table').val();
            var category =$('#category').val();var expense_proof=$('#expense_proof').val();
            var table = $('#StData').DataTable({

                    'ajax' : { 
                        url: 'api/expense-data-table.php', 
                        data:{location:location,payment_method:payment_method,start_date:start_date,end_date:end_date,search:search_table,category:category,expense_proof:expense_proof}, 
                        type: 'POST'},
                        bDestroy: true,
                    "buttons": [
                    { extend: 'copyHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'excelHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'csvHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': false,
                    exportOptions: { columns: [ 0, 1, 2, 3, 4, 5,6,7,8,9,10,11 ] } },
                    { extend: 'colvis', text: 'Columns'},
                    ]

                });
            document.getElementById("search_table").focus();
        });
        $('#filter').click(function() {
            emp_data();
        });
   
    });
    function delete_expense(id){
            var result = confirm("Confirm want to delete this Expense Details?");
            if (result) {
                    $.ajax({
                    type: 'POST',
                    url: 'api/delete.php',
                    data: {type:'expense_delete',delete_id:id},                  
                    success: function(response) {
                        console.log(response); 
                        emp_datas();
                    }
                });
            }
         }
         function emp_datas(){
            var location =$('#location').val(); 
            var payment_method =$('#payment_method').val(); 
            var start_date =$('#start_date').val(); 
            var end_date =$('#end_date').val(); 
            var search_table =$('#search_table').val();
            var category =$('#category').val();var expense_proof=$('#expense_proof').val();
            var table = $('#StData').DataTable({

                    'ajax' : { 
                        url: 'api/expense-data-table.php', 
                        data:{location:location,payment_method:payment_method,start_date:start_date,end_date:end_date,search:search_table,category:category,expense_proof:expense_proof}, 
                        type: 'POST'},
                        bDestroy: true,
                    "buttons": [
                    { extend: 'copyHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
                    { extend: 'excelHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
                    { extend: 'csvHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
                    { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': false,
                    exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } },
                    { extend: 'colvis', text: 'Columns'},
                    ]

                });
        }
</script>
<script type="text/javascript">
    $(document).ready(function(){
        /*$('#form').hide();
        $('.toggle_form').click(function(){
            $("#form").slideToggle();
            return false;
        });*/
    });
</script>


<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div style="background:white;">
                <div class="box-header">

            <a  href="#" class="btn btn-default btn-sm toggle_form pull-right" style='margin-left: 5px;'>
                Show/Hide</a>
            <a  href="expense-add.php" class="btn btn-success btn-sm pull-right"><i class="fa fa-plus-circle"></i> Add Expense</a>
                    <h3 class="box-title">Expense List</h3>
                </div>
                <div class="box-body">

<div id="form" class="panel panel-warning">
<div class="panel-body">

<div class="row">

<div class="col-sm-4">
<div class="form-group">
<label class="control-label" for="customer">Select Category</label>
<select name="category" class="form-control select2 form-select-sm" style="width:100%" id="category">
<option value="0">All Category</option>
<?php $statement = $pdo->prepare("SELECT * FROM `tbl_exp_category`");
        $statement->execute();
        $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
        foreach ($location_result as $result) {
            echo "<option value=".$result['id'].">".$result['category']."</option>";
        }?>
</select>
</div>
</div>

<div class="col-sm-4">
<div class="form-group">
<label class="control-label" for="customer">Select Location</label>
<select name="location" class="form-control select2" style="width:100%" id="location">
<option value="0">All Location</option>
<?php $statement = $pdo->prepare("SELECT * FROM `tbl_exp_location`");
        $statement->execute();
        $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); 
        foreach ($location_result as $result) {
            echo "<option value=".$result['id'].">".$result['office']."-".$result['location']."</option>";
        }?>
</select>
</div>
</div>


<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="user">Payment Method</label>
<select name="payment_method" class="form-control select2" id="payment_method" data-placeholder="Payment Method" style="width:100%;">
<option value="0">All</option>
<option value="Cash">Cash</option>
<option value="Card">Card</option>
<option value="UPI Transfer">UPI Transfer</option>
<option value="Acc Transfer">Acc Transfer</option>
<option value="Cheque">Cheque</option>
</select>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="user">Expense Proof</label>
<select name="expense_proof" class="form-control select2" id="expense_proof" data-placeholder="Payment Method" style="width:100%;">
<option value="0">All</option>
<option value="1">Uploaded</option>
<option value="2">Not Uploaded</option>
</select>
</div>
</div>

<div class="col-sm-2">
<div class="form-group">
<label class="control-label" for="start_date">Start Date</label>
<input type="text" name="start_date" value="<?php if(isset($_GET['start_date'])){ echo $_GET['start_date']; } ?>"  class="form-control datetimepicker" id="start_date" />
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label class="control-label" for="end_date">End Date</label>
<input type="text" name="end_date" value="<?php if(isset($_GET['end_date'])){ echo $_GET['end_date']; } ?>"  class="form-control datetimepicker" id="end_date" />
</div>
</div>
<div class="col-sm-2">
    <div class="form-group">
        <label class="control-label" for="end_date">Action</label><br>
    <button id="filter" type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
                       </div>
</div>

<div class="clearfix"></div>


                    <div class="table-responsive">
                        <table id="StData" class="table table-striped table-bordered table-condensed table-hover" style="margin-bottom:5px;">
                            <thead>
                                <tr>
                                    <td colspan="14" class="p0"><input type="text" class="form-control b0" name="search_table" id="search_table"  placeholder="Search Here" style="width:100%;background-color: darkblue;color: white;"></td>
                                </tr>
                                <tr class="active">
                                    <th style="min-width:150px;">Action</th>
                                    <th>S.no</th>
                                    <th>Amount</th>
                                    <th>Ref No</th>
                                    <th>Category </th>
                                    <th>Emp Name</th>
                                    <th>Expense For</th>
                                    <th>Expense Date</th>
                                    <th>Payment Method</th>                                   
                                    <th>Location</th>    
                                    <th>Note</th>    
                                    <th>Added By</th>        
                                    <th>Created At</th>   
                                    <th>Updated At</th>   
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="14" class="dataTables_empty"><center> Loading Pls Wait Data</center></td>
                                </tr>
                            </tbody>
                            
                        </table>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>
<?php include "footer.php";?>

Zerion Mini Shell 1.0