<?php
include_once('../helpers/init.php');
include_once('header.php');
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>Existing Client Management</title>

        <!-- Bootstrap Core CSS -->
        <link href="../css/bootstrap.min.css" rel="stylesheet">

        <!-- MetisMenu CSS -->
        <link href="../css/metisMenu.min.css" rel="stylesheet">

        <!-- DataTables CSS -->
        <link href="../css/dataTables/dataTables.bootstrap.css" rel="stylesheet">

        <!-- DataTables Responsive CSS -->
        <link href="../css/dataTables/dataTables.responsive.css" rel="stylesheet">

        <!-- Custom CSS -->
        <link href="../css/startmin.css" rel="stylesheet">

        <!-- Custom Fonts -->
        <link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css">
    </head>
    <body>

        <div id="wrapper">

            <!-- Navigation -->
            <?php include 'navs.php'; ?>
            <div id="page-wrapper">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12">
                            <h1 class="page-header">Manage Client Here</h1>
                        </div>
                        <!-- /.col-lg-12 -->
                    </div>
                    <!-- /.row -->
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="panel panel-default">
                                
                                <div class="panel-heading">
                                    <b>Manage Your Client Here</b>
                                </div>
                                <?php
if(isset($_GET['result']) && $_GET['result']=="success"){
?>
<div class="alert alert-success alert-dismissible">
  <button type="button" class="close" data-dismiss="alert">&times;</button>
  <strong>Success!</strong> Action Done Successfully!
</div>
<!---->                               
<?php
}
if(isset($_GET['result']) && $_GET['result']=="failer"){
?>
<div class="alert alert-danger alert-dismissible">
  <button type="button" class="close" data-dismiss="alert">&times;</button>
  <strong>Fail!</strong><?php if(isset($_GET['message'])){echo $_GET['message']; } ?>
</div>
<?php
}
?>
                                <!-- /.panel-heading -->
                                <div class="panel-body">                                    
                                    <div class="table-responsive">
                                        <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                            <thead>
                                                <tr>
                                                    <th>Client Name</th> 
                                                    <th style="width:100px;">Take Action </th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php
                                                $clients = get("services","id","DESC");
                                                $count=1;
                                                foreach($clients as $row){
                                                ?>
                                                <tr class="odd gradeX">
                                                    <td><?php echo $row['name']; ?></td>
                                                    <td class="center">
                                                        <div class="btn-group">
                         <a href="update-services.php?id=<?php echo $row['id']; ?>" class="btn btn-sm btn-primary" style="margin-right:0.5em;" title="Manage"><span class="fa fa-pencil-square-o"></span> </a> 
                                                            
                         <a href="service-gallery.php?id=<?php echo $row['id']; ?>" class="btn btn-sm btn-warning" style="margin-right:0.5em;" title="Add Picture"><span class="fa fa-camera"></span> </a><!-- 
                                                            
                      	<a onclick="return confirm('Sure You Want to Delete?');" href="../process/client-functions.php?id=<?php echo $row['id']; ?>&action=deleteClient" class="btn btn-sm btn-danger" title="Delete"><span class="fa fa-trash"></span> </a>-->

                      </div>
                                                    </td>
                                                </tr>
                                                <?php $count++; } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                    <!-- /.table-responsive -->                                    
                                </div>
                                <!-- /.panel-body -->
                            </div>
                            <!-- /.panel -->
                        </div>
                        <!-- /.col-lg-12 -->
                    </div>
                    <!-- /.row --->
                </div>
                <!-- /.container-fluid -->
            </div>
            <!-- /#page-wrapper -->

        </div>
        <!-- /#wrapper -->

        <!-- jQuery -->
        <script src="../js/jquery.min.js"></script>

        <!-- Bootstrap Core JavaScript -->
        <script src="../js/bootstrap.min.js"></script>

        <!-- Metis Menu Plugin JavaScript -->
        <script src="../js/metisMenu.min.js"></script>
        
        <!-- DataTables JavaScript -->
        <script src="../js/dataTables/jquery.dataTables.min.js"></script>
        <script src="../js/dataTables/dataTables.bootstrap.min.js"></script>

        <!-- Custom Theme JavaScript -->
        <script src="../js/startmin.js"></script>
        <!-- Page-Level Demo Scripts - Tables - Use for reference -->
        <script>
            $(document).ready(function() {
                $('#dataTables-example').DataTable({
                        responsive: true
                });
            });
        </script>

    </body>
</html>
