alert('ไม่สามารถแสดงข้อมูลนิตยสารดังกล่าว');history.back();"; }else{ echo ""; exit; } $role_staff=webpage_detail_func("role_member_staff"); $totalCol = 3; $pagename = 'magpreview'; if(isset($_SESSION['loginusername'])){ $magazineflag = webpage_detail_func("flag_magazine_show_member"); }else{ $magazineflag = webpage_detail_func("flag_magazine_show"); } $sql = "select magazineinfo.magInfoName, magazineinfo.magInfoId, magazine.magcount, magazine.magRemark, magazine.magStock from magazine right join magazineinfo on magazine.maginfoid = magazineinfo.maginfoid and magazineinfo.maginfoflag >= ".webpage_detail_func("flag_magazineinfo_show")." where "; if(isset($_SESSION['loginrole'])){ if($_SESSION['loginrole']<>$role_staff){ $sql = $sql."magazine.magflag > ".webpage_detail_func("flag_magazine_hide")." and magazine.magflag <= ".$magazineflag." and "; } } $sql = $sql."magazine.magid = ".$magid; $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']; $magcount = $row['magcount']; $magstock = $row['magStock']; $magremark = ''; if($maginfoid==509 || $maginfoid==510 || $maginfoid==511 || $maginfoid==512 || $maginfoid==513 || $maginfoid==514 || $maginfoid==516){ //ละคร เกมส์ออนไลน์ $magremark = ' '.stripslashes($row['magRemark']); } }else{ echo ""; exit; } $magazineinfonoshowgirl = "397|32|36|272|19|158|405|403|350|358|374|37|45|82|340|47|442|430|431|432|258|104|77|445|446|448|449|452|452|453|459|460|463|467|468|470|475|476|478|492|495|497|518|519|520|526|541|543|547|558|565|566|570|591|608|609|615|621|627|628|637|643|658|662|665|672|693|704|727|743|746|749|751|758|762|766|772|788|790|841|859|864|892|896|911|912|913|914|915|916|917|918|919|920|921|922|923|924|925|926|927"; $magazineinfonoshowguy = "42|284|156|437|288|363|118|427|183|406|402|274|241|308|335|325|313|76|251|115|51|53|57|130|123|42|50|40|43|257|444|46|128|483|498|499|515|525|534|563|564|569|579|604|620|623|629|635|644|649|659|661|664|685|687|706|740|747|768|775|780|784|789|802|819|822|823|824|869|876|880|883|887|907"; $magazineinfoguy = 0; $magazineinfogirl = 0; $magazineinfonoshowcheck = 1; $magazineinfonoshow = $magazineinfonoshowgirl; $tempInput = explode("|",$magazineinfonoshow); $countarray = sizeof($tempInput); for($i=0; $i<$countarray; $i++){ if($tempInput[$i] == $maginfoid){ $magazineinfonoshowcheck = 0; $magazineinfogirl = 1; break; } } $magazineinfonoshow = $magazineinfonoshowguy; $tempInput = explode("|",$magazineinfonoshow); $countarray = sizeof($tempInput); for($i=0; $i<$countarray; $i++){ if($tempInput[$i] == $maginfoid){ $magazineinfonoshowcheck = 0; $magazineinfoguy = 1; break; } } //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; ?>