<?php
include("../../packages/require.php");
include("controller/controller_client.php");
$curpage = "client";
$page_name = "index.php";
if($acsg_client == 0){
    header("Location:".$path['dashboard']);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <title><?=$title['client'];?></title>
    <?php include($global['root']."packages/head.php");?>
</head>
<body class="<?=$global['body-css'];?>">
    <div class="wrapper">

        <?php include($global['root']."section/header.php");?>
      
        <?php include($global['root']."section/sidebar.php");?>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                  <h1>
                    Module Client
                    <small>Adding and editing your client</small>
                  </h1>
                  <ol class="breadcrumb">
                        <li><a href="<?=$path['dashboard'];?>"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li class="active">Client</li>
                  </ol>
            </section>

            <!-- Main content -->
            <section class="content">
                <!-- Default box -->
                <div class="box">
                    <div class="box-header with-border">
                        <div class="row">
                            <div class="col-xs-12 col-sm-12">
                                <div class="head-btn text-right">
                                    <a href="javascript:void(0);" id="btn-clear" class="btn btn-default full-xs xs-down10" style="display: none;">
                                        <i class="fa fa-times"></i> Clear Filter
                                    </a>
                                    <?php if($acsc_create == 1){ ?>
                                    <a href="<?=$path['client-insert'];?>" class="btn btn-primary full-xs xs-down10">
                                        <i class="fa fa-plus"></i> Add New Data
                                    </a>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-4 col-xs-12 hide">
                                <div class="input-group down1">
                                    <span class="input-group-addon"><i class="fa fa-sort-amount-desc"></i></span>
                                    <select class="form-control input-sort" name="region" id="region-select">
                                    </select>
                                </div>
                            </div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="input-group down1">
                                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                                    <input type="text" name="q" class="form-control" id="search-input" placeholder="Search Client Name...">
                                </div>
                            </div>
                            <div class="col-sm-4 col-xs-12 hidden-xs"></div>
                            <div class="col-sm-4 col-xs-12">
                                <div class="body-total text-right">
                                    <span class="numbadge">
                                        Total Data <span id="label-total" class="badge bg-light-blue">0</span>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="body-content">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-middle">
                                    <thead>
                                        <tr>
                                            <th class="text-center">#</th>
                                            <th class="text-center">Client Name</th>
                                            <th class="text-center">Phone</th>
                                            <th class="text-center">Email</th>
                                            <th class="text-center">Status</th>
                                            <th class="text-center">Create Date</th>
                                            <th class="text-center">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody id="table-list"></tbody>
                                    <tbody id="table-loader">
                                        <tr style="background-color: #ffffff !important;">
                                            <td colspan="15">
                                                <div class="loader-image">
                                                    <img src="<?=$global['absolute-url'].'img/load.gif';?>" align="icon">
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer clearfix">
                        <div class="row">
                            <div class="col-sm-5"></div>
                            <div class="col-sm-7">
                                <ul id="mod-pagination" style="display: none;" class="pagination pagination-sm no-margin pull-right">
                                    <li id="pag-prev" style="display: none;">
                                        <a id="btn-prev" href="javascript:void(0);" data-page="">Previous</a>
                                    </li>
                                    <li>
                                    <ul id="pag-list"></ul>
                                    </li>
                                    <li id="pag-next" style="display: none;">
                                        <a id="btn-next" href="javascript:void(0);" data-page="">Next</a>
                                    </li>
                                </ul>
                                <input type="hidden" id="cur-page" value="1">
                                <input type="hidden" id="redir-url" value="<?=$path['client'];?>">
                                <input type="hidden" id="acsc-edit" value="<?=$acsc_edit;?>">
                                <input type="hidden" id="acsc-delete" value="<?=$acsc_delete;?>">
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.box-footer-->
            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->

        <?php include($global['root']."section/footer.php");?>

    </div>
    <!-- ./wrapper -->

    <?php include($global['root']."packages/footer.php");?>
    <script src="<?=$global['absolute-url'];?>module/client/js/index.js?<?=mt_rand(10,1000);?>"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            <?php if($message != "") { ?>
            //use session here for alert success/failed
            var alertText = "<?=$message;?>";
                <?php if($alert != "success"){ ?>
                errorAlert(alertText);// error alert
                <?php } else { ?>
                successAlert(alertText);// success alert
                <?php } ?>
            <?php } ?>
        });
    </script>
</body>
</html>