eb7081bdd2fce5b0839608e87011b3e8.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:89:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\general\profile\index.html";i:1709714141;s:72:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\layout\default.html";i:1709714141;s:69:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\meta.html";i:1709714141;s:71:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\script.html";i:1730083808;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  8. <meta name="renderer" content="webkit">
  9. <meta name="referrer" content="never">
  10. <meta name="robots" content="noindex, nofollow">
  11. <link rel="shortcut icon" href="/assets/img/favicon.ico" />
  12. <!-- Loading Bootstrap -->
  13. <link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  14. <?php if(\think\Config::get('fastadmin.adminskin')): ?>
  15. <link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  16. <?php endif; ?>
  17. <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
  18. <!--[if lt IE 9]>
  19. <script src="/assets/js/html5shiv.js"></script>
  20. <script src="/assets/js/respond.min.js"></script>
  21. <![endif]-->
  22. <script type="text/javascript">
  23. var require = {
  24. config: <?php echo json_encode($config); ?>
  25. };
  26. </script>
  27. </head>
  28. <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
  29. <div id="main" role="main">
  30. <div class="tab-content tab-addtabs">
  31. <div id="content">
  32. <div class="row">
  33. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  34. <section class="content-header hide">
  35. <h1>
  36. <?php echo __('Dashboard'); ?>
  37. <small><?php echo __('Control panel'); ?></small>
  38. </h1>
  39. </section>
  40. <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
  41. <!-- RIBBON -->
  42. <div id="ribbon">
  43. <ol class="breadcrumb pull-left">
  44. <?php if($auth->check('dashboard')): ?>
  45. <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
  46. <?php endif; ?>
  47. </ol>
  48. <ol class="breadcrumb pull-right">
  49. <?php foreach($breadcrumb as $vo): ?>
  50. <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
  51. <?php endforeach; ?>
  52. </ol>
  53. </div>
  54. <!-- END RIBBON -->
  55. <?php endif; ?>
  56. <div class="content">
  57. <style>
  58. .profile-avatar-container {
  59. position: relative;
  60. width: 100px;
  61. margin: 0 auto;
  62. }
  63. .profile-avatar-container .profile-user-img {
  64. width: 100px;
  65. height: 100px;
  66. }
  67. .profile-avatar-container .profile-avatar-text {
  68. display: none;
  69. }
  70. .profile-avatar-container:hover .profile-avatar-text {
  71. display: block;
  72. position: absolute;
  73. height: 100px;
  74. width: 100px;
  75. background: #444;
  76. opacity: .6;
  77. color: #fff;
  78. top: 0;
  79. left: 0;
  80. line-height: 100px;
  81. text-align: center;
  82. }
  83. .profile-avatar-container button {
  84. position: absolute;
  85. top: 0;
  86. left: 0;
  87. width: 100px;
  88. height: 100px;
  89. opacity: 0;
  90. }
  91. </style>
  92. <div class="row animated fadeInRight">
  93. <div class="col-md-4">
  94. <div class="box box-primary">
  95. <div class="panel-heading">
  96. <?php echo __('Profile'); ?>
  97. </div>
  98. <div class="panel-body">
  99. <form id="update-form" role="form" data-toggle="validator" method="POST" action="<?php echo url('general.profile/update'); ?>">
  100. <?php echo token(); ?>
  101. <input type="hidden" id="c-avatar" name="row[avatar]" value="<?php echo htmlentities($admin['avatar']); ?>"/>
  102. <div class="box-body box-profile">
  103. <div class="profile-avatar-container">
  104. <img class="profile-user-img img-responsive img-circle" src="<?php echo htmlentities(cdnurl($admin['avatar'])); ?>" alt="">
  105. <div class="profile-avatar-text img-circle"><?php echo __('Click to edit'); ?></div>
  106. <button type="button" id="faupload-avatar" class="faupload" data-input-id="c-avatar"><i class="fa fa-upload"></i> <?php echo __('Upload'); ?></button>
  107. </div>
  108. <h3 class="profile-username text-center"><?php echo htmlentities($admin['nickname']); ?></h3>
  109. <div class="form-group">
  110. <label for="username" class="control-label"><?php echo __('Username'); ?>:</label>
  111. <input type="text" class="form-control" id="username" name="row[username]" value="<?php echo htmlentities($admin['username']); ?>" disabled/>
  112. </div>
  113. <div class="form-group">
  114. <label for="mobile" class="control-label"><?php echo __('Mobile'); ?>:</label>
  115. <input type="text" class="form-control" id="mobile" name="row[mobile]" value="<?php echo htmlentities($admin['mobile']); ?>" disabled/>
  116. </div>
  117. <div class="form-group">
  118. <label for="email" class="control-label"><?php echo __('Email'); ?>:</label>
  119. <input type="text" class="form-control" id="email" name="row[email]" value="<?php echo htmlentities($admin['email']); ?>" data-rule="required;email"/>
  120. </div>
  121. <div class="form-group">
  122. <label for="nickname" class="control-label"><?php echo __('Nickname'); ?>:</label>
  123. <input type="text" class="form-control" id="nickname" name="row[nickname]" value="<?php echo htmlentities($admin['nickname']); ?>" data-rule="required"/>
  124. </div>
  125. <div class="form-group">
  126. <label for="password" class="control-label"><?php echo __('Password'); ?>:</label>
  127. <input type="password" class="form-control" id="password" placeholder="<?php echo __('Leave password blank if dont want to change'); ?>" autocomplete="new-password" name="row[password]" value="" data-rule="password"/>
  128. </div>
  129. <div class="form-group">
  130. <button type="submit" class="btn btn-primary"><?php echo __('Submit'); ?></button>
  131. <button type="reset" class="btn btn-default"><?php echo __('Reset'); ?></button>
  132. </div>
  133. </div>
  134. </form>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="col-md-8">
  139. <div class="panel panel-default panel-intro panel-nav">
  140. <div class="panel-heading">
  141. <ul class="nav nav-tabs">
  142. <li class="active"><a href="#one" data-toggle="tab"><i class="fa fa-list"></i> <?php echo __('Admin log'); ?></a></li>
  143. </ul>
  144. </div>
  145. <div class="panel-body">
  146. <div id="myTabContent" class="tab-content">
  147. <div class="tab-pane fade active in" id="one">
  148. <div class="widget-body no-padding">
  149. <div id="toolbar" class="toolbar">
  150. <?php echo build_toolbar('refresh'); ?>
  151. </div>
  152. <table id="table" class="table table-striped table-bordered table-hover table-nowrap" width="100%">
  153. </table>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
  168. <input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
  169. <input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
  170. <script>
  171. function watermark(element, config) {
  172. // 获取元素的坐标
  173. function getOffset(el) {
  174. if (el.offsetParent) {
  175. return {
  176. x: el.offsetLeft + getOffset(el.offsetParent).x,
  177. y: el.offsetTop + getOffset(el.offsetParent).y,
  178. };
  179. }
  180. return {
  181. x: el.offsetLeft,
  182. y: el.offsetTop,
  183. };
  184. }
  185. if (!element) return;
  186. // 默认配置
  187. const _config = {
  188. text1: '浙江美浓材料科技有限公司', //文本1
  189. text2: '', // 文本2
  190. start_x: 0, // x轴起始位置
  191. start_y: 0, // y轴起始位置
  192. space_x: 100, // x轴间距
  193. space_y: 50, // y轴间距
  194. width: 210, // 宽度
  195. height: 80, // 长度
  196. fontSize: 14, // 字体
  197. color: '#aaa', // 字色
  198. alpha: 0.4, // 透明度
  199. rotate: 15, // 倾斜度
  200. };
  201. // 替换默认配置
  202. if (arguments.length === 2 && typeof arguments[1] === "object") {
  203. const src = arguments[1] || {};
  204. for (let key in src) {
  205. if (src[key] && _config[key] && src[key] === _config[key]) {
  206. continue;
  207. } else if (src[key]) {
  208. _config[key] = src[key];
  209. }
  210. }
  211. }
  212. // 节点的总宽度
  213. const total_width = element.scrollWidth;
  214. // 节点的总高度
  215. const total_height = element.scrollHeight;
  216. // 创建文本碎片,用于包含所有的插入节点
  217. const mark = document.createDocumentFragment();
  218. // 水印节点的起始坐标
  219. const position = getOffset(element);
  220. let x = position.x + _config.start_x, y = position.y + _config.start_y;
  221. // 先循环y轴插入水印
  222. do {
  223. // 再循环x轴插入水印
  224. do {
  225. // 创建单个水印节点
  226. const item = document.createElement('div');
  227. item.className = 'watermark-item';
  228. // 设置节点的样式
  229. item.style.position = "absolute";
  230. item.style.zIndex = 99999;
  231. item.style.left = `${x}px`;
  232. item.style.top = `${y}px`;
  233. item.style.width = `${_config.width}px`;
  234. item.style.height = `${_config.height}px`;
  235. item.style.fontSize = `${_config.fontSize}px`;
  236. item.style.color = _config.color;
  237. item.style.textAlign = 'center';
  238. item.style.opacity = _config.alpha;
  239. item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
  240. // item.style.filter = `opacity(${_config.alpha * 100}%)`;
  241. item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
  242. item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
  243. item.style.msTransform = `rotate(-${_config.rotate}deg)`;
  244. item.style.OTransform = `rotate(-${_config.rotate}deg)`;
  245. item.style.transform = `rotate(-${_config.rotate}deg)`;
  246. item.style.pointerEvents = 'none'; //让水印不遮挡页面的点击事件
  247. // 创建text1水印节点
  248. const text1 = document.createElement('div');
  249. text1.appendChild(document.createTextNode(_config.text1));
  250. item.append(text1);
  251. // 创建text2水印节点
  252. const text2 = document.createElement('div');
  253. text2.appendChild(document.createTextNode(_config.text2));
  254. item.append(text2);
  255. // 添加水印节点到文本碎片
  256. mark.append(item);
  257. // x坐标递增
  258. x = x + _config.width + _config.space_x;
  259. // 超出文本右侧坐标停止插入
  260. } while (total_width + position.x > x + _config.width);
  261. // 重置x初始坐标
  262. x = position.x + _config.start_x;
  263. // y坐标递增
  264. y = y + _config.height + _config.space_y;
  265. // 超出文本底部坐标停止插入
  266. } while (total_height + position.y > y + _config.height);
  267. // 插入文档碎片
  268. element.append(mark);
  269. }
  270. var username = document.getElementById('username');
  271. var company = document.getElementById('company');
  272. //找到存放水印的盒子
  273. const element = document.getElementsByTagName('body')[0];
  274. watermark(element,{text1:username.value,text2:company.value});
  275. </script>
  276. </body>
  277. </html>