52 $table_attr =
'border="1"';
56 $cols = $cols_count = 3;
65 if (!isset($params[
'loop'])) {
66 trigger_error(
"html_table: missing 'loop' parameter",E_USER_WARNING);
70 foreach ($params as $_key => $_value) {
73 $$_key = (array)$_value;
77 if (is_array($_value) && !empty($_value)) {
79 $cols_count = count($_value);
80 }
elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {
81 $cols = explode(
',', $_value);
82 $cols_count = count($cols);
83 }
elseif (!empty($_value)) {
84 $cols_count = (int)$_value;
91 $$_key = (int)$_value;
100 $$_key = (string)$_value;
111 $loop_count = count($loop);
112 if (empty($params[
'rows'])) {
114 $rows = ceil($loop_count / $cols_count);
115 }
elseif (empty($params[
'cols'])) {
116 if (!empty($params[
'rows'])) {
118 $cols_count = ceil($loop_count / $rows);
122 $output =
"<table $table_attr>\n";
124 if (!empty($caption)) {
125 $output .=
'<caption>' . $caption .
"</caption>\n";
128 if (is_array($cols)) {
129 $cols = ($hdir ==
'right') ? $cols : array_reverse($cols);
132 for ($r = 0; $r < $cols_count; $r++) {
141 for ($r = 0; $r < $rows; $r++) {
143 $rx = ($vdir ==
'down') ? $r * $cols_count : ($rows-1 - $r) * $cols_count;
145 for ($c = 0; $c < $cols_count; $c++) {
146 $x = ($hdir ==
'right') ? $rx + $c : $rx + $cols_count-1 - $c;
147 if ($inner !=
'cols') {
149 $x = floor($x / $cols_count) + ($x % $cols_count) * $rows;
152 if ($x < $loop_count) {
168 if (!is_array($var)) {
171 $ret = $var[$no % count($var)];
174 return ($ret) ?
' ' . $ret :
'';
smarty_function_html_table_cycle($name, $var, $no)
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
smarty_function_html_table($params, $template)
Smarty {html_table} function plugin.