/**
* Function data_box
* Function: Output the content in the data source according to the template
* Parameter
* $fun callback function, must be provided. Its function is to read data from the data source. The best thing to return is an associative array
* $source data source, must be provided. Can be an array or query result
* $template template, optional. Use standard tables to output data when no template is provided
* Template format:
* array(top=>"",block=>"",fool=>"")
* Among them:
* top beginning part
* The repeatable part of block, the variable is the key of the associative array, in the form of $IN_varname. The leading IN_ can be omitted
* end of fool
*/
function data_box($_fun,$_source,$_template="") {
$_ar = $_fun(&$_source);
if($_template == "") {
while(list($k,) = each($_ar)) {
$th .= "$k";
$td .= "$IN_$k";
}
$_template = array(top=>"$th",block=>"$td",fool=>"