<?php include('header.php');?>
<main id="dashboard">
    <div class="container">


        <div class="row">

            <div class="col-sm-9">

                <div class="page-title">
                    <h1><strong> <?php echo $save_user['title'];?> </strong>   </h1>
                </div>

            </div>
<!--
            <div class="col-sm-3 text-right">
                <a href="<?php echo baseUrl('addnew.php');?>" class="btn btn-lg btn-success btn-block">Add New</a>
                <br>
            </div>
-->
        </div>

        <div class="row">
            <div class="col-sm-9">
                <?php include('cron_info.php');?>
                <?php if(!empty($save_user['errors'])) {
                    foreach($save_user['errors'] as $error) { ?>
                        <div role="alert" class="alert alert-info alert-danger alert-dismissable">
                            <button type="button" class="close" data-dismiss="alert"
                                    aria-hidden="true">&times;</button>
                            <?php echo $error;?>
                        </div>
                <?php } } ?>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-12">

                <div class="panel panel-fb">

                    <div class="panel-body">
                        <form action="<?php echo baseUrl('add_user.php');?>" class="form-horizontal" method="post">
                            <input type="hidden" name="submit" value="user">
                            <input type="hidden" name="uid" value="<?php echo $save_user['uid'];?>">

                            <div class="form-group clearfix">
                                <label for="input" class="col-sm-3 col-xs-12 control-label"> Name </label>

                                <div class="col-sm-6 col-xs-9">
                                    <input required type="text" class="form-control" id="name" name="name" value="<?php echo empty($save_user['name']) ? '' : $save_user['name'];?>">
                                </div>
                            </div>

                            <div class="form-group clearfix">
                                <label for="input" class="col-sm-3 col-xs-12 control-label"> Email </label>

                                <div class="col-sm-6 col-xs-9">
                                    <input required type="email" class="form-control" id="email" name="email" value="<?php echo empty($save_user['email']) ? '' : $save_user['email'];?>">
                                </div>
                            </div>

                            <div class="form-group clearfix">
                                <label for="input" class="col-sm-3 col-xs-12 control-label"> Timezone </label>

                                <div class="col-sm-6 col-xs-9">
                                    <select class="form-control" name="timezone">
                                        <?php if(!empty($timezones)) {
                                            foreach($timezones as $key => $timezone){ ?>
                                                <option value="<?php echo $key;?>" <?php echo ($save_user['timezone'] == $key) ? 'selected' : '';?>><?php echo $timezone;?></option>
                                            <?php }
                                        }?>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group clearfix">
                                <label for="input" class="col-sm-3 col-xs-12 control-label"> FB Pages Limit </label>

                                <div class="col-sm-6 col-xs-9">
                                    <input required type="number" class="form-control" id="fb_pages_limit" name="fb_pages_limit" value="<?php echo empty($save_user['fb_pages_limit']) ? '1' : $save_user['fb_pages_limit'];?>">
                                </div>
                            </div>

                            <div class="form-group clearfix">

                                <label for="input" class="col-sm-3 col-xs-12 control-label"> Password </label>

                                <div class="col-sm-6 col-xs-9">
                                    <input type="password" class="form-control" id="cpassword" name="cpassword" value="" autocomplete="off">
                                </div>
                            </div>

                            <div class="form-group clearfix">

                                <label for="input" class="col-sm-3 col-xs-12 control-label"> Re-type Password </label>

                                <div class="col-sm-6 col-xs-9">
                                    <input type="password" class="form-control" id="repassword" name="repassword" value="" autocomplete="off">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-9 text-right">
                                    <button class="btn btn-primary" type="submit"> <i class="fa fa-pencil"> </i>  <?php echo $save_user['button'];?> </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<?php include('footer.php');?>