installscript.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. function initbody(){
  2. var tit = document.title;
  3. if(tit.indexOf('<?')>-1){
  4. alert('提示:您没有开启php短标签,系统将不能使用\n\n请到php.ini下将short_open_tag = ON。');
  5. }
  6. }
  7. var bool = false;
  8. function nextabc(){
  9. $('#step1').hide();
  10. $('#step2').show();
  11. }
  12. function backabc(){
  13. $('#step2').hide();
  14. $('#step1').show();
  15. }
  16. function wancla(){
  17. $('#step2').hide();
  18. $('#step3').show();
  19. }
  20. function delinstall(){
  21. var url = js.getajaxurl('delinstall','install');
  22. $.get(url,function(){
  23. js.msg('success','删除成功');
  24. });
  25. return false;
  26. }
  27. function submitla(){
  28. if(bool)return;
  29. var a = js.getformdata();
  30. if(isempt(a.host)){
  31. js.setmsg('数据库地址不能为空');
  32. return;
  33. }
  34. if(isempt(a.user)){
  35. js.setmsg('用户名不能为空');
  36. return;
  37. }
  38. if(isempt(a.base)){
  39. js.setmsg('数据库名称不能为空');
  40. return;
  41. }
  42. if(isempt(a.perfix)){
  43. js.setmsg('表名前缀不能为空');
  44. return;
  45. }
  46. var url = location.href;
  47. a.url = url.substr(0, url.lastIndexOf('/')+1);
  48. js.setmsg('处理中...');
  49. bool = true;
  50. $.ajax({
  51. data:a,url:js.getajaxurl('save','install'),
  52. type:'post',
  53. success:function(da){
  54. js.setmsg();
  55. if(da!='success'){
  56. js.setmsg(da);
  57. bool = false;
  58. }else{
  59. wancla();
  60. }
  61. },
  62. error:function(e){
  63. js.setmsg('出错:'+e.responseText+'');
  64. bool = false;
  65. }
  66. });
  67. }
  68. function getxhkey(o1){
  69. var url = 'http://www.rockoa.com/';
  70. url+='api.php?a=getxhkey&gkey='+device+'';
  71. js.open(url, 400,300,'huoq');
  72. js.alert('根据弹框提示就可以','提示', function(){
  73. try{js.openarr['huoq'].close();}catch(e){}
  74. o1.innerHTML=js.getmsg('获取中...');
  75. $.getJSON(url+'&stype=1&callback=?',function(ret){
  76. if(ret.success){
  77. form('xinhukey').value=ret.data.xhkey;
  78. o1.innerHTML=js.getmsg(ret.data.msg);
  79. }else{
  80. o1.innerHTML=js.getmsg(ret.msg);
  81. }
  82. });
  83. });
  84. }