$ret, 'fld' => $fld, 'res' => $res, 'max' => $max, 'fields' => $fields); } mb_http_output("EUC-JP"); header("Content-Type: text/html; charset=EUC-JP"); header("Expires: Thu, 01 Dec 1994 16:00:00 GMT"); header("Last-Modified: ". gmdate("D, d M Y H:i:s"). " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); $db_host = '192.168.61.222'; $db_port = '5432'; $db_name = 'picnic'; $db_accn = 'postgres'; $db_pass = ''; $db_com = sprintf( "host=%s port=%s dbname=%s user=%s password=%s", $db_host, $db_port, $db_name, $db_accn, $db_pass); $db = pg_connect($db_com); $day = date('Ymd'); $day_s = sprintf( '%s/%s/%s', substr($day,0,4),substr($day,4,2),substr($day,6,2)); $day_e = date( 'Y/m/d', mktime ( 0,0,0, substr($day,4,2),substr($day,6,2)+1, substr($day,0,4))); $qry = sprintf( "select * from temperature where '%s' <= time and time < '%s' order by time desc", $day_s, $day_e); // echo $qry; // exit; $table = queryCommon( $db, $qry ); $items = $table['items']; $data .= "\n"; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= ''; $data .= "\n"; $table_color = array('ffffff','eeeeee'); if(sizeof($items)) { for($i=0;$i\n", $table_color[$i%2], substr( $items[$i]['time'], 0, 16 ), $items[$i]['v1'], $items[$i]['v2'], trim($items[$i]['place'])); } } } $data .= '
日時温度湿度場所
%s%6.2f%6.2f%s
'; // // ヘッダー // $html_head = ' PIC NIC 実験ページ '; // // フッター // // $html_foot = '
PIC NIC 管理ページへ'; $html_foot.= ''; // // 出力 // print $html_head.$data.$html_foot; ?>