PageRenderTime 80ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/rxwandc/application/admin.rxwan.com/views/index/login.php

https://bitbucket.org/i1598/caiyun_stat
PHP | 121 lines | 121 code | 0 blank | 0 comment | 1 complexity | bf9d42221bbafcd7553ea87d76ea3618 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" type="text/css" href="../../extjs/resources/css/ext-all.css">
  7. <link rel="stylesheet" type="text/css" href="../../extjs/style.css">
  8. <script type="text/javascript" src="../../extjs/ext-all.js"></script>
  9. <script type="text/javascript">
  10. Ext.onReady(function() {
  11. Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
  12. Ext.QuickTips.init();
  13. function handler1() {
  14. form.form.submit({
  15. url : '/login',
  16. submitEmptyText : false,
  17. waitMsg : 'Saving Data...',
  18. success : function(form, action) {
  19. console.log(action.result.type);
  20. switch(action.result.type){
  21. case 3:
  22. Ext.Msg.alert('Warning','密码错误');
  23. break;
  24. case 4:
  25. Ext.Msg.alert('Warning', '登录成功');
  26. window.location.href = "/";
  27. break;
  28. }
  29. },
  30. failure : function(form, action) {
  31. switch (action.failureType) {
  32. case Ext.form.Action.CLIENT_INVALID:
  33. Ext.Msg.alert('Error Warning', "用户名或密码不能为空");
  34. break;
  35. case Ext.form.Action.CONNECT_FAILURE:
  36. Ext.Msg.alert('Error Warning', 'network abort!');
  37. break;
  38. case Ext.form.Action.SERVER_INVALID:
  39. Ext.Msg.alert('Error Warning', "The form's values format error!");
  40. //simple.form.reset();
  41. break;
  42. }
  43. }
  44. });
  45. }
  46. Ext.form.Field.prototype.msgTarget = 'side';
  47. var form = Ext.create('Ext.form.Panel', {
  48. layout : 'absolute',
  49. defaultType : 'textfield',
  50. border : false,
  51. items : [{
  52. fieldLabel : 'username',
  53. fieldWidth : 60,
  54. msgTarget : 'side',
  55. allowBlank : false,
  56. blankText : 'Account input not null !',
  57. x : 5,
  58. y : 25,
  59. name : 'username',
  60. anchor : '-5' // anchor width by percentage
  61. }, {
  62. id:'passwdInput',
  63. fieldLabel : 'password',
  64. fieldWidth : 60,
  65. inputType : 'password',
  66. msgTarget : 'side',
  67. allowBlank : false,
  68. blankText : 'Account input not null !',
  69. x : 5,
  70. y : 55,
  71. name : 'password',
  72. anchor : '-5' // anchor width by percentage
  73. ,listeners : {
  74. specialKey : function(field, e) {
  75. if (e.getKey() == Ext.EventObject.ENTER) {//响应回车
  76. //queryHandler();//处理回车事件
  77. //comName.selectText();//处理回车事件后选中输入框的文字
  78. //console.log(33);
  79. handler1();
  80. }
  81. }
  82. }
  83. }]
  84. });
  85. var win = Ext.create('Ext.window.Window', {
  86. title : 'Login RX Manager',
  87. closable : false,
  88. width : 400,
  89. height : 200,
  90. minWidth : 300,
  91. minHeight : 100,
  92. layout : 'fit',
  93. plain : true,
  94. items : form,
  95. buttons : [{
  96. text : 'Login',
  97. handler:handler1
  98. }, {
  99. text : 'Cancel',
  100. handler : function() {
  101. form.form.reset();
  102. }
  103. }]
  104. ,listeners:{
  105. beforeshow:function(){
  106. // console.log(passwd);
  107. }
  108. }
  109. });
  110. win.show();
  111. });
  112. </script>
  113. <link type="text/css" rel="stylesheet" href="../../extjs/login.css" />
  114. <title>RX Management Background</title>
  115. </head>
  116. <body></body>
  117. </html>