<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">
        <div class="col-sm-6">
          <h1>Update Ibast Details Page</h1>
        </div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="<?php echo admin_url() ?>admin">Home</a></li>
            <li class="breadcrumb-item active">Ibast Page</li>
          </ol>
        </div>
      </div>
    </div><!-- /.container-fluid -->
  </section>

  <?php echo form_open_multipart(base_url() . 'admin/ibast/edit_ibast_details_page/' . $data->ibd_id); ?>
  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-12">
          <div class="card card-default">
            <div class="card-header">
              <h3 class="card-title">Page SEO</h3>
            </div>
            <div class="card-body">
              <div class="row">
                <div class="col-md-4">
                  <div class="form-group">
                    <label>Select Course <span class="text-danger">*</span></label>
                    <select type="text" name="idb_course_page_id" class="form-control" placeholder="Enter Page Meta Title">
                      <option value="">Select From List</option>
                      <?php foreach ($all_course as $key => $course) : ?>
                        <option <?php if ($course->ibast_id == $data->idb_course_page_id) {
                                  echo 'selected';
                                } ?> value="<?php echo $course->ibast_id; ?>"><?php echo $course->ibast_meta_title; ?></option>
                      <?php endforeach; ?>
                    </select>
                  </div>
                </div>
                <div class="col-md-8">
                  <div class="form-group">
                    <label>Page Meta Title</label>
                    <input type="text" name="ibd_meta_title" class="form-control" placeholder="Enter Page Meta Title" value="<?php echo $data->ibd_meta_title; ?>">
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label>Page Meta Keywords</label>
                    <textarea type="text" name="ibd_meta_keywords" class="form-control" placeholder="Enter Page Meta Keywords"><?php echo $data->ibd_meta_keywords; ?></textarea>
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label>Page Meta Description</label>
                    <textarea type="text" name="ibd_meta_description" class="form-control" placeholder="Enter Page Meta Description"><?php echo $data->ibd_meta_description; ?></textarea>
                  </div>
                </div>
                <div class="col-md-5">
                  <div class="form-group">
                    <label>Sub Heading </label>
                    <input type="text" name="ibd_sub_title" class="form-control" placeholder="Enter Page Sub Heading" value="<?php echo $data->ibd_sub_title; ?>" />
                  </div>
                </div>
                <div class="col-md-7">
                  <div class="form-group">
                    <label>Heading <span class="text-danger">*</span></label>
                    <input type="text" name="ibd_title" class="form-control" placeholder="Enter Page Heading" required value="<?php echo $data->ibd_title; ?>" />
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label>Sub Heading 2</label>
                    <input type="text" name="ibd_sub_title_1" class="form-control" placeholder="Enter Page Sub Heading 2" value="<?php echo $data->ibd_sub_title_1; ?>" />
                  </div>
                </div>
                <div class="col-md-6">
                  <div class="form-group">
                    <label>Sub Heading 3</label>
                    <input type="text" name="ibd_sub_title_2" class="form-control" placeholder="Enter Page Sub Heading 3" value="<?php echo $data->ibd_sub_title_2; ?>" />
                  </div>
                </div>
                <div class="col-md-8">
                  <div class="form-group">
                    <label>Course Name <span class="text-danger">*</span></label>
                    <input type="text" name="ibd_course_name" class="form-control" placeholder="Enter Page Sub Heading 3" value="<?php echo $data->ibd_course_name; ?>" />
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="form-group">
                    <label>Course Date <span class="text-danger">*</span></label>
                    <input type="datetime-local" name="ibd_date_time" class="form-control" placeholder="Enter Page Sub Heading 3" value="<?php echo $data->ibd_date_time; ?>" />
                  </div>
                </div>

                <div class="col-md-12">
                  <div class="form-group">
                    <button class="btn btn-info" type="submit" style="float: right">Update</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-12">
          <div class="card card-default">
            <div class="card-header">
              <h3 class="card-title">Section 1</h3>
            </div>
            <div class="card-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="form-group">
                    <label>Section 1 heading</label>
                    <input type="text" name="ibd_section_1_heading" class="form-control" placeholder="Enter Section 1 Title" value="<?php echo $data->ibd_section_1_heading; ?>">
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group row mb-3">
                    <label class="col-md-12 col-form-label" for="outcomes">Content</label>
                    <div class="col-md-12">
                      <div id="area_1">
                        <?php
                        $section_data = json_decode($data->ibd_section_1_data, true);
                        if (!empty($section_data)) : ?>
                          <?php foreach ($section_data as $key_1 => $section_item) : ?>
                            <div class="d-flex mt-2">
                              <div class="flex-grow-1 px-3">
                                <div class="form-group">
                                  <select class="form-control font-awsom" name="icon_1[]">
                                    <option value="">Select Icon</option>
                                    <?php $this->load->view('admin/include/fafa_icon_select', ['icon' => $section_item['icon']]) ?>
                                  </select>
                                </div>
                                <div class="form-group">
                                  <input type="text" class="form-control" name="title_1[]" placeholder="<?php echo get_phrase('Content Title'); ?>" value="<?php echo $section_item['title']; ?>">
                                </div>
                                <div class="form-group">
                                  <textarea type="text" class="form-control" name="description_1[]" placeholder="<?php echo get_phrase('Content Description'); ?>"><?php echo $section_item['description']; ?></textarea>
                                </div>
                              </div>
                              <div class="">
                                <?php if ($key_1 == 0) : ?>
                                  <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_1()"> <i class="fa fa-plus"></i> </button>
                                <?php else : ?>
                                  <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_1(this)"> <i class="fa fa-minus"></i> </button>
                                <?php endif; ?>
                              </div>
                            </div>
                          <?php endforeach; ?>
                        <?php else : ?>
                          <div class="d-flex mt-2">
                            <div class="flex-grow-1 px-3">
                              <div class="form-group">
                                <select class="form-control font-awsom" name="icon_1[]">
                                  <option value="">Select Icon</option>
                                  <?php $this->load->view('admin/include/fafa_icon_select') ?>
                                </select>
                              </div>
                              <div class="form-group">
                                <input type="text" class="form-control" name="title_1[]" placeholder="<?php echo get_phrase('Content Title'); ?>">
                              </div>
                              <div class="form-group">
                                <textarea type="text" class="form-control" name="description_1[]" placeholder="<?php echo get_phrase('Content Description'); ?>"></textarea>
                              </div>
                            </div>
                            <div class="">
                              <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_1()"><i class="fa fa-plus"></i></button>
                            </div>
                          </div>
                        <?php endif; ?>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group">
                    <button class="btn btn-info" type="submit" style="float: right">Update</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-12">
          <div class="card card-default">
            <div class="card-header">
              <h3 class="card-title">Section 2</h3>
            </div>
            <div class="card-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="form-group">
                    <label>Section 2 heading <span class="text-danger">*</span> </label>
                    <input type="text" name="ibd_section_2_heading" class="form-control" placeholder="Enter Section 2 Title" value="<?php echo $data->ibd_section_2_heading; ?>" >
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group row mb-3">
                    <label class="col-md-12 col-form-label" for="outcomes">Content</label>
                    <div class="col-md-12">
                      <div id="area_2">
                        <?php
                        $section_data_2 = json_decode($data->ibd_section_2_data, true);
                        if (!empty($section_data_2)) : ?>
                          <?php foreach ($section_data_2 as $key_2 => $section_item_2) : ?>
                            <div class="d-flex mt-2">
                              <div class="flex-grow-1 px-3">
                                <div class="form-group">
                                  <select class="form-control font-awsom" name="icon_2[]">
                                    <option value="">Select Icon</option>
                                    <?php $this->load->view('admin/include/fafa_icon_select', ['icon' => $section_item_2['icon']]) ?>
                                  </select>
                                </div>
                                <div class="form-group">
                                  <input type="text" class="form-control" name="title_2[]" placeholder="<?php echo get_phrase('Content Title'); ?>" value="<?php echo $section_item_2['title']; ?>">
                                </div>
                                <div class="form-group">
                                  <input type="text" class="form-control" name="description_2[]" placeholder="<?php echo get_phrase('Content Description'); ?>" value="<?php echo $section_item_2['description']; ?>">
                                </div>
                              </div>
                              <div class="">
                                <?php if ($key_2 == 0) : ?>
                                  <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_2()"> <i class="fa fa-plus"></i> </button>
                                <?php else : ?>
                                  <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_2(this)"> <i class="fa fa-minus"></i> </button>
                                <?php endif; ?>
                              </div>
                            </div>
                          <?php endforeach; ?>
                        <?php else : ?>
                          <div class="d-flex mt-2">
                            <div class="flex-grow-1 px-3">
                              <div class="form-group">
                                <select class="form-control font-awsom" name="icon_2[]">
                                  <option value="">Select Icon</option>
                                  <?php $this->load->view('admin/include/fafa_icon_select') ?>
                                </select>
                              </div>
                              <div class="form-group">
                                <input type="text" class="form-control" name="title_2[]" placeholder="<?php echo get_phrase('Content Title'); ?>">
                              </div>
                              <div class="form-group">
                                <input type="text" class="form-control" name="description_2[]" placeholder="<?php echo get_phrase('Content Description'); ?>">
                              </div>
                            </div>
                            <div class="">
                              <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_2()"><i class="fa fa-plus"></i></button>
                            </div>
                          </div>
                        <?php endif; ?>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group">
                    <button class="btn btn-info" type="submit" style="float: right">Update</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-12">
          <div class="card card-default">
            <div class="card-header">
              <h3 class="card-title">Section 3</h3>
            </div>
            <div class="card-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="form-group">
                    <label>Section 3 heading <span class="text-danger">*</span> </label>
                    <input type="text" name="ibd_section_3_heading" class="form-control" placeholder="Enter Section 3 Title" value="<?php echo $data->ibd_section_3_heading; ?>" >
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group row mb-3">
                    <label class="col-md-12 col-form-label" for="outcomes">Content</label>
                    <div class="col-md-12">
                      <div id="area_3">
                        <?php
                        $section_data_3 = json_decode($data->ibd_section_3_data, true);
                        if (!empty($section_data_3)) : ?>
                          <?php foreach ($section_data_3 as $key_3 => $section_item_3) : ?>
                            <div class="d-flex mt-2">
                              <div class="flex-grow-1 px-3">
                                <div class="form-group">
                                  <select class="form-control font-awsom" name="icon_3[]">
                                    <option value="">Select Icon</option>
                                    <?php $this->load->view('admin/include/fafa_icon_select', ['icon' => $section_item_3['icon']]) ?>
                                  </select>
                                </div>
                                <div class="form-group">
                                  <input type="text" class="form-control" name="title_3[]" placeholder="<?php echo get_phrase('Content Title'); ?>" value="<?php echo $section_item_3['title']; ?>">
                                </div>
                                <div class="form-group">
                                  <input type="text" class="form-control" name="description_3[]" placeholder="<?php echo get_phrase('Content Description'); ?>" value="<?php echo $section_item_3['description']; ?>">
                                </div>
                                <div class="form-group">
                                  <input type="text" class="form-control" name="duration_3[]" placeholder="<?php echo get_phrase('Content Duration'); ?>" value="<?php echo $section_item_3['duration']; ?>">
                                </div>
                              </div>
                              <div class="">
                                <?php if ($key_3 == 0) : ?>
                                  <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_3()"> <i class="fa fa-plus"></i> </button>
                                <?php else : ?>
                                  <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_3(this)"> <i class="fa fa-minus"></i> </button>
                                <?php endif; ?>
                              </div>
                            </div>
                          <?php endforeach; ?>
                        <?php else : ?>
                          <div class="d-flex mt-2">
                            <div class="flex-grow-1 px-3">
                              <div class="form-group">
                                <select class="form-control font-awsom" name="icon_3[]">
                                  <option value="">Select Icon</option>
                                  <?php $this->load->view('admin/include/fafa_icon_select') ?>
                                </select>
                              </div>
                              <div class="form-group">
                                <input type="text" class="form-control" name="title_3[]" placeholder="<?php echo get_phrase('Content Title'); ?>">
                              </div>
                              <div class="form-group">
                                <input type="text" class="form-control" name="description_3[]" placeholder="<?php echo get_phrase('Content Description'); ?>">
                              </div>
                              <div class="form-group">
                                  <input type="text" class="form-control" name="duration_3[]" placeholder="<?php echo get_phrase('Content Duration'); ?>" >
                                </div>
                            </div>
                            <div class="">
                              <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_3()"><i class="fa fa-plus"></i></button>
                            </div>
                          </div>
                        <?php endif; ?>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group">
                    <button class="btn btn-info" type="submit" style="float: right">Update</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-12">
          <div class="card card-default">
            <div class="card-header">
              <h3 class="card-title">FAQ Section</h3>
            </div>
            <div class="card-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="form-group">
                    <label>Section FAQ heading <span class="text-danger">*</span> </label>
                    <input type="text" name="ibd_section_4_heading" class="form-control" placeholder="Enter Section FAQ Title" value="<?php echo $data->ibd_section_4_heading; ?>" >
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group row mb-3">
                    <label class="col-md-12 col-form-label" for="outcomes">Content</label>
                    <div class="col-md-12">
                      <div id="area_4">
                        <?php
                        $section_data_4 = json_decode($data->ibd_section_4_data, true);
                        if (!empty($section_data_4)) : ?>
                          <?php foreach ($section_data_4 as $key_4 => $faq) : ?>
                            <div class="d-flex mt-2">
                              <div class="flex-grow-1 px-3">
                                <div class="form-group">
                                  <input type="text" class="form-control" name="faq_title[]" placeholder="<?php echo get_phrase('FAQ Title'); ?>" value="<?php echo $faq['title']; ?>">
                                </div>
                                <div class="form-group">
                                  <input type="text" class="form-control" name="faq_content[]" placeholder="<?php echo get_phrase('FAQ Content'); ?>" value="<?php echo $faq['content']; ?>">
                                </div>
                              </div>
                              <div class="">
                                <?php if ($key_4 == 0) : ?>
                                  <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_4()"> <i class="fa fa-plus"></i> </button>
                                <?php else : ?>
                                  <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_4(this)"> <i class="fa fa-minus"></i> </button>
                                <?php endif; ?>
                              </div>
                            </div>
                          <?php endforeach; ?>
                        <?php else : ?>
                          <div class="d-flex mt-2">
                            <div class="flex-grow-1 px-3">
                              <div class="form-group">
                                <input type="text" class="form-control" name="faq_title[]" placeholder="<?php echo get_phrase('FAQ Title'); ?>">
                              </div>
                              <div class="form-group">
                                <input type="text" class="form-control" name="faq_content[]" placeholder="<?php echo get_phrase('FAQ Content'); ?>">
                              </div>
                            </div>
                            <div class="">
                              <button type="button" class="btn btn-success btn-sm" name="button" onclick="append_4()"><i class="fa fa-plus"></i></button>
                            </div>
                          </div>
                        <?php endif; ?>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-md-12">
                  <div class="form-group">
                    <button class="btn btn-info" type="submit" style="float: right">Update</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </section>

  <?php echo
  form_close();
  ?>
