<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <?php 
  if(strpos($_SERVER['REQUEST_URI'], "/event/")!==false):
  $eid = explode("/event/", $_SERVER['REQUEST_URI'])[1];
  $get_url = "https://inbots.io/ttt/api/public/api/events/".$eid;
  $event = @file_get_contents($get_url);
  $event_name = $event ? json_decode($event)->data->fields->default->title : false;
  $event_name = preg_replace("/\"/", "\\\"", $event_name);
  $event_desc = $event ? (json_decode($event)->data->fields->default->description ?? false) : false;
  if($event_desc){
    $event_desc = preg_replace("/<.*?>/", "", $event_desc);
    $event_desc = preg_replace("/\"/", "\\\"", $event_desc);
    if(strlen($event_desc) > 180){
      $event_desc = substr($event_desc, 0, 150) . "⋯";
    }
  }
  $event_image = $event ? json_decode($event)->data->fields->default->image_url : false;
  
  $event_start_date = $event ? json_decode($event)->data->start_date : false;
  $event_end_date = $event ? json_decode($event)->data->end_date : false;
  $event_venue = $event ? json_decode($event)->data->fields->default->venue : false;
  $event_venue = preg_replace("/\"/", "\\\"", $event_venue);
  $event_address = $event ? json_decode($event)->data->fields->default->address : false;
  $event_address = preg_replace("/\"/", "\\\"", $event_address);
  
  $event_tickets = $event ? json_decode($event)->data->tickets : [];

  $organizer_name = $event ? json_decode($event)->data->organizer->fields->default->title : false;
  $organizer_name = preg_replace("/\"/", "\\\"", $organizer_name);
  $organizer_email = $event ? json_decode($event)->data->organizer->email : false;
  $organizer_phone = $event ? preg_replace('/,/','',(json_decode($event)->data->organizer->phone)) : false;
  $organizer_logo = $event ? json_decode($event)->data->organizer->picture_url : false;
  $organizer_url_string = $event ? json_decode($event)->data->organizer->url_string : false;
?>
  <title><?=$event_name;?></title>
  <meta property="og:title" content="<?=$event_name?$event_name:'1TICKS - 活動行銷就係1TICKS咁簡單';?>" />
  <meta name="twitter:title" content="<?=$event_name?$event_name:'1TICKS - 活動行銷就係1TICKS咁簡單';?>" />
  <meta name="description" content="<?=$event_desc?$event_desc:'在1TICKS上創建活動、處理票務及活動行銷比你想像中更容易，由網上宣傳、活動登記、電子門票入場都可以1TICKS過完成！舉辦不收費活動更可免費使用，讓你不費分毫即可將活動達至最大曝光。';?>" />
  <meta property="og:description" content="<?=$event_desc?$event_desc:'在1TICKS上創建活動、處理票務及活動行銷比你想像中更容易，由網上宣傳、活動登記、電子門票入場都可以1TICKS過完成！舉辦不收費活動更可免費使用，讓你不費分毫即可將活動達至最大曝光。';?>" />
  <meta name="twitter:description" content="<?=$event_desc?$event_desc:'在1TICKS上創建活動、處理票務及活動行銷比你想像中更容易，由網上宣傳、活動登記、電子門票入場都可以1TICKS過完成！舉辦不收費活動更可免費使用，讓你不費分毫即可將活動達至最大曝光。';?>" />
  <meta property="og:image" content="<?=$event_image?$event_image:'https://www.signhub.io/ticktactoe/staging/static/preview.png';?>" />
  <meta name="twitter:image" content="<?=$event_image?$event_image:'https://www.signhub.io/ticktactoe/staging/static/preview.png';?>" />
  <meta property="og:url" content="https://www.signhub.io/ticktactoe/staging/event/<?=$eid;?>" />
  <script type=application/ld+json>{
    "@context": "https://www.schema.org",
    "@type": "Event",
    "name": "<?=$event_name;?>",
    "image": "<?=$event_image;?>",
    "url": "https://www.signhub.io/ticktactoe/staging/event/<?=$eid;?>",
    "description": "<?=$event_desc;?>",
    "startDate": "<?=$event_start_date;?>",
    "endDate": "<?=$event_end_date;?>",
    "location": {
      "@type" : "Place",
      "name" : "<?=$event_venue;?>",
      "address" : "<?=$event_address;?>"
    },
    "offers": [
    <?php for($i = 0; $i < count($event_tickets); $i++):?>
      {
        "@type": "Offer",
        "name": "<?=preg_replace("/\"/", "\\\"", $event_tickets[$i]->fields->default->title);?>",
        "price": <?=$event_tickets[$i]->price;?>,
        "priceCurrency": "<?=$event_tickets[$i]->currency;?>",
        "url": "https://1ticks.com/event/<?=$eid;?>",
        "availability": "<?=($event_tickets[$i]->remainder>0)?'http://schema.org/InStock':'https://schema.org/SoldOut';?>",
        "priceValidUntil": "<?=!empty($event_tickets[$i]->active_end_date)?$event_tickets[$i]->active_end_date:$event_end_date;?>",
        "validFrom": "<?=!empty($event_tickets[$i]->active_start_date)?$event_tickets[$i]->active_start_date:$event_start_date;?>"
      }
      <?php if($i<(count($event_tickets)-1)):?>,<?php endif;?>
    <?php endfor;?>
    ],
    "organizer": {
      "@type": "Organization",
      "name": "<?=$organizer_name;?>",
      "email": "<?=$organizer_email;?>",
      "phone": "<?=$organizer_phone;?>",
      "logo": "<?=$organizer_logo;?>",
      "url": "https://www.signhub.io/ticktactoe/staging/organizer/<?=$organizer_url_string;?>"
    }
  }</script>
