<script src="<?php echo base_url();?>ckeditor/ckeditor.js"></script>
      <section class="content-header">
      <h1>

        Events Entry Rooms

      </h1>

      <ol class="breadcrumb">

        <li><a href="<?php echo base_url().'admin';?>"><i class="fa fa-dashboard"></i> Home</a></li>

        <li><a href="<?php echo base_url('admin/event/roomlist/'.$roomDetail['entry_id']);?>">Events Entry Rooms</a></li>

        <li class="active"> Edit</li>

      </ol>

    </section>

    

    <section class="content">

      <div class="row">

      <?php echo $this->utility->showMsg();?>

        <div class="col-md-12">

        <div class="loader" style="display:none;"><img src='<?php echo base_url();?>assets/images/loading.gif' alt='loading' /></div>

          <!-- Horizontal Form -->

          <div class="box box-info">

            <div class="box-header with-border">

              <h3 class="box-title">Edit </h3>

            </div>

            <!-- /.box-header -->

            <!-- form start -->

            <form id="add_frm" name="add_frm" class="form-horizontal" method="post" action="" enctype="multipart/form-data">

              <div class="box-body">
              <?php if(!empty($languages)){ 
                  foreach ($languages as $lang) { ?>
                   
                <div class="form-group">

                  <label class="col-sm-2 control-label">Ttile [<?php echo $lang['name']; ?>]</label>

                  <div class="col-sm-10">
                    <?php $title = getValue('event_features_lang_values',array('lang_id'=>$lang['id'],'event_feature_id'=>$roomDetail['id'])); ?>
                    <input type="text" class="form-control" id="title" name="name_<?php echo $lang['id']; ?>" value="<?php if(!empty($title)){ echo $title['title']; }?>" placeholder="Please enter title">

                  </div>

                </div>
              <?php } } ?>  
              <?php if(!empty($languages)){ 
                  foreach ($languages as $lang) { ?>  
                <div class="form-group">

                  <label class="col-sm-2 control-label">Content [<?php echo $lang['name']; ?>]</label>

                  <div class="col-sm-10">
                  <?php $content = getValue('event_features_lang_values',array('lang_id'=>$lang['id'],'event_feature_id'=>$roomDetail['id'])); ?>
                    <textarea name="content_<?php echo $lang['id']; ?>" class="form-control"><?php if(!empty($content)){ echo $content['content']; }?></textarea>
                  <script>
                           CKEDITOR.replace( 'content_<?php echo $lang['id']; ?>',{
                                    filebrowserBrowseUrl : '/castle/fileman/index.html',
                                    filebrowserImageBrowseUrl : '/castle/fileman/index.html?type=image',
                                    removeDialogTabs: 'link:upload;image:upload'
                            });
                        </script> 
                </div>
              </div>
              <?php } } ?> 
              <div class="form-group">

                  <label class="col-sm-2 control-label">Image</label>

                  <div class="col-sm-10">
                  <img src="<?php echo base_url(); ?>assets/userfiles/<?php echo $roomDetail['path'].'/'.$roomDetail['filename'].'.'.$roomDetail['extension'];?>" width="100">
                    <input type="file" class="form-control" id="image" name="image" >

                  </div>

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

                  <label class="col-sm-2 control-label">Party Night Price</label>

                  <div class="col-sm-10">
                      <input type="text" name="party_price" id="party_price" value="<?php echo $roomDetail['base_price']; ?>">
                  </div>

                </div>

                <div class="form-group">

                  <label class="col-sm-2 control-label">Extra Night Price</label>

                  <div class="col-sm-10">
                      <input type="text" name="extra_price" id="extra_price" value="<?php echo $roomDetail['extra_night_price']; ?>">
                  </div>

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

                  <label class="col-sm-2 control-label">Total Available Rooms</label>

                  <div class="col-sm-10">
                      <input type="text" name="room_total" id="room_total" value="<?php echo $roomDetail['room_total']; ?>">
                  </div>

                </div>

              </div>

              

              <div class="box-footer">

                <button type="button" onclick="return_back()"class="btn btn-warning  margin-left  " >Cancel</button>

                <input type="submit" class="btn btn-black " value="Update" id="add">

              </div>

              <input type="hidden" name="frmSecurity" value="<?php echo $this->utility->getSecurity();?>"/>

            </form>

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

    <style type="text/css">

    .loader{

      position: fixed;

      left: 0;

      top: 0;

      right: 0;

      bottom: 0;

      width: 100%;

      height: 100%;

      background-color: rgba(0, 0, 0, 0.60);

      z-index: 9999;

      text-align: center;

    }

    .loader img{

      z-index: 99999;

      margin-top: 10%;

    }

    </style>

   <script type='text/javascript'>
      $("#add_frm").validate({
        rules: {
          name_2:{
            required: true
          },
          content_2:{
            required: true
          },
          party_price:{
            required:true,
            number:true,
          },
          extra_price:{
            required:true,
            number:true,
          },
        }
      });
      $(function(){
        $("#fromDate").datetimepicker();
        $("#toDate").datetimepicker();
      });
    </script>

   <script type="text/javascript">
    function return_back()
    {
      var back_url='<?php echo base_url()."admin/event/roomlist/".$this->uri->segment(4); ?>';
      window.location=back_url;
    }
   </script>