tpl_list_box_content.php

本文介绍了一个用于基于提供的数组生成表格输出的PHP模板文件,详细解释了如何使用此模板来展示数据。

<?php
/**
* Common Template - tpl_tabular_display.php
*
* This file is used for generating tabular output where needed, based on the supplied array of table-cell contents.
*
* @package templateSystem
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_list_box_content.php 2926 2006-02-01 05:47:29Z drbyte $
*/

//print_r($list_box_contents);
$cell_scope = (!isset($cell_scope) || empty($cell_scope)) ? 'col' : $cell_scope;
$cell_title = (!isset($cell_title) || empty($cell_title)) ? 'list' : $cell_title;

?>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<?php
for($row=0; $row<sizeof($list_box_contents); $row++) {
$params = "";
if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];
?>
<tr <?php echo $params; ?>>
<?php
for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
$r_params = "";
$cell_type = ($row==0) ? 'th' : 'td';
if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . $list_box_contents[$row][$col]['params'];
if ($cell_type=='th') $r_params .= ' scope="' . $cell_scope . '" id="' . $cell_title . '-Cell-' . $row . ' - ' . $col.'"';
if (isset($list_box_contents[$row][$col]['text'])) {
?>
<?php echo '<' . $cell_type . $r_params . '>'; ?><?php echo $list_box_contents[$row][$col]['text'] ?><?php echo '</' . $cell_type . '>'; ?>
<?php
}
}
?>
</tr>
<?php
}
?>
</table>

✓ 客服系统登录 请使用您的账号登录系统 ✓ 登录成功!正在跳转到控制面板... 用户名 admin 密码 •••••• 登录 快速链接 帮助中心 找回密码 用户注册 联系我们 客服系统 v2.5.1 © 2023 [root@yfw ~]# cd /www/wwwroot/szrengjing.com/kefu [root@yfw kefu]# ll total 80 drwxr-xr-x 2 www www 4096 Aug 6 20:14 cache -rwxr-xr-x 1 www www 5060 Aug 6 19:41 config.php drwxr-xr-x 4 root root 4096 Aug 6 14:46 includes -rwxr-xr-x 1 www www 48150 Aug 6 20:11 index.php drwxr-xr-x 3 root root 4096 Aug 6 14:24 js drwxr-xr-x 2 www www 4096 Aug 6 20:15 logs drwxr-xr-x 2 root root 4096 Aug 6 20:16 templates drwxr-xr-x 2 www www 4096 Aug 6 21:04 templates_c [root@yfw kefu]# <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>客服系统 - 登录页面</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; } .container { width: 100%; max-width: 500px; background: rgba(255, 255, 255, 0.95); border-radius: 15px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3); overflow: hidden; } .header { background: #2c3e50; color: white; padding: 25px 30px; text-align: center; position: relative; } .header h1 { font-size: 24px; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; } .header h1 i { font-size: 28px; } .content { padding: 30px; } .message-container { margin-bottom: 25px; padding: 15px; border-radius: 8px; display: flex; align-items: center; gap: 12px; font-size: 16px; } .info { background-color: #e3f2fd; color: #0d47a1; border-left: 4px solid #2196f3; } .success { background-color: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; } .error { background-color: #ffebee; color: #c62828; border-left: 4px solid #f44336; } .error-details { margin-top: 10px; padding: 10px; background: #fff; border-radius: 5px; border: 1px solid #ffcdd2; font-size: 14px; } .form-group { margin-bottom: 20px; } .form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #333; } .form-control { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 16px; transition: border-color 0.3s; } .form-control:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2); } .btn { display: block; width: 100%; padding: 14px; background: linear-gradient(to right, #3498db, #2980b9); color: white; border: none; border-radius: 8px; font-size: 18px; font-weight: 600; cursor: pointer; transition: all 0.3s; } .btn:hover { background: linear-gradient(to right, #2980b9, #2573a7); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); } .links-container { margin-top: 25px; padding-top: 20px; border-top: 1px solid #eee; } .links-container h3 { margin-bottom: 15px; color: #2c3e50; text-align: center; } .link-list { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; } .link-item { display: inline-block; padding: 10px 20px; background: #f8f9fa; border-radius: 30px; color: #3498db; text-decoration: none; font-weight: 500; transition: all 0.3s; border: 1px solid #e9ecef; } .link-item:hover { background: #3498db; color: white; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3); } .footer { text-align: center; padding: 20px; background: #f8f9fa; color: #6c757d; font-size: 14px; border-top: 1px solid #e9ecef; } @media (max-width: 576px) { .content { padding: 20px 15px; } .header { padding: 20px; } .link-list { flex-direction: column; align-items: center; } } </style> </head> <body> <div class="container"> <div class="header"> <h1><i class="icon">✓</i> 客服系统登录</h1> <p>请使用您的账号登录系统</p> </div> <div class="content"> <!-- 消息提示区域 - 修复了Smarty语法错误 --> <div class="message-container success"> <span class="icon">✓</span> <div class="message"> 登录成功!正在跳转到控制面板... </div> </div> <!-- 登录表单区域 - 修复了Smarty语法错误 --> <form id="loginForm"> <div class="form-group"> <label for="username">用户名</label> <input type="text" id="username" class="form-control" placeholder="请输入用户名" value="admin"> </div> <div class="form-group"> <label for="password">密码</label> <input type="password" id="password" class="form-control" placeholder="请输入密码" value="••••••"> </div> <button type="submit" class="btn">登录</button> </form> <!-- 链接区域 - 修复了Smarty语法错误 --> <div class="links-container"> <h3>快速链接</h3> <div class="link-list"> <a href="#" class="link-item">帮助中心</a> <a href="#" class="link-item">找回密码</a> <a href="#" class="link-item">用户注册</a> <a href="#" class="link-item">联系我们</a> </div> </div> </div> <div class="footer"> 客服系统 v2.5.1 © 2023 </div> </div> <script> // 模拟Smarty模板功能 document.getElementById('loginForm').addEventListener('submit', function(e) { e.preventDefault(); const username = document.getElementById('username').value; const password = document.getElementById('password').value; // 模拟不同消息类型 const messageContainer = document.querySelector('.message-container'); const messageIcon = messageContainer.querySelector('.icon'); const messageText = messageContainer.querySelector('.message'); if(username === 'admin' && password === 'password123') { messageContainer.className = 'message-container success'; messageIcon.textContent = '✓'; messageText.textContent = '登录成功!正在跳转到控制面板...'; } else { messageContainer.className = 'message-container error'; messageIcon.textContent = '✗'; messageText.innerHTML = '登录失败!用户名或密码错误<br><div class="error-details">错误详情:用户不存在或密码不匹配</div>'; } }); </script> </body> </html> 根据信息 请生成对应源文件完整版 全面兼容PHP5.3.29
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值