public function makeHtml($id, $path) { self::filter($path); $array = data::getData($path); $html = ''; $total = ''; foreach ($array as $k => $v) { if ($k) { $t = $id ? $id . '_' . $k : $k; $name = $v[0] !== '-' ? '<a href="javascript:;" id="a_' . $t . '" path="' . $path . '">' . $v[1] . '</a>' : $v[1]; if ($id) { $blank = ""; $b_count = count(explode("_", $id)); for ($i = 1; $i < $b_count; $i++) { $blank .= " "; } $name = $blank . $name; } $name = $id ? " " . $name : $name; $html .= "<div id='d_" . $t . "'>\n\t<span class='content' style='width:30px;text-align: center'><input type='checkbox' id='c_" . $t . "'/></span>\n\t<span class='content' style='width:680px;padding-left: 20px'>" . $name . "</span>\n\t<span class='content' style='width:150px'>" . $v[2] . "</span>\n\t<span class='content' style='width:80px;text-align: right'>" . $v[3] . "</span>\n</div>"; } else { $total_t = $id ? $id . "_total" : "total"; $total = "<div id='d_" . $total_t . "'>\n\t<span class='content' style='width:30px;text-align: center'></span>\n\t<span class='content' style='width:680px;padding-left: 20px'></span>\n\t<span class='content' style='width:150px'></span>\n\t<span class='content' style='width:80px;text-align: right'>总计:" . $v . "</span>\n</div>"; } } return $html . $total; }
function dataDropdown($name, $id, $currentValue, $sql) { include "test_lib_m.php"; $objThis_S = new data(); $q_data = $objThis_S->getData($sql = $sql); include "test_lib_v.php"; $objThis_V = new display(); $tmpX = $objThis_V->showBox($name = $name, $id = $id, $q_query = $q_data, $currentValue = $currentValue); return $tmpX; }