
<main class="app-content">
<div class="app-title">
  <div>
    <h1><i class="fa fa-th-list"></i> Main Services</h1>
  </div>
  <ul class="app-breadcrumb breadcrumb">
    <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
    <li class="breadcrumb-item">Service</li>
    <li class="breadcrumb-item active"><a href="#">Home</a></li>
  </ul>
</div>
<div class="row">
  
  <div class="col-md-12">
    <div class="col-md-8">
      <div class="tile">
        <h3 class="tile-title">Services</h3>
        <?php 
        if(isset($edi['0']))
        {
          foreach($edi as $row)
          {
            ?>
             <div class="tile-body">
          <form name="frm" method="post" action="addService">
            <div class="form-group">
              <label class="control-label">Service Title</label>
              <input class="form-control" name="title" type="text" value="<?php echo $row->service_name?>" placeholder="title" required>
              <input type="hidden" name="sid" value="<?php echo $row->id?>"/>
            </div>
            <div class="form-group">
              <label class="control-label">Status</label>
              <select name="status">
                <?php $opt=$row->status;?>
                <option value="Y"<?php if($opt=='Y'){echo "selected";} ?>>Active</option>
                <option value="N" <?php if($opt=='N'){echo "selected";} ?> >Inactive</option>
              </select>
            </div>
            <div class="tile-footer">
              <input class="btn btn-primary" type="submit" name="update" value="Update">&nbsp;&nbsp;&nbsp;<a class="btn btn-secondary" href="#"><i class="fa fa-fw fa-lg fa-times-circle"></i>Cancel</a>
            </div>
          </form>

        </div>
            <?php
          }
        }
        else
        {
          ?>
          <div class="tile-body">
            <form name="frm" method="post" action="addService">
              <div class="form-group">
                <label class="control-label">Service Title</label>
                <input class="form-control" name="title" type="text" placeholder="title" required>
              </div>
              <div class="tile-footer">
                <button class="btn btn-primary" type="submit" name="update_btn2"><i class="fa fa-fw fa-lg fa-check-circle"></i>Add Now</button>&nbsp;&nbsp;&nbsp;<a class="btn btn-secondary" href="#"><i class="fa fa-fw fa-lg fa-times-circle"></i>Cancel</a>
              </div>
            </form>

          </div>

          <?php
        }
        ?>
        

        <table class="table mt-5">
            <thead>
              <tr>
                <th scope="col">Sl. No</th>
                <th scope="col">Service Name</th>
                <th scope="col">Status</th>
				 <th scope="col">Action</th>
               
              </tr>
            </thead>
            <tbody>
              <?php 
              $i=1;
              if(isset($data['0']))
              {
                foreach($data as $row)
                {
                  ?>
                  <tr>
                    <th scope="row"><?php echo $i?></th>
				            <td><?php echo $row->service_name ?></td>
                    <td><?php if($row->status=='Y'){
                    echo 'Active'; }
                    else
                    {
                      echo 'Inactive';
                    }
                      ?></td>
				           
                  <td>    <a href="<?php echo base_url()?>editService/<?php echo $row->id?>" class="btn btn-sm btn-danger" >Update</a></form></td>
              </tr>
                  <?php
                  $i++;
                }
              }
              ?>
			
				
             
			
            </tbody>
          </table>
      </div>
    </div>
  </div>
</div>
</main>
<!-- Essential javascripts for application to work-->
<script src="<?php echo base_url()?>assets/js/jquery-3.3.1.min.js"></script>
<script src="<?php echo base_url()?>assets/js/popper.min.js"></script>
<script src="<?php echo base_url()?>assets/js/bootstrap.min.js"></script>
<script src="<?php echo base_url()?>assets/js/main.js"></script>
<!-- The javascript plugin to display page loading on top-->
<script src="<?php echo base_url()?>assets/js/plugins/pace.min.js"></script>
<!-- Page specific javascripts-->
<!-- Google analytics script-->
<script type="text/javascript">
if(document.location.hostname == 'pratikborsadiya.in') {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-72504830-1', 'auto');
ga('send', 'pageview');
}
</script>
</body>
</html>