<?php $this->load->view('common/head')?>

<body>
<div class="page-container list-menu-view">
<!--Leftbar Start Here -->
<?php $this->load->view('common/sidebar')?>

    <div class="page-content">
    <!--Topbar Start Here -->
    <?php $this->load->view('common/header') ?>
        <div class="main-container">
            <div class="container-fluid">
                <div class="page-breadcrumb">
                    <div class="row">
                        <?php if(validation_errors()!=''){?>
                    <div class="alert alert-danger alert-dismissible">
                    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                        <?php echo validation_errors(); ?>
                    </div>
                        <?php }?>
                        <div class="col-md-7">
                            <div class="page-breadcrumb-wrap">
                                <div class="page-breadcrumb-info">
                                    
                                    <ul class="list-page-breadcrumb">
                                        <li><a href="#">Home</a>
                                        </li>
                                        <li class="active-page"> Edit Slider</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-5">

                        </div>
                    </div>
                </div>
                 <?php 
                    if($this->session->flashdata('msg')!=''){
                        echo '<div class="alert alert-success alert-dismissible">
                              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                              <strong>'.$this->session->flashdata('msg').'</strong> 
                            </div>';
                    }
                    if($this->session->flashdata('err')!=''){
                        echo '<div class="alert alert-danger alert-dismissible">
                              <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                              <strong>'.$this->session->flashdata('err').'</strong> 
                            </div>';
                    }
                ?>
                <div class="row">
                    <div class="col-md-12 ">
                    <div class="box-widget widget-module">
                            <div class="widget-head clearfix">
                                <span class="h-icon"><i class="fa fa-bars"></i></span>
                                <h4>Edit Slider</h4>
                            </div>
                            <div class="widget-container">
                                <div class=" widget-block">
                                    <form action="<?= base_url('admin/slider/edit/'.$slider['id'])?>" method="post" enctype="multipart/form-data">
                                         <legend>Edit Slider</legend>
                                   

                                     <div class="form-group">
                                        <label>Title</label>
                                         <input type="text" name="title" value="<?= $slider['title']?>" class="form-control"  required="">
                                     </div>

                                      

                                       <div class="form-group">
                                        <label>Content</label>
                                         <textarea  name="content" class="form-control"  required=""><?= $slider['content']?></textarea>
                                     </div>

                                    
                                      
                                       <div class="form-group">
                                        <label>Image</label>
                                         <input type="file" name="image" value="<?= set_value('image')?>" class="form-control"  >
                                     </div>
                                     
                                      <div class="form-group">
                                        <label>Sort Order</label>
                                         <input type="number" value="<?= $slider['sort']?>" name="sort" class="form-control" >
                                     </div>

                                     <div class="form-group">
                                        <label> Status</label>
                                         <select class="form-control" name="status">
                                             <option <?php if($slider['status']=='Active'){ echo 'selected'; }?>>Active</option>
                                             <option <?php if($slider['status']=='Inactive'){ echo 'selected'; }?>>Inactive</option>
                                         </select>
                                     </div>
                                     <input type="submit" name="" class="btn btn-primary" value="Submit">
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    </div>
                  <?php $this->load->view('common/foot'); ?>
        </div>
    </div>

    <?php $this->load->view('common/footer')?>

    <!-- <script type="text/javascript" src="<?= base_url('public /js/custom.js')?>"></script> -->

    <!-- <?php
        $this->load->view('Products/custom');
    ?> -->