ok

Mini Shell

Direktori : /home2/selectio/www/obnovit-tracking/old/
Upload File :
Current File : /home2/selectio/www/obnovit-tracking/old/attendance-bulk-upload.php

<?php  include "header.php";?>
<div class="content-wrapper" style="background:white;">
        <div class="clearfix"></div>

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div>
                <div class="box-header">
                    <a  href="sample-csv-format/attendance-bulk-upload-csv.php" class="btn btn-warning btn-sm pull-right"><i class="fa fa-upload"></i> Download Sample Format for </a>
                    <h3 class="box-title"><b>Bulk Upload Attendance : </b></h3>
                </div>
                <div class="box-body">
                    <div class="col-lg-12">
<div id="loading-div">
<center><img src="assets/load.gif" style="10%"><br>
<strong class="blink_me">Loading Pls Wait... </strong></center>
</div>
<div id="success-div">
</div>
<div id="content-div">
                        <form action="" id="bulk_upload_form" enctype="multipart/form-data" method="post" accept-charset="utf-8">
                                                                 
                        <div class="row">
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label class="required" for="category">Bulk Upload Attendance</label>                                    
                                    <input type="file" name="file" value="" placeholder="Browse CSV File" class="form-control tip" id="file" accept=".csv"  required="required" />
                                
                                <center>(Only csv Format)</center></div>
                            </div>
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label class="" for="category">Action</label><br>                                    
                                    <input type="submit" name="add_category" value="Upload Attendance"  class="btn btn-success" />
                                </div>
                            </div>
 </form>
                             
                             
                        </div>
                        

                       
             
                       <table style="width:60%">
                                 <tr>
                                     <th>S.no</th>
                                     <th>Columns Name</th>
                                     <th>Required or Optional</th>
                                     <th>Description</th>
                                 </tr>
                                 <tr>
                                     <td>1</td>
                                     <td>Emp-id</td>
                                     <td><span style='color:red;'>Required</span></td>
                                     <td>Employee Id</td>
                                 </tr>
                                  <tr>
                                     <td>2</td>
                                     <td>Attendance Date</td>
                                     <td><span style='color:red;'>Required</span></td>
                                     <td>20-10-2022(dd-mm-year)</td>
                                 </tr>
                                  <tr>
                                     <td>3</td>
                                     <td>Check In Time </td>
                                     <td><span style='color:red;'>Required</span></td>
                                     <td>H:M:S  (10:10:02)</td>
                                 </tr>
                                 <tr>
                                     <td>4</td>
                                     <td>Check Out Time </td>
                                     <td><span style='color:red;'>Required</span></td>
                                     <td>H:M:S  (05:10:30)</td>
                                 </tr>
                                  <tr>
                                     <td>5</td>
                                     <td>Type</td>
                                     <td><span style='color:red;'>Required</span></td>
                                     <td>1.Present , 2.Half day, 3. Absent, 5.Bonus Leave , 6. Permission Leave</td>
                                 </tr>
                             </table>
            </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>
<script>
    $( document ).ready(function() {
        $('#loading-div').hide();
        
    
        function showData(){
            $('#loading-div').show();
            $('#content-div').hide();
            setTimeout(function() {
                $('#loading-div').hide();
                $('#content-div').show('blind', {}, 500)
            }, 800);
        }
        

    $('#bulk_upload_form').on('submit', function(e){
                e.preventDefault();
                console.log('Ready For Bulk Upload');
                $('#loading-div').show();
                var formData = new FormData(this);
                formData.append('type', 'create_employe');
                                $.ajax({
                            url: 'excel-bulk-upload-api/followup-api.php',
                            type: 'post',
                            dataType: 'json',
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                          enctype: 'multipart/form-data',
                            success: function (response) {
                                console.log(response);
                                if(response['error']==false){
                                    $('#loading-div').hide();
                                    $('#bulk_upload_form').trigger("reset");
                                    $('#content-div').hide();
                                   var msg='<center><b>'+response['message']+'</b><br><a  href="" class="btn btn-warning btn-sm pull-center"><i class="fa fa-arrow-left"></i> Back to Bulk Upload</a><center>';
                                     $('#success-div').append(msg);
                                    $('#success-div').show();
                                }
                                else if(response['error']==true){
                                    
                                    $('#loading-div').hide();
                                    $('#content-div').hide();
                                    console.log('Count : '+response['error_msg_count']);
                                    /*var msg='<center><b>'+response['message']+'</b><br><a  href="" class="btn btn-warning btn-sm pull-center"><i class="fa fa-arrow-left"></i> Back to Bulk Upload</a><center>';*/
                                    var msg='<center><table style="width:100%;><tr><td style="background: #3c8dbc;color: white;font-weight: 700;"></td><td style="background: #3c8dbc;color: white;font-weight: 700;">Row Number</td><td style="background: #3c8dbc;color: white;font-weight: 700;">Error Details</td></tr>';
                                    for(var i=0;i<response['error_msg_count'];i++){
                                        msg+='<tr><td>'+response['error_msg_row'][i]+'</td><td style="color: red;">'+response['message'][i]+'</td></tr>';
                                    }
                                    msg+='</table></center><center><b>'+response['error_msg_count']+' Error Found...</b><br><a  href="" class="btn btn-warning btn-sm pull-center"><i class="fa fa-arrow-left"></i> Back to Bulk Upload</a><center>';
                                     $('#success-div').append(msg);
                                    $('#success-div').show();
                                }
                                else{
                                    alert('something went wrong pls try again...');
                                    $('#loading-div').hide();
                                    $('#content-div').show();
                                }
                            }
                        });
    });
});
</script>
<style>
    table,td,th{
        padding:5px;
    }
    th{
        border: 1px solid black;
    }
    td{
        border: 1px solid black;
        border-style: dashed;
    }
</style>
<?php include "footer.php";?>

Zerion Mini Shell 1.0