MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/www/imenso.co/matrix/admin/assignment_delete.php
<?php include 'admin_header.php';
error_reporting(0);
// include('../PHPExcel/Classes/PHPExcel/IOFactory.php');
?>
<div class="container" style="background: #fff;position:relative; margin-top:42px ">
    <div class="assignment-dashboard">
     
        <form action="" method="POST" >
            <div class="row">
                <div class="col-sm-8 border-right">
                    <h5 class="mt-3 mb-3">
                      
                        <div class="pull-right">
                        <strong class="badge badge-secondary checked_count">0</strong> 
                    
                        <a href="javascript:;" id="delete_folder"><input class="btn btn-primary" type="button" name="delete_folder" value="Delete" /></a>
                        </div></h5>
                       
                     <input type="text" name="search" class="mb-3 assignment_delete"  placeholder="Search: [Folder Index/User]" id="search" style=" width: -webkit-fill-available; text-align: center;">
                    <div class="table-responsive" id="assignment_delete_table">
                        <table class="table table-striped table-sm table-bordered" >
                            <thead>
                                <tr>
                                    <th>Action</th>
                                    <th>
                                        <a href="javascript:;" class="column_sort_delete" id="assignment_no" data-order="desc"> Folder Index </a>

                                    </th>
                                    <th>
                                        <a href="javascript:;" class="column_sort_delete" id="no_of_record" data-order="desc"> Data Count</a>
                                    </th>
                                    <th>
                                        <a href="javascript:;" class="column_sort_delete" id="name" data-order="desc"> Completed By </a>
                                    </th>
                                    <th>
                                        <a href="javascript:;" class="column_sort_delete" id="assignment_date" data-order="desc"> Assigned Date </a>
                                    </th>
                                    <th> 
                                        <a href="javascript:;" class="column_sort_delete" id="submit_date" data-order="desc">Completed Date </a>
                                    </th>
                                    
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $total = 0 ;
                                $result = $conn->query("SELECT assignments.* , users.name FROM assignments inner join users on users.id = assignments.user_id WHERE assignments.assignment_status_id = 2 AND assignments.submit_date IS NOT NULL AND assignments.deleted=0 AND assignments.submit_date <= '".date('Y-m-d', strtotime('-3 days'))."' order by assignments.submit_date ASC");
                                while($row = $result->fetch_assoc()) {
                                $total = $total + $row['no_of_record'] ;
                                   
                                ?>
                                <tr>
                                    <td><input type="checkbox" class="chk_doc_no1" name="doc_no[]" value="<?php echo $row['assignment_no'] ?>" file_count="<?php echo $row['no_of_record'] ?>"  /></td>
                                    <td> <?php echo $row['assignment_no'] ?> </td>
                                    <td> <?php echo $row['no_of_record'] ?></td>
                                    <td> <?php echo $row['name'] ?></td> 
                                    <td><?php echo date('m/d/Y ', strtotime($row['assignment_date'])) ?></td>
                                    <td><?php echo date('m/d/Y ', strtotime($row['submit_date'])) ?></td>
                                  
                                </tr>
                                <?php
                                }
                                ?> 
                            </tbody>
                        
                        </table>
                    </div>
                </div>
 
            </div>
        </form>
    </div>
</div>

<?php
?>
<script>
    $(document).ready(function(){
        
        $(".total_count").html("[<?php echo $total ?>]");
        // $('input:radio[name="operator_id"]:visible:first').attr('checked','checked');
        
        
        $(".chk_doc_no1").change(function() {
            var total = 0 ;
            $("input[name='doc_no[]']:checked").each(function () {
                total = total + parseInt($(this).attr("file_count"));
            });

            $(".checked_count").html(total); 
        });
        
    });

  
    $('#delete_folder').on('click', function(e) {
        
        var SlectedAssignment = new Array();
        $("input.chk_doc_no1:checked").each(function() {
            SlectedAssignment.push($(this).val());
        }); 
        console.log(SlectedAssignment);
        $("#list").val(SlectedAssignment);
    
        $.ajax({
            url: "assignment_delete_code.php",
            type: "post",
            data: {SlectedAssignment:SlectedAssignment} ,
            success: function (response) {
                console.log(response);
                location.reload();
               // You will get response from your PHP page (what you echo or print)
            },
            error: function(jqXHR, textStatus, errorThrown) {
               console.log(textStatus, errorThrown);
            }
        });

    });
    
</script>
<?php 

$conn->close();


//include 'admin_footer.php';
?>