<?php
defined('BASEPATH') or exit('No direct script access allowed');
?>
    <!DOCTYPE html>
    <html>

    <head>
    
        <title>สำนักงานสาธารณสุขจังหวัดสุรินทร์</title>
        <link rel="icon" type="image/png" href="<?php echo base_url();?>images/logo_MOPH.png">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/font-awesome.min.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/animate.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/font.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/li-scroller.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/slick.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/jquery.fancybox.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/theme.css">
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/style.css">
     





    </head>

    <body>

        <div id="preloader">
            <div id="status">&nbsp;</div>
        </div>
        <a class="scrollToTop" href="#">
            <i class="fa fa-angle-up"></i>
        </a>
        <div class="container">
        <header id="header">
        <? $this->load->view("header_view");?>
        </header>






            <section id="contentSection">
                <br />
                <div class="row">
                    <div class="col-lg-3 col-md-3 col-sm-3">
                        <!--  -->
                    </div>
                    <div class="col-lg-6 col-md-6 col-sm-6">
                        <div class="left_content">
                            <div class="single_page">
                            <form action="<?php echo base_url(); ?>index.php/Newscontrol/listedit" method="get">
                                 <div class="row">
                    <div class="col-lg-8 col-md-8 col-sm-8">
                                    <div class="form-group">
                                        <label for="group">กลุ่มข่าว</label>
                                        <select class="form-control" id="group" name="group">
                                            <option disabled selected>กรุณาเลือกกลุ่มข่าว</option>
                                            <?php foreach ($group as $item): ?>
                                            <option value="<?php echo $item->id ?>">
                                                <?php echo $item->name ?>
                                            </option>
                                            <?php endforeach;?>
                                        </select>
                                    </div>
                                    </div>
                                    <div class="col-lg-4 col-md-4 col-sm-4">
                                    <div style="padding-top:25px">
                                    <button type="submit" class="btn btn-primary btn-block" style="border-radius: 8px">ค้นหา</button>
                                     </div></div>
                        </div>   
                               </form>     
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-3 col-sm-3">
                        <a href="<?php echo base_url(); ?>index.php/Newscontrol/admin">
                            <button type="button" class="btn btn-default" style="float: right;border-radius: 8px">
                                <span style="color:green; padding: 15px 43px;">เพิ่มข้อมูล</span>
                            </button>
                        </a>
                    </div> 
                   
                    <br/><br/>
                    <div class="col-lg-3 col-md-3 col-sm-3">
                        <a href="<?php echo base_url(); ?>index.php/Newscontrol/logout">
                            <button type="button" class="btn btn-default" style="float: right;border-radius: 8px">
                                <span style="color:red; padding: 15px 32px;">ออกจากระบบ</span>
                            </button>
                        </a>
                    </div>
                </div>

            </section>



           <section id="contentSection">
    <br />
    <div class="row">
        <div class="col-lg-12 col-md-12 col-sm-12">



            <table id="mytable" class="table table-bordred table-striped">
                <thead>
                    <th>รูปภาพ</th>
                    <th>หัวข้อข่าว</th>
                    <th>วันที่ลงข่าว</th>
                    <th>เวลา</th>
                    <th>แก้ไข</th>
                    <th>ลบ</th>
                </thead>



                <tbody>
        <?php if ($listedit): ?>
                <?php foreach ($listedit as $item): ?>
                    <tr>
                        <td>
                        <img style="width:80px;height:60px" src="<?php echo base_url() . 'images/' . $item->img_news; ?>">
                        </td>
                        <td style="width:50%"><?php echo $item->name_news; ?></td>
                        <td><?php echo date("d-m-Y", strtotime($item->date_n)); ?></td>
                        <td><?php echo date("H:i:s", strtotime($item->date_n)); ?></td>
                        <td>
                            <p data-placement="top" data-toggle="tooltip" title="Edit">
                            <a href="<?php echo base_url(); ?>index.php/Newscontrol/edit?id=<?php echo $item->id;?>&group=<?php echo $item->group_news;?>&name=<?php echo $item->name;?>&img_news=<?php echo $item->img_news;?>&file_news=<?php echo $item->file_news;?>">
                                <button class="btn btn-primary btn-xs" data-title="Edit"  data-toggle="modal">
                                    <span class="glyphicon glyphicon-pencil"></span>
                                </button>
                                </a>
                            </p>
                        </td>
                        <td>
                            <p data-placement="top" data-toggle="tooltip" title="Delete">
                            <a href="<?php echo base_url(); ?>index.php/Newscontrol/delete?id=<?php echo $item->id;?>&group=<?php echo $item->group_news;?>">
                                <button class="btn btn-danger btn-xs" data-title="Delete"  data-toggle="modal">
                                    <span class="glyphicon glyphicon-trash"></span>
                                </button>
                            </a>
                            </p>
                        </td>
                        
                    </tr>
                    <?php endforeach;?>
                    <?php endif;?>
                </tbody>
            </table>

        </div>
    </div>
</section>


            <footer >
            <div align="center" class="col-md-12 col-lg-12 col-sm-12 col-xs-12" style="font-size:12px;color:white;padding:5px; background-color:#232222;">
   <? $this->load->view("footer_sview");?>
            </footer>
        </div>
        <script src="<?php echo base_url(); ?>assets/js/jquery.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/wow.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/slick.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/jquery.li-scroller.1.0.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/jquery.newsTicker.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/jquery.fancybox.pack.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/custom.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/ckeditor.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/sample.js"></script>
   
    </body>

    </html>