<?php

if($_SESSION["type"] != 1){
	echo "No permission to access"; die();
	}
$s_id= $_GET['s_id'];
?>
<div class="row">
    <div class="col-lg-12" style="margin-top:-41px;margin-bottom:-13px;">
        <h1 class="page-header" style="font-size:19px; color:#09F;"><i class="fa fa-user fa-fw"></i>&nbsp;More Services</h1>
    </div>
    <!-- /.col-lg-12 -->
</div>
<!-- Row -->
<?php       
    if (isset($_POST['btsave'])) {
        $s_name = mysqli_real_escape_string($conn,$_POST['s_name']);
        $s_desc = mysqli_real_escape_string($conn,$_POST['s_desc']);
        mysqli_query($conn,"SET NAMES utf8");
        mysqli_query($conn,"update tbl_services set s_name='$s_name',s_desc='$s_desc' where s_id = $s_id") or die(mysql_error());	
        ?>
        	<script type="text/javascript">
              window.location.href="?page=addservices";
            </script>
       <?php 
    }   
?>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default" style="width:100%;">
            <div class="panel-body">
                <div class="row">
                    <form method="post" enctype="multipart/form-data">
                        <?php
							mysqli_query($conn,'SET NAMES utf8');
							$sql_p=mysqli_query($conn,"SELECT * FROM tbl_services where s_id = $s_id"); 
							while($row5=mysqli_fetch_array($sql_p)){
						?>
                        <div class="col-lg-6"> 
                            <div class="form-group">
                                <label style="color:#3a3a3a;"v>Services Name</label>
                                <input class="form-control" placeholder="Services Name" name="s_name" value="<?php echo $row5['s_name'];?>"/>
                            </div>
                            <div class="form-group">
                                <label>Services Description</label>
                                <textarea class="form-control" rows="35" name="s_desc" placeholder="Services Description"><?php echo $row5['s_desc'];?></textarea>
                            </div>
                            
                            <div class="form-group" style="margin-top:-25px;">
                                <label></label><br/>
                                <input type="submit" name="btsave" class="btn btn-success" value="&nbsp;Update&nbsp;" title="Update"/>
                                 <a href="?page=addservices">
                            <input type="button" name="addnew" class="btn btn-primary" value="&nbsp;Back&nbsp;" title="Back"/>
                            </a>
                            </div> 
                        </div>
                       <?php } ?>    
                    </form>
                </div>
            </div>
       </div>
    </div>
</div>
<?php
	include('services_data.php');
?>