function getSingleWavInfo($single = true) { saveWavInfo(); $dateTime = strtotime(date('Y-m-d')); $sql_select = 'SELECT u.user_id,u.user_name,w.number_info,w.time_info FROM ' . $GLOBALS['ecs']->table('wavtime') . ' w, ' . $GLOBALS['ecs']->table('admin_user') . " u WHERE w.admin_id=u.user_id AND w.update_time={$dateTime}"; if ($single) { $sql_select .= " AND u.user_id={$_SESSION['admin_id']}"; $result = $GLOBALS['db']->getRow($sql_select); if (empty($result)) { return false; } $result['time_info'] = round($result['time_info'] / 60); } else { $info = $GLOBALS['db']->getAll($sql_select); $result = array(); foreach ($info as &$val) { $val['time_info'] = round($val['time_info'] / 60); $result[$val['user_name']] = $val; } } return $result; }
<?php define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; include 'includes/lib_wav.php'; saveWavInfo();