<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">Industries 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">Industries</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/industries'); ?>" 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/industries'); ?>" 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($industriesE->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 Industries</h4>
                     </div>
                     <a href="<?= base_url(); ?>admin/industries" class="btn btn-primary"><i class="fa-solid fa-plus"></i>Industries List</a>
                  </div>
                  <form class="form" action="<?= base_url('admin/industries-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-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 class="col-md-12">
                              <div class="form-group">
                                 <label class="form-label">Faq 1</label>
                                 <input type="text" class="form-control" name="faq1" >
                              </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="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="faq2" >
                              </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="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="faq3" >
                              </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="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="faq4" >
                              </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="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="faq5" >
                              </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="desc5"></textarea>
                              </div>
                           </div>
                           
                           <div class="col-md-12">
                              <div class="form-group"><br>
                                 <label class="form-label">Icon<span class="reqired-star">*</span></label>
                                 <input type="file" id="file" name="icon" required>
                              </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="image" required>
                              </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 Industries</h4>
                  </div>
                  <form class="form" action="<?= base_url('admin/industries-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="<?= $industriesE->id; ?>" required>
                                 <input type="text" class="form-control" name="title" value="<?= $industriesE->title; ?>" required>
                              </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"><?= $industriesE->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="faq1" value="<?= $industriesE->faq1; ?>">
                              </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="desc1"><?= $industriesE->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="faq2" value="<?= $industriesE->faq2; ?>" >
                              </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="desc2"><?= $industriesE->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="faq3" value="<?= $industriesE->faq3; ?>">
                              </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="desc3"><?= $industriesE->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="faq4" value="<?= $industriesE->faq4; ?>">
                              </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="desc4"><?= $industriesE->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="faq5" value="<?= $industriesE->faq5; ?>">
                              </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="desc5"><?= $industriesE->desc5; ?></textarea>
                              </div>
                           </div>
                            <div class="col-md-12">
                            <div class="form-group"><br>
                                <label class="form-label">Icon<span class="reqired-star">*</span></label>
                                <!-- Show existing image -->
                                <img src="<?= base_url('uploads/industries/' . $industriesE->icon); ?>" width="100">
                                <!-- Preserve existing image filename -->
                                <input type="hidden" name="existing_image" value="<?= $industriesE->icon; ?>">
                                <!-- Optional new image upload -->
                                <input type="file" id="icon" name="icon">
                            </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/industries/' . $industriesE->image); ?>" width="100">
                                <!-- Preserve existing image filename -->
                                <input type="hidden" name="existing_image" value="<?= $industriesE->image; ?>">
                                <!-- Optional new image upload -->
                                <input type="file" id="image" name="image">
                            </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($industriesE->status == 1 ){ echo "selected";}else{} ?>>Active</option>
                                    <option value="0" <?php if($industriesE->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>