tpl_columnar_display.php

本文介绍了一个用于生成表格输出的PHP模板文件,该文件可以根据提供的单元格内容数组动态生成表格结构。此模板适用于需要展示列表或表格数据的场景,并支持自定义单元格参数。

<?php
/**
* Common Template - tpl_columnar_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-2006 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_columnar_display.php 3157 2006-03-10 23:24:22Z drbyte $
*/

?>
<?php
if ($title) {
?>
<?php echo $title; ?>
<?php
}
?>
<?php
if (is_array($list_box_contents) > 0 ) {


for($row=0;$row<sizeof($list_box_contents);$row++) {
$params = "";
//if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params'];
?>

<?php

$test = sizeof($list_box_contents[$row]);


for($col=0;$col<sizeof($list_box_contents[$row]);$col++) {
$r_params = "";
if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params'];
if (isset($list_box_contents[$row][$col]['text'])) {
?>

<?php echo '<div' . $r_params . '>' . $list_box_contents[$row][$col]['text'] . '</div>' . "\n"; ?>
<?php
}
}
?>
<br class="clearBoth" />
<?php
}
}
?>

with user_passed_exams as ( -- 查询技术复核类型的考试信息 select '技术复核' as exam_type, t.user_id, t.emp_num, t.exam_code, t.exam_name, -- 子查询:计算当前考试类型下有效的考试总数 (select count(1) from tpl_lookup_item_t li where li.classify_code = 'INTERVIEW_EXAM_INFO' and li.status = '1' and li.item_attr2 = '有效' and instr(li.item_attr4, '技术复核') > 0) as required_count from omp_exam_record_t t left join tpl_lookup_item_t li on li.classify_code = 'INTERVIEW_EXAM_INFO' and li.status = '1' and li.item_code = t.exam_code where t.is_pass = '1' and instr(li.item_attr4, '技术复核') > 0 and t.user_id is not null group by t.user_id, emp_num, t.exam_code, t.exam_name union all -- 查询综合复核类型的考试信息 select '综合复核' as exam_type, t.user_id, t.emp_num, t.exam_code, t.exam_name, -- 子查询:计算当前考试类型下有效的考试总数 (select count(1) from tpl_lookup_item_t li where li.classify_code = 'INTERVIEW_EXAM_INFO' and li.status = '1' and li.item_attr2 = '有效' and instr(li.item_attr4, '综合复核') > 0) as required_count from omp_exam_record_t t left join tpl_lookup_item_t li on li.classify_code = 'INTERVIEW_EXAM_INFO' and li.status = '1' and li.item_code = t.exam_code where t.is_pass = '1' and instr(li.item_attr4, '综合复核') > 0 and t.user_id is not null group by t.user_id, emp_num, t.exam_code, t.exam_name), -- 对每个用户在每种考试类型下的通过考试数量进行统计 -- 并聚合通过的考试编码和名称 user_passed_count as (select user_id, emp_num, exam_type, count(*) as passed_count, required_count, listagg(exam_code, ',') within group (order by exam_code) as passed_exam_codes, listagg(exam_name, ',') within group (order by exam_code) as passed_exam_names from user_passed_exams group by user_id, emp_num, exam_type, required_count), -- 判断用户是否已全部通过所需考试,并标记状态(pass_status) user_pass_status as (select upc.exam_type, upc.user_id, upc.emp_num, upc.passed_count, upc.required_count, case when upc.passed_count >= upc.required_count then '已全部通过' else '未全部通过' end as pass_status, upc.passed_exam_codes, upc.passed_exam_names from user_passed_count upc where (upc.user_id, upc.exam_type) in ( -- 子查询:筛选出因未通过考试而被自动失效的用户记录 select log.user_id as userid, log.interview_type as interviewtype from omp_emp_reviewer_log_t log where log.operate_type like '%自动失效%' and log.operate_cause like '%复核官没有通过考试或者没有参加考试,系统自动失效资质%' and (log.user_id, log.interview_type) in ( -- 子查询:获取维护状态为“失效”的复核人员信息 select a.user_id as userid, a.interview_type as interviewtype from omp_emp_reviewer_pool_t a where a.vindicate_type = '失效') order by log.creation_date desc)), -- 筛选出两种考试类型都已通过的用户 user_pass_exit as (select a.user_id, (select t1.lname from tpl_user_t t1 where t1.lname like concat('%',a.emp_num,'%')) as w3name, a.emp_num, a.exam_type, a.passed_count, a.required_count, a.pass_status, a.passed_exam_codes, a.passed_exam_names, g.full_name_zh as deptname, org_v.l1_org_name as bg, org_v.l2_org_name as bu, org_v.l3_org_name as pdu, org_v.l4_org_name as develop, (select t1.lname from tpl_user_t t1 where t1.user_id = b.created_by) as created_by, (select t2.lname from tpl_user_t t2 where t2.user_id = b.last_updated_by) as last_updated_by from user_pass_status a left join omp_emp_reviewer_pool_t b on a.user_id = b.user_id and a.exam_type = b.interview_type and b.vindicate_type = '失效' left join omp_local_org_t org_v on org_v.id = b.local_org_id left join omp_org_t g on g.org_code = b.dept_id and g.is_vaild = 'Y' where pass_status = '已全部通过') -- 最终查询:筛选出两种考试类型都已通过的用户 select * from user_pass_exit; 上述SQL中的tpl_user_t 是子查询,是否可以优化下
08-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值