/var/www/hkosl.com/survey_demo/campaign.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
<?php
    
require_once('webadmin/basic_info.php');

    if (!isset(
$_GET["id"]) || (int)$_GET["id"] <= 0) {
        echo 
"<script type='text/javascript'>alert('Cannot find survey information.');</script>";
        exit;
    } else {
        
$id = (int)$_GET["id"];
        
$campaign get_campaign($id);
        
check_campaign_date($campaign);

        if(
$nowdate >= $campaign["start_date"] && $nowdate <= $campaign["end_date"]." 23:59:59"){
            
$_SESSION["id"] = $id;
        }
    }

?>

<!DOCTYPE html>
<html>
<head>
    <?php require_once('html_head.php'); ?>
</head>
<body>

<div class="container">
    <h1>
        <?php
            
foreach ($arraylangcode as $langcode => $langname) {
                if (!empty(
$campaign["name_" $langcode])) {
                    echo 
$campaign["name_" $langcode] . "<br>";
                }
            }
        
?>
    </h1>

    <div style="margin-top: 30px;">
        <?php
            
foreach ($arraylangcode as $langcode => $langname) {
                if (!empty(
$campaign["desc1_" $langcode])) {
                    echo 
$campaign["desc1_" $langcode] . "<br><br>";
                }
            }
        
?>
    </div>

    <?php
        
if($nowdate >= $campaign["start_date"] && $nowdate <= $campaign["end_date"]." 23:59:59"){
    
?>
    <div class="tc" style="margin-top: 50px;">
        <a href="survey_form.php?id=<?=$id?>">
            <div class="btn">進入問卷 Do Survey</div>
        </a>
    </div>
    <?php ?>
</div>

<?php require_once('html_footer.php'); ?>
</body>
</html>