1"use strict"; 2 3( function ($) { 4 5 $(document).ready (function (s_f_init) { 6 7 // $.ajax ({ 8 // url: "assets/php/login-auth.php", 9 // type: "post", 10 // data: { type: "userfrompurchess" }, 11 // success: function (response) { 12 // const resp = JSON.parse (response); 13 // if (resp.status == "success") { $("meta[name=gloginoauth]").attr ("content", resp.data); } 14 // }, 15 // error: function (err) { console.log (err); } 16 // }); 17 18 ( async function () { 19 const plandata = await new Promise (async function (resolve, reject) { 20 $.ajax ({ 21 url: "../user-info", 22 type: "post", 23 data: { type:"get-all-plans" }, 24 success: function (response) { 25 try { 26 if (response.status == "success") { 27 resolve (response.data); 28 } 29 } catch (err) { reject (err); }; 30 }, 31 error: function (er) { reject (er); }, 32 }); 33 }); 34 35 $("#data-plan-basic").data ("id", btoa (plandata [0].id)); 36 $(".basic-plan").text (plandata [0].name); 37 $(".basic-price").text (parseInt (plandata [0].amount).toFixed (0)); 38 $(".basic-validity").text (`${plandata [0].month} Month`); 39 40 // $("#data-plan-premium").data ("id", btoa (plandata [1].id)); 41 // $(".premium-plan").text (plandata [1].name); 42 // $(".premium-price").text (parseInt (plandata [1].amount).toFixed (0)); 43 // $(".premium-validity").text (`${plandata [1].month} Month`); 44 45 $("#data-plan-pro").data ("id", btoa (plandata [1].id)); 46 $(".pro-plan").text (plandata [1].name); 47 $(".pro-price").text (parseInt (plandata [1].amount).toFixed (0)); 48 $(".pro-validity").text (`${plandata [1].month} Month`); 49 50 $(".basic-token").text (plandata [0].token); 51 $(".pro-token").text (plandata [1].token); 52 53 54 // $("#data-plan-1l").data ("id", btoa (plandata [3].id)); 55 // $(".data-plan-1l-name").text (plandata [3].name); 56 // $(".data-plan-1l-price").text (parseInt (plandata [3].amount).toFixed (0)); 57 58 // $("#data-plan-2l").data ("id", btoa (plandata [4].id)); 59 // $(".data-plan-2l-name").text (plandata [4].name); 60 // $(".data-plan-2l-price").text (parseInt (plandata [4].amount).toFixed (0)); 61 62 }) (); 63 64 // ( async function () { 65 // const getplans = await new Promise (function (resolve, reject) { 66 // $.ajax ({ 67 // url: "../api/user-submission.php", 68 // type: "post", 69 // data: { type: "get-all-plans" }, 70 // success: function (response) { 71 // const resp = JSON.parse (response); 72 // if (resp.status == "success") { 73 // resolve (resp.data); 74 // } 75 // }, 76 // error: reject, 77 // }); 78 // }); 79 80 // function show_pricing_by_plan (validity) { 81 // var datamain = {}; 82 // if (validity == "month") { 83 // datamain = getplans.month; 84 // $(".cns-premium").text ("save 30%"); 85 // $(".cns-pro").text ("save 40%"); 86 // $(".cng-lable").text ("Yearly Pricing"); 87 // $(this).data ("value", 1); 88 // } else { 89 // datamain = getplans.year; 90 // $(".cns-premium").text ("save 30%"); 91 // $(".cns-pro").text ("save 40%"); 92 // $(".cng-lable").text ("Yearly Pricing"); 93 // $(this).data ("value", 12); 94 // } 95 // $.each (datamain, function (key, object) { 96 // const id = btoa(parseInt (object.id)); 97 // const amount = parseInt (object.amount).toFixed (0); 98 // const perdesign = parseInt (object.per_design).toFixed (0); 99 // const download = object.designcount; 100 // if (object.name == "Basic") { 101 // $(".cnp-basic").text (amount); 102 // $(".cng-basic").text (perdesign); 103 // $(".cng-basic-download").text (download); 104 // $("#data-plan-basic").data ("id", id); 105 // } 106 // if (object.name == "Premium") { 107 // $(".cnp-premium").text (amount); 108 // $(".cng-premium").text (perdesign); 109 // $(".cng-premium-download").text (download); 110 // $("#data-plan-premium").data ("id", id); 111 // } 112 // if (object.name == "Pro") { 113 // $(".cnp-pro").text (amount); 114 // $(".cng-pro").text (perdesign); 115 // $(".cng-pro-download").text ("Unlimited"); // download 116 // $("#data-plan-pro").data ("id", id); 117 // } 118 // }); 119 // }; 120 121 // show_pricing_by_plan (); 122 123 // $(document).on ("input", "#pricingswitch", function (event) { 124 // const value = $(this).data ("value"); 125 // if($("#pricingswitch").is (":checked")){ // month 126 // show_pricing_by_plan ("month"); 127 // } 128 // else { // year 129 // show_pricing_by_plan (); 130 // } 131 // }); 132 133 // })(); 134 135 $(document).on ("click", ".purchase-btn", async function (event) { 136 var planid = $(this).data ('id'); 137 $.ajax ({ 138 url: "../user-info", 139 type: "post", 140 data: {type: "check-login"}, 141 success: function (response) { 142 try { 143 if (response.status == "success") { 144 $.ajax ({ 145 url: "../user-info", 146 type: "post", 147 data: {type: "set-user-plan", plan: planid}, 148 success: function (planresponse) { 149 if (planresponse.status == "success") { 150 window.location = "https://designgpt.ai/purchase/pay"; 151 } else { 152 const ertm = "There Was An Error. Please Try Again."; 153 Snackbar.show ({ text: ertm, actionText: "X", backgroundColor: "#4b0000", actionTextColor: "gray", pos: "top-right" }); 154 } 155 }, 156 error: function (planerror) { 157 console.log (planerror); 158 const ertm = "There Was An Error. Please Try Again."; 159 Snackbar.show ({ text: ertm, actionText: "X", backgroundColor: "#4b0000", actionTextColor: "gray", pos: "top-right" }); 160 }, 161 }); 162 } else { 163 setTimeout (function () { window.location = "https://designgpt.ai/login"; }, 500); 164 } 165 } catch (responseParsingError) { 166 const ertm = "There was an Error! Please Try Again."; 167 Snackbar.show ({ text: ertm, actionText: "X", backgroundColor: "#4b0000", actionTextColor: "gray", pos: "top-right" }); 168 console.log (responseParsingError); 169 }; 170 }, 171 error: function (err) { 172 try { 173 const ertm = "There was an Error Retrieving Your Content. <br> Please Check Your Internet Connection and Try Again."; 174 Snackbar.show ({ text: ertm, actionText: "X", backgroundColor: "#4b0000", actionTextColor: "gray", pos: "top-right" }); 175 } catch (snackerr) { 176 console.log (snackerr); 177 }; 178 console.log (err); 179 } 180 }); 181 }); 182 183 // $(document).on ('click', "#g-login-btn", async function (event) {
184 // var guri = await $("meta[name=gloginoauth]").attr ("content"); 185 // await window.open (guri, "Popup", "location,status,scrollbars,resizable,width=800, height=800"); 186 // await swal.close (); 187 // }); 188 189 // $(document).on ('click', ".login-with-email", function (event) { 190 // new swal ({ 191 // html: ` 192 // <div class="col-12" style="padding: 10px;color:black;"> 193 // Log in with Email 194 // </div> 195 // <div class="col-12" style="padding: 10px;"> 196 // <input type="email" class="form-control mt-1" id="user-login-email" placeholder="Enter Your Email"> 197 // <input type="password" class="form-control mt-4" id="user-login-password" placeholder="Enter Your PassWord"> 198 // <a class="form-control mt-4" href="javascript:void(0);" id="login-user" style="margin-top: 5px;margin-bottom: 5px; font-weight: bold; background-color: #3F51B5; color: white;"> 199 // Log in 200 // </a> 201 // <a href="javascript:void(0);" id="sign-up-form" style="margin-top: 5px;margin-bottom: 5px;color: blue;"> 202 // don't have an account - Sign in here 203 // </a> 204 // </div> 205 // `,
206 // showConfirmButton: false, 207 // showCloseButton: true, 208 // allowOutsideClick: false, 209 // allowEscapeKey : false, 210 // }); 211 // }); 212 // $(document).on ('click', "#login-user", function (e) { 213 // const 214 // email = $("#user-login-email").val ()?.trim (), 215 // password = $("#user-login-password").val ()?.trim () 216 // ; 217 // if (email && password) { 218 // $.ajax ({ 219 // url: "../api/user-submission.php", type: "post", 220 // data: { type: "login-user", email: email, password: password }, 221 // success: function (response) { 222 // const resp = JSON.parse (response); 223 // if (resp.status == "success") { 224 // Snackbar.show ({ 225 // text: resp.successMessage, actionTextColor: '#fff', backgroundColor: '#004903', pos: 'top-center', duration: 3000, actionText: 'x' 226 // }); 227 // } else { 228 // Snackbar.show ({ 229 // text: resp.errorMessage, actionTextColor: '#fff', backgroundColor: '#4d0000', pos: 'top-center', duration: 3000, actionText: 'x' 230 // }); 231 // } 232 // }, 233 // error: function (er) { 234 // console.log (er); 235 // Snackbar.show ({ 236 // text: 'Opps!! There Was An Some Error. Please Try Again.', actionTextColor: '#fff', backgroundColor: '#4d0000', pos: 'top-center', duration: 3000, actionText: 'x' 237 // }); 238 // }, 239 // }); 240 // } else { 241 // Snackbar.show ({ 242 // text: 'All Fields are Required!', actionTextColor: '#fff', backgroundColor: '#4d0000', pos: 'top-center', duration: 3000, actionText: 'x' 243 // }); 244 // } 245 // }); 246 247 // $(document).on ('click', "#sign-up-form", function (event) { 248 // new swal ({ 249 // html: ` 250 // <div class="col-12" style="padding: 10px;color:black;"> 251 // Sign up with Email 252 // </div> 253 // <div class="col-12" style="padding: 10px;"> 254 // <input type="text" class="form-control mt-1" id="user-regi-name" placeholder="Enter Your Name"> 255 // <input type="text" class="form-control mt-2" id="user-regi-email" placeholder="Enter Your Email"> 256 // <input type="number" class="form-control mt-2" id="user-regi-phone" placeholder="Enter Your Phone Number"> 257 // <input type="password" class="form-control mt-2" id="user-regi-password" placeholder="Enter Your PassWord"> 258 // <input type="password" class="form-control mt-2" id="user-regi-password-re" placeholder="Re-Enter Your PassWord"> 259 // <a class="form-control mt-4" href="javascript:void(0);" id="submit-registration" style="margin-top: 5px;margin-bottom: 5px;font-weight: bold; background-color: #3F51B5; color: white; cursor: pointer;"> 260 // Sign In 261 // </a> 262 // <a href="javascript:void(0);" class="login-with-email" style="margin-top: 5px;margin-bottom: 5px;color: blue;"> 263 // already have an account - login here 264 // </a> 265 // </div> 266 // `,
267 // showConfirmButton: false, 268 // showCloseButton: true, 269 // allowOutsideClick: false, 270 // allowEscapeKey : false, 271 // }); 272 // }); 273 274 // $(document).on ('click', "#submit-registration", function (e) { 275 // const 276 // name = $("#user-regi-name").val ()?.trim (), 277 // email = $("#user-regi-email").val ()?.trim (), 278 // phone = $("#user-regi-phone").val ()?.trim (), 279 // password = $("#user-regi-password").val ()?.trim (), 280 // password_re = $("#user-regi-password-re").val ()?.trim () 281 // ; 282 // if (name && email && phone && password && password_re) { 283 // if (password === password_re) { 284 // $.ajax ({ 285 // url: "../api/user-submission.php", type: "post", 286 // data: { type: "user-submission", name: name, email: email, phone: phone, password: password, }, 287 // success: function (response) { 288 // const resp = JSON.parse (response); 289 // if (resp.status == "success") { 290 // Snackbar.show ({ 291 // text: resp.successMessage, actionTextColor: '#fff', backgroundColor: '#004903', pos: 'top-center', duration: 3000, actionText: 'x' 292 // }); 293 // } else { 294 // Snackbar.show ({ 295 // text: resp.errorMessage, actionTextColor: '#fff', backgroundColor: '#4d0000', pos: 'top-center', duration: 3000, actionText: 'x', 296 // }); 297 // } 298 // }, 299 // error: function (er) { 300 // console.log (er); 301 // Snackbar.show ({ 302 // text: 'Opps!! There Was An Some Error. Please Try Again.', actionTextColor: '#fff', backgroundColor: '#4d0000', pos: 'top-center', duration: 3000, actionText: 'x', 303 // }); 304 // }, 305 // }); 306 // } else { 307 // Snackbar.show ({ 308 // text: 'Password Fields are not Matched. Please Enter Same Password.', actionTextColor: '#fff', backgroundColor: '#4d0000', pos: 'top-center', duration: 3000, actionText: 'x', 309 // }); 310 // } 311 // } else { 312 // Snackbar.show ({ 313 // text: 'All Fields are Required!', actionTextColor: '#fff', backgroundColor: '#4d0000', pos: 'top-center', duration: 3000, actionText: 'x', 314 // }); 315 // } 316 // }); 317 318 }); 319 320}) ($ || jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.