<?php
session_start();
error_reporting(E_ALL);
ini_set('display_errors', 1);

require_once "../config.php";
include_once "../../ichat/admin/route.php";
require_once '../check_edit_page.php';
if ($session->is_logged_in() != true ) {
        redirect_to(WEB_LINK.'/login');
} else {
    $current_user = User::get_specific_id($session->admin_id);
    $current_user->set_online();
    $group = $current_user->prvlg_group;
}

require_once '../database1.php';
class Add extends database
{
	public function getRules()
	{
		return $this->fetchAll('ichat_groups');
	}

    public function getUser($id)
    {
        return $this->fetchRow('ichat_users', ['id' => $id]);
    }
}

$obj = new Add();
$rules = $obj->getRules();
$data = $obj->getUser($id);

require_once("../../ichat/admin/assets/includes/Library/SessManager.php");
require_once("../../ichat/admin/assets/includes/Library/User.php");
$session = new  SessManager();

$templateType = 'add';
include '../header.php';
?>
               <!-- MAIN CONTENT-->
            <div class="main-content">
                <div class="section__content section__content--p30">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="overview-wrap">
                                    <h2 class="title-1">Add Users</h2>
                                    
                                </div>
                                
                              
                            </div>
                        </div>
                        
                        <div class="row m-t-25 m-row">
                    
                            <div class="col-lg-10">
                                <div class="card">
                                    
                                    <div class="card-body card-block">
                                        <form method="post" class="form" cluster-url="../ajax/user/edit_ajax?id=<?php echo $id;?>" cluster-redirect="list"  enctype="multipart/form-data">
									       <?php include_once "template/user_form.php" ?>
                                       </form>
                                   </div>
                                </div>
                            </div>
                          
                        </div>
                        
                   <?php
				   include '../footer.php';
				   ?>