message.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {if empty($tips)}
  2. {php define('IN_MESSAGE', true)}
  3. {template 'common/header'}
  4. <div class="container message-noexist text-center">
  5. <span class="error-icon"><i class="wi text-{$label} wi-{if $label=='success'}right-sign{/if}{if $label=='danger'}warning-sign{/if}{if $label=='info'}info-sign{/if}{if $label=='warning'}error-sign{/if}"></i></span>
  6. {if is_array($msg)}
  7. <h2>MYSQL 错误:</h2>
  8. <div class="tips">{php echo cutstr($msg['sql'], 300, 1);}</div>
  9. <div class="state"><b>{$msg['error'][0]} {$msg['error'][1]}:</b>{$msg['error'][2]}</div>
  10. {else}
  11. <div class="tips">{$caption}</div>
  12. <div class="state">{$msg}</div>
  13. {/if}
  14. {if $redirect && $type != 'expired'}
  15. <div class="btn-group">
  16. <a class="btn btn-link" href="{$redirect}">如果你的浏览器没有自动跳转,请点击此链接</a>
  17. <script type="text/javascript">
  18. setTimeout(function () {
  19. location.href = "{$redirect}";
  20. }, 3000);
  21. </script>
  22. </div>
  23. {else}
  24. <p>
  25. {if $type != 'expired'}
  26. <a href="javascript:history.go(-1);" class="btn btn-primary">点击这里返回上一页</a>
  27. <a href="{php echo url('home/welcome/system', array('page' => 'home'))}" class="btn btn-default">首页</a>
  28. {/if}
  29. {loop $extend $button}
  30. <a href="{$button['url']}" class="{$button['class']}" target="{if !empty($button['target'])}{$button['target']}{else}_self{/if}">{$button['title']}</a>
  31. {/loop}
  32. </p>
  33. {/if}
  34. </div>
  35. {if $redirect == url('home/welcome/ext', array('m' => 'store')) && $type == 'expired'}
  36. <script type="text/javascript">
  37. setTimeout(function () {
  38. location.href = "{$redirect}";
  39. }, 5000);
  40. </script>
  41. {/if}
  42. {template 'common/footer'}
  43. {else}
  44. {template 'common/header-base'}
  45. <script type="text/javascript">
  46. function setCookie(cname,cvalue,exdays){
  47. var d = new Date();
  48. d.setTime(d.getTime()+(exdays*24*60*60*1000));
  49. var expires = "expires="+d.toGMTString();
  50. document.cookie = cname+"="+cvalue+"; "+expires;
  51. }
  52. //设置cookie
  53. var modal = new Object();
  54. {if is_array($msg)}
  55. modal.title = 'MYSQL 错误';
  56. modal.msg = '{php echo cutstr($msg['sql'], 300, 1);}';
  57. {else}
  58. modal.title = '{$caption}';
  59. modal.msg = '<i class="wi text-{$label} wi-{if $label=='success'}right-sign{/if}{if $label=='danger'}warning-sign{/if}{if $label=='info'}info-sign{/if}{if $label=='warning'}error-sign{/if}"></i>{$msg}';
  60. {/if}
  61. {if $redirect}
  62. modal.redirect = "{$redirect}";
  63. {else}
  64. modal.redirect = "";
  65. {/if}
  66. setCookie("modal",JSON.stringify(modal),30000);
  67. //跳转
  68. {if $redirect}
  69. setTimeout(function(){
  70. window.location.href= "{$redirect}";
  71. },0)
  72. {else}
  73. setTimeout(function(){
  74. window.history.back(-1);
  75. },0)
  76. {/if}
  77. </script>
  78. <div class="hidden">
  79. <div>
  80. {template 'common/footer-base'}
  81. </div>
  82. {/if}