人人商城

message.tpl.php 3.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php defined('IN_IA') or exit('Access Denied');?><?php if(empty($tips)) { ?>
  2. <?php define('IN_MESSAGE', true)?>
  3. <?php (!empty($this) && $this instanceof WeModuleSite || 0) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
  4. <div class="container message-noexist text-center">
  5. <span class="error-icon"><i class="wi text-<?php echo $label;?> wi-<?php if($label=='success') { ?>right-sign<?php } ?><?php if($label=='danger') { ?>warning-sign<?php } ?><?php if($label=='info') { ?>info-sign<?php } ?><?php if($label=='warning') { ?>error-sign<?php } ?>"></i></span>
  6. <?php 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><?php echo $msg['error']['0'];?> <?php echo $msg['error']['1'];?>:</b><?php echo $msg['error']['2'];?></div>
  10. <?php } else { ?>
  11. <div class="tips"><?php echo $caption;?></div>
  12. <div class="state"><?php echo $msg;?></div>
  13. <?php } ?>
  14. <?php if($redirect) { ?>
  15. <div class="btn-group">
  16. <a class="btn btn-link" href="<?php echo $redirect;?>">如果你的浏览器没有自动跳转,请点击此链接</a>
  17. <script type="text/javascript">
  18. setTimeout(function () {
  19. location.href = "<?php echo $redirect;?>";
  20. }, 3000);
  21. </script>
  22. </div>
  23. <?php } 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. <?php if(is_array($extend)) { foreach($extend as $button) { ?>
  28. <a href="<?php echo $button['url'];?>" class="<?php echo $button['class'];?>"><?php echo $button['title'];?></a>
  29. <?php } } ?>
  30. </p>
  31. <?php } ?>
  32. </div>
  33. <?php (!empty($this) && $this instanceof WeModuleSite || 0) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>
  34. <?php } else { ?>
  35. <?php (!empty($this) && $this instanceof WeModuleSite || 0) ? (include $this->template('common/header-base', TEMPLATE_INCLUDEPATH)) : (include template('common/header-base', TEMPLATE_INCLUDEPATH));?>
  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. <?php if(is_array($msg)) { ?>
  46. modal.title = 'MYSQL 错误';
  47. modal.msg = '<?php echo cutstr($msg['sql'], 300, 1);?>';
  48. <?php } else { ?>
  49. modal.title = '<?php echo $caption;?>';
  50. modal.msg = '<i class="wi text-<?php echo $label;?> wi-<?php if($label=='success') { ?>right-sign<?php } ?><?php if($label=='danger') { ?>warning-sign<?php } ?><?php if($label=='info') { ?>info-sign<?php } ?><?php if($label=='warning') { ?>error-sign<?php } ?>"></i><?php echo $msg;?>';
  51. <?php } ?>
  52. <?php if($redirect) { ?>
  53. modal.redirect = "<?php echo $redirect;?>";
  54. <?php } else { ?>
  55. modal.redirect = "";
  56. <?php } ?>
  57. setCookie("modal",JSON.stringify(modal),30000);
  58. //跳转
  59. <?php if($redirect) { ?>
  60. setTimeout(function(){
  61. window.location.href= "<?php echo $redirect;?>";
  62. },0)
  63. <?php } else { ?>
  64. setTimeout(function(){
  65. window.history.back(-1);
  66. },0)
  67. <?php } ?>
  68. </script>
  69. <div class="hidden">
  70. <div>
  71. <?php (!empty($this) && $this instanceof WeModuleSite || 0) ? (include $this->template('common/footer-base', TEMPLATE_INCLUDEPATH)) : (include template('common/footer-base', TEMPLATE_INCLUDEPATH));?>
  72. </div>
  73. <?php } ?>