$smarty->assign("ps", $ps); $smarty->assign("psinfo", $psinfo); echo $smarty->fetch("list.html"); } else { $maps = map_list_get($_SESSION['uid']); $start = $_REQUEST['iDisplayStart']; $limit = $_REQUEST['iDisplayLength']; for ($i = $start; $i < $start + $limit; $i++) { if (isset($maps[$i])) { $result_map[] = $maps[$i]; } } $response['sEcho'] = $_REQUEST['sEcho']; $response['iTotalRecords'] = count($maps); $response['iTotalDisplayRecords'] = count($maps); $response['aaData'] = create_rows($result_map, $start); //print_r($_REQUEST); exit(json_encode($response)); } function create_rows($maps, $startsn = 0) { global $TWMAP3URL; for ($i = 0; $i < count($maps); $i++) { if ($maps[$i]['gpx'] == 1) { // 產生瀏覽連結 $gpx = sprintf("<span id='icon_mapshow' onclick=\"map_action('mapshow','%s?goto=%d,%d&show_kml_layer=1')\"></span>", $TWMAP3URL, $maps[$i]['locX'] + $maps[$i]['shiftX'] * 500, $maps[$i]['locY'] - $maps[$i]['shiftY'] * 500); } else { $gpx = ""; } $rows[$i]['sn'] = $i + 1 + $startsn; $rows[$i]['date'] = preg_replace("#\\.\\d+\$#", "", $maps[$i]['cdate']);
function create_bond($isins) { create_rows('creso_obbligazioni', 'isin', $isins); }