alert('ไม่สามารถแสดงข้อมูลภาพโฆษณาดังกล่าว');history.back();"; }else{ echo ""; exit; } $totalCol = 5; $pagename = 'adpreview'; if(isset($_SESSION['loginusername'])){ $magazineflag = webpage_detail_func("flag_magazine_show_member"); $adflag = webpage_detail_func("flag_ad_show_member"); }else{ $magazineflag = webpage_detail_func("flag_magazine_show"); $adflag = webpage_detail_func("flag_ad_show"); } $sql = "select magazineinfo.magInfoName, magazineinfo.magInfoId, magazine.magId from magazine right join magazineinfo on magazine.maginfoid = magazineinfo.maginfoid and magazineinfo.maginfoflag >= ".webpage_detail_func("flag_magazineinfo_show")." right join advertise on magazine.magid = advertise.admagid where magazine.magflag > ".webpage_detail_func("flag_magazine_hide")." and magazine.magflag <= ".$magazineflag." and advertise.adflag > ".webpage_detail_func("flag_ad_hide")." and advertise.adflag <= ".$adflag." and advertise.adid = ".$adid; $result = select_data_func($sql); $totalRow = mysql_num_rows($result); if($totalRow>0){ $row = mysql_fetch_array($result); $magazineinfoname = stripslashes($row['magInfoName']); $maginfoid = $row['magInfoId']; $magid = $row['magId']; }else{ echo ""; exit; } //get book information for facebook og tag $sql_magazine_info = "select mi.*, ci.codeinfovalue as magInfoTypeName, c2.codeinfovalue as magInfoIssueName from magazineinfo mi left join codeinfo ci on mi.maginfotype = ci.codeinfokey and ci.codeinfotype = 'magtype' left join codeinfo c2 on mi.maginfoissue = c2.codeinfokey and c2.codeinfotype = 'magissue' where maginfoflag >= ".webpage_detail_func("flag_magazineinfo_show")." and maginfoid = ".$maginfoid; $result_magazine_info = select_data_func($sql_magazine_info); $row_magazine_info = mysql_fetch_array($result_magazine_info); $sql_magazine = "select * from magazine m right join cover c on m.magid = c.covmagid right join image i on c.covid = i.imgreferid and i.imgrefertype = 'CV' where m.magid = ".$magid ." order by i.imgrank"; $result_magazine = select_data_func($sql_magazine); $row_magazine = mysql_fetch_array($result_magazine); $magissuename = ''; $magissuename .= ''.$magazineinfoname.''; $magissuename .= ' vol. '.$row_magazine['magVolumn'].''; $magissuename .= ' no. '.$row_magazine['magNo'].''; $release_date = ' '.convert_monthEng_func(substr($row_magazine['magDate'],5,2)).' '.substr($row_magazine['magDate'],0,4); $magdate = $row_magazine['magDate']; $magimgpath = $row_magazine['imgPath']; $maginfoid = $row_magazine['magInfoId']; //echo $release_date; $magissuename .= $release_date; ?>