</div>
<style>
  #blank_field_section_1,
  #blank_field_section_2,
  #blank_field_section_3,
  #blank_field_section_4 {
    display: none;
  }
</style>
<div id="blank_field_section_1">
  <div class="d-flex mt-2">
    <div class="flex-grow-1 px-3">
      <div class="form-group">
        <select class="form-control font-awsom" name="icon_1[]" required="required">
          <option value="">Select Icon</option>
          <?php $this->load->view('admin/include/fafa_icon_select') ?>
        </select>
      </div>
      <div class="form-group">
        <input type="text" class="form-control" name="title_1[]" placeholder="<?php echo get_phrase('Content Title'); ?>" required>
      </div>
      <div class="form-group">
        <textarea type="text" class="form-control" name="description_1[]" placeholder="<?php echo get_phrase('Content Description'); ?>" required></textarea>
      </div>
    </div>
    <div class="">
      <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_1(this)"> <i class="fa fa-minus"></i> </button>
    </div>
  </div>
</div>

<div id="blank_field_section_2">
  <div class="d-flex mt-2">
    <div class="flex-grow-1 px-3">
      <div class="form-group">
        <select class="form-control font-awsom" name="icon_2[]" required="required">
          <option value="">Select Icon</option>
          <?php $this->load->view('admin/include/fafa_icon_select') ?>
        </select>
      </div>
      <div class="form-group">
        <input type="text" class="form-control" name="title_2[]" placeholder="<?php echo get_phrase('Content Title'); ?>">
      </div>
      <div class="form-group">
        <input type="text" class="form-control" name="description_2[]" placeholder="<?php echo get_phrase('Content Description'); ?>">
      </div>
    </div>
    <div class="">
      <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_2(this)"> <i class="fa fa-minus"></i> </button>
    </div>
  </div>
