Viewing file: article.php (13.72 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? include 'index_Include.php'; $_SESSION['page'] = 'article.php';
if (isset($_GET[article_id])&&trim($_GET[article_id])) { $article_id = trim($_GET[article_id]); $article_SL = " SELECT * FROM article WHERE article_id = '$article_id'"; $article_QR = mysqli_query($con,$article_SL); $article = mysqli_fetch_array($article_QR); $article_name = $article[article_name]; ?> <!DOCTYPE html> <html lang='en'> <head> <title> <? echo $article[article_name]; ?> </title> <meta name="keywords" content=" <? echo $article[article_name]; ?>"> <meta name="description" content=" <? echo $article[article_detail]; ?> "> <meta name="author" content=" <? echo $article[article_name]; ?>"> <? include 'index_head.php'; ?>
<meta property="og:image" content="http://<? echo $fixed[fixed_website]; ?>/Files/article_photo/<? echo $article[article_photo]; ?>" /> <meta property="og:title" content="<? echo $article[article_name]; ?>" /> <meta property="og:description"content="<? echo $article[article_detail]; ?>"/> </head> <body> <? include 'index_navbar.php'; ?> <div style="background-color: #f0f0f0;"> <div class="container between20"> <div class="row"> <div class="col-md-12 text-center"> <span class="page-topic color1 "> <? echo $article[article_name]; ?> </span> </div> </div> </div> </div> <div class="container between20"> <div class="row"> <div class="col-md-8"> <div class="row margintop15"> <div class="col-md-12"> <img class="full " src="Files/article_photo/<?php echo $article[article_photo]; ?>" > <div class="text-right margintop15"> <a href="" class="btn btn-main " data-toggle="modal" data-target="#share_modal_article" > แชร์ </a> </div> <!-- share_modal_article --> <div id="share_modal_article" class="modal fade" role="dialog"> <div class="modal-dialog "> <div class="modal-content"> <form method="post"> <div class="modal-body text-center"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title color1 bold" > คุณต้องการแชร์ไปยัง</h4> <div class="row"> <div class="col-md-12"> <? $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?> <p class="size18"> <a style="padding: 4px 7px;" href="http://www.facebook.com/share.php?u=<? echo $actual_link; ?>" target="_blank" class="margintop10 btm-sm btn btn-primary"> <img src="Files/facebook.png" style="height: 17px; margin-top: -15px;margin-bottom: -12px;"> Facebook </a> <a style="padding: 4px 7px;" style="background-color: #008600;" href="http://lineit.line.me/share/ui?url=<? echo $actual_link; ?>" target="_blank" class="margintop10 btm-sm btn btn-success"> <img src="Files/linesocial.png" style="height: 17px; margin-top: -15px;margin-bottom: -12px;"> Line </a> <a style="padding: 4px 7px;" href="http://mail.google.com/mail/u/0/?view=cm&to&su=<? echo $product[product_name]; ?>&body=<? echo $actual_link; ?>" target="_blank" class="margintop10 btm-sm btn btn-danger"> <img src="Files/mail.png" style="height: 17px; margin-top: -15px;margin-bottom: -12px;"> Gmail </a> </p> </div> </div> </div> </form> </div> </div> </div> <!-- share_modal_article --> <p class="page-topic color1 margintop15"> <? echo $article[article_detail]; ?> </p> </div> </div>
<div class="row"> <div class="col-md-12 Review"> <?php echo $article[article_review]; ?> </div> </div> <div class="row "> <div class="col-md-12 top-margin3"> <? $Specification_SL = " SELECT * FROM Specification WHERE SpecificationCode = 'article_id$article[article_id]' ORDER BY SpecificationID ASC"; $Specification_QR = mysqli_query($con,$Specification_SL); while ($Specification = mysqli_fetch_array($Specification_QR)) { ?> <? if (isset($Specification[SpecificationPhoto])&&trim($Specification[SpecificationPhoto])!='') { ?> <div class="margintop30"> <img src="Files/SpecificationPhoto/<?php echo $Specification[SpecificationPhoto]; ?>" class="full" /> </div> <? } ?> <? if (isset($Specification[SpecificationReview])&&trim($Specification[SpecificationReview])!='') { ?> <div class="margintop30"> <?php echo $Specification[SpecificationReview]; ?> </div> <? } ?> <? if (isset($Specification[SpecificationYoutube])&&trim($Specification[SpecificationYoutube])!='') { ?> <div class="margintop30"> <div class="embed-responsive embed-responsive-16by9"> <iframe src="<?php echo $Specification['SpecificationYoutube']; ?>?rel=0&controls=0&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> </div> </div> <? } ?> <? if (isset($Specification[SpecificationFacebook])&&trim($Specification[SpecificationFacebook])!='') { ?> <div class="margintop30"> <div class="embed-responsive embed-responsive-16by9"> <iframe src="https://www.facebook.com/plugins/video.php?href=<?php echo $Specification['SpecificationFacebook']; ?>&show_text=0&width=269" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true"></iframe> </div> </div> <? } ?> <? } ?> </div> </div> <div class="row "> <? $article_picture_SL = " SELECT * FROM article_picture WHERE article_id = '$_SESSION[article_id]' ORDER BY article_picture_id ASC"; $article_picture_QR = mysqli_query($con,$article_picture_SL); $article_picture_Row = mysqli_num_rows($article_picture_QR);
if (isset($article_picture_Row)&&$article_picture_Row!=0) {
$article_picture_SL = " SELECT * FROM article_picture WHERE article_id = '$_SESSION[article_id]' ORDER BY article_picture_id ASC"; $article_picture_QR = mysqli_query($con,$article_picture_SL); $Ac_i=1; $article_pictureActive = 1; while ($article_picture = mysqli_fetch_array($article_picture_QR)) { ?> <div class="col-md-12 margintop30"> <img class="full" src="Files/article_picture_photo/<?php echo $article_picture[article_picture_photo]; ?>" > </div> <? } } ?> </div>
<div class="margintop15"> <div class="row"> <div class="col-md-12"> <p class="page-topic"> ข่าวและบทความอื่นๆ </p> </div> </div> <? $article_SL = " SELECT * FROM article WHERE article_id != '$article_id' ORDER BY RAND() LIMIT 2"; $article_QR = mysqli_query($con,$article_SL); $Ac_i=1; while ($article = mysqli_fetch_array($article_QR)) { if ($Ac_i==1) { ?> <div class="row"> <? } ?> <div class="col-md-8"> <? include 'index_panel_article.php'; ?> </div> <? if ($Ac_i==1) { $Ac_i=0; ?> </div> <? } $Ac_i++; } if ($Ac_i!=1) { echo "</div>"; } ?> </div>
</div> <!-- 9 --> <div class="col-md-4"> <div class="row"> <div class="col-md-12"> <? include 'index_search_right.php'; ?> <div class="row"> <div class="col-md-12 paddingbottom15"> <div class="col-md-12 boxsha"> <p class="font1 size20 margintop15"> สนใจสอบถามรายละเอียด </p> <? $social_SL = " SELECT * FROM social ORDER BY social_id ASC "; $social_QR = mysqli_query($con,$social_SL); while ($social = mysqli_fetch_array($social_QR)) { ?> <p class="hide1" title="<?php echo $social[social_name]; ?>"> <? if (isset($social[social_link])&&$social[social_link]!='') {
if ($social[social_type]=='Tel') { ?> <a style="text-align: left;" class="padding5 size17 text-black" href="tel:<?php echo $social[social_link]; ?>" target="_blank"> <? if (isset($social[social_photo])&&$social[social_photo]!='') { ?> <img style="max-height:28px;" src="Files/social_photo/<?php echo $social[social_photo]; ?>" /> <? } else{ echo $social[social_type]." : "; } ?> <?php echo $social[social_name]; ?> </a> <? } else{ ?> <a style="text-align: left;" class="padding5 size17 text-black" href="http://<?php echo $social[social_link]; ?>" target="_blank"> <? if (isset($social[social_photo])&&$social[social_photo]!='') { ?> <img style="max-height:28px;" src="Files/social_photo/<?php echo $social[social_photo]; ?>" /> <? } else{ echo $social[social_type]." : "; } ?> <?php echo $social[social_name]; ?> </a> <? } } else{ ?> <a style="text-align: left;" class="padding5 size17 text-black"> <? if (isset($social[social_photo])&&$social[social_photo]!='') { ?> <img style="max-height:28px;" src="Files/social_photo/<?php echo $social[social_photo]; ?>" /> <? } else{ echo $social[social_type]." : "; } ?> <?php echo $social[social_name]; ?> </a> <? } ?> </p> <? } ?> </div> </div> </div> </div> </div> </div> </div> <div class="row hidden-sm hidden-xs" > <div class="col-md-12"> <ul class="breadcrumb no-radius" style="margin-bottom: 0px;"> <li><a href="index.php">หน้าแรก</a></li> <li><a href="article.php"> ข่าวและบทความ </a></li> <li class="active"> <?php echo $article_name; ?> </li> </ul> </div> </div> </div> <!-- container --> <? include 'index_footer.php'; ?> </body> </html> <?
} else{
$Q = 1; $Row = "SELECT * FROM article ";
$RowQuery = mysqli_query($con,$Row); $Num_Rows = mysqli_num_rows($RowQuery);
$Per_page = 20; $page = $_GET["page"]; if(!$_GET["page"]){ $page=1; } $Prev_page = $page-1; $Next_page = $page+1; $page_Start = (($Per_page*$page)-$Per_page); if($Num_Rows<=$Per_page){ $Num_pages =1; } else if(($Num_Rows % $Per_page)==0){ $Num_pages =($Num_Rows/$Per_page) ; } else{ $Num_pages =($Num_Rows/$Per_page)+1; $Num_pages = (int)$Num_pages; }
$i=$page_Start+1;
$article_SL = $Row . " ORDER BY article_id DESC LIMIT $page_Start , $Per_page "; $article_QR = mysqli_query($con,$article_SL); ?>
<!DOCTYPE html> <html lang='en'> <head> <title> ข่าวและบทความ | <? echo $fixed[fixed_topic]; ?> | <? echo $fixed[fixed_website]; ?> </title> <meta name="description" content="<? echo $fixed[fixed_company]; ?> <? echo $fixed[fixed_topic]; ?>"> <meta name="keywords" content="ข่าวและบทความ - <? echo $fixed[fixed_topic]; ?>"> <meta name="author" content="<? echo $fixed[fixed_topic]; ?>"> <? include 'index_head.php'; ?> </head> <body> <? include 'index_navbar.php'; ?> <div style="background-color: #f0f0f0;"> <div class="container between20"> <div class="row"> <div class="col-md-12 text-center"> <span class="page-topic color1 "> ข่าวและบทความ <? if ($Num_Rows=='0') { echo " (ไม่พบข้อมูล)"; } else{ ?> <span class="size16 text-muted"> <? echo number_format($Num_Rows); ?> รายการ </span> <? } ?> </span> </div> </div> </div> </div> <div class="container between20"> <? $Ac_i = 1; while ($article = mysqli_fetch_array($article_QR)) { if ($Ac_i==1) { ?> <div class="row"> <?php } ?> <div class="col-md-6 col-xs-6"> <? include 'index_panel_article.php'; ?> </div> <?php if ($Ac_i==2) { $Ac_i=0; ?> </div> <? } $Ac_i++; } if ($Ac_i!=1) { echo "</div>"; } ?> <div class="row"> <div class="col-md-12 text-center"> <? include 'index_pagenum.php'; ?> </div> </div> <div class="row hidden-sm hidden-xs margintop30" > <div class="col-md-12"> <ul class="breadcrumb no-radius" style="margin-bottom: 0px;"> <li><a href="index.php">หน้าแรก</a></li> <li> <a onclick="goBack();" href="#"> กลับ </a> </li> <li class="active"> ข่าวและบทความ </li> </ul> </div> </div> </div> <? include 'index_footer.php'; ?> </body> </html> <? } ?>
|