<?php else:
  if(strpos($_SERVER['REQUEST_URI'], "/403")!==false){http_response_code(403);}
  if(strpos($_SERVER['REQUEST_URI'], "/404")!==false){http_response_code(404);}
  if(strpos($_SERVER['REQUEST_URI'], "/500")!==false){http_response_code(500);}
?>
  <title>1TICKS - 活動行銷就係1TICKS咁簡單</title>
  <meta property="og:title" content="1TICKS - 活動行銷就係1TICKS咁簡單" />
  <meta name="twitter:title" content="1TICKS - 活動行銷就係1TICKS咁簡單" />
  <meta name="description" content="在1TICKS上創建活動、處理票務及活動行銷比你想像中更容易，由網上宣傳、活動登記、電子門票入場都可以1TICKS過完成！舉辦不收費活動更可免費使用，讓你不費分毫即可將活動達至最大曝光。">
  <meta property="og:description" content="在1TICKS上創建活動、處理票務及活動行銷比你想像中更容易，由網上宣傳、活動登記、電子門票入場都可以1TICKS過完成！舉辦不收費活動更可免費使用，讓你不費分毫即可將活動達至最大曝光。" />
  <meta name="twitter:description" content="在1TICKS上創建活動、處理票務及活動行銷比你想像中更容易，由網上宣傳、活動登記、電子門票入場都可以1TICKS過完成！舉辦不收費活動更可免費使用，讓你不費分毫即可將活動達至最大曝光。" />
  <meta property="og:image" content="https://www.signhub.io/ticktactoe/staging/static/preview.png" />
  <meta name="twitter:image" content="https://www.signhub.io/ticktactoe/staging/static/preview.png" />
  <meta property="og:url" content="https://www.signhub.io/ticktactoe/staging/" />
<?php endif;?>

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5, user-scalable=no, minimal-ui">
    <meta name="keywords" content="1ticks,ticketing,ticketing tools,event ticketing,free ticketing system,event promotion,MacauTicket,kktix,juven,澳門售票,售票網,廣星,售票平台,舉辦活動,免費舉辦活動,活動推廣,活動行銷,宣傳活動">
    <meta name="robots" content="index,follow">
    <link rel="sitemap" href="/ticktactoe/staging/sitemap.xml" type="application/xml">
    
    <link rel="shortcut icon" href="/ticktactoe/staging/favicon.ico" type="image/x-icon">
    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
    <!-- <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Noto+Sans+SC:300,400,500,700|Noto+Sans+TC:300,400,500,700&amp;display=swap&amp;subset=chinese-simplified,chinese-traditional" rel="stylesheet"> -->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons"rel="stylesheet">
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="apple-mobile-web-app-title" content="1TICKS">
    <link rel="apple-touch-icon" href="https://www.signhub.io/ticktactoe/staging/static/apple-icons-150.png">
    

    <meta property="og:type" content="website" />
    <meta property="og:site_name" content="1TICKS" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:site" content="@1TICKS" />
    <!-- <script async defer src="https://www.google.com/recaptcha/api.js"></script> -->

    <!-- Google Tag Manager -->
    <script>
      var dataLayer = dataLayer || [];
      var ga = function(){};
      window.dataLayer.push({
        originalLocation: document.location.protocol + '//' +
                          document.location.hostname +
                          document.location.pathname +
                          document.location.search
      });
    </script>
    
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl+ '&gtm_auth=8IeIuZV3TKLxZF7lye_7gQ&gtm_preview=env-7&gtm_cookies_win=x';f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-WJMGSW3');</script>
    <!-- End Google Tag Manager -->
     
    <!-- Stripe -->
    <script async defer src="https://js.stripe.com/v3/"></script>
    <!-- End Stripe -->

    <!-- Facebook -->
    <script>
      var FB = undefined;
      // var fbq = function(){};
      (function(d, s, id){
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) {return;}
        js = d.createElement(s); js.id = id;
        js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.3";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));
    </script>
    <!-- End Facebook -->
    <!-- Facebook Pixel Code -->
    <script>
    !function(f,b,e,v,n,t,s)
    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s)}(window,document,'script',
    'https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', "2701598046523398"); 
    </script>
    <noscript>
    <img height="1" width="1" 
    src="https://www.facebook.com/tr?id=2701598046523398&ev=PageView
    &noscript=1"/>
    </noscript>
    <!-- End Facebook Pixel Code -->
    <!-- polyfill (IE only) -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script>
    <script>
      if (!String.prototype.padStart) {
        String.prototype.padStart = function padStart(targetLength,padString) {
          targetLength = targetLength>>0; //truncate if number or convert non-number to 0;
          padString = String((typeof padString !== 'undefined' ? padString : ' '));
          if (this.length > targetLength) {
            return String(this);
          }
          else {
            targetLength = targetLength-this.length;
            if (targetLength > padString.length) {
              padString += padString.repeat(targetLength/padString.length); //append to original to ensure we are longer than needed
            }
            return padString.slice(0,targetLength) + String(this);
          }
        };
      }
    </script>
    <!-- End polyfill (IE only) -->
  <link href="/ticktactoe/staging/group-routes.js" rel="prefetch"><link href="/ticktactoe/staging/group-user.js" rel="prefetch"><link href="/ticktactoe/staging/app.js" rel="preload" as="script"></head>
  <body>
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WJMGSW3&gtm_auth=8IeIuZV3TKLxZF7lye_7gQ&gtm_preview=env-7&gtm_cookies_win=x"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    <noscript>
      <strong>We're sorry but 1ticks doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
  <script type="text/javascript" src="/ticktactoe/staging/app.js"></script></body>
</html>