</div>

<div id="blank_field_section_3">
  <div class="d-flex mt-2">
    <div class="flex-grow-1 px-3">
      <div class="form-group">
        <select class="form-control font-awsom" name="icon_3[]" required="required">
          <option value="">Select Icon</option>
          <?php $this->load->view('admin/include/fafa_icon_select') ?>
        </select>
      </div>
      <div class="form-group">
        <input type="text" class="form-control" name="title_3[]" placeholder="<?php echo get_phrase('Content Title'); ?>">
      </div>
      <div class="form-group">
        <input type="text" class="form-control" name="description_3[]" placeholder="<?php echo get_phrase('Content Description'); ?>">
      </div>
      <div class="form-group">
        <input type="text" class="form-control" name="duration_3[]" placeholder="<?php echo get_phrase('Content Duration'); ?>">
      </div>
    </div>
    <div class="">
      <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_3(this)"> <i class="fa fa-minus"></i> </button>
    </div>
  </div>
</div>

<div id="blank_field_section_4">
  <div class="d-flex mt-2">
    <div class="flex-grow-1 px-3">
      <div class="form-group">
        <input type="text" class="form-control" name="faq_title[]" placeholder="<?php echo get_phrase('FAQ Title'); ?>">
      </div>
      <div class="form-group">
        <input type="text" class="form-control" name="faq_content[]" placeholder="<?php echo get_phrase('FAQ Content'); ?>">
      </div>
    </div>
    <div class="">
      <button type="button" class="btn btn-danger btn-sm" style="margin-top: 0px;" name="button" onclick="remove_4(this)"> <i class="fa fa-minus"></i> </button>
    </div>
  </div>
</div>

<script>
  var blank_field_section_4 = jQuery('#blank_field_section_4').html();
  function append_4() {
    jQuery('#area_4').append(blank_field_section_4);
  }
  function remove_4(outcomeElem) {
    jQuery(outcomeElem).parent().parent().remove();
  }

  var blank_field_section_3 = jQuery('#blank_field_section_3').html();
  function append_3() {
    jQuery('#area_3').append(blank_field_section_3);
  }
  function remove_3(outcomeElem) {
    jQuery(outcomeElem).parent().parent().remove();
  }

  var blank_field_section_2 = jQuery('#blank_field_section_2').html();
  function append_2() {
    jQuery('#area_2').append(blank_field_section_2);
  }
  function remove_2(outcomeElem) {
    jQuery(outcomeElem).parent().parent().remove();
  }

  var blank_field_section_1 = jQuery('#blank_field_section_1').html();
  function append_1() {
    jQuery('#area_1').append(blank_field_section_1);
  }
  function remove_1(outcomeElem) {
    jQuery(outcomeElem).parent().parent().remove();
  }
</script>