
<!-- PAGE-INDEX-STARTS -->

<div class="breadcrumbs">
    <div class="breadcrumbs-inner">
        <div class="row m-0">
            <div class="col-sm-4">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><?= $pTitle ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li><a href="<?= base_url() ?>">Dashboard</a></li>
                            <li><a ><?= $menu ?></a></li>
                            <li class="active"><?= $smenu ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- PAGE-INDEX-ENDS -->

<!-- PAGE-CONTENT-STARTS -->

<div class="content">
   <div class="animated fadeIn">
      <div class="row">
        <div class="col-lg-12">
          <?php 
          $url = (!isset($subcat_id)||empty($subcat_id))
          ?'Sub_services/create_subservices':'Sub_services/edit_subservices/'.$subcat_id;
          if($this->session->flashdata('message')) { 
          $flashdata = $this->session->flashdata('message'); ?>
          <div class="alert alert-<?= $flashdata['class'] ?>">
            <button class="close" data-dismiss="alert" type="button">×</button>
            <?= $flashdata['message'] ?>
          </div>
          <?php } ?>
          <form role="form" action="<?= base_url($url) ?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
            <div class="card">
              <div class="card-header">
                <strong><?= $pDescription ?></strong>
              </div>
              <div class="card-body card-block">                   
                <div class="form-group">
                  <div class="row">
                    <div class="col-md-6">
                      <label for="nf-email" class=" form-control-label">Service Name</label>
                      <select name="service_id" id="selectSm" class="form-control required">
                        <option value="">Please select</option>    
                        <?php foreach($catData as $key =>  $category) { ?> 
                        <?php  if  (isset($subcat_id)||!empty($subcat_id)) { ?>
                        <option <?= $subcatData->service_id == $category['id'] ? "selected" : "" ; ?> value="<?= $category['id'] ?>"><?= $category['service_name'] ?></option>
                        <?php }else{?> 
                        <option  value="<?= $category['id'] ?>"><?= $category['service_name'] ?></option>
                        <?php }} ?> 
                      </select>
                    </div>
                     <div class="col-md-6">
                      <label for="nf-email" class=" form-control-label">Subservice Name</label>
                      <input type="text" id="nf-brand" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$"  name="sub_services" placeholder="Enter Subservice Name" class="form-control required" value="<?= (isset($subcatData->sub_services))?$subcatData->sub_services:'' ?>" >
                    </div>
                  </div>
                </div>
              
             
                <div class="form-group">
                  <div class="row">
                    <div class="col-md-12">
                      <button type="submit" class="btn btn-primary">
                        <i class="fa fa-dot-circle-o"></i> Submit
                      </button>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </form>
        </div>        
      </div>
    </div>
  </div>

  <!-- PAGE-CONTENT-ENDS -->

        