<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">Pricing 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">Pricing</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/pricing'); ?>" 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/pricing'); ?>" 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($pricingsE->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 Pricing</h4>
                     </div>
                     <a href="<?= base_url(); ?>admin/pricing" class="btn btn-primary"><i class="fa-solid fa-plus"></i>Pricing List</a>
                  </div>
                  <form class="form" action="<?= base_url('admin/pricing-add-action'); ?>" method="post" enctype="multipart/form-data">
                     <div class="box-body">
                        <div class="row">
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Title<span class="reqired-star">*</span></label>
                                 <input type="text" class="form-control" name="title" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Price<span class="reqired-star">*</span></label>
                                 <input type="text" class="form-control" name="price" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Popular</label>
                                 <select class="form-select" name="popular">
                                    <option value="yes">Yes</option>
                                    <option value="no">No</option>
                                 </select>
                              </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="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 Pricing</h4>
                  </div>
                  <form class="form" action="<?= base_url('admin/pricing-update'); ?>" method="post" enctype="multipart/form-data">
                     <div class="box-body">
                        <div class="row">
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Title<span class="reqired-star">*</span></label>
                                 <input type="hidden" class="form-control" name="id" value="<?= $pricingsE->id; ?>" required>
                                 <input type="text" class="form-control" name="title" value="<?= $pricingsE->title; ?>" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Price<span class="reqired-star">*</span></label>
                                 <input type="text" class="form-control" name="price" value="<?= $pricingsE->price; ?>" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Popular</label>
                                 <select class="form-select" name="popular">
                                    <option value="yes" <?php if($pricingsE->popular == 'yes' ){ echo "selected";}else{} ?>>Yes</option>
                                    <option value="no" <?php if($pricingsE->popular == 'no' ){ echo "selected";}else{} ?>>No</option>
                                 </select>
                              </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="description"><?= $pricingsE->description; ?></textarea>
                              </div>
                           </div>
                           <div class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Status</label>
                                 <select class="form-select" name="status">
                                    <option value="1" <?php if($pricingsE->status == 1 ){ echo "selected";}else{} ?>>Active</option>
                                    <option value="0" <?php if($pricingsE->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>