/var/www/hkosl.com/thebh/20161004/include/header.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
    
require_once '../webadmin/configure.php';

    
date_default_timezone_set('Asia/Hong_Kong');

    
$today date("Y-m-d");

    
$siteinfo SiteInfo::first();
    
$promotions Popup::whereRaw("deleted=? and status=? and datefrom<=? and dateto>=?", array(01$today$today))->orderBy('popup_id''ASC')->get();
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title><?= _h($siteinfo['companyname_tc']) ?> - <?= $page_settings['section'?></title>
    
    <link rel="shortcut icon" href="../images/headLogo.jpg">

    <script type="text/javascript">
        function closePopup(){
            request = $.ajax({
                url: "../include/session.php",
                type: "POST",
                data: ''
            });

            request.done(function (response, textStatus, jqXHR){
                //alert("work");
            });

            request.fail(function (jqXHR, textStatus, errorThrown){
                console.error(
                    "The following error occured: "+
                    textStatus, errorThrown
                );
            });
        }
    </script>
    <!-- <script src="../js/masonry.pkgd.js"></script> -->
</head>

<body>
    
    <div class="topNewsBar">
        <button id="TopNews" style="display:none;">Toggle</button>
        <p id="promotion">
            <button class="TopCloseBTN" id="closeBTN" onclick="closePopup()">&times;</button>
            <?php
            $num_rows 
count($promotions);
            
$counter 0;
            foreach (
$promotions as $promotion) { 
                echo 
nl2br($promotion["popupdesc_tc"]);

                
$counter++;
                if (
$counter != $num_rows)
                    echo 
"<br/>";
            } 

            if ((
$num_rows != 0) && (!isset($_SESSION['popup']))){
                echo 
'<script>';
                echo 
'    window.onload = function(){';
                echo 
'       document.getElementById("TopNews").click();';
                echo 
'    }';
                echo 
'</script>';
            }
            
?>

            <button class="TopCloseTxtBTN" id="closeTxtBTN" onclick="closePopup()">關閉</button>
        </p>
    </div>


    <div class="SocialMedia">
      <div class="container">
        <div class="media">
          <a href="<?= _h($siteinfo['facebook']) ?>" target="_blank"><img src="../images/media/facebook.png"></a>
          <a href="https://lhgroupmember.onesolution.hk/" target="_blank"><img src="../images/media/person.png"></a>
          <a href="http://www.lhg.com.hk/TimD" target="_blank">相關網頁</a>
        </div>  
      </div>  
    </div>