{"id":20838,"date":"2023-02-09T13:12:15","date_gmt":"2023-02-09T05:12:15","guid":{"rendered":"https:\/\/flowtaipei.com\/?page_id=20838"},"modified":"2023-02-09T13:16:18","modified_gmt":"2023-02-09T05:16:18","slug":"my-gifts","status":"publish","type":"page","link":"https:\/\/flowtaipei.com\/en\/my-gifts\/","title":{"rendered":"Gifts"},"content":{"rendered":"<p style=\"text-align: center;\">    <link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-EVSTQN3\/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">\r\n    <link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery-confirm\/3.3.2\/jquery-confirm.min.css\">\r\n\r\n    <script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.5.1\/jquery.min.js\"><\/script>\r\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/js\/bootstrap.bundle.min.js\" integrity=\"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn\/tWtIaxVXM\" crossorigin=\"anonymous\"><\/script>\r\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery-confirm\/3.3.2\/jquery-confirm.min.js\"><\/script>\r\n\r\n\r\n\r\n    <div id=\"CurrentUserHeaderHolder\" style=\"text-align:center;margin-right:auto;margin-left: auto;\"><\/div>\r\n    <script>\r\n\r\n\r\n        $(document).ready(function(){\r\n            LoadCurrentUserHeader();\r\n        });\r\n\r\n        function LoadCurrentUserHeader(){\r\n\r\n            var currentuserheader=-1;\r\n            $('#CurrentUserHeaderHolder').load('https:\/\/flowtaipei.com\/php\/functions.php', { currentuserheader : currentuserheader, language: ''  });\r\n\r\n        }\r\n\r\n    <\/script>\r\n\r\n\r\n\r\n<script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.5.1\/jquery.min.js\"><\/script>\r\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.2\/dist\/js\/bootstrap.bundle.min.js\" integrity=\"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn\/tWtIaxVXM\" crossorigin=\"anonymous\"><\/script>\r\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery-confirm\/3.3.2\/jquery-confirm.min.js\"><\/script>\r\n\r\n\r\n\r\n\r\n\r\n\r\n    <div class='table w-auto text-nowrap' style=\"overflow-x:auto;width:100%\">\r\n        <h4>\u6211\u8cb7\u4e86\u7684\u79ae\u7269 Gifts I bought<\/h4>\r\n\r\n<table class=\"table table-striped table-responsive\"\">\r\n    <tr style=\"text-align: center;\">\r\n        <th style=\"text-align: center;\">Purchase Date<\/th>\r\n        <th style=\"text-align: center;\">OrderID<\/th>\r\n        <th style=\"text-align: center;\">Gift<\/th>\r\n        <th style=\"text-align: center;\">Receiver<\/th>\r\n        <th style=\"text-align: center;\">Redeemed<\/th>\r\n        <th style=\"text-align: center;\">Gift Code<\/th>\r\n        <th style=\"text-align: center;\"><\/th>\r\n        <th style=\"text-align: center;\"><\/th>\r\n    <\/tr>\r\n\r\n\r\n<\/table>\r\n    <\/div>\r\n\r\n    <input type=\"hidden\" id=\"sendgiftcode\" name=\"sendgiftcode\" value=\"0\">\r\n    <input type=\"hidden\" id=\"sendgiftproductid\" name=\"sendgiftproductid\" value=\"0\">\r\n    <input type=\"hidden\" id=\"sendgiftname\" name=\"sendgiftname\" value=\"0\">\r\n    <input type=\"hidden\" id=\"senderemail\" name=\"senderemail\" value=\"0\">\r\n\r\n\r\n\r\n    <script>\r\n        $(\"button[name='CopyGiftCode']\").click (function() {\r\n            var row = $(this).closest(\"tr\");\r\n            \/\/var giftcode = row.text();\r\n            var giftcode = row.find('td:eq(5)').text();\r\n            \/\/var giftcodecell=row.find('td:eq(4)')\r\n            const elem = document.createElement('textarea');\r\n            elem.value =giftcode;\r\n            document.body.appendChild(elem);\r\n            elem.select();\r\n            document.execCommand('copy');\r\n            document.body.removeChild(elem);\r\n            alert(\"Copied the gift code: \" +  giftcode);\r\n        })\r\n\r\n\r\n\r\n        $(\"button[name='GiftEmail']\").click (function() {\r\n            var row = $(this).closest(\"tr\");\r\n            var sendgiftcode = row.find('td:eq(5)').text();\r\n            var sendgiftproductid = row.find('td:eq(6)').text();\r\n            var sendgiftname = row.find('td:eq(2)').text();\r\n            var senderemail='';\r\n            $('#sendgiftcode').val(sendgiftcode);\r\n            $('#sendgiftproductid').val(sendgiftproductid);\r\n            $('#sendgiftname').val(sendgiftname);\r\n            $('#senderemail').val(senderemail);\r\n\r\n\r\n            $.confirm({\r\n                boxWidth: '70%',\r\n                useBootstrap: false,\r\n                title: \"\u767c\u9001\u79ae\u7269 Send this gift?\",\r\n                content:\r\n                    \"<form action='https:\/\/flowtaipei.com\/en\/my-gifts\/' method='post' id='formsendgift' class='giftemail'>\" +\r\n                    \"<div style='align:center'><strong>\" + $('#sendgiftname').val() + \"<\/strong><br> \" +\r\n                    \"\u767b\u5165\u4f60\u60f3\u8981\u6536\u5230\u79ae\u7269\u7684\u4eba\u7684\u96fb\u5b50\u4fe1\u7bb1.  \u4f60\u9084\u6709\u53ef\u4ee5\u5beb\u4e00\u6bb5\u8a0a\u606f.<br>  \" +\r\n                    \"Enter the receiver's email address.  You can also enter a short message if you like.<br>&nbsp;<br> \" +\r\n                    \"<input type='text' size='30'  autofocus placeholder='\u6536\u4ef6\u4eba\u96fb\u5b50\u4fe1\u7bb1 Receiver Email' class='postreceiveremail' id='postreceiveremail' name='postreceiveremail' required \/><br>&nbsp;<br>\" +\r\n                    \"<textarea rows='4' cols='1' maxlength='200' placeholder='\u4f60\u7684\u8a0a\u606f Your Message' class='postgiftmessage' name='postgiftmessage'\/><\/textarea>\" +\r\n                    \"<input type='hidden' id='postsendgiftcode' name='postsendgiftcode' value='\" + $('#sendgiftcode').val() +\"'>\" +\r\n                    \"<input type='hidden' id='postsendgiftproductid' name='postsendgiftproductid' value='\" + $('#sendgiftproductid').val() + \"'>\" +\r\n                    \"<input type='hidden' id='postsendgiftname' name='postsendgiftname' value='\" + $('#sendgiftname').val() + \"'>\" +\r\n                    \"<input type='hidden' id='postsenderemail' name='postsenderemail' value=>\" +\r\n                    \"<\/form>\",\r\n                buttons: {\r\n                    confirm: function () {\r\n                        text: '\u767c\u9001\u79ae\u7269 Send Gift'\r\n\r\n                        $( \"#formsendgift\" ).submit();\r\n                        $.alert({\r\n                            title: 'Sending...',\r\n                            content: '\u5728\u767c\u9001...\u8acb\u7b49\u4e00\u4e0b...\u4e0d\u8981\u518d\u9ede\u64ca... Sending... Please wait and do not click again... ',\r\n                            boxWidth: '70%',\r\n                            useBootstrap: false,\r\n                        })\r\n                    },\r\n\r\n                    cancel: function () {\r\n                        $.alert({\r\n                            title: 'Canceled \u53d6\u6d88\u4e86',\r\n                            content: 'Canceled \u53d6\u6d88\u4e86',\r\n                            boxWidth: '70%',\r\n                            useBootstrap: false,\r\n                        })\r\n                    }\r\n\r\n                }\r\n            })\r\n        })\r\n\r\n\r\n    <\/script>\r\n\r\n\r\n    <div class='table w-auto text-nowrap' style=\"overflow-x:auto;width:100%\"  align=\"center\">\r\n        <h4>\u6211\u8cb7\u4e86\u7684\u79ae\u7269 Gifts I received<\/h4>\r\n\r\n        <table class=\"table table-striped table-responsive\" style=\"align:center\">\r\n            <tr style=\"text-align: center;\">\r\n                <th style=\"text-align: center;\">Gift<\/th>\r\n                <th style=\"text-align: center;\">Giver<\/th>\r\n                <th style=\"text-align: center;\">Redeemed<\/th>\r\n                <th style=\"text-align: center;\">Gift Code<\/th>\r\n                <th style=\"text-align: center;\"><\/th>\r\n                <th style=\"text-align: center;\"><\/th>\r\n            <\/tr>\r\n\r\n\r\n                    <\/table>\r\n    <\/div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<div style=\"text-align:center;\">\r\n\r\n    <strong>\u514c\u63db\u4e00\u500b\u79ae\u7269 Redeem a Gift Code<\/strong><br>\r\n    <!--<form name=\"formgiftcoderedeem\" id=\"formgiftcoderedeem\" method=\"post\"><\/form> -->\r\n    <input id=\"giftcoderedeem\" name=\"giftcoderedeem\" width=\"200\" placeholder=\"\u8f38\u5165\u4f60\u7684 Gift Code Enter your Gift Code\" size=\"60\" style=\"border: 2px solid black;\r\n  border-radius: 4px;text-align:center;\" required\/><br>&nbsp;<br>\r\n    \u9019\u500b\u6703\u628a\u79ae\u7269\u52a0\u4f60\u7684\u5e33\u6236 This will add the gift to your own account<br>\r\n    <button type = 'button' class='btn btn-success' id = 'btngiftcoderedeem' value = 'btngiftcoderedeem' >\u514c\u63db Redeem Gift<\/button>\r\n    <\/form>\r\n\r\n<\/div>\r\n\r\n    <script>\r\n        $(\"#btngiftcoderedeem\").click (function() {\r\n            var giftcoderedeem = document.getElementById(\"giftcoderedeem\").value;\r\n\r\n            var giftcodeformat = \/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]*$\/;\r\n            $('#giftcoderedeem').val(giftcoderedeem);\r\n            if(document. getElementById(\"giftcoderedeem\").value.match(giftcodeformat))\r\n            {\r\n\r\n            }\r\n            else\r\n            {\r\n                $.alert({\r\n                    title: 'Invalid Gift Code',\r\n                    content: 'Gift Code\u4e0d\u5c0d You entered an invalid gift code',\r\n                    boxWidth: '70%',\r\n                    useBootstrap: false,\r\n                })\r\n                return false;\r\n            }\r\n\r\n\r\n            if(document. getElementById(\"giftcoderedeem\").value.length===0)\r\n            {\r\n                $.alert({\r\n                    title: 'Enter a Gift Code',\r\n                    content: '\u4f60\u6c92\u6709\u8f38\u5165Gift Code You have not entered a gift code.',\r\n                    boxWidth: '70%',\r\n                    useBootstrap: false,\r\n                })\r\n                return false;\r\n            }\r\n\r\n\r\n\r\n            $.confirm({\r\n                boxWidth: '70%',\r\n                useBootstrap: false,\r\n                title: \"\u514c\u63db? Redeem Gift?\",\r\n                content:\r\n                    \"<div align='center'><strong>Redeem Gift Code?<\/strong><br> \" +\r\n                    \"\u9019\u500b\u6703\u628a\u79ae\u7269\u52a0\u4f60\u7684\u5e33\u6236 This will add the gift to your own account\",\r\n                buttons: {\r\n\r\n                    confirm: function () {\r\n                        text: '\u514c\u63db Redeem Gift'\r\n\r\n\r\n                        $.alert({\r\n                            title: 'Transferring...',\r\n                            content: '\u5728\u8f49\u8b93...\u8acb\u7b49\u4e00\u4e0b...\u4e0d\u8981\u518d\u9ede\u64ca... Transferring... Please wait and do not click again... ',\r\n                            boxWidth: '70%',\r\n                            useBootstrap: false,\r\n                        })\r\n                        location.href = \"https:\/\/flowtaipei.com\/en\/my-gifts\/?giftcode=\" + giftcoderedeem;\r\n                    },\r\n\r\n                    cancel: function () {\r\n                        $.alert({\r\n                            title: 'Canceled \u53d6\u6d88\u4e86',\r\n                            content: 'Canceled \u53d6\u6d88\u4e86',\r\n                            boxWidth: '70%',\r\n                            useBootstrap: false,\r\n                        })\r\n                    }\r\n\r\n                }\r\n            })\r\n\r\n\r\n\r\n\r\n        })\r\n\r\n\r\n\r\n\r\n\r\n            <\/script>\r\n\r\n\r\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"wf_page_folders":[],"class_list":["post-20838","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/pages\/20838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/comments?post=20838"}],"version-history":[{"count":0,"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/pages\/20838\/revisions"}],"wp:attachment":[{"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/media?parent=20838"}],"wp:term":[{"taxonomy":"wf_page_folders","embeddable":true,"href":"https:\/\/flowtaipei.com\/en\/wp-json\/wp\/v2\/wf_page_folders?post=20838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}