 <!-- include 'header' -->
 <script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/admin.js"></script>
<body>
	<div class="mainLayout">
		<div class="mainMenu">
			<div class="menuItem">
				<a href="#" class="mLogo">CLD</a>
				<ul>
					<!-- include 'menu' -->
				</ul>
			</div>
		</div>
		<div class="warpContent">
			<div class="subMenu fL">
				<div class="menuItem">
					<ul>
						<!-- include 'admin_menu' -->
					</ul>
				</div>
			</div>
			<div class="adminContent autoHeight">
			<div class="subNav">
					<!-- include 'adminReceiptMenu' -->
				</div>
			
					<form method="post" action="/addRole" name="group">
					<legend>审批角色</legend>
					    <div class="control-group">
			              <label class="control-label">角色名称</label>
			              <div class="controls">
			                <input type="text" name="title">
			              </div>
			            </div>
			            <div class="control-group">
			              <label class="control-label">成员</label>
			              <div class="controls">
				              <!-- loop staffList -->
				               <label class="checkbox inline">
				               <input type="checkbox" name="staff[]"  value="{{staffList' value.sid}}:{{staffList' value.username}}:{{staffList' value.avatar}}">{{staffList' value.username}}
				               </label>
				               <!-- endloop -->
			            	</div>
			            </div>
			            <div class="control-group">
			              <div class="controls">
					    			<button class="button" type="submit">添加新角色</button>
			              </div>
			            </div>
			    </form>
						<table class="table table-striped">
              <thead>
                <tr>
                  <th width="30%">角色名称</th>
                  <th>成员</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              <!-- loop roleList -->
                <tr>
                  <td>{{roleList' value.name}}</td>
                  <td>
                  <!-- loop roleList' value.list -->
                  	{{roleList' value' value.1}} <a href="#change" onclick='changeStaff("{{roleList' value' value.1}}","{{roleList' value.rid}}","{{roleList' value' value.0}}")' data-toggle="modal" role="button" class="icon-" title="更换">J</a> 
                  <!-- endloop -->
                  </td>
                  <td><a href="/delRole/{{roleList' value.rid}}">删除</a></td>
                </tr>
              <!-- endloop -->
                
              </tbody>
          	</table>
					
			</div>
		</div>
	</div>
<!--弹出（锁信息）-->
<div class="modal hide fade" id="change">
	<div class="modal-dialog">
		<div class="modal-content">
    <div class="modal-header">
    <h3>更换审批人</h3>
    </div>
    <form action="/updateRole">
    <input type="hidden" name="oldStaff" id="oldStaff" value="">
    <input type="hidden" name="rid" id="rid" value="">
    <div class="modal-body">
    	<div class="control-group">
    		<div class="controls">
			    <select name="newStaff"  style="width:190px" id="roleStaff">
			    	<option>读取中</option>
			    </select>
			</div>
		</div>
    	<div class="control-group">
    		<div class="controls">
			    <p class="colRed">更换后，正在审批的报销单也将由新审批人审批。</p>
			</div>
		</div>
    </div>
	<div class="modal-footer">
	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
	    <input type="submit" value="确定更换" class="button">
	</div>
	</form>
		</div>
	</div>
</div>
<!--弹出-->	
<script type="text/javascript">autoFlashHeight();</script>	
</body>