<?php $this->load->view('common/head')?>
<link href="//cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.css" rel="stylesheet">

<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"> Add Change Story</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>Add programe</h4>
                            </div>
                            <div class="widget-container">
                                <div class=" widget-block">
                                    <form action="<?= base_url('admin/programe/add')?>" method="post" enctype="multipart/form-data">
                                         <legend>Add programe</legend>
                                   

                                     <div class="form-group">
                                        <label>Title</label>
                                         <input type="text" name="tittle" value="<?= set_value('tittle')?>" class="form-control"  required="">
                                     </div>


                                      <div class="form-group">
                                        <label>Price</label>
                                         <input type="text" name="price" value="<?= set_value('price')?>" class="form-control"  required="">
                                     </div>

                                     <div class="form-group">
                                        <label>package</label>
                                         <textarea type="text" name="package" value="<?= set_value('package')?>" class="form-control full-editor"  required=""></textarea>
                                     </div>

                                     <div class="form-group">
                                        <label>Venue</label>
                                         <textarea type="text" name="venue" value="<?= set_value('venue')?>" class="form-control full-editor"  required=""></textarea>
                                     </div>

                                       <div class="form-group">
                                        <label>Short Desc</label>
                                          <input   name="shortdesc" class="form-control"  required=""><?= set_value('shortdesc')?></input>
                                     </div>

                                     <div class="form-group">
                                        <label>Terms</label>
                                        <textarea name="terms" class="form-control full-editor"  required=""value="<?= set_value('shortdesc')?>"></textarea>
                                     </div>
                                      
                                       <div class="form-group">
                                        <label>Image</label>
                                         <input type="file" name="image" value="<?= set_value('image')?>" class="form-control"  required="">
                                     </div>
                                        
                                         <div class="form-group">
                                        <label>Slider</label>
                                         <input type="file" name="slider[]" multiple="multiple" value="<?= set_value('slider')?>" class="form-control"  required="">
                                     </div>

                                     <div class="form-group">
                                        <label>Seat</label>
                                         <input type="number" name="seat" value="<?= set_value('seat')?>" class="form-control"  required="">
                                     </div>

                                     <div class="form-group">
                                        <label>Date</label>

                                        <div class="date">
                                            
                                        </div>
                                         <input type="hidden" name="tour_date" value="<?= set_value('tour_date')?>" class="form-control "  id="set_val"  required="">
                                     </div>

                                      <div class="form-group">
                                        <label>Time</label>
                                         <input type="text" id="scrollDefaultExample" name="tour_time" value="<?= set_value('tour_time')?>" class="form-control"  required="">
                                     </div>
                                     
                                      <div class="form-group">
                                        <label>Sort Order</label>
                                         <input type="number" value="<?= set_value('sort')?>" name="sort" class="form-control" >
                                     </div>

                                     <div class="form-group">
                                        <label> Status</label>
                                         <select class="form-control" name="status">
                                             <option <?php if(set_value('status')=='Active'){ echo 'selected'; }?>>Active</option>
                                             <option <?php if(set_value('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 src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.7/summernote.js"></script>

<script>
    $=jQuery;
            $(function() {
                $('#scrollDefaultExample').timepicker({ 'scrollDefault': 'now' });
            });
var availableDates = ["23-6-2019","21-6-2019"];
            $('.date').datepicker({
                
  multidate: true,
    format: 'dd-mm-yyyy'
});


            //$('.date').datepicker('setDates', availableDates);
            $('.date').datepicker('show');

            $('.date').on("changeDate", function () {
        var the_dates = $('.date').datepicker('getFormattedDate');
        $('#set_val').val(the_dates);
        //this does not work
        console.log($('.date').datepicker('getFormattedDate'))
    });
            </script>