<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title><?php echo ($title); ?> | 追格小程序后台管理</title>   
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="description" content="追格微信小程序后台管理">
        <meta name="keywords" content="追格,小程序">
        <meta name="author" content="追格">

        <!-- Base Css Files -->
        <link href="/Public/assets/libs/jqueryui/ui-lightness/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" />
        <link href="/Public/assets/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
        <link href="/Public/assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
        <link href="/Public/assets/libs/fontello/css/fontello.css" rel="stylesheet" />
        <link href="/Public/assets/libs/animate-css/animate.min.css" rel="stylesheet" />
        <!-- <link href="/Public/assets/libs/nifty-modal/css/component.css" rel="stylesheet" /> -->
        <link href="/Public/assets/libs/pace/pace.css" rel="stylesheet" />
        <link href="/Public/assets/libs/jquery-icheck/skins/all.css" rel="stylesheet" />
		<link href="/Public/assets/libs/jquery-notifyjs/styles/metro/notify-metro.css" rel="stylesheet" type="text/css" />

        <link href="/Public/assets/css/style.css" rel="stylesheet" type="text/css" />
        <link href="/Public/assets/css/style-responsive.css" rel="stylesheet" />
		<link href="/Public/css/append.css" rel="stylesheet" />

        <link rel="shortcut icon" href="/favicon.ico">
        <link rel="apple-touch-icon" href="/Public/assets/img/apple-touch-icon.png" />
    </head>
	
<body class="fixed-left">
	<!-- Begin page -->
	<div id="wrapper">
		
        <!-- Top Bar Start -->
        <div class="topbar">
            <div class="topbar-left">
                <div class="logo">
                    <h1><a href="#"><img src="/Public/assets/img/logo.png" alt="Logo"></a></h1>
                </div>
                <button class="button-menu-mobile open-left">
                <i class="fa fa-bars"></i>
                </button>
            </div>
            <!-- Button mobile view to collapse sidebar menu -->
            <div class="navbar navbar-default" role="navigation">
                <div class="container">
                    <div class="navbar-collapse2">
                        <ul class="nav navbar-nav navbar-right top-navbar">
                            <li class="dropdown iconify hide-phone"><a href="#" onclick="javascript:toggle_fullscreen()"><i class="icon-resize-full-2"></i></a></li>
                            <li class="dropdown topbar-profile">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="rounded-image topbar-profile-image"><img src="/Public/images/users/user-35.jpg"></span><strong><?php echo session('admin_name')?></strong> <i class="fa fa-caret-down"></i></a>
                                <ul class="dropdown-menu">
                                    <li><a href='/admin/Index/updPwd'><i class="icon-key"></i> 修改密码</a></li>
                                    <li><a id="btn-logout" href="javascript:void(0)"><i class="icon-logout-1"></i> 退出</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                    <!--/.nav-collapse -->
                </div>
            </div>
        </div>
        <!-- Top Bar End -->
        		
        <!-- Left Sidebar Start -->
        <!-- Left Sidebar Start -->
<div class="left side-menu">
    <div class="sidebar-inner slimscrollleft">
        <!--- Divider -->
        <div id="sidebar-menu">
            <ul>
					<li class=''>
						<a href='/Admin/Index/index'><i class='icon-home-3'></i><span>首页</span></a>
					</li>
					<?php  foreach($navlist as $k=>$v) { if(in_array($v['id'], $role)) { ?>
							<li class='has_sub'><a href='javascript:void(0);'><i class='fa fa-table'></i><span><?php echo $v['auth_name'];?></span> <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
									<ul>
							<?php
 foreach($v['list'] as $k1=>$v1){ if(in_array($v1['id'],$role)){ ?>
							<li><a href="<?php echo $v1['href']?>" <?php if($action_name==$v1['key']){echo "class='active'";}?> ><span><?php echo $v1['auth_name'];?></span></a></li>
							<?php
 }} ?>
							
						</ul>
					</li>
					<?php
 }} ?>
               
                <!-- <li class='has_sub'><a href='javascript:void(0);'><i class='fa fa-table'></i><span>用户管理</span> <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                    <ul>
                        <li><a href="/index.php/Admin/User/index" <?php if($nav=='用户管理'){echo "class='active'";}?> ><span>用户列表</span></a></li>
                    </ul>
                </li>
                				<li class='has_sub'><a href='javascript:void(0);'><i class='fa fa-table'></i><span>名片管理</span> <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                    <ul>
                						<li><a href="<?php echo U('card/userCardList');?>" <?php if($nav=='用户名片列表'){echo "class='active'";}?> ><span>用户名片列表</span></a></li>
                        <li><a href="<?php echo U('card/cardList');?>" <?php if($nav=='联系人名片列表'){echo "class='active'";}?> ><span>联系人名片列表</span></a></li>
                    </ul>
                </li> -->
             
                <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="left-footer">
        <div class="progress progress-xs">
            <div class="progress-bar bg-green-1" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
                <span class="progress-precentage">80%</span>
            </div>

            <a data-toggle="tooltip" title="See task progress" class="btn btn-default" data-modal="task-progress"><i class="fa fa-inbox"></i></a>
        </div>
    </div>
</div>



<!-- Left Sidebar End -->
        <!-- Left Sidebar End -->

        <!-- Start right content -->
        <div class="content-page">
		<ol class="breadcrumb">
				<li><a style="curor:pointer;"  href='<?php echo U('Index/index');?>'>首页</a></li>
			<li><a href="#"><?php echo parent_name($action_name);?></a></li>
			<li><a href="#"><?php echo category_name($action_name);?></a></li>
		</ol>
            <div class="content">
				<!-- 列表start -->
				<div class="widget-content padding">
		            <div class="table-responsive">
		                <div class="widget">
		                    <form method='post' action='<?php echo U('Auth/addUser');?>'  enctype="multipart/form-data" id='formdata'>
		                        <table class="table">
		                            <tbody>
		                            <tr>
		                                <td>&nbsp;&nbsp;&nbsp;&nbsp;用户名</td>
		                                <td>
		                                    <div class="col-sm-5">
		                                        <input type="text" class="form-control" id="admin_name" value="" name='admin_name' placeholder="用户名">
		                                    </div>
		                                </td>
		                            </tr>
		                            <tr>
		                                <td>&nbsp;&nbsp;&nbsp;&nbsp;密码</td>
		                                <td>
		                                    <div class="col-sm-5">
		                                        <input type="password" class="form-control" id="admin_password" value="" name='admin_password' placeholder="密码">
		                                    </div>
		                                </td>
		                            </tr>
		                            <tr>
		                                <td>&nbsp;&nbsp;&nbsp;&nbsp;确认密码</td>
		                                <td>
		                                    <div class="col-sm-5">
		                                        <input type="password" class="form-control" id="readmin_password" value="" name='readmin__password' placeholder="确认密码">
		                                    </div>
		                                </td>
		                            </tr>
		                            <tr>
		                                <td colspan=2>
		                                    <button type="button" class="btn btn-primary submit_btn">提交</button>
		                                </td>
		                            </tr>
		                            </tbody>
		                        </table>
		                    </form>
		                </div>
		            </div>
		        </div>
				<!-- 列表end -->
				<!-- Footer Start -->
<footer>
    <a href="https://www.zhuige.com" title="追格-微信小程序" target="_blank">追格-微信小程序</a> &copy; 2017
</footer>
<!-- Footer End -->		
	        </div>	
	    </div>
	</div>
<script>
    var resizefunc = [];
</script>
<script src="/Public/assets/libs/jquery/jquery-1.11.1.min.js"></script>
<script src="/Public/assets/libs/jquery-detectmobile/detect.js"></script>
<script src="/Public/assets/libs/jquery-icheck/icheck.min.js"></script>
<script src="/Public/assets/libs/jquery-notifyjs/notify.min.js"></script>
<script src="/Public/assets/libs/jquery-notifyjs/styles/metro/notify-metro.js"></script>
<script src="/Public/assets/libs/jqueryui/jquery-ui-1.10.4.custom.min.js"></script>
<script src="/Public/assets/libs/jquery-ui-touch/jquery.ui.touch-punch.min.js"></script>
<script src="/Public/assets/libs/bootstrap/js/bootstrap.min.js"></script>
<!-- <script src="/Public/assets/libs/bootstrap-bootbox/bootbox.min.js"></script> -->
<script src="/Public/assets/libs/bootstrap-fileinput/bootstrap.file-input.js"></script>
<!-- <script src="/Public/assets/libs/magnific-popup/jquery.magnific-popup.min.js"></script> -->
<script src="/Public/assets/libs/fastclick/fastclick.js"></script>
<script src="/Public/assets/libs/pace/pace.min.js"></script>
<script src="/Public/assets/js/pages/notifications.js"></script>
<script src="/Public/assets/js/init.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#btn-logout").click(function() {
			if(confirm('确定退出？')) {
				window.location.href = '/admin/index/logout';
			}
		});
	});
</script>
<script src="/Public/js/jquery.form.js"></script>
<script type="text/javascript">
<!--
	$(function(){
	    $('.submit_btn').click(function(){
	        var admin_name = $('#admin_name').val();
	        var admin_password = $('#admin_password').val();
	        var readmin_password = $('#readmin_password').val();

	        if(admin_name==''){
	            $('#admin_name').css('background','#F88E8B');
	            return false;
	        }
	        $('#admin_name').css('background','');
	        if(admin_password==''){
	            $('#admin_password').css('background','#F88E8B');
	            return false;
	        }
	        $('#admin_password').css('background','');
	        if(readmin_password==''){
	            $('#readmin_password').css('background','#F88E8B');
	            return false;
	        }
	        $('#readmin_password').css('background','');
	        if(admin_password!=readmin_password){
	            $('#admin_password').css('background','#F88E8B');
	            $('#readmin_password').css('background','#F88E8B');
	            return false;
	        }
	        $('#admin_password').css('background','');
	        $('#readmin_password').css('background','');

	        $("#formdata").ajaxSubmit({
	            type:'post',
	            url:'/Admin/Auth/addUser',
	            success:function(data){
	                notify('success','top center','添加成功');
                    setTimeout(function () {
                        location.href = "/Admin/auth/userList"
                    }, 1000);
	            }
	        });
	    })
	})
//-->
</script>
</body>
</html>