123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="description" content="">
- <meta name="author" content="">
- <!--<link rel="icon" href="favicon.ico">-->
- <title>DbAdmin Teach</title>
- <!-- Bootstrap core CSS -->
- <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
- <!-- Custom styles for this template -->
- <link href="css/U.EX.DB.css" rel="stylesheet">
- <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
- <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
- <script src="js/assets/ie-emulation-modes-warning.js"></script>
- <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.js"></script>
- <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- <body>
- <div class="site-wrapper">
- <div class="site-wrapper-inner">
- <div class="cover-container">
- <div class="masthead clearfix">
- <div class="inner">
- <h3 class="masthead-brand">
- DbAdmin</h3>
- <ul class="nav masthead-nav">
- <li class="active"><a href="#" id="U_db_User">主页</a></li>
- </ul>
- </div>
- </div>
- <div class="inner cover" id="U_db_IndexFrame">
- <h1 class="cover-heading">
- 学习数据库管理</h1>
- <p class="lead">
- 你可以通过你的1473账号登陆,并创建自己的数据库进行学习。</p>
- <p class="lead">
- <a href="#" class="btn btn-lg btn-default" onclick="U.dbAdmin.ZFram('U_db_IndexFrame','U_db_LoginFrame')">
- Go!</a>
- </p>
- </div>
- <div class="inner cover" style="display: none;" id="U_db_LoginFrame">
- <from onkeydown="if(event.keyCode===13) U.dbAdmin.Login();">
- <h1 class="cover-heading" style="margin-top: -80px;">
- 登陆</h1>
- <p class="lead" style="margin-left: -80px;">
- 用户名:
- <input type="text" id="un" style="color: #343434" name="username" /></p>
- <p class="lead" style="margin-left: -80px;">
- 密码 :
- <input type="password" id="ps" style="color: #343434" name="password" />
- </p>
- <small id="loginError" style="color:Red;"></small>
- <p class="lead" style="margin-top: 10px;">
- <button class="btn btn-lg btn-default" onclick="U.dbAdmin.Login();">Go!</button>
- </p>
- </from>
- </div>
- <div class="inner cover" style="display: none;" id="U_db_ListFrame" onkeydown="if(event.keyCode===13) U.dbAdmin.DbUserCreate();">
- <div id="U_db_L_Create" style="display: none;">
- 你的数据库账号密码:<input type="password" style="color: #343434" id="U_db_LF_Ps" />
- 确认密码:<input type="password" style="color: #343434" id="U_db_LF_Pst" />
- <br />
- <small id="U_db_LF_Error" style="color: Red; margin-top: 20px;"></small>
- <button class="btn btn-lg btn-default" style="margin-top: 20px;" onclick="U.dbAdmin.DbUserCreate();">
- 创建你的第一个数据库账号吧!~</button>
- </div>
- <div id="U_db_L_Data" style="display: block">
- </div>
- </div>
- <div class="mastfoot">
- <div class="inner">
- <p>
- 版权所有 <a href="http://www.1473.cn">1473</a> ,数据库<a href="http://10.1.47.56/phpmyadmin/">点我</a>,
- by <a href="http://weibo.com/smalltr">@Qv</a>.</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!--<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>-->
- <!--<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>-->
- <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
- <!--<script src="js/assets/ie10-viewport-bug-workaround.js"></script>-->
- <script type="text/javascript"> document.domain = "1473.cn";</script>
- <script src="http://www.1473.cn/uform.js" type="text/javascript"></script>
- <script src="http://teacher.1473.cn/crossdomain.js" type="text/javascript"></script>
- <script type="text/javascript">
- Namespace.register("U.dbAdmin"); //示例项目命名空间,需要调整命名空间的请重新定义命名空间
- U.CD.AjaxUrl = 'http://teacher.1473.cn/'; //后台默认请求页面
- U.CD.AjaxCross = "http://teacher.1473.cn/CD.htm"; //后台跨域文件
- U.CD.Host = "192.168.100.67"; //需要更换数据库host,在这里更换
- U.CD.Database = "mysql"; //需要更换数据库名字,在这里更换UseStudio_School
- U.CD.Init();
- //视图最简单的切换,由于使用频率高,暂时这样写着先,以后看看有什么可以改的。
- U.dbAdmin.ZFram = function (a, b) {
- $('#' + a + '')[0].style.display = 'none';
- $('#' + b + '')[0].style.display = 'block';
- }
- //登陆时的各种提示语,配合页面上的静态元素简易表现
- //$("#loginError")[0].innerHTML
- //登陆的验证,由于是登陆没什么检测规则
- U.dbAdmin.Login = function () {
- var isNull = ($('#un')[0].value === '' || $('#ps')[0].value === ''); //判断为空的时候
- if (isNull) {
- $('#loginError')[0].innerHTML = '请填写完整!';
- return false;
- }
- $('#loginError')[0].innerHTML = '';
- U.A.Request('UseStudioManage.uploadUserinfo', ([$('#un')[0].value, $('#ps')[0].value, '', 2]), U.dbAdmin.LoginRes, ([]));
- }
- //登陆成功后,后台数据库反馈的数据,从这个地方
- //开始页面视图的初始化 View Loading~~~~
- U.dbAdmin.LoginRes = function (res) {
- if (!res.value) {
- $('#loginError')[0].innerHTML = '账户名或密码错误';
- } else {
- $('#loginError')[0].innerHTML = '';
- U.dbAdmin.Me = res.value[0][0];
- //把那些密码啥的都隐藏起来
- U.dbAdmin.Name = $('#U_db_User')[0].value = $('#un')[0].value; $('#ps')[0].value = '';
- U.dbAdmin.ZFram('U_db_LoginFrame', 'U_db_ListFrame');
- //U.ACD.Request(U.CD.AjaxUrl, (["Add_File", userid, node.ID, node.Deep, _nnode.ID, _nnode.Name, content]), U.CD.RT.CP_OKAsyn, ([""]));
- // U.A.Request("UseStudioManage.uploadUserinfo", ([$("#un")[0].value, $("#ps")[0].value, "", U.MS.produceGuid()]), U.dbAdmin.LoginRes, ([]));
- // U.ACD.Request(U.CD.AjaxUrl, ([U.CD.Host, U.CD.Database, "USE_SelectUser", U.dbAdmin.Me.UserId]), U.dbAdmin.ListInit, ([]));
- U.ACD.Request(U.CD.AjaxUrl, ([U.CD.Host, U.CD.Database, "TEST_SELECT"]), U.dbAdmin.ListInit, ([]));
- }
- }
- //获取到数据后的视图初始化
- //把数据库账号列表load出来
- U.dbAdmin.ListInit = function (res) {
- if (!res.value[0].length) {
- $('#U_db_L_Create')[0].style.display = 'block';
- $('#U_db_L_Data')[0].style.display = 'none';
- return false;
- }
- //开始加载列表
- $('#U_db_L_Create')[0].style.display = 'none';
- $('#U_db_L_Data')[0].style.display = 'block';
- var value = res.value[0];
- for (var i = 0, t; t = value[i]; i++) {
- $('#U_db_L_Data')[0].innerHTML = '<p class="lead">用户名:' + t.username + ' - 密码: ' + t.password + '</p>'
- }
- }
- //新用户创建数据库账号
- //创建完成后加载数据~
- U.dbAdmin.DbUserCreate = function () {//U_db_LF_Error
- var isUnTrue = $('#U_db_LF_Ps')[0].value !== $('#U_db_LF_Pst')[0].value;
- var isNull = ($('#U_db_LF_Ps')[0].value === '' || $('#U_db_LF_Pst')[0].value === '');
- if (isNull) {
- $('#U_db_LF_Error')[0].innerHTML = '请填写完整';
- return false;
- }
- if (isUnTrue) {
- $('#U_db_LF_Error')[0].innerHTML = '请确认密码输入一致';
- return false;
- }
- U.ACD.Request(U.CD.AjaxUrl, ([U.CD.Host, U.CD.Database, 'USE_CreateUser', U.dbAdmin.Me.UserName, $('#U_db_LF_Ps')[0].value, U.dbAdmin.Me.UserId]), U.dbAdmin.ListInit, ([]));
- }
- </script>
- </body>
- </html>
|