='$now' and open='t' order by tdate desc";
// 最新情報データ抽出 --------------------------//
function get_freshnews ($sql) {
$result = pg_exec($sql);
if($result) {
$index = pg_numrows($result);
if($index) {
for($i=0;$i<$index;$i++) {
$row[$i] = pg_fetch_row($result,$i);
}
}
pg_freeresult($result);
} else {
echo("$sql の実行に失敗しました\n");
exit;
}
return $row;
}
//----------------------------------------------//
// ショップ情報抽出 ------------------------------//
function get_shop ($var) {
$sql = "select * from shopinfo where shopid='$var'";
$result = pg_exec($sql);
if($result) {
$rtn = pg_fetch_row($result,0);
pg_freeresult($result);
return $rtn;
} else {
echo("$sql の実行に失敗しました\n");
exit;
}
}
//----------------------------------------------//
// ジャンル名抽出 ------------------------------//
function get_genre ($var) {
$sql = "select name from genre where gid='$var'";
$result = pg_exec($sql);
if($result) {
$rtn = pg_result($result,0,0);
return $rtn;
pg_freeresult($result);
} else {
echo("$sql の実行に失敗しました\n");
exit;
}
}
//----------------------------------------------//
// ショップIDチェック --------------------------//
function check_shopid ($var) {
$sql = "select shopid from shopinfo where shopid='$var'";
$result = pg_exec($sql);
if($result) {
$row = pg_numrows($result);
if($row) {
return "true";
} else {
return "false";
}
pg_freeresult($result);
} else {
echo("$sql の実行に失敗しました\n");
exit;
}
}
//----------------------------------------------//
$dbcon = new DbConnect("$dbname","$dbport","5432","$dbuser","$dbpass"); // 接続 -------
if(check_shopid($shopid) == "false") {
header("Location: http://www.atc-mare.com/shop/list_category.html");
exit;
}
$row = get_freshnews($sql);
$shop = get_shop($shopid);
$pict_names = "names" . $shop[3] . ".gif";
$pict_cates = "catepicts_" . $shop[3] . ".gif";
$pict_floor = "floorl_" . $shop[4] . "f.gif";
$pict_upper = "../$shop[5]/img/name_l.gif";
$pict_lower = "../$shop[5]/img/name_s.gif";
$backto = "../$shop[5]/index.html";
?>
最新情報: