Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
368 liveuser 1
<?php
2
 
3
/*
4
 
5
	QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2014~2026 MIN ZHI, CHEN
7
 
8
    This file is part of QBPWCF.
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
*/
24
 
25
#使用命名空間qbpwcf
26
namespace qbpwcf;
27
 
28
#assets dir
29
$assetsDir="assets of table::divAjax_20251110";
30
 
31
#函式說明:
32
#建立div表格,並具備翻頁功能,從ajax取得新資料.
33
#回傳結果:
34
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
35
#$result["error"],錯誤訊息.
36
#$result["function"],當前執行的函數名稱.
37
#$result["content"],表格的html內容.
38
#$result["argu"],使用的參數.
39
#$result["argued"],參數檢查後使用的參數.
40
#必填參數:
41
#$conf["dataUrl"],字串,取得資料的url.
42
$conf["dataUrl"]="assets of table::divAjax_20251110/index.php";
43
#可省略參數:
44
#$conf["defaulBorderStyleName"],字串,預設的表格框線css類別樣式名稱,預設為"__qbpwcf_border",樣式為{border:1px solid;}
45
#$conf["defaulBorderStyleName"]="__qbpwcf_border";
46
#$conf["id.table"],字串,table的id.
47
#$conf["id.table"]="tableId";
48
#$conf["class.table"],陣列,最外層div要套用的css類別樣式
49
#$conf["class.table"]=array();
50
#$conf["class.table.head"],陣列,表格標題最外層div要套用的css類別樣式
51
#$conf["class.table.head"]=array();
52
#$conf["class.table.head.th"],陣列,<th>要套用的css類別樣式
53
#$conf["class.table.head.th"]=array();
54
#$conf["class.table.head.th.td"],陣列,標題欄位內容標籤<td>要套用的css類別樣式
55
#$conf["class.table.head.th.td"]=array();
56
#$conf["class.table.body"],陣列,表格內容最外圍div要套用的css類別樣式
57
#$conf["class.table.body"]=array();
58
#$conf["class.table.body.tr"],陣列,<tr>要套用的css類別樣式
59
#$conf["class.table.body.tr"]=array();
60
#$conf["class.table.body.tr.odd"],陣列,奇數<tr>要套用的css類別樣式.
61
#$conf["class.table.body.tr.odd"]=array();
62
#$conf["class.table.body.tr.even"],陣列,偶數<tr>要套用的css類別樣式.
63
#$conf["class.table.body.tr.even"]=array();
64
#$conf["class.table.body.tr.td"],陣列,內容欄位標籤<td>要套用的css類別樣式
65
#$conf["class.table.body.tr.td"]=array();
66
#$conf["titleRow"],字串陣列,表格內個欄位的標題內容.
67
#$conf["titleRow"]=array();
68
#$conf["titleId"],字串,抬頭的id.
69
#$conf["titleId"]="titleId";
70
#參考資料:
71
#https://www.w3.org/Style/css2-updates/css2/tables.html
72
#備註:
73
#無.
74
$divAjax=table::divAjax($conf);
75
unset($conf);
76
 
77
#如果異常
78
if($divAjax["status"]==="false"){
79
 
80
	#函式說明:
81
	#撰寫log
82
	#回傳結果:
83
	#$result["status"],狀態,"true"或"false".
84
	#$result["error"],錯誤訊息陣列.
85
	#$result["function"],當前函式的名稱.
86
	#$result["argu"],使用的參數.
87
	#必填參數:
88
	#$conf["path"],字串,log檔案的路徑與名稱.
89
	$conf["path"]=$logFile;
90
	#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
91
	$conf["content"]=$divAjax;
92
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
93
	$conf["fileArgu"]=__FILE__;
94
	#可省略參數:
95
	#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
96
	#$conf["rewrite"]="false";
97
	#參考資料:
98
	#無.
99
	#備註:
100
	#無.
101
	$record=logs::record($conf);
102
	unset($conf);
103
 
104
	#如果寫log失敗
105
	if($record["status"]==="false"){
106
 
107
		#印出結果
108
		var_dump($record);
109
 
110
		}#if end
111
 
112
	#結束執行,回傳錯誤代碼1
113
	exit(1);
114
 
115
	}#if end
116
 
117
#印出 html 語法
118
echo $divAjax["content"];
119
 
120
?>