Created
March 3, 2014 06:02
-
-
Save leonguyen/9319271 to your computer and use it in GitHub Desktop.
ad_tpl list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <% include ../header %> | |
| <% include ../admin/menu %> | |
| <% include ../admin/msg %> | |
| <div class="page-header"> | |
| <% if(typeof(sess.AuthList['N'])!='undefined'){%> | |
| <button type="button" class="btn btn-default pull-right" id="btnAdd" name="btnAdd" onclick="location.href='/ad_user/create'"><span class="glyphicon glyphicon-plus"></span> Add new</button> | |
| <%}//if%> | |
| <h2><%=title%></h2> | |
| </div> | |
| <form id="frm" name="frm" class="form" role="form" method="post" action="/ad_user/search"> | |
| <div class="row"> | |
| <div class="col-md-3"> | |
| <label class="control-label" for="txtName">Username or Email</label> | |
| <input type="text" class="form-control" id="txtName" name="txtName" placeholder="Username or Email" autofocus autocomplete="off" value="<%=typeof(sess.search)!='undefined'?sess.search.name:''%>"> | |
| </div> | |
| <div class="col-md-2"> | |
| <label class="control-label" for="selStatus">Status</label> | |
| <select class="form-control" id="selStatus" name="selStatus"> | |
| <option value="" <%=typeof(sess.search)!='undefined'&&sess.search.status==''?'selected="selected"':''%>>Either</option> | |
| <option value="1" <%=typeof(sess.search)!='undefined'&&sess.search.status=='1'?'selected="selected"':''%>>Enable</option> | |
| <option value="0" <%=typeof(sess.search)!='undefined'&&sess.search.status=='0'?'selected="selected"':''%>>Disable</option> | |
| </select> | |
| </div> | |
| <div class="col-md-2"> | |
| <label class="control-label" for="btnSearch"> </label> | |
| <button class="form-control" type="submit" class="btn btn-default" id="btnSearch" name="btnSearch"><span class="glyphicon glyphicon-search"></span> Search</button> | |
| </div> | |
| </div> | |
| <p> | |
| <table class="table table-bordered"> | |
| <thead> | |
| <tr> | |
| <th><input type="checkbox" id="chkA" name="chkA" onclick="chkAll(this.checked)"></th> | |
| <th>Username <a href="/ad_user/search?uName=ASC">▲</a><a href="/ad_user/search?uName=DESC">▼</a></th> | |
| <th>Email <a href="/ad_user/search?uEmail=ASC">▲</a><a href="/ad_user/search?uEmail=DESC">▼</a></th> | |
| <th>Status <a href="/ad_user/search?uStatus=ASC">▲</a><a href="/ad_user/search?uStatus=DESC">▼</a></th> | |
| <th>Action</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <% mlist.forEach(function(ml){ %> | |
| <tr <%=ml.uId!=sess.uId&&ml.uType<=sess.uType?'style=display:none':''%>> | |
| <td> | |
| <input type="checkbox" id="chkId[]" name="chkId[]" <%=ml.uId==sess.uId||ml.uType<sess.uType?'style=display:none':''%> value="<%=ml.uId==sess.uId||ml.uType<sess.uType?'':ml.uId%>"> | |
| </td> | |
| <td><%=ml.uName?ml.uName:''%></td> | |
| <td><%=ml.uEmail?ml.uEmail:''%></td> | |
| <td> | |
| <div class="btn-group" <%=ml.uId==sess.uId||ml.uType<sess.uType?'style=display:none':''%>> | |
| <button type="button" class="btn btn-default btn-sm" id="btnEna" <%=ml.uStatus==1?'disabled="disabled"':''%> onclick="location.href='/ad_user/status/<%=ml.uId?ml.uId:''%>/1'">Enable</button> | |
| <button type="button" class="btn btn-default btn-sm" id="btnDis" <%=ml.uStatus==0?'disabled="disabled"':''%> onclick="location.href='/ad_user/status/<%=ml.uId?ml.uId:''%>/0'">Disable</button> | |
| </div> | |
| </td> | |
| <td> | |
| <div class="btn-group" <%=ml.uType<sess.uType?'style=display:none':''%>> | |
| <% if(typeof(sess.AuthList['E'])!='undefined' || typeof(sess.AuthList['R'])!='undefined'){%> | |
| <button type="button" id="btnEdit" class="btn btn-default" onclick="location.href='/ad_user/edit/<%=ml.uId?ml.uId:''%>'"> | |
| <span class="glyphicon glyphicon-pencil"></span> | |
| </button> | |
| <%}//if%> | |
| <% if(typeof(sess.AuthList['D'])!='undefined'){%> | |
| <button type="button" id="btnDel" class="btn btn-default" onclick="del(<%=ml.uId?ml.uId:''%>)" <%=ml.uId==sess.uId||ml.uType<sess.uType?'style=display:none':''%>> | |
| <span class="glyphicon glyphicon-remove"></span> | |
| </button> | |
| <%}//if%> | |
| </div> | |
| </td> | |
| </tr> | |
| <% });//mlist %> | |
| </tbody> | |
| </table> | |
| <div class="row"><div class="col-md-2"> | |
| <label class="control-label" for="selUpd">Update</label> | |
| <select class="form-control" id="selUpd" name="selUpd"> | |
| <option value="" selected="selected">---</option> | |
| <% if(typeof(sess.AuthList['D'])!='undefined'){%> | |
| <option value="del">Delete selected</option> | |
| <%}//if%> | |
| <% if(typeof(sess.AuthList['V'])!='undefined'){%> | |
| <option value="ena">Enable selected</option> | |
| <option value="dis">Disable selected</option> | |
| <%}//if%> | |
| </select> | |
| </div> | |
| <div class="col-md-8"> | |
| <div id="pg" style="margin:5px 0px;<%=typeof(pg)!='undefined'&&pg.pageCount=='1'?'display:none':''%>"></div> | |
| </div> | |
| <div class="col-md-2" <%=typeof(pg)!='undefined'&&pg.pageCount=='1'?'style=display:none':''%>> | |
| <label class="control-label" for="selLimit">Limit</label> | |
| <select class="form-control" id="selLimit" name="selLimit"> | |
| <option value="10" <%=typeof(sess.search)!='undefined'&&sess.search.per_page=='10'?'selected="selected"':''%>>10 items</option> | |
| <option value="20" <%=typeof(sess.search)!='undefined'&&sess.search.per_page=='20'?'selected="selected"':''%>>20 items</option> | |
| <option value="50" <%=typeof(sess.search)!='undefined'&&sess.search.per_page=='50'?'selected="selected"':''%>>50 items</option> | |
| <option value="100" <%=typeof(sess.search)!='undefined'&&sess.search.per_page=='100'?'selected="selected"':''%>>100 items</option> | |
| </select> | |
| </div></div> | |
| </form> | |
| <% include list_js %> | |
| <% include js %> | |
| <% include ../footer %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment