<div class="content-wrapper">
   <div class="container-full">
      <!-- Content Header (Page header) -->	  
      <div class="content-header">
         <div class="d-flex align-items-center">
            <div class="me-auto">
               <h4 class="page-title">Service Management</h4>
               <div class="d-inline-block align-items-center">
                  <nav>
                     <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#"><i class="fa fa-home"></i></a></li>
                        <li class="breadcrumb-item active" aria-current="page">Service</li>
                     </ol>
                  </nav>
               </div>
            </div>
         </div>
      </div>
      <!-- Main content -->
      <section class="content">
         <?php if ($this->session->flashdata('success')) { ?>
         <div class="alert alert-success">
            <a href="<?= base_url('admin/package'); ?>" class="close" data-dismiss="alert" aria-label="close">×</a>
            <strong><?php echo $this->session->flashdata('success'); ?></strong>
         </div>
         <?php } ?>
         <?php if ($this->session->flashdata('error')) { ?>
         <div class="alert alert-danger">
            <a href="<?= base_url('admin/package'); ?>" class="close" data-dismiss="alert" aria-label="close">×</a>
            <strong><?php echo $this->session->flashdata('error'); ?></strong>
         </div>
         <?php } ?>
         <div class="row">
            <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
               <div class="box">
                  <!-- /.box-header -->
                  <?php if(empty($packageE->package_id)){ ?>
                  <div class="d-flex" style="display: flex !important;justify-content: space-between; align-items: center;padding: 0 20px 0 0;border-bottom: 1px solid #f0f3f6;">
                     <div class="box-header with-border">
                        <h4 class="box-title">Add Service</h4>
                     </div>
                     <a href="<?= base_url(); ?>admin/package" class="btn btn-primary"><i class="fa-solid fa-plus"></i>Service List</a>
                  </div>
                  <form class="form" action="<?= base_url('admin/package-add-action'); ?>" method="post" enctype="multipart/form-data">
                     <div class="box-body">
                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Title<span class="reqired-star">*</span></label>
                                 <input type="text" class="form-control" name="package_title" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Type<span class="reqired-star">*</span></label>
                                 <input type="text" class="form-control" name="package_type" required>
                              </div>
                           </div>
                            <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Short Description<span class="reqired-star">*</span></label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2" name="package_sub_title" ></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2" id="editor1" name="package_description" ></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 1</label>
                                 <input type="text" class="form-control" name="itinerary_day1" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 1 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc1"></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 2</label>
                                 <input type="text" class="form-control" name="itinerary_day2" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 2 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc2"></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 3</label>
                                 <input type="text" class="form-control" name="itinerary_day3" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 3 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc3"></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 4</label>
                                 <input type="text" class="form-control" name="itinerary_day4" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 4 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc4"></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 5</label>
                                 <input type="text" class="form-control" name="itinerary_day5" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 5 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc5"></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 6</label>
                                 <input type="text" class="form-control" name="itinerary_day6" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 6 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc6"></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 7</label>
                                 <input type="text" class="form-control" name="itinerary_day7" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 7 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc7"></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 8</label>
                                 <input type="text" class="form-control" name="itinerary_day8" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 8 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc8"></textarea>
                              </div>
                           </div>
                           
                           <div class="col-md-12">
                              <div class="form-group"><br>
                                 <label class="form-label">Image<span class="reqired-star">*</span></label>
                                 <input type="file" id="file" name="package_image" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Meta Title</label>
                                 <input type="text" class="form-control" name="package_meta_title" >
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Meta Keyword</label>
                                 <input type="text" class="form-control" name="package_meta_keyword" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Meta Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="package_meta_description" ></textarea>
                              </div>
                           </div>
                        </div>
                     </div>
                     <!-- /.box-body -->
                     <div class="box-footer">
                        <button type="submit" class="btn btn-primary">Save</button>
                     </div>
                  </form>
                  <?php }else{ ?>
                  <div class="box-header with-border">
                     <h4 class="box-title">Update Service</h4>
                  </div>
                  <form class="form" action="<?= base_url('admin/package-update'); ?>" method="post" enctype="multipart/form-data">
                     <div class="box-body">
                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Title<span class="reqired-star">*</span></label>
                                 <input type="hidden" class="form-control" name="package_id" value="<?= $packageE->package_id; ?>" required>
                                 <input type="text" class="form-control" name="package_title" value="<?= $packageE->package_title; ?>" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Type<span class="reqired-star">*</span></label>
                                 <input type="text" class="form-control" name="package_type" value="<?= $packageE->package_type; ?>" >
                              </div>
                           </div>
                            <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Short Description<span class="reqired-star">*</span></label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2" name="package_sub_title" ><?= $packageE->package_sub_title; ?></textarea>
                              </div>
                           </div>
                            <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Description<span class="reqired-star">*</span></label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2" id="editor1" name="package_description"><?= $packageE->package_description; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 1</label>
                                 <input type="text" class="form-control" name="itinerary_day1" value="<?= $packageE->itinerary_day1; ?>">
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 1 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc1"><?= $packageE->itinerary_desc1; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 2</label>
                                 <input type="text" class="form-control" name="itinerary_day2" value="<?= $packageE->itinerary_day2; ?>" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 2 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc2"><?= $packageE->itinerary_desc2; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 3</label>
                                 <input type="text" class="form-control" name="itinerary_day3" value="<?= $packageE->itinerary_day3; ?>">
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 3 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc3"><?= $packageE->itinerary_desc3; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 4</label>
                                 <input type="text" class="form-control" name="itinerary_day4" value="<?= $packageE->itinerary_day4; ?>">
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 4 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc4"><?= $packageE->itinerary_desc4; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 5</label>
                                 <input type="text" class="form-control" name="itinerary_day5" value="<?= $packageE->itinerary_day5; ?>">
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 5 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc5"><?= $packageE->itinerary_desc5; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 6</label>
                                 <input type="text" class="form-control" name="itinerary_day6" value="<?= $packageE->itinerary_day6; ?>">
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 6 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc6"><?= $packageE->itinerary_desc6; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 7</label>
                                 <input type="text" class="form-control" name="itinerary_day7" value="<?= $packageE->itinerary_day7; ?>">
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 7 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc7"><?= $packageE->itinerary_desc7; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 8</label>
                                 <input type="text" class="form-control" name="itinerary_day8" value="<?= $packageE->itinerary_day8; ?>">
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 8 Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="itinerary_desc8"><?= $packageE->itinerary_desc8; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                            <div class="form-group"><br>
                                <label class="form-label">Image<span class="reqired-star">*</span></label>
                                <!-- Show existing image -->
                                <img src="<?= base_url('uploads/package/' . $packageE->package_image); ?>" width="100">
                                <!-- Preserve existing image filename -->
                                <input type="hidden" name="existing_image" value="<?= $packageE->package_image; ?>">
                                <!-- Optional new image upload -->
                                <input type="file" id="package_image" name="package_image">
                            </div>
                        </div>
                        
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Meta Title</label>
                                 <input type="text" class="form-control" name="package_meta_title" >
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Meta Keyword</label>
                                 <input type="text" class="form-control" name="package_meta_keyword" >
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Meta Description</label>
                                 <textarea class="form-control" placeholder="Description ..." rows="2"  name="package_meta_description" ></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Status</label>
                                 <select class="form-select" name="package_status">
                                    <option value="1" <?php if($packageE->package_status == 1 ){ echo "selected";}else{} ?>>Active</option>
                                    <option value="0" <?php if($packageE->package_status == 0 ){ echo "selected";}else{} ?>>Inactive</option>
                                 </select>
                              </div>
                           </div>
                        </div>
                     </div>
                     <!-- /.box-body -->
                     <div class="box-footer">
                        <button type="submit" class="btn btn-primary">Update</button>
                     </div>
                  </form>
                  <?php } ?> 
               </div>
            </div>
            <!-- /.box -->			
         </div>
      </section>
      <!-- /.content -->
   </div>
</div>