 <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark"><?php echo $title ?></h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="<?php echo base_url() ?>admin/admin/dashboard">Dashboard</a></li>
              <li class="breadcrumb-item"><a href="#"><?php echo ucwords(str_replace("_", " ", $this->uri->segment(2))); ?></a></li>
              <li class="breadcrumb-item active"><?php echo ucwords(str_replace("_", " ", $title)); ?></li>

            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->
  <?php
    $errors = $this->session->userdata('errors');
    if (isset($errors)) {
        ?>
        <script>
            swal ( "Oops" ,  "<?php echo $errors ?>" ,  "error" )
        </script>
        <?php echo $errors ?>
        <?php
        $this->session->unset_userdata('errors');
    }
    $error = $this->session->userdata('error');
    if (isset($error)) {
        ?>
         <script>
            swal ( "Oops" ,  "<?php echo $error ?>" ,  "error" )
        </script>
        <?php
        $this->session->unset_userdata('error');
    }
    $success = $this->session->userdata('success');
    if (isset($success)) {
        ?>
         <script>
            swal({
          title: "Done!",
          text: "<?php echo $success ?>",
          icon: "success",
        });
        </script>
        <?php
        $this->session->unset_userdata('success');
    }
    ?>
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <!-- Info boxes -->
       

        <div class="card card-default">
            <!-- /.card-header -->
          <div class="card-body">

            <table width="100%">
              <tr>
                <th>Section Name</th>
                <th>Status</th>
              </tr>
              <?php echo form_open(base_url().'admin/frontend_setting/change_section_status'); ?>
              <tr>
                <td>Flagship Course</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">

                      <input type="checkbox" name="sec_flag_course" <?php if($section_on_off->sec_flag_course  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Short About Us</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">

                      <input type="checkbox" name="sec_short_about" <?php if($section_on_off->sec_short_about  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Stacts</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control">

                      <input type="checkbox" name="sec_stacts" <?php if($section_on_off->sec_stacts  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Video</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_video" <?php if($section_on_off->sec_video  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
               <tr>
                <td>API Course</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_course" <?php if($section_on_off->sec_course  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
               <tr>
                <td>Event</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_event" <?php if($section_on_off->sec_event  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Course</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                       <input type="checkbox" name="sec_course_2" <?php if($section_on_off->sec_course_2  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
             
              <tr>
                <td>Ebook</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_ebook" <?php if($section_on_off->sec_ebook  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
             <tr >
                <td>Content</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_content" <?php if($section_on_off->sec_content  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Logo</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_logo" <?php if($section_on_off->sec_logo  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Placed Student</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_placed_student" <?php if($section_on_off->sec_placed_student  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Blog</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_blog" <?php if($section_on_off->sec_blog  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Download App</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_download_app" <?php if($section_on_off->sec_download_app  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>Testimonials Menu</td>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <input type="checkbox" name="sec_menu_testimonials" <?php if($section_on_off->sec_menu_testimonials  == 1){echo 'checked';} ?> value="1">
                    </div>
                  </div>
                </td>
              </tr>
              <tr>
                <td>
                  <div class="form-group">
                    <div class="custom-control ">
                      <button type="submit" class="btn btn-primary">Update</button>
                    </div>
                  </div>
                </td>
              </tr>
            </table>
             <?php echo form_close(); ?>
          </div>
       
      </div><!--/. container-fluid -->
    </section>
    <!-- /.content -->
  </div>

  

  <script>
function update_flash_deal_status(el){
    if(el.checked){
        var status = 1;
        alert(status)
    }
    else{
        var status = 0;
        alert(status)
    }
    $.ajax({
          type: "post",
          async: true,
          url: '<?php echo base_url('admin/frontend_settings/change_section_status')?>',
          data: {el:el,status:status},
          success: function (data) {
              if (data == 1) {
                 //location.reload(true);
              } else {
                  alert(data)
              }
          },
          error: function () {
               swal ( "Oops" ,  "Request Failed!" ,  "warning" );
          }
      });

  
}
</script>