人人商城

message.html 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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}
  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. <a href="javascript:history.go(-1);" class="btn btn-primary">点击这里返回上一页</a>
  26. <a href="./?c=account&a=display" class="btn btn-primary">首页</a>
  27. {loop $extend $button}
  28. <a href="{$button['url']}" class="{$button['class']}">{$button['title']}</a>
  29. {/loop}
  30. </p>
  31. {/if}
  32. </div>
  33. {template 'common/footer'}
  34. {else}
  35. {template 'common/header-base'}
  36. <script type="text/javascript">
  37. function setCookie(cname,cvalue,exdays){
  38. var d = new Date();
  39. d.setTime(d.getTime()+(exdays*24*60*60*1000));
  40. var expires = "expires="+d.toGMTString();
  41. document.cookie = cname+"="+cvalue+"; "+expires;
  42. }
  43. //设置cookie
  44. var modal = new Object();
  45. {if is_array($msg)}
  46. modal.title = 'MYSQL 错误';
  47. modal.msg = '{php echo cutstr($msg['sql'], 300, 1);}';
  48. {else}
  49. modal.title = '{$caption}';
  50. 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}';
  51. {/if}
  52. {if $redirect}
  53. modal.redirect = "{$redirect}";
  54. {else}
  55. modal.redirect = "";
  56. {/if}
  57. setCookie("modal",JSON.stringify(modal),30000);
  58. //跳转
  59. {if $redirect}
  60. setTimeout(function(){
  61. window.location.href= "{$redirect}";
  62. },0)
  63. {else}
  64. setTimeout(function(){
  65. window.history.back(-1);
  66. },0)
  67. {/if}
  68. </script>
  69. <div class="hidden">
  70. <div>
  71. {template 'common/footer-base'}
  72. </div>
  73. {/if}