ok

Mini Shell

Direktori : /proc/thread-self/root/home2/selectio/public_html/obnovit-tracking/old/
Upload File :
Current File : //proc/thread-self/root/home2/selectio/public_html/obnovit-tracking/old/employee.php

<?php  include "header.php";?>
<div class="content-wrapper" style="background:white;">
        <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 search_table =$('#search_table').val();
            var filter_month =$('#filter_month').val();
             var filter_year =$('#filter_year').val();
             var filter_created_by =$('#filter_created_by').val();
             var filter_updated_by =$('#filter_updated_by').val();
              var filter_department =$('#filter_department').val();
            var filter_designation =$('#filter_designation').val();
            var table = $('#StData').DataTable({

                    'ajax' : { 
                        url: 'data-tables/employee-data-table.php', 
                        data:{filter_department:filter_department,filter_designation:filter_designation,search:search_table,filter_month:filter_month,filter_year:filter_year,filter_created_by:filter_created_by,filter_updated_by:filter_updated_by}, 
                        type: 'POST'},
                        bFilter: true,
                        bDestroy: true,
                        searching: true,pageLength: 10,
                    "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'},
                    ]

                });
        }
        $('#filter_month,#filter_year,#filter_created_by,#filter_updated_by,#filter_department,#filter_designation').change(function() {
            emp_data();
        });
        $('#search_table').keyup(function() {  
           
            var search_table =$('#search_table').val();
            var filter_month =$('#filter_month').val();
             var filter_year =$('#filter_year').val();
             var filter_created_by =$('#filter_created_by').val();
             var filter_updated_by =$('#filter_updated_by').val();
              var filter_department =$('#filter_department').val();
            var filter_designation =$('#filter_designation').val();
             
            var table = $('#StData').DataTable({

                    'ajax' : { 
                        url: 'data-tables/employee-data-table.php', 
                        data:{filter_department:filter_department,filter_designation:filter_designation,search:search_table,filter_month:filter_month,filter_year:filter_year,filter_created_by:filter_created_by,filter_updated_by:filter_updated_by}, 
                        type: 'POST'},
                        bDestroy: true,pageLength: 10,
                    "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'},
                    ]

                }); 
            document.getElementById("search_table").focus();
            //table.search(this.value).draw();       
        });

    });
    function delete_employee(id){
            var result = confirm("Confirm want to delete this Holiday?");
            if (result) {
                    $.ajax({
                    type: 'POST',
                    url: 'api/delete.php',
                    data: {type:'employee_delete',delete_id:id,table_name:'tbl_user'},                  
                    success: function(response) {
                        //console.log(response); 
                        emp_datas();
                    }
                });
            }
         }
         function emp_datas(){
             var search_table =$('#search_table').val();
             
             var filter_month =$('#filter_month').val();
             var filter_year =$('#filter_year').val();
             var filter_created_by =$('#filter_created_by').val();
             var filter_updated_by =$('#filter_updated_by').val();
                           var filter_department =$('#filter_department').val();
            var filter_designation =$('#filter_designation').val();
             
            var table = $('#StData').DataTable({

                    'ajax' : { 
                        url: 'data-tables/employee-data-table.php', 
                        data:{filter_department:filter_department,filter_designation:filter_designation,search:search_table,filter_month:filter_month,filter_year:filter_year,filter_created_by:filter_created_by,filter_updated_by:filter_updated_by}, 
                        type: 'POST'},
                        bFilter: true,
                        bDestroy: true,
                        searching: true,pageLength: 10,
                    "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>


<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div >
                <div class="box-header">

            
   <?php if($_SESSION['hrm']['id']==1 || $allPermissions['category']['create']=="1"){ ?>         <a  href="employee-add.php" class="btn btn-success btn-sm pull-right"><i class="fa fa-plus-circle"></i> Create New Employee</a> <?php } ?>
                    <h3 class="box-title"><b><i class="fa fa-list"></i> Employee List</b></h3>
                </div>
                <div class="box-body">
<div class="row">

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

<div class="col-sm-2">
<div class="form-group">
<label class="control-label" for="filter_department">Department</label>
<select name="filter_department" class="form-control select2" style="width:100%" id="filter_department" required>
    <option value="">All</option>
    <?php 
        $statement = $pdo->prepare("SELECT * FROM tbl_departement");
        $statement->execute();
        $result = $statement->fetchAll(PDO::FETCH_ASSOC);
        foreach ($result as $data) {
        echo "<option value=".$data['id'].">".$data['departement']."</option>";
    }?>
</select>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label class="control-label" for="filter_designation">Designation</label>
<select name="filter_designation" class="form-control" style="width:100%" id="filter_designation" required>
    <option value="">All</option>
    
</select>
</div>
</div>


<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="filter_created_by">Created By</label>
<select name="filter_created_by" class="form-control select2" style="width:100%" id="filter_created_by" required>
    <option value="">All</option>
    <?php 
$statement = $pdo->prepare("SELECT * FROM tbl_user");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach($result as $com_user){
            echo "<option value='".$com_user['id']."'>".$com_user['emp_name']."</option>";
        }
    ?>
</select>
</div>
</div>

<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="filter_updated_by">Updated By</label>
<select name="filter_updated_by" class="form-control select2" style="width:100%" id="filter_updated_by" required>
    <option value="">All</option>
    <?php 
$statement = $pdo->prepare("SELECT * FROM tbl_user");
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
foreach($result as $com_user){
            echo "<option value='".$com_user['id']."'>".$com_user['emp_name']."</option>";
        }
    ?>
</select>
</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;font-size: 14px;">
                            <thead>
                                <tr>
                                    <td colspan="12" class="p0"><input type="text" class="form-control b0" name="search_table" id="search_table"  placeholder="Search Here" style="width:100%;background-color: <?=$theme_color?>color: white;"></td>
                                </tr>
                                <tr class="active">
                                    <th style="width:100px;">Action</th>
                                    <th>S.no</th>
                                     <!--<th>Photo</th>-->
                                    <th>Employee Name</th>
                                    <th>Mobile No</th>
                                    <th>Gender</th>
                                    <th>Department</th>
                                    <th>Designation</th>
                                    <th>Created At </th>
                                    <th>Updated At</th>
                                    <th>Created By </th>
                                    <th>Updated By</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="10" class="dataTables_empty"><center> Loading Pls Wait Data</center></td>
                                </tr>
                            </tbody>
                            
                        </table>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>




<script>
 $(document).ready(function() { 
$("#filter_department").change(function () {
        get_desgination();
    });
    
    
    function get_desgination(){
         $('#filter_designation').empty();
        var departement_id=$('#filter_department').val();
                                $.ajax({
                            url: 'api/get-desgination-api.php',
                            type: 'post',
                            dataType: 'json',
                            data: {type:'get_desgination',departement_id:departement_id},
                            success: function (response) {
                                //console.log(response);
                                var m='<option value="all">All</option>';
                                if(response['error']==false){
                                    for(var n=0;n<response['data'].length;n++){
                                        m+='<option value='+response['data'][n]['id']+'>'+response['data'][n]['desgination']+'</option>';
                                    }
                                }
                                $('#filter_designation').append(m);  
                                
                               
                            }
                        });
    }
 });
</script>
<?php include "footer.php";?>

Zerion Mini Shell 1.0