require_once('../prepare4static.php');
function index( $p )
{
if(!empty($p['id'])){
$dir_name = $p['id'];
}else{
$dir_name = "rice";
}
if(!empty($p['fid'])){
$file_name = $p['fid'];
}else{
$file_name = "1";
}
$read_file = sprintf('/home/www/public/special/%s/html/%s.html',$dir_name,$file_name);
if(!file_exists($read_file)){
print "File is none in common directory 'html' !
";
}
switch($p['version']){
case "1":
if("i" == $p['carrier'] && preg_match("/505/i",$p['agent']) || preg_match("/506/i",$p['agent']))
{
$tmp_path = sprintf('/home/www/public/special/%s/html_%s2/%s.html',$dir_name,$p['carrier'],$file_name);
if(file_exists($tmp_path)){
$read_file = $tmp_path;
}
}
else
{
$tmp_path = sprintf('/home/www/public/special/%s/html_%s%s/%s.html',$dir_name,$p['carrier'],$p['version'],$file_name);
if(file_exists($tmp_path)){
$read_file = $tmp_path;
}
}
break;
case "2":
if("i" == $p['carrier'])
{
$tmp_path = sprintf('/home/www/public/special/%s/html_%s3/%s.html',$dir_name,$p['carrier'],$file_name);
if(file_exists($tmp_path)){
$read_file = $tmp_path;
}
}
else
{
$tmp_path = sprintf('/home/www/public/special/%s/html_%s%s/%s.html',$dir_name,$p['carrier'],$p['version'],$file_name);
if(file_exists($tmp_path)){
$read_file = $tmp_path;
}
}
break;
case "3":
$tmp_path = sprintf('/home/www/public/special/%s/html_%s%s/%s.html',$dir_name,$p['carrier'],$p['version'],$file_name);
if(file_exists($tmp_path)){
$read_file = $tmp_path;
}
break;
default:
//2の用途が不明なので下位機種を見るように変更
//$tmp_path = sprintf('/home/www/public/special/%s/html_i2/%s.html',$dir_name,$file_name);
$tmp_path = sprintf('/home/www/public/special/%s/html_i1/%s.html',$dir_name,$file_name);
if(file_exists($tmp_path)){
$read_file = $tmp_path;
}
break;
}
if(DEBUG_MODE){print "read -> ".$read_file."
";}
if(file_exists($read_file)){
require_once($read_file);
exit;
}
/*
$template =& loadTemplate( $p );
$template->setVariable('site_top',SITE_NAME);
$template->show();
*/
}
index( $p );
?>