PageSourceSearch

https://kadambini.org/public/js/user-ajax.js?kadambini=1815628933

js kadambini.org collected 2026-09-25 11:49:29 UTC 109,985 bytes, 3,555 lines download raw bytes

1var getUrlParameter = function getUrlParameter(sParam) {
2  var sPageURL = window.location.search.substring(1),
3    sURLVariables = sPageURL.split("&"),
4    sParameterName,
5    i;
6
7  for (i = 0; i < sURLVariables.length; i++) {
8    sParameterName = sURLVariables[i].split("=");
9
10    if (sParameterName[0] === sParam) {
11      return sParameterName[1] === undefined
12        ? true
13        : decodeURIComponent(sParameterName[1]);
14    }
15  }
16  return false;
17};
18
19function numbersonly(e) {
20  var unicode = e.charCode ? e.charCode : e.keyCode;
21  if (unicode != 8) {
22    if (unicode < 48 || unicode > 57) return false;
23  }
24}
25
26function IsEmail(emailid) {
27  var regex =
28    /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
29  if (!regex.test(emailid)) {
30    return false;
31  } else {
32    return true;
33  }
34}
35function isValid(str) {
36  var regex = new RegExp("^[a-zA-Z0-9]+$");
37  if (!regex.test(str)) {
38    return false;
39  } else {
40    return true;
41  }
42}
43
44// project_path and base_path are now injected from config.php via footer.html
45// var project_path is defined in footer.html from $kadambini_api_url
46// var base_path is defined in footer.html from $kadambini_base_url
47
48var pathArray = window.location.pathname.split("/");
49
50// If running in localhost, remove project folder
51if (window.location.hostname === "localhost") {
52  pathArray.splice(1, 1);
53}
54
55var prdcatid = pathArray[2];
56var prdcatname = pathArray[3];
57var prdcode = pathArray[2];
58var prdvarnt = pathArray[3];
59
60var vt = "";
61if (pathArray[1] == "subscribe-sub-details") {
62  loadsubscriptiondetails();
63}
64if (pathArray[1] == "details") {
65  loadproductdetails();
66}
67if (pathArray[1] == "subscription-details") {
68  loadmysubscriptiondetails();
69}
70
71$(document).ready(function () {
72  var currentPage = window.location.pathname;
73  //console.log("currentPage==", currentPage)
74
75  // All Page
76  loadmycart();
77  loadcart();
78  loadmyorders();
79  loadmyorderdetails();
80  loadmysubscription();
81
82  // User details
83  showprofile();
84
85  //Homepage APIs
86  if (currentPage === "/") {
87    loadStoryForHome();
88    loadRecentMagazineListForHome();
89  }
90
91  //book
92  if (currentPage === "/" || currentPage === "/book") {
93    loadBookList();
94  }
95
96  //subscribe-details
97  if (currentPage === "/subscribe-details") {
98    loadsubscribedtl();
99  }
100
101  loadpreviousmagazinelist();
102  loadpopularmagazinelist();
103  loadoptionmagazinelist();
104
105  loadevent();
106  loadstory();
107  loadstorydetails();
108  loadstorycomment();
109
110  //loadproductdetails();
111});
112
113/**
114 * Handle Kadambini User Signup
115 * ----------------------------
116 * - Client-side validation
117 * - API call
118 * - Toast-based error & success handling
119 * - Redirect after success toast
120 */
121function handleKdmSignup() {
122  // Collect form values
123  const firstName = $("#first_name").val().trim();
124  const lastName = $("#last_name").val().trim();
125  const mobileNumber = $("#mobile").val().trim();
126  const email = $("#emailid").val().trim();
127  const password = $("#regpaswrd").val().trim();
128  const confirmPassword = $("#cpaswrd").val().trim();
129  const redirectAfterRegister = $("#hidereg").val();
130  const userSource = "WEB";
131  const isTermsAccepted = $('input[name="term"]:checked').val();
132
133  if (!firstName) return showToast("First name is required", "error");
134
135  if (!lastName) return showToast("Last name is required", "error");
136
137  if (!mobileNumber || !isValid(mobileNumber))
138    return showToast("Valid mobile number is required", "error");
139
140  if (!email || !IsEmail(email))
141    return showToast("Valid email address is required", "error");
142
143  if (!password) return showToast("Password is required", "error");
144
145  if (!confirmPassword || password !== confirmPassword)
146    return showToast("Passwords do not match", "error");
147
148  if (!isTermsAccepted)
149    return showToast("Please accept the terms & conditions", "error");
150
151  $.ajax({
152    type: "POST",
153    url: project_path + "add-user.php",
154    dataType: "json",
155    cache: false,
156    data: {
157      firstname: firstName,
158      lastname: lastName,
159      mobl: mobileNumber,
160      email: email,
161      pwd: password,
162      usrfrom: userSource,
163    },
164
165    success: function (response) {
166      // Success
167      if (response.success) {
168        showToast(response.message, "success", 2500);
169
170        // Redirect after toast duration
171        setTimeout(() => {
172          if (redirectAfterRegister) {
173            window.location.href = base_path + "checkout";
174          } else {
175            window.location.href = base_path + "profile";
176          }
177        }, 2500);
178      }
179
180      // API Error
181      else {
182        if (response.errors) {
183          // Show first error only
184          const firstErrorKey = Object.keys(response.errors)[0];
185          const firstErrorMessage = response.errors[firstErrorKey][0];
186          showToast(firstErrorMessage, "error");
187        } else {
188          showToast(response.message || "Registration failed", "error");
189        }
190      }
191    },
192
193    error: function (xhr) {
194      let errorMessage = "Something went wrong. Please try again.";
195
196      if (xhr.responseJSON && xhr.responseJSON.message) {
197        errorMessage = xhr.responseJSON.message;
198      }
199
200      showToast(errorMessage, "error");
201    },
202  });
203}
204
205/**
206 * Handle API structured validation errors
207 */
208function handleApiErrors(response) {
209  if (response.errors) {
210    Object.keys(response.errors).forEach(function (field) {
211      const message = response.errors[field][0];
212
213      switch (field) {
214        case "firstname":
215          $("#first_name").css("border", "1px solid red");
216          break;
217
218        case "lastname":
219          $("#last_name").css("border", "1px solid red");
220          break;
221
222        case "email":
223          $("#emailid").css("border", "1px solid red");
224          break;
225
226        case "mobl":
227          $("#mobile").css("border", "1px solid red");
228          break;
229      }
230
231      showGlobalError(message);
232    });
233  } else {
234    showGlobalError(response.message);
235  }
236}
237
238/**
239 * Show global error message
240 */
241function showGlobalError(message) {
242  $("#invld_lgnerr").html(message).show();
243  setTimeout(() => {
244    $("#invld_lgnerr").hide();
245  }, 3000);
246}
247
248/**
249 * Show global success message
250 */
251function showGlobalSuccess(message) {
252  $("#invld_lgnerr")
253    .removeClass("error")
254    .addClass("success")
255    .html(message)
256    .show();
257}
258
259function userlogin(lgntyp) {
260  var error = 0;
261  var user = $("#user").val();
262  var pwd = $("#paswrd").val();
263
264  $.ajax({
265    type: "POST",
266    crossDomain: true,
267    dataType: "json",
268    cache: false,
269    url: project_path + "user-login.php",
270    data: { userid: user, paswd: pwd },
271    beforeSend: function () {
272      if (user == "") {
273        error += 1;
274        $("#user").css("border", "1px solid red");
275        $("#user").val("");
276      } else {
277        $("#user").css("border", "1px solid #e1e1e1");
278      }
279      if (pwd == "") {
280        error += 1;
281        $("#paswrd").css("border", "1px solid red");
282        $("#paswrd").val("");
283      } else {
284        $("#paswrd").css("border", "1px solid #e1e1e1");
285      }
286
287      if (error > 0) {
288        return false;
289      }
290      //$("#lodr").show();
291      //$("#lodr_layr").show();
292    },
293    success: function (msg) {
294      if (msg == 1) {
295        if (lgntyp == 4) {
296          window.location.href = "profile";
297        } else if (lgntyp == 5) {
298          var hidestryid = $("#hidestryid").val();
299          var hidestrynam = $("#hidestrynam").val();
300          window.location.href =
301            base_path + "story-details/" + hidestryid + "/" + hidestrynam;
302        } else {
303          window.location.href = "checkout";
304        }
305      }
306      if (msg == 2) {
307        $("#invld_lgnerr").html("Inavlid User Name Or Password !");
308        $("#invld_lgnerr").show();
309        setTimeout(function () {
310          $("#invld_lgnerr").hide();
311        }, 2500);
312      }
313    },
314    error: function (err) {
315      //alert(err);
316      //alert('Check your internet connection!');
317    },
318  });
319}
320
321function showprofile() {
322  $.ajax({
323    type: "POST",
324    dataType: "JSON",
325    crossDomain: true,
326    cache: false,
327    url: project_path + "sltuserdetails.php",
328    ContentType: "application/json",
329    beforeSend: function () {},
330    success: function (msg) {
331      $.each(msg.userdetails, function () {
332        $("#prflname").html(this.fullnam);
333        $("#chkotname").html(this.fullnam);
334        $("#delvr_nam").val(this.fullnam);
335        $("#fstnamid").html(this.fstnam);
336        $("#lstnamid").html(this.lstnam);
337        $("#sincfrom").html(
338          "Hello, Welcome to Kadambini Official Website. Member Since " +
339            this.crtdt,
340        );
341        /*Edit user*/
342        $("#fstname").val(this.fstnam || "N/A");
343        $("#lstname").val(this.lstnam || "N/A");
344        $("#mobl").val(this.mobile || "");
345        $("#emailid").val(this.emailid || "");
346        $("#dob").val(this.dbval || "");
347
348        $("#prflemailid").html(this.emailid || "N/A");
349        $("#prflmobile").html(this.mobile || "N/A");
350        if (this.gndr != "") {
351          $("#prflgndr").html(this.gndr);
352          if (this.gndr == "Male") {
353            $("#gndrid").html(
354              '<div class="form-check form-check-inline"><input class="form-check-input" type="radio" CHECKED name="gend" id="inlineRadio1" value="Male"><label class="form-check-label" for="inlineRadio1">Male</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio2" value="Female"><label class="form-check-label" for="inlineRadio2">Female</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio3" value="Other"><label class="form-check-label" for="inlineRadio3">Other</label></div>',
355            );
356          } else if (this.gndr == "Female") {
357            $("#gndrid").html(
358              '<div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio1" value="Male"><label class="form-check-label" for="inlineRadio1">Male</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" CHECKED name="gend" id="inlineRadio2" value="Female"><label class="form-check-label" for="inlineRadio2">Female</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio3" value="Other"><label class="form-check-label" for="inlineRadio3">Other</label></div>',
359            );
360          } else {
361            $("#gndrid").html(
362              '<div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio1" value="Male"><label class="form-check-label" for="inlineRadio1">Male</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio2" value="Female"><label class="form-check-label" for="inlineRadio2">Female</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" CHECKED id="inlineRadio3" value="Other"><label class="form-check-label" for="inlineRadio3">Other</label></div>',
363            );
364          }
365        } else {
366          $("#gndrid").html(
367            '<div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio1" value="Male" CHECKED><label class="form-check-label" for="inlineRadio1">Male</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio2" value="Female"><label class="form-check-label" for="inlineRadio2">Female</label></div><div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="gend" id="inlineRadio3" value="Other"><label class="form-check-label" for="inlineRadio3">Other</label></div>',
368          );
369        }
370        if (this.db != "Jan 01, 1970") {
371          $("#prfldb").html(this.db);
372        }
373        if (this.profilePic != "") {
374          $("#profilepc").html(
375            '<img src="' +
376              base_path +
377              "public/images/uploads/" +
378              this.profilePic +
379              '">',
380          );
381          $(".profile-im").html(
382            '<img src="' +
383              base_path +
384              "public/images/uploads/" +
385              this.profilePic +
386              '">',
387          );
388          $("#edtprofilepc").html(
389            '<input type="hidden" id="pl" value="' + this.profilePic + '">',
390          );
391        } else {
392          $("#profilepc").html(
393            '<img src="' + base_path + 'public/image/user.png">',
394          );
395          $(".profile-im").html(
396            '<img src="' + base_path + 'public/image/user.png">',
397          );
398          $("#edtprofilepc").html('<input type="hidden" id="pl" value="">');
399        }
400      });
401    },
402    error: function (err) {
403      //alert(err);
404      //alert('Check your internet connection!');
405    },
406  });
407}
408function updateprofile() {
409  var error = 0;
410  var fd = new FormData();
411  var prl = $("#profile").val();
412  var fstname = $("#fstname").val();
413  var lstname = $("#lstname").val();
414  var mobl = $("#mobl").val();
415  var emailid = $("#emailid").val();
416  var dob = $("#dob").val();
417  var mblexst = $("#mblexst").val();
418  var emlexst = $("#emlexst").val();
419  var gndr = $('input[name="gend"]:checked').val();
420  var pl = $("#pl").val();
421  var prfil = $("#profile")[0].files[0];
422
423  fd.append("firstnam", fstname);
424  fd.append("lastname", lstname);
425  fd.append("gender", gndr);
426  fd.append("hideprfl", pl);
427  fd.append("prfl", prfil);
428  fd.append("mobile", mobl);
429  fd.append("email", emailid);
430  fd.append("db", dob);
431  $.ajax({
432    url: project_path + "updtprofile.php",
433    type: "post",
434    data: fd,
435    contentType: false,
436    processData: false,
437    beforeSend: function () {
438      if (mblexst != 0 || emlexst != 0) {
439        error += 1;
440      }
441      if (fstname == "") {
442        error += 1;
443        $("#fstname").css("border", "1px solid red");
444        $("#fstname").val("");
445      } else {
446        $("#fstname").css("border", "1px solid #e1e1e1 ");
447      }
448      if (mobl == "") {
449        error += 1;
450        $("#mobl").css("border", "1px solid red");
451        $("#mobl").val("");
452      } else {
453        $("#mobl").css("border", " 1px solid #e1e1e1");
454      }
455      if (emailid == "") {
456        error += 1;
457        $("#emailid").css("border", "1px solid red");
458        $("#emailid").val("");
459      } else {
460        if (IsEmail(emailid) == false) {
461          error += 1;
462          $("#dupeml").html("Invalid Email ID");
463          $("#dupeml").show();
464          var x = document.getElementById("dupeml");
465          x.className = "show";
466          setTimeout(function () {
467            $("#dupeml").hide();
468          }, 2500);
469          $("#emailid").css("border", "1px solid red");
470        } else {
471          $("#emailid").css("border", "1px solid #e1e1e1");
472        }
473      }
474      if (error > 0) {
475        return false;
476      }
477      $(".loading-overlay").show();
478    },
479    success: function (msg) {
480      if (msg == 1) {
481        window.location.href = "profile";
482      }
483      if (msg == 2) {
484        $("#invld_lgnerr").html("Invalid Email ID");
485        $("#invld_lgnerr").show();
486        var x = document.getElementById("invld_lgnerr");
487        x.className = "show";
488        setTimeout(function () {
489          $("#invld_lgnerr").hide();
490        }, 2500);
491      }
492      $(".loading-overlay").hide();
493      $("body").removeClass("fixbody");
494    },
495    error: function (err) {
496      //alert(err);
497      //alert('Check your internet connection!');
498    },
499  });
500}
501
502function changepaswrd() {
503  var error = 0;
504  var pasword = $("#password").val();
505  var conf_password = $("#conf_password").val();
506  $.ajax({
507    type: "POST",
508    crossDomain: true,
509    dataType: "json",
510    cache: false,
511    url: project_path + "changepaswrd.php",
512    data: { paswrd: pasword },
513    beforeSend: function () {
514      if (pasword == "") {
515        error += 1;
516        $("#password").css("border", "1px solid red");
517        $("#password").val("");
518      } else {
519        $("#password").css("border", " 1px solid #e1e1e1");
520      }
521      if (conf_password == "") {
522        error += 1;
523        $("#conf_password").css("border", "1px solid red");
524        $("#conf_password").val("");
525      } else {
526        if (pasword != conf_password) {
527          error += 1;
528          $("#mtchpwd").html("Confirm password didn't match !");
529          $("#conf_password").val("");
530        } else {
531          $("#conf_password").css("border", " 1px solid #e1e1e1");
532        }
533      }
534      if (error > 0) {
535        return false;
536      }
537    },
538    success: function (msg) {
539      if (msg == 1) {
540        window.location.reload();
541      }
542    },
543    error: function (err) {
544      //alert(err);
545      //alert('Check your internet connection!');
546    },
547  });
548}
549
550function loadBookList() {
551  var booklist = "";
552  var bnrbooklist = "";
553  var seltbooklist = "";
554  $.ajax({
555    type: "POST",
556    dataType: "JSON",
557    crossDomain: true,
558    cache: false,
559    url: project_path + "sltbooklist.php",
560    ContentType: "application/json",
561    beforeSend: function () {
562      $(".loading-overlay").show();
563    },
564    success: function (response) {
565      $.each(response.araybooklist, function () {
566        if (this.ipmg != "" || this.ipmg != null) {
567          var igg = "public/images/products/" + this.ipmg;
568        }
569        if (this.ipmg == "" || this.ipmg == null) {
570          var igg = "public/images/products/nomig.jpg";
571        }
572
573        if (this.nodt != 0) {
574          if (this.selprc != 0.0) {
575            booklist +=
576              '<a href="' +
577              this.bookurl +
578              '" target="_blank" class="swiper-slide swiper-slide1212 "><img src="' +
579              igg +
580              '" alt="' +
581              this.productname +
582              '" title="' +
583              this.productname +
584              '"><div class="dt-hd1"><h1>' +
585              this.productname +
586              "</h1><h3>" +
587              this.wrter +
588              '</h3><div class="aaa"><h4>₹ ' +
589              this.selprc +
590              "</h4><span>Buy Now</span></div></div></a>";
591
592            bnrbooklist +=
593              ' <div class="swiper-slide swiper-slide36"> <img src="' +
594              igg +
595              '" alt=""> <div class="left-t"><h1>' +
596              this.productname +
597              "</h1><p>" +
598              this.shortdesc +
599              "</p><h6>₹ " +
600              this.selprc +
601              '</h6> <div class="buy"> <a href="' +
602              this.bookurl +
603              '" target="_blank">Buy Now</a></div></div></div>';
604
605            seltbooklist +=
606              '<div class="col"><div class="mag-no mag-no11 w-100 h-100"> <a class="w-100" href="' +
607              base_path +
608              "details/" +
609              this.prdcod +
610              "/" +
611              this.prdvrnt +
612              '"> <img src="' +
613              igg +
614              '" alt="' +
615              this.productname +
616              '" title="' +
617              this.productname +
618              '"> </a> <h5>' +
619              this.booktype +
620              "</h5> <h1>" +
621              this.productname +
622              "</h1> <h5>by " +
623              this.wrter +
624              '</h5> <div class="price-chart"> <h3 class="old-price">₹ ' +
625              this.mrp +
626              '</h3> <h3 class="new-price">₹ ' +
627              this.selprc +
628              '</h3><div class="add"> <a href="' +
629              this.bookurl +
630              '" target="_blank">Buy Now</a> </div </div>></div></div>';
631          } else {
632            booklist +=
633              '<a href="' +
634              this.bookurl +
635              '" target="_blank" class="swiper-slide swiper-slide1212 "><img src="' +
636              igg +
637              '" alt="' +
638              this.productname +
639              '" title="' +
640              this.productname +
641              '"><div class="dt-hd1"><h1>' +
642              this.productname +
643              "</h1><h3>" +
644              this.wrter +
645              '</h3><div class="aaa"><h4>₹ ' +
646              this.mrp +
647              "</h4><span>Buy Now</span></div></div></a>";
648
649            bnrbooklist +=
650              ' <div class="swiper-slide swiper-slide36"> <img src="' +
651              igg +
652              '" alt="' +
653              this.productname +
654              '" title="' +
655              this.productname +
656              '"> <div class="left-tt"><h1>' +
657              this.productname +
658              "</h1><p>" +
659              this.shortdesc +
660              "</p><h6>₹ " +
661              this.mrp +
662              '</h6> <div class="buy"> <a href="' +
663              this.bookurl +
664              '" target="_blank">Buy Now</a></div></div></div>';
665
666            seltbooklist +=
667              '<div class="col"><div class="mag-no mag-no11 w-100 h-100"> <a class="w-100" href="' +
668              this.bookurl +
669              '"  target="_blank"> <img src="' +
670              igg +
671              '" alt="' +
672              this.productname +
673              '" title="' +
674              this.productname +
675              '"> </a> <h5>' +
676              this.booktype +
677              "</h5> <h1>" +
678              this.productname +
679              "</h1> <h5>by " +
680              this.wrter +
681              '</h5> <div class="price-chart"> <h3 class="new-price">₹ ' +
682              this.mrp +
683              '</h3> <div class="add"> <a href="' +
684              this.bookurl +
685              '" target="_blank">Buy Now</a> </div></div></div></div>';
686          }
687        }
688      });
689      $("#booklistid").html(booklist);
690      // $('#bnrbooklistid').html(bnrbooklist);
691      $("#seltbooklistid").html(seltbooklist);
692      $(".loading-overlay").hide();
693      //sliderInit();
694      bookswiper();
695      bookswiper1();
696    },
697    error: function (err) {
698      //alert(err);
699      //alert('Check your internet connection!');
700    },
701  });
702}
703
704function loadRecentMagazineListForHome() {
705  var rcntmagznlist = "";
706  var sl = 1;
707  $.ajax({
708    type: "POST",
709    dataType: "JSON",
710    crossDomain: true,
711    cache: false,
712    url: project_path + "loadrecentmagazinelist.php",
713    ContentType: "application/json",
714    beforeSend: function () {
715      $(".loading-overlay").show();
716    },
717    success: function (response) {
718      $.each(response.arayrecentmagaznist, function () {
719        if (this.ipmg != "" || this.ipmg != null) {
720          var igg = "public/images/products/" + this.ipmg;
721        }
722        if (this.ipmg == "" || this.ipmg == null) {
723          var igg = "public/images/products/nomig.jpg";
724        }
725        if (this.nodt != 0) {
726          var myString = this.prdvrnt;
727          var urlString = myString.replace(/\s+/g, "-");
728          rcntmagznlist +=
729            '<div class="swiper-slide swiper-slide1" id="sld' +
730            sl +
731            '"> <div class="inner-june gap-0 w-100"><div class="row g-3"><div class="col-lg-4 col-md-5 col-sm-12"><div class="left-june w-100"><div class="left-june-img"><img src="' +
732            igg +
733            '" alt="' +
734            this.productname +
735            '" title="' +
736            this.productname +
737            '"></div></div></div>
737<div class="col-lg-8 col-md-7 col-sm-12"><div class="right-june w-100"><div class="kdmb"><h1>' +
738            this.productname +
739            "</h1><p>" +
740            this.shortdesc +
741            '</p></div><div class="kd-btn"><div class="bttt1"><a href="' +
742            base_path +
743            "details/" +
744            this.prdcod +
745            "/" +
746            urlString +
747            '">Buy Now</a></div><a href="contact-us"><div class="bttt2" id="bttt5"><p>Contact With Us</p></div></a></div><div class="letter-slide"><h3>Kadambini <span>Kunikatha</span> Kadambini <span>Kunikatha</span></h3></div></div></div></div></div></div>';
748        }
749        ++sl;
750      });
751      $("#recentmagazine").html(rcntmagznlist);
752      $(".loading-overlay").hide();
753      rcntswpr();
754    },
755    error: function (err) {
756      //alert(err);
757      //alert('Check your internet connection!');
758    },
759  });
760}
761function loadmagazinelist(page_num) {
762  page_num = page_num ? page_num : 0;
763  var magazinelist = $("#magazinelist").val();
764  var year = $("#year").val();
765  var month = $("#month").val();
766  var allmagznlist = "";
767  $.ajax({
768    type: "POST",
769    url: project_path + "loadmagazinelist.php",
770    data: { magazincat: magazinelist, yer: year, mnth: month, page: page_num },
771    beforeSend: function () {
772      $(".loading-overlay").show();
773    },
774    success: function (response) {
775      $("#postContent").html(response);
776      $(".loading-overlay").hide();
777    },
778    error: function (err) {
779      //alert(err);
780      //alert('Check your internet connection!');
781    },
782  });
783}
784function loadoptionmagazinelist() {
785  var magzntype = pathArray[2];
786  var sltmagznlist = "";
787  $.ajax({
788    type: "POST",
789    dataType: "JSON",
790    crossDomain: true,
791    cache: false,
792    url: project_path + "loadoptionmagazinelist.php",
793    ContentType: "application/json",
794    beforeSend: function () {
795      $(".loading-overlay").show();
796    },
797    success: function (response) {
798      $.each(response.arayoptnmagaznlist, function () {
799        if (this.nodt != 0) {
800          if (magzntype == this.ctid) {
801            var chkd = "selected";
802          } else {
803            var chkd = "";
804          }
805          sltmagznlist +=
806            '<option value="' +
807            this.ctid +
808            '" ' +
809            chkd +
810            ">" +
811            this.catname +
812            "</option>";
813        }
814      });
815      $("#magazinelist").html(
816        '<option value="">Select...</option>' + sltmagznlist,
817      );
818      $(".loading-overlay").hide();
819    },
820    error: function (err) {
821      //alert(err);
822      //alert('Check your internet connection!');
823    },
824  });
825}
826function loadpopularmagazinelist() {
827  var allpoplarmagznlist = "";
828  var sl = 1;
829  $.ajax({
830    type: "POST",
831    dataType: "JSON",
832    crossDomain: true,
833    cache: false,
834    url: project_path + "loadpopularmagazinelist.php",
835    ContentType: "application/json",
836    beforeSend: function () {
837      $(".loading-overlay").show();
838    },
839    success: function (response) {
840      $.each(response.araymagaznlist, function () {
841        if (this.ipmg != "" || this.ipmg != null) {
842          var igg = "public/images/products/" + this.ipmg;
843        }
844        if (this.ipmg == "" || this.ipmg == null) {
845          var igg = "public/images/products/nomig.jpg";
846        }
847        if (this.nodt != 0) {
848          var myString = this.prdvrnt;
849          var urlString = myString.replace(/\s+/g, "-");
850          if (this.selprc != 0.0) {
851            allpoplarmagznlist +=
852              '<a href="' +
853              base_path +
854              "details/" +
855              this.prdcod +
856              "/" +
857              urlString +
858              '" style="text-decoration:none;color: #000;"><div class="pop-tp"> <div class="pop-img"> <img src="' +
859              igg +
860              '" alt="' +
861              this.productname +
862              '" title="' +
863              this.productname +
864              '"> </div><div class="pop-txt"> <h6>' +
865              this.productname +
866              "</h6> <p>" +
867              this.shortdesc +
868              "</p> <h5>₹ " +
869              this.selprc +
870              "</h5> </div></div></a>";
871          } else {
872            allpoplarmagznlist +=
873              '<a href="' +
874              base_path +
875              "details/" +
876              this.prdcod +
877              "/" +
878              urlString +
879              '" style="text-decoration:none;color: #000;"><div class="pop-tp"> <div class="pop-img"> <img src="' +
880              igg +
881              '" alt="' +
882              this.productname +
883              '" title="' +
884              this.productname +
885              '"> </div><div class="pop-txt"> <h6>' +
886              this.productname +
887              "</h6> <p>" +
888              this.shortdesc +
889              "</p> <h5>₹ " +
890              this.mrp +
891              "</h5> </div></div></a>";
892          }
893        }
894        ++sl;
895      });
896      $("#allpoplarmgznlistid").html(allpoplarmagznlist);
897      $(".loading-overlay").hide();
898    },
899    error: function (err) {
900      //alert(err);
901      //alert('Check your internet connection!');
902    },
903  });
904}
905function loadpreviousmagazinelist() {
906  var prvsmagznlist = "";
907  var sl = 1;
908  $.ajax({
909    type: "POST",
910    dataType: "JSON",
911    crossDomain: true,
912    cache: false,
913    url: project_path + "loadpreviousmagazinelist.php",
914    ContentType: "application/json",
915    beforeSend: function () {
916      $(".loading-overlay").show();
917    },
918    success: function (response) {
919      $.each(response.arayprvsmagaznist, function () {
920        if (this.ipmg != "" || this.ipmg != null) {
921          var igg = "public/images/products/" + this.ipmg;
922        }
923        if (this.ipmg == "" || this.ipmg == null) {
924          var igg = "public/images/products/nomig.jpg";
925        }
926        if (this.nodt != 0) {
927          prvsmagznlist +=
928            '<div class="swiper-slide swiper-slide35"> <div class="inner-issue"> <div class="left-issue"><div class="is-hd"><h1>' +
929            this.productname +
930            "</h1><p>" +
931            this.shortdesc +
932            '</p></div><div class="is-hd-bt"><div class="bttt1"><a href="' +
933            base_path +
934            "details/" +
935            this.prdcod +
936            "/" +
937            this.prdvrnt +
938            '">Order</a></div><a href="' +
939            base_path +
940            'contact-us"><div class="bttt2" id="bttt7"><p>Contact With Us</p></div></a></div></div><div class="right-issue"> <div class="right-issue-img"> <img src="' +
941            igg +
942            '" alt=""> </div></div></div></div>';
943        }
944        ++sl;
945      });
946      $("#previousmagazine").html(prvsmagznlist);
947      $(".loading-overlay").hide();
948      prvsswpr();
949    },
950    error: function (err) {
951      //alert(err);
952      //alert('Check your internet connection!');
953    },
954  });
955}
956
957function loadproductdetails() {
958  var prdvt = prdvarnt.replaceAll("-", " ");
959  $.ajax({
960    type: "POST",
961    dataType: "JSON",
962    crossDomain: true,
963    cache: false,
964    url: project_path + "loadmyproductdetails.php",
965    data: { prdctcod: prdcode, prdctvarnt: prdvt },
966    ContentType: "application/json",
967    beforeSend: function () {
968      //$("#lodr").show();
969      //$("#lodr_layr").show();
970    },
971    success: function (response) {
972      $.each(response.myprdtl, function () {
973        $("#prdnm").html(this.prdnam);
974        $("#prd_code").html(prdcode);
975        $("#desp").html(this.des);
976        $("#shrtdesc").html(this.shortdesc);
977        $("#magimg").html(
978          '<img class="w-100" src="' +
979            base_path +
980            "public/images/products/" +
981            this.ipmg +
982            '" alt="' +
983            this.prdnam +
984            '" title="' +
985            this.prdnam +
986            '">',
987        );
988
989        if (prdvt != "") {
990          if (prdvt == "Soft Copy") {
991            var sftchk = "CHECKED";
992          } else {
993            var sftchk = "";
994          }
995          if (this.catid != 1) {
996            $("#copytype").html(
997              '<div class="chk1"><input type="radio" ' +
998                sftchk +
999                ' id="softid" name="copy_type" value="Soft Copy" onclick="getmagazincopytype(' +
1000                "'" +
1001                prdcode +
1002                "'" +
1003                "," +
1004                "'Soft-Copy'" +
1005                ')"><label for="softid" class="sftcpy"> <span>Soft Copy</span></label></div>',
1006            );
1007          } else {
1008            $("#copytype").html("");
1009          }
1010        }
1011        if (this.selprc != 0.0) {
1012          $("#prdprc").html(
1013            '<p class="old-price1">₹' +
1014              this.mrp +
1015              "</p><p>₹" +
1016              this.selprc +
1017              "</p>",
1018          );
1019          if (this.stockstatus == 1) {
1020            if (this.addcart == 1) {
1021              $("#cartbtn").html(
1022                '<a href="javascript:void(0);" onclick="addtocart(' +
1023                  "'" +
1024                  prdcode +
1025                  "'" +
1026                  "," +
1027                  "'" +
1028                  prdvt +
1029                  "'" +
1030                  "," +
1031                  "'" +
1032                  this.prdnam +
1033                  "'" +
1034                  "," +
1035                  "'" +
1036                  this.mrp +
1037                  "'" +
1038                  "," +
1039                  "'" +
1040                  this.selprc +
1041                  "'" +
1042                  "," +
1043                  "'" +
1044                  this.catid +
1045                  "'" +
1046                  "," +
1047                  "'" +
1048                  this.ipmg +
1049                  "'" +
1050                  ',1);">
1050Add to Cart</a>',
1051              );
1052            } else {
1053              $("#cartbtn").html(
1054                '<a href="' + base_path + 'cart">Go to Cart</a>',
1055              );
1056            }
1057          } else {
1058            $("#cartbtn").html('<a href="javascript:void(0)">Out Of Stock</a>');
1059          }
1060        } else {
1061          $("#prdprc").html("<p>₹" + this.mrp + "</p>");
1062          if (this.stockstatus == 1) {
1063            if (this.addcart == 1) {
1064              $("#cartbtn").html(
1065                '<a href="javascript:void(0);" onclick="addtocart(' +
1066                  "'" +
1067                  prdcode +
1068                  "'" +
1069                  "," +
1070                  "'" +
1071                  prdvt +
1072                  "'" +
1073                  "," +
1074                  "'" +
1075                  this.prdnam +
1076                  "'" +
1077                  "," +
1078                  "'" +
1079                  this.mrp +
1080                  "'" +
1081                  "," +
1082                  "'" +
1083                  this.selprc +
1084                  "'" +
1085                  "," +
1086                  "'" +
1087                  this.catid +
1088                  "'" +
1089                  "," +
1090                  "'" +
1091                  this.ipmg +
1092                  "'" +
1093                  ',1);">Add to Cart</a>',
1094              );
1095            } else {
1096              $("#cartbtn").html(
1097                '<a href="' + base_path + 'cart">Go to Cart</a>',
1098              );
1099            }
1100          } else {
1101            $("#cartbtn").html('<a href="javascript:void(0)">Out Of Stock</a>');
1102          }
1103        }
1104      });
1105    },
1106    error: function (err) {
1107      //alert(err);
1108      //alert('Check your internet connection!');
1109    },
1110  });
1111}
1112function addtocart(
1113  prdcod,
1114  prdvt,
1115  prdctname,
1116  pric,
1117  slpric,
1118  catid,
1119  prdimg,
1120  carttype,
1121) {
1122  var error = 0;
1123  var edition_year = $("#edition_year").val();
1124  var edition_month = $("#edition_month").val();
1125  if (pathArray[1] == "subscribe-sub-details" && prdvt == "Soft Copy") {
1126    if (edition_year == "") {
1127      error += 1;
1128      $("#edition_year").css("border", "1px solid red");
1129    }
1130    if (edition_month == "") {
1131      error += 1;
1132      $("#edition_month").css("border", "1px solid red");
1133    }
1134    if (error > 0) {
1135      return false;
1136    }
1137  }
1138  var qaty = $("#qaty").text();
1139  $.ajax({
1140    type: "POST",
1141    crossDomain: true,
1142    dataType: "json",
1143    cache: false,
1144    url: project_path + "addtocart.php",
1145    data: {
1146      prdctcod: prdcod,
1147      prodctname: prdctname,
1148      prdvarnt: prdvt,
1149      prdprc: pric,
1150      prdslprc: slpric,
1151      prdcatid: catid,
1152      quanty: qaty,
1153      prodimg: prdimg,
1154      editionyear: edition_year,
1155      editionmonth: edition_month,
1156    },
1157    beforeSend: function () {},
1158    success: function (response) {
1159      if (response == 1) {
1160        loadcart();
1161        $(".cart-popup").addClass("cart-popup-new");
1162        if (timeoutHandler) clearTimeout(timeoutHandler);
1163        timeoutHandler = setTimeout(function () {
1164          $(".cart-popup").removeClass("cart-popup-new");
1165        }, 5000);
1166        $("#addcartimg").html(
1167          '<img src="' + base_path + "public/images/products/" + prdimg + '">',
1168        );
1169        $("#cartname").html(prdctname);
1170        $("#cartprc").html("Rs." + pric);
1171        if (pathArray[1] == "subscribe-sub-details") {
1172          $("#cartbtn").html(
1173            '<a href="' + base_path + 'checkout">Go to Cart</a>',
1174          );
1175          $("#sbcartbtn").html(
1176            '<a href="' + base_path + 'checkout">Go to Cart</a>',
1177          );
1178        } else {
1179          $("#cartbtn").html('<a href="' + base_path + 'cart">Go to Cart</a>');
1180          $("#sbcartbtn").html(
1181            '<a href="' + base_path + 'cart">Go to Cart</a>',
1182          );
1183        }
1184      }
1185      if (response == 2) {
1186        $("#rplcbtn").html(
1187          '<a href="javascript:void(0);" onclick="replaceaddtocart(' +
1188            "'" +
1189            prdcod +
1190            "'" +
1191            "," +
1192            "'" +
1193            prdvt +
1194            "'" +
1195            "," +
1196            "'" +
1197            prdctname +
1198            "'" +
1199            "," +
1200            "'" +
1201            pric +
1202            "'" +
1203            "," +
1204            "'" +
1205            slpric +
1206            "'" +
1207            "," +
1208            "'" +
1209            catid +
1210            "'" +
1211            "," +
1212            "'" +
1213            prdimg +
1214            "'" +
1215            "," +
1216            "'" +
1217            carttype +
1218            "'" +
1219            ')">Replace</a>',
1220        );
1221        $("#replace-pop").css({ transform: "scale(1)" });
1222      }
1223    },
1224    error: function (err) {
1225      //alert(err);
1226      //alert('Check your internet connection!');
1227    },
1228  });
1229}
1230function replaceaddtocart(
1231  prdcod,
1232  prdvt,
1233  prdctname,
1234  pric,
1235  slpric,
1236  catid,
1237  prdimg,
1238  carttype,
1239) {
1240  var qaty = $("#qaty").text();
1241  $.ajax({
1242    type: "POST",
1243    crossDomain: true,
1244    dataType: "json",
1245    cache: false,
1246    url: project_path + "replaceandaddtocart.php",
1247    data: {
1248      prdctcod: prdcod,
1249      prodctname: prdctname,
1250      prdvarnt: prdvt,
1251      prdprc: pric,
1252      prdslprc: slpric,
1253      prdcatid: catid,
1254      quanty: qaty,
1255      prodimg: prdimg,
1256    },
1257    beforeSend: function () {},
1258    success: function (response) {
1259      if (response == 1) {
1260        $("#replace-pop").css({ transform: "scale(0)" });
1261        loadcart();
1262        $(".cart-popup").addClass("cart-popup-new");
1263        if (timeoutHandler) clearTimeout(timeoutHandler);
1264        timeoutHandler = setTimeout(function () {
1265          $(".cart-popup").removeClass("cart-popup-new");
1266        }, 5000);
1267        $("#addcartimg").html(
1268          '<img src="' + base_path + "public/images/products/" + prdimg + '">',
1269        );
1270        $("#cartname").html(prdctname);
1271        $("#cartprc").html("Rs." + pric);
1272        if (pathArray[1] == "subscribe-sub-details") {
1273          $("#cartbtn").html(
1274            '<a href="' + base_path + 'checkout">
1274Go to Cart</a>',
1275          );
1276          $("#sbcartbtn").html(
1277            '<a href="' + base_path + 'checkout">Go to Cart</a>',
1278          );
1279        } else {
1280          $("#cartbtn").html('<a href="' + base_path + 'cart">Go to Cart</a>');
1281          $("#sbcartbtn").html(
1282            '<a href="' + base_path + 'cart">Go to Cart</a>',
1283          );
1284        }
1285      }
1286    },
1287    error: function (err) {
1288      //alert(err);
1289      //alert('Check your internet connection!');
1290    },
1291  });
1292}
1293function addprdqty() {
1294  var qty = $("#qaty").text();
1295  var pls = parseInt(qty) + 1;
1296  $("#qaty").text(pls);
1297}
1298function minusprdqty() {
1299  var qty = $("#qaty").text();
1300  var minu = parseInt(qty) - 1;
1301  if (minu > 0) {
1302    $("#qaty").text(minu);
1303  } else {
1304    return false;
1305  }
1306}
1307function loadcart() {
1308  var cartval = "";
1309  $.ajax({
1310    type: "POST",
1311    dataType: "JSON",
1312    crossDomain: true,
1313    cache: false,
1314    url: project_path + "cartcount.php",
1315    contentType: "application/json",
1316    beforeSend: function () {},
1317    success: function (response) {
1318      $.each(response.crtcnt, function (index, item) {
1319        cartval += item.cartvalu || 0;
1320      });
1321      $(".cartcnt").html(cartval);
1322    },
1323    error: function (err) {
1324      console.error("Error loading cart count:", err);
1325    },
1326  });
1327}
1328
1329function loadmycart() {
1330  var cartlistid = "";
1331  var cartlistnameid = "";
1332  $.ajax({
1333    type: "POST",
1334    dataType: "JSON",
1335    crossDomain: true,
1336    cache: false,
1337    url: project_path + "loadmycartlist.php",
1338    ContentType: "application/json",
1339    beforeSend: function () {
1340      $(".loading-overlay").show();
1341    },
1342    success: function (response) {
1343      $.each(response.mycartlist, function () {
1344        if (this.nodt != 0) {
1345          if (this.varnt == "Hard Copy" || this.varnt == "Soft Copy") {
1346            cartlistid +=
1347              '<div class="row g-3"><div class="col-lg-3 col-md-4 col-sm-6 col-4"> <div class="sub-lef w-100"> <img class="w-100" src="public/images/products/' +
1348              this.prdimg +
1349              '" alt="' +
1350              this.prodnam +
1351              '" title="' +
1352              this.prodnam +
1353              '"> </div></div><div class="col-lg-9 col-md-8 col-sm-6 col-8"> <div class="sub-rig w-100"> <div class="mag-n"> <h1>' +
1354              this.prodnam +
1355              '</h1> </div><div class="mag-code"> </div><div class="mag-price"> <h1>₹ ' +
1356              this.mrp +
1357              '</h1> </div><div class="quantity"> <div class="inner-quantity"> <div class="q-no" style="border:none;"></div><div class="remove-c"> <span class="fa fa-trash"></span> <a href="javascript:void(0)" onclick="removetempcart(' +
1358              "'" +
1359              this.tempcarid +
1360              "'" +
1361              ');">Remove</a> </div></div></div></div></div></div><hr>';
1362          } else {
1363            if (this.sellprc != 0.0) {
1364              cartlistid +=
1365                '<div class="row g-3"><div class="col-lg-3 col-md-4 col-sm-6 col-4"> <div class="sub-lef w-100"> <img class="w-100" src="public/images/products/' +
1366                this.prdimg +
1367                '" alt="' +
1368                this.prodnam +
1369                '" title="' +
1370                this.prodnam +
1371                '"> </div></div><div class="col-lg-9 col-md-8 col-sm-6 col-8"><div class="sub-rig w-100"> <div class="mag-n"> <h1>' +
1372                this.prodnam +
1373                '</h1> </div><div class="mag-code"> <h3>' +
1374                this.prdcod +
1375                '</h3> </div><div class="mag-price"> <h1>₹ ' +
1376                this.sellprc +
1377                '</h1> </div><div class="quantity"> <h5>Quantity</h5> <div class="inner-quantity"> <div class="q-no"> <p onclick="updtminusprdqty(' +
1378                "'" +
1379                this.tempcarid +
1380                "'" +
1381                ');" style="cursor:pointer;">-</p><p id="qaty' +
1382                this.tempcarid +
1383                '">' +
1384                this.qty +
1385                '</p><p onclick="updtplusprdqty(' +
1386                "'" +
1387                this.tempcarid +
1388                "'" +
1389                ');" style="cursor:pointer;">+</p></div><div class="remove-c">
1389 <span class="fa fa-trash"></span> <a href="javascript:void(0)" onclick="removetempcart(' +
1390                "'" +
1391                this.tempcarid +
1392                "'" +
1393                ');">Remove</a> </div></div></div></div></div></div><hr>';
1394            } else {
1395              cartlistid +=
1396                '<div class="row g-3"><div class="col-lg-3 col-md-4 col-sm-6 col-4">  <div class="sub-lef w-100"> <img class="w-100" src="public/images/products/' +
1397                this.prdimg +
1398                '" alt="' +
1399                this.prodnam +
1400                '" title="' +
1401                this.prodnam +
1402                '"> </div></div><div class="col-lg-9 col-md-8 col-sm-6 col-8"> <div class="sub-rig w-100"> <div class="mag-n"> <h1>' +
1403                this.prodnam +
1404                '</h1> </div><div class="mag-code"> <h3>' +
1405                this.prdcod +
1406                '</h3> </div><div class="mag-price"> <h1>₹ ' +
1407                this.mrp +
1408                '</h1> </div><div class="quantity"> <h5>Quantity</h5> <div class="inner-quantity"> <div class="q-no"> <p onclick="updtminusprdqty(' +
1409                "'" +
1410                this.tempcarid +
1411                "'" +
1412                ');" style="cursor:pointer;">-</p><p id="qaty' +
1413                this.tempcarid +
1414                '">' +
1415                this.qty +
1416                '</p><p onclick="updtplusprdqty(' +
1417                "'" +
1418                this.tempcarid +
1419                "'" +
1420                ');" style="cursor:pointer;">+</p></div><div class="remove-c"> <span class="fa fa-trash"></span> <a href="javascript:void(0)" onclick="removetempcart(' +
1421                "'" +
1422                this.tempcarid +
1423                "'" +
1424                ');">Remove</a> </div></div></div></div></div></div><hr>';
1425            }
1426          }
1427          cartlistnameid +=
1428            '<li class="lli"><h3>' +
1429            this.prodnam +
1430            '</h3><h3 class="ppp">₹ ' +
1431            this.sbtotalprice +
1432            "</h3></li>";
1433          $("#cart").show();
1434          $("#empty-cart").hide();
1435        } else {
1436          $("#cart").hide();
1437          $("#empty-cart").show();
1438          //$('#section_empty_wish_list').show();
1439        }
1440        $("#mycart").html(cartlistid);
1441        $("#cartlistname").html(cartlistnameid);
1442        $("#cartcntlist").html("Price (" + this.totlcrtcnt + " Items)");
1443        $("#mycartval").html("₹ " + this.totalprice);
1444        $("#cartsbtotal").html("₹ " + this.totalprice);
1445        //$('#subtotal').val(this.totalprice);
1446      });
1447      $(".loading-overlay").hide();
1448    },
1449    error: function (err) {
1450      //alert(err);
1451      //alert('Check your internet connection!');
1452    },
1453  });
1454}
1455
1456function removetempcart(tempcarid) {
1457  var msg = confirm("Are You Sure ?");
1458  if (msg) {
1459    $.ajax({
1460      type: "POST",
1461      crossDomain: true,
1462      dataType: "json",
1463      cache: false,
1464      url: project_path + "removetempcartitem.php",
1465      data: { tempcartid: tempcarid },
1466      beforeSend: function () {},
1467      success: function (response) {
1468        if (response == 1) {
1469          loadmycart();
1470          loadcart();
1471          loadcheckout();
1472        }
1473      },
1474      error: function (err) {
1475        //alert(err);
1476        //alert('Check your internet connection!');
1477      },
1478    });
1479  }
1480}
1481
1482function updtplusprdqty(pid) {
1483  var qty = $("#qaty" + pid).text();
1484  var pls = parseInt(qty) + 1;
1485  $.ajax({
1486    type: "POST",
1487    crossDomain: true,
1488    dataType: "json",
1489    cache: false,
1490    url: project_path + "updtplusprdqty.php",
1491    data: { tmppid: pid, plsqty: pls },
1492    beforeSend: function () {
1493      $(".loading-overlay").show();
1494    },
1495    success: function (response) {
1496      if (response == 1) {
1497        loadmycart();
1498        loadcart();
1499      }
1500      $(".loading-overlay").hide();
1501    },
1502    error: function (err) {
1503      //alert(err);
1504      //alert('Check your internet connection!');
1505    },
1506  });
1507}
1508function updtminusprdqty(pid) {
1509  var qty = $("#qaty" + pid).text();
1510  var minu = parseInt(qty) - 1;
1511
1512  if (minu >= 0) {
1513    $.ajax({
1514      type: "POST",
1515      crossDomain: true,
1516      dataType: "json",
1517      cache: false,
1518      url: project_path + "updtminusprdqty.php",
1519      data: { tmppid: pid, qunty: minu },
1520      beforeSend: function () {
1521        $(".loading-overlay").show();
1522      },
1523      success: function (response) {
1524        loadmycart();
1525        loadcart();
1526        $(".loading-overlay").hide();
1527      },
1528      error: function (err) {
1529        //alert(err);
1530        //alert('Check your internet connection!');
1531      },
1532    });
1533  }
1534}
1535function defaultaddress(dflt, dlvrid) {
1536  $.ajax({
1537    type: "POST",
1538    dataType: "JSON",
1539    crossDomain: true,
1540    cache: false,
1541    url: project_path + "updatedefaultadrs.php",
1542    data: { defalt: dflt, delvrid: dlvrid },
1543    ContentType: "application/json",
1544    beforeSend: function () {},
1545    success: function (msg) {
1546      if (msg == 1) {
1547        location.reload();
1548      }
1549    },
1550    error: function (err) {
1551      //alert(err);
1552      //alert('Check your internet connection!');
1553    },
1554  });
1555}
1556
1557function removeaddrs(dlvrid) {
1558  var alrt = confirm("Are you sure ?");
1559  if (alrt) {
1560    $.ajax({
1561      type: "POST",
1562      dataType: "JSON",
1563      crossDomain: true,
1564      cache: false,
1565      url: project_path + "deleteaddrs.php",
1566      data: { delvrid: dlvrid },
1567      ContentType: "application/json",
1568      beforeSend: function () {},
1569      success: function (msg) {
1570        if (msg == "1") {
1571          loaddelvradrs();
1572        }
1573      },
1574      error: function (err) {
1575        //alert(err);
1576        //alert('Check your internet connection!');
1577      },
1578    });
1579  } else {
1580    return false;
1581  }
1582}
1583
1584function placeorder() {
1585  var adrid = $("#adrid").val();
1586  var sbtotal = $("#subtotal").val();
1587  //var delvrychargs = $('#delvrycharge').val();
1588  var delvrychargs = 0;
1589  var paymentmode = "COD";
1590  $.ajax({
1591    type: "POST",
1592    url: project_path + "placeorder.php",
1593    data:
1594      "adrsid=" +
1595      adrid +
1596      "&subtotal=" +
1597      sbtotal +
1598      "&payment_mode=" +
1599      paymentmode +
1600      "&delvrycharg=" +
1601      delvrychargs,
1602    beforeSend: function () {
1603      alert(this.data);
1604      $(".loading-overlay").show();
1605    },
1606    success: function (html) {
1607      window.location.href = base_path + "profile?succ=1";
1608    },
1609  });
1610}
1611function loadmyorders() {
1612  var ordlistid = "";
1613  var mobordlistid = "";
1614  $.ajax({
1615    type: "POST",
1616    dataType: "JSON",
1617    crossDomain: true,
1618    cache: false,
1619    url: project_path + "loadmyorderlist.php",
1620    ContentType: "application/json",
1621    beforeSend: function () {
1622      //$("#lodr").show();
1623      //$("#lodr_layr").show();
1624    },
1625    success: function (response) {
1626      $.each(response.myordrlist, function () {
1627        if (
1628          (this.prdocatid == 2 || this.prdocatid == 3) &&
1629          this.orderstatus == "DELIVERED"
1630        ) {
1631          var stst = "VERIFIED";
1632        } else {
1633          var stst = this.orderstatus;
1634        }
1635        if (this.nodt != 0) {
1636          ordlistid +=
1637            '<div class="col-lg-6 col-md-12 col-sm-12"><div class="ord w-100"><div class="order-type"><div class="order-hd"><h3>' +
1638            this.totrder +
1639            ' Items Ordered</h3><div class="order-id"><h6>' +
1640            this.orderid +
1641            " <span>" +
1642            this.orderdate +
1643            '</span></h6></div><div class="pending-bt"><a href="#" style="color:' +
1644            this.clrcls +
1645            '">' +
1646            stst +
1647            '</a></div></div><div class="order-img"><img src="public/image/kdm.png" alt=""><div class="order-price"><h6>₹' +
1648            this.totalamnt +
1649            '</h6></div></div></div><hr><div class="dts-bt"><a href="order-details/' +
1650            this.orderid +
1651            '">View Details</a></div></div></div>';
1652        } else {
1653          ordlistid +=
1654            '<div class="col-lg-6 col-md-12 col-sm-12"><div class="ord w-100"><div class="order-type"><div class="order-hd"><h3 style="color:red;text-align:center;">No order found !</h3></div></div></div></div>';
1655        }
1656      });
1657      $("#myorder").html(ordlistid);
1658    },
1659    error: function (err) {
1660      //alert(err);
1661      //alert('Check your internet connection!');
1662    },
1663  });
1664}
1665
1666function loadmylatestorder() {
1667  var lastordlistid = "";
1668  $.ajax({
1669    type: "POST",
1670    dataType: "JSON",
1671    crossDomain: true,
1672    cache: false,
1673    url: project_path + "loadmylatestorder.php",
1674    ContentType: "application/json",
1675    beforeSend: function () {
1676      //$("#lodr").show();
1677      //$("#lodr_layr").show();
1678    },
1679    success: function (response) {
1680      $.each(response.mylastordrlist, function () {
1681        if (this.nodt != 0) {
1682          lastordlistid +=
1683            '<div class="recent_order_table_inner_wrapper"><div class="img_recent_order_table_inner_wrapper"><img src="' +
1684            base_path +
1685            'public/images/orderLogo.png"></div><div class="text_recent_order_table_inner_wrapper"><h5><b>Order Id: </b>' +
1686            this.orderid +
1687            "</h5><h5><b>Date: </b>" +
1688            this.orderdate +
1689            '</h5><div class="prod_qty_wrapper"><div class="prod_qty_wrapper_lft"><span>' +
1690            this.totrder +
1691            ' Item</span></div><div class="prod_qty_wrapper_rgt"><span>' +
1692            this.totalamnt +
1693            '</span></div></div><div class="prod_qty_wrapper_btn"><div class="prod_qty_wrapper_btnlft"><span>Order Status:-</span> <span class="' +
1694            this.clrcls +
1695            '">' +
1696            this.orderstatus +
1697            '</span></div><div class="prod_qty_wrapper_btnrgt"><a href="' +
1698            base_path +
1699            "orderdetails/" +
1700            this.orderid +
1701            '">Details</a></div></div></div></div>';
1702        } else {
1703          lastordlistid +=
1704            '<div class="recent_order_table_inner_wrapper"><p style="color:red;text-align:center;">No data found !</p></div>';
1705        }
1706        $("#mylastorder").html(lastordlistid);
1707      });
1708    },
1709    error: function (err) {
1710      //alert(err);
1711      //alert('Check your internet connection!');
1712    },
1713  });
1714}
1715
1716function loadmyorderdetails() {
1717  var ordrid = $("#ordrid").val();
1718  var orddtlid = "";
1719  $.ajax({
1720    type: "POST",
1721    dataType: "JSON",
1722    crossDomain: true,
1723    cache: false,
1724    url: project_path + "loadmyorderdetails.php",
1725    data: { orderid: ordrid },
1726    ContentType: "application/json",
1727    beforeSend: function () {
1728      //$("#lodr").show();
1729      //$("#lodr_layr").show();
1730    },
1731    success: function (response) {
1732      $.each(response.myordrdtl, function () {
1733        if (this.prdocatid != 1) {
1734          if (this.ordersts == "DELIVERED") {
1735            var rdmor =
1736              '<div class="rd-mr"><span class="fa fa-book" aria-hidden="true" style="color:black;"><a href="' +
1737              base_path +
1738              "user-magazine/" +
1739              this.prodcod +
1740              '/" target="_blank" style="color:red;">Read Full Magazine</a></span></div>';
1741          } else {
1742            var rdmor =
1743              '<div class="rd-mr"><span style="color: #e10f0f;letter-spacing: 1px;">You can read the magazine once admin verifies your order.</span></div>';
1744          }
1745        } else {
1746          var rdmor = "";
1747        }
1748        if (this.nodt != 0) {
1749          orddtlid +=
1750            '<li class="od-li"> <div class="mgm-img"> <img src="' +
1751            base_path +
1752            "public/images/products/" +
1753            this.prdimg +
1754            '" alt="' +
1755            this.prodname +
1756            '" title="' +
1757            this.prodname +
1758            '"> </div><div class="mg-name-prc"> <h3>' +
1759            this.prodname +
1760            '</h3> <div class="price-crs"> <span>₹' +
1761            this.prchsunitprice +
1762            " × " +
1763            this.quantity +
1764            "</span> </div>" +
1765            rdmor +
1766            '</div><div class="prccc"> <p>₹' +
1767            this.totalamnt +
1768            "</p></div></li><hr>";
1769        } else {
1770          orddtlid +=
1771            '<li class="od-li"> <div class="mgm-img" style="text-align:center;color:red">No data found !</div></li>';
1772        }
1773        $("#myorderdtl").html(orddtlid);
1774        $("#ordiddate").html(this.orddate);
1775        $("#ordnumb").html(ordrid);
1776        $("#ordsts").html(this.ordersts);
1777        $("#gdtot").html("₹" + this.subtotal);
1778        $("#grndtot").html("₹" + this.subtotal);
1779        if (this.razorpaymentid != null) {
1780          $("#transid").html("Online (TXN ID: " + this.razorpaymentid + ")");
1781        } else {
1782          $("#transid").html("Offline");
1783        }
1784        $("#dlvradrs").html(
1785          "<h3>" +
1786            this.delname +
1787            '</h3><div class="s-dt-ad"><p>' +
1788            this.delflatno +
1789            ", " +
1790            this.deladrs +
1791            "<br>" +
1792            this.landmrk +
1793            "<br>" +
1794            this.pincod +
1795            ", " +
1796            this.state +
1797            "</p><h3>Contact : " +
1798            this.delmobl +
1799            "</h3></div>",
1800        );
1801        if (this.ordersts == "DELIVERED") {
1802          $("#ordrftrlink").html(
1803            '<a href="' +
1804              base_path +
1805              "order-receipt?ordr=" +
1806              ordrid +
1807              '" target="_blank"> <div class="print"> <span class="fa fa-print"></span> <span>Print Invoice</span> </div></a> <a href="' +
1808              base_path +
1809              'contact-us"> <div class="print"> <span class="fa fa-cloud"></span> <span>Connect With Us</span> </div></a>',
1810          );
1811        } else {
1812          $("#ordrftrlink").html(
1813            '<a href="' +
1814              base_path +
1815              'contact-us"> <div class="print"> <span class="fa fa-cloud"></span> <span>Connect With Us</span> </div></a>',
1816          );
1817        }
1818      });
1819    },
1820    error: function (err) {
1821      //alert(err);
1822      //alert('Check your internet connection!');
1823    },
1824  });
1825}
1826
1827function loadcountorder() {
1828  $.ajax({
1829    type: "POST",
1830    dataType: "JSON",
1831    crossDomain: true,
1832    cache: false,
1833    url: project_path + "loadcountorder.php",
1834    ContentType: "application/json",
1835    beforeSend: function () {
1836      //$("#lodr").show();
1837      //$("#lodr_layr").show();
1838    },
1839    success: function (response) {
1840      $.each(response.myordercount, function () {
1841        $("#totrderid").html(this.totrder);
1842        $("#totpendid").html(this.totpend);
1843        $("#totdelvrid").html(this.totdelvr);
1844      });
1845    },
1846    error: function (err) {
1847      //alert(err);
1848      //alert('Check your internet connection!');
1849    },
1850  });
1851}
1852
1853//product
1854function loadallproduct() {
1855  filterfabric = [];
1856  $("input:checkbox[name=filter_fabric]:checked").each(function () {
1857    filterfabric.push($(this).val());
1858  });
1859  filterdesign = [];
1860  $("input:checkbox[name=filter_design]:checked").each(function () {
1861    filterdesign.push($(this).val());
1862  });
1863  filteroccasion = [];
1864  $("input:checkbox[name=filter_occasion]:checked").each(function () {
1865    filteroccasion.push($(this).val());
1866  });
1867  filterblouse = [];
1868  $("input:checkbox[name=filter_blouse]:checked").each(function () {
1869    filterblouse.push($(this).val());
1870  });
1871  filtercolor = [];
1872  $("input:checkbox[name=filter_color]:checked").each(function () {
1873    filtercolor.push($(this).val());
1874  });
1875  pricebet = [];
1876  $("input:checkbox[name=filter_price]:checked").each(function () {
1877    pricebet.push($(this).val());
1878  });
1879  var pricstrng = pricebet.toString();
1880  var nameArr = pricstrng.split(",");
1881  var prc_ragmin = nameArr[0];
1882  var prc_ragmax = nameArr[nameArr.length - 1];
1883
1884  var allproducthtml = "";
1885  $.ajax({
1886    type: "POST",
1887    dataType: "JSON",
1888    crossDomain: true,
1889    cache: false,
1890    url: project_path + "sltallproduct.php",
1891    data: {
1892      minprice: prc_ragmin,
1893      maxprice: prc_ragmax,
1894      blouseid: filterblouse,
1895      colorid: filtercolor,
1896      occasionid: filteroccasion,
1897      designid: filterdesign,
1898      fabricid: filterfabric,
1899    },
1900    ContentType: "application/json",
1901    beforeSend: function () {
1902      $(".loading-overlay").show();
1903    },
1904    success: function (response) {
1905      $.each(response.allproduct, function () {
1906        if (this.nodt == "1") {
1907          if (this.ipmg != "" || this.ipmg != null) {
1908            var igg = base_path + "public/images/products/" + this.ipmg;
1909          }
1910          if (this.ipmg == "" || this.ipmg == null) {
1911            var igg = base_path + "public/images/products/nomig.jpg";
1912          }
1913          if (this.sellstatus == 2) {
1914            var outstck = '<div class="sld_out">Sold Out</div>';
1915          } else {
1916            var outstck = "";
1917          }
1918          if (this.selprc != 0.0) {
1919            allproducthtml +=
1920              '<div class="col-lg-3 col-md-4 col-sm-6"><div class="all_prod_outer_wrapper"><a href="' +
1921              base_path +
1922              "details/" +
1923              this.prdcod +
1924              "/" +
1925              this.prdvrnt +
1926              '"><div class="all_prod_outer_wrapper_img"><img src="' +
1927              igg +
1928              '" alt="' +
1929              this.productname +
1930              '" title="' +
1931              this.productname +
1932              '">' +
1933              outstck +
1934              '</div><div class="all_prod_outer_wrapper_details-txt"><div class="all_prod_outer_wrapper_details"><div class="all_prod_product_nm">' +
1935              this.productname +
1936              '</div><div class="all_prod_product_pr"><span class="prod_actPrice">' +
1937              this.selprc +
1938              '</span><span class="prod_mrpPrice">' +
1939              this.mrp +
1940              '</span></div></div><div class="all_prod_outer_wrapper_btn"><button>Quick View</button> </div></div></a><button class="add_to_wishlist ' +
1941              this.wishcntclr +
1942              '" id="rltid' +
1943              this.prid +
1944              '" onclick="addtowishlist(' +
1945              "'" +
1946              this.prdcod +
1947              "'" +
1948              "," +
1949              "'" +
1950              this.prdvrnt +
1951              "'" +
1952              "," +
1953              "'" +
1954              this.productname +
1955              "'" +
1956              "," +
1957              "'" +
1958              this.mrp +
1959              "'" +
1960              "," +
1961              "'" +
1962              this.selprc +
1963              "'" +
1964              "," +
1965              "'" +
1966              this.catid +
1967              "'" +
1968              "," +
1969              "'" +
1970              this.ipmg +
1971              "'" +
1972              "," +
1973              "'" +
1974              this.prid +
1975              "'" +
1976              ');"><svg width="24" height="20" viewBox="0 0 24 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.8401 2.78419C20.3294 2.27319 19.7229 1.86784 19.0555 1.59127C18.388 1.31471 17.6726 1.17236 16.9501 1.17236C16.2276 1.17236 15.5122 1.31471 14.8448 1.59127C14.1773 1.86784 13.5709 2.27319 13.0601 2.78419L12.0001 3.84419L10.9401 2.78419C9.90843 1.7525 8.50915 1.1729 7.05012 1.1729C5.59109 1.1729 4.19181 1.7525 3.16012 2.78419C2.12843 3.81588 1.54883 5.21516 1.54883 6.67419C1.54883 8.13322 2.12843 9.5325 3.16012 10.5642L4.22012 11.6242L10.5859 17.99C11.367 18.771 12.6333 18.771 13.4143 17.99L19.7801 11.6242L20.8401 10.5642C21.3511 10.0534 21.7565 9.447 22.033 8.77954C22.3096 8.11208 22.4519 7.39668 22.4519 6.67419C22.4519 5.9517 22.3096 5.23629 22.033 4.56883C21.7565 3.90137 21.3511 3.29494 20.8401 2.78419Z" stroke="#303030" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button></div></div><div class="load-more" lastID="' +
1977              this.prid +
1978              '" style="display: none;"><img src="' +
1979              base_path +
1980              'public/images/load.gif" style="width: 33px;"/></div>';
1981          } else {
1982            allproducthtml +=
1983              '<div class="col-lg-3 col-md-4 col-sm-6"><div class="all_prod_outer_wrapper"><a href="' +
1984              base_path +
1985              "details/" +
1986              this.prdcod +
1987              "/" +
1988              this.prdvrnt +
1989              '"><div class="all_prod_outer_wrapper_img"><img src="' +
1990              igg +
1991              '" alt="' +
1992              this.productname +
1993              '" title="' +
1994              this.productname +
1995              '">' +
1996              outstck +
1997              '</div><div class="all_prod_outer_wrapper_details-txt"><div class="all_prod_outer_wrapper_details"><div class="all_prod_product_nm">' +
1998              this.productname +
1999              '</div><div class="all_prod_product_pr"><span class="prod_actPrice">' +
2000              this.mrp +
2001              '</span></div></div><div class="all_prod_outer_wrapper_btn"><button>
2001Quick View</button> </div></div></a><button class="add_to_wishlist ' +
2002              this.wishcntclr +
2003              '" id="rltid' +
2004              this.prid +
2005              '" onclick="addtowishlist(' +
2006              "'" +
2007              this.prdcod +
2008              "'" +
2009              "," +
2010              "'" +
2011              this.prdvrnt +
2012              "'" +
2013              "," +
2014              "'" +
2015              this.productname +
2016              "'" +
2017              "," +
2018              "'" +
2019              this.mrp +
2020              "'" +
2021              "," +
2022              "'" +
2023              this.selprc +
2024              "'" +
2025              "," +
2026              "'" +
2027              this.catid +
2028              "'" +
2029              "," +
2030              "'" +
2031              this.ipmg +
2032              "'" +
2033              "," +
2034              "'" +
2035              this.prid +
2036              "'" +
2037              ');"><svg width="24" height="20" viewBox="0 0 24 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.8401 2.78419C20.3294 2.27319 19.7229 1.86784 19.0555 1.59127C18.388 1.31471 17.6726 1.17236 16.9501 1.17236C16.2276 1.17236 15.5122 1.31471 14.8448 1.59127C14.1773 1.86784 13.5709 2.27319 13.0601 2.78419L12.0001 3.84419L10.9401 2.78419C9.90843 1.7525 8.50915 1.1729 7.05012 1.1729C5.59109 1.1729 4.19181 1.7525 3.16012 2.78419C2.12843 3.81588 1.54883 5.21516 1.54883 6.67419C1.54883 8.13322 2.12843 9.5325 3.16012 10.5642L4.22012 11.6242L10.5859 17.99C11.367 18.771 12.6333 18.771 13.4143 17.99L19.7801 11.6242L20.8401 10.5642C21.3511 10.0534 21.7565 9.447 22.033 8.77954C22.3096 8.11208 22.4519 7.39668 22.4519 6.67419C22.4519 5.9517 22.3096 5.23629 22.033 4.56883C21.7565 3.90137 21.3511 3.29494 20.8401 2.78419Z" stroke="#303030" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button></div></div><div class="load-more" lastID="' +
2038              this.prid +
2039              '" style="display: none;"><img src="' +
2040              base_path +
2041              'public/images/load.gif" style="width: 33px;"/></div>';
2042          }
2043        } else {
2044          allproducthtml +=
2045            '<div class="noproduct"><img src="' +
2046            base_path +
2047            'public/images/noproduct.png"><h3>No Product found !</h3></div><div class="load-more" lastID="0" style="display: none;"><img src="' +
2048            base_path +
2049            'public/images/load.gif" style="width: 33px;"/></div>';
2050        }
2051      });
2052      $("#showallproduct").html(allproducthtml);
2053      $(".loading-overlay").hide();
2054    },
2055    error: function (err) {
2056      //alert('Check your internet connection!');
2057    },
2058  });
2059}
2060
2061//contact
2062function SubmitContact() {
2063  var error = 0;
2064  var cont_name = $("#cont_name").val();
2065  var cont_phone = $("#cont_phone").val();
2066  var cont_email = $("#cont_email").val();
2067  var cont_message = $("#cont_message").val();
2068
2069  $.ajax({
2070    type: "POST",
2071    crossDomain: true,
2072    dataType: "json",
2073    cache: false,
2074    url: project_path + "SubmitContact.php",
2075    data: {
2076      name: cont_name,
2077      mobl: cont_phone,
2078      email: cont_email,
2079      message: cont_message,
2080    },
2081    beforeSend: function () {
2082      if (cont_name == "") {
2083        error += 1;
2084        $("#cont_name").css("border", "1px solid red");
2085        $("#cont_name").val("");
2086      } else {
2087        $("#cont_name").css("border", "1px solid #e1e1e1");
2088      }
2089      if (cont_phone == "") {
2090        error += 1;
2091        $("#cont_phone").css("border", "1px solid red");
2092        $("#cont_phone").val("");
2093      } else {
2094        if (isValid(cont_phone) == false) {
2095          error += 1;
2096          $("#cont_phone").css("border", "1px solid red");
2097          $("#invalid_mobl").html("Mobile Number can have only numbers.");
2098        } else {
2099          $("#cont_phone").css("border", "1px solid #e1e1e1");
2100        }
2101      }
2102      if (cont_email == "") {
2103        error += 1;
2104        $("#cont_email").css("border", "1px solid red");
2105        $("#cont_email").val("");
2106      } else {
2107        if (IsEmail(cont_email) == false) {
2108          error += 1;
2109          $("#invalid_email").html("Invalid Email ID");
2110          $("#invalid_email").show();
2111          var x = document.getElementById("invalid_email");
2112          x.className = "show";
2113          setTimeout(function () {
2114            $("#invalid_email").hide();
2115          }, 2500);
2116          $("#cont_email").css("border", "1px solid red");
2117        } else {
2118          $("#cont_email").css("border", "1px solid #e1e1e1");
2119        }
2120      }
2121      if (error > 0) {
2122        return false;
2123      }
2124      //$("#lodr").show();
2125      //$("#lodr_layr").show();
2126    },
2127    success: function (msg) {
2128      if (msg == 1) {
2129        $("#pop").show();
2130      }
2131    },
2132    error: function (err) {
2133      //alert(err);
2134      //alert('Check your internet connection!');
2135    },
2136  });
2137}
2138
2139function connectwithus() {
2140  var error = 0;
2141  var frd = new FormData();
2142  var story_name = $("#story_name").val();
2143  var story_purpose = $("#story_purpose").val();
2144  var story_email = $("#story_email").val();
2145  var story_message = $("#story_message").val();
2146  var prfil = $("#file")[0].files[0];
2147  frd.append("storyname", story_name);
2148  frd.append("storypurpose", story_purpose);
2149  frd.append("storyemail", story_email);
2150  frd.append("storymessage", story_message);
2151  frd.append("prfile", prfil);
2152  // for (var pair of frd.entries()) {
2153  // alert(pair[0]+ ', ' + pair[1]);
2154  // }
2155  if (story_name == "") {
2156    error += 1;
2157    $("#strynamerr").html("Your Name should not be blank!");
2158    $("#strynamerr").show();
2159    var x = document.getElementById("strynamerr");
2160    x.className = "show";
2161    setTimeout(function () {
2162      $("#strynamerr").hide();
2163    }, 2500);
2164  }
2165  if (story_purpose == "") {
2166    error += 1;
2167    $("#stryerr").html("Your Purpose should not be blank!");
2168    $("#stryerr").show();
2169    var x = document.getElementById("stryerr");
2170    x.className = "show";
2171    setTimeout(function () {
2172      $("#stryerr").hide();
2173    }, 2500);
2174  }
2175  if (story_email == "") {
2176    error += 1;
2177    $("#dupeml").html("Put your valid Email ID");
2178    $("#dupeml").show();
2179    var x = document.getElementById("dupeml");
2180    x.className = "show";
2181    setTimeout(function () {
2182      $("#dupeml").hide();
2183    }, 2500);
2184  } else {
2185    if (IsEmail(story_email) == false) {
2186      error += 1;
2187      $("#dupeml").html("Invalid Email ID");
2188      $("#dupeml").show();
2189      var x = document.getElementById("dupeml");
2190      x.className = "show";
2191      setTimeout(function () {
2192        $("#dupeml").hide();
2193      }, 2500);
2194    }
2195  }
2196  if (error > 0) {
2197    return false;
2198  }
2199  $.ajax({
2200    type: "POST",
2201    url: project_path + "connectwithus.php",
2202    data: frd,
2203    contentType: false,
2204    processData: false,
2205    beforeSend: function () {
2206      if (Object.keys(jQuery.browser)[0] == "mozilla") {
2207        $(".loading-overlay").show();
2208        setTimeout(function () {
2209          $(".loading-overlay").hide();
2210          $("#pop").show();
2211          $("input, textarea").val("");
2212        }, 1000);
2213      } else {
2214        $(".loading-overlay").show();
2215      }
2216    },
2217    success: function (msg) {
2218      if (msg == 1) {
2219        $("#pop").show();
2220      }
2221      $(".loading-overlay").hide();
2222    },
2223    error: function (err) {
2224      //alert(err);
2225      //alert('Check your internet connection!');
2226    },
2227  });
2228}
2229function verifyemail() {
2230  var error = 0;
2231  var verfy_email = $("#verfy_email").val();
2232  $("#otpmail").html(verfy_email);
2233  $.ajax({
2234    type: "POST",
2235    crossDomain: true,
2236    dataType: "json",
2237    cache: false,
2238    url: project_path + "verify-user-email.php",
2239    data: { email: verfy_email },
2240    beforeSend: function () {
2241      if (verfy_email == "") {
2242        error += 1;
2243        $("#verfy_email").css("border", "1px solid red");
2244        $("#verfy_email").val("");
2245      } else {
2246        if (IsEmail(verfy_email) == false) {
2247          error += 1;
2248          $("#invalid_vrfemail").html("Invalid Email ID");
2249          $("#invalid_vrfemail").show();
2250          var x = document.getElementById("invalid_vrfemail");
2251          setTimeout(function () {
2252            $("#invalid_vrfemail").hide();
2253          }, 2500);
2254          $("#verfy_email").css("border", "1px solid red");
2255        } else {
2256          $("#verfy_email").css("border", "1px solid #e1e1e1");
2257        }
2258      }
2259      if (error > 0) {
2260        return false;
2261      }
2262      $(".loading-overlay").show();
2263    },
2264    success: function (msg) {
2265      if (msg == 0) {
2266        $("#invalid_vrfemail").html("OTP Not Sent !");
2267        $("#invalid_vrfemail").show();
2268        var x = document.getElementById("invalid_vrfemail");
2269        setTimeout(function () {
2270          $("#invalid_vrfemail").hide();
2271        }, 2500);
2272      }
2273      if (msg == 1) {
2274        $(".inner-lg-frm6").css({ display: "block" });
2275        $(".inner-lg-frm5").css({ display: "none" });
2276        $(".inner-lg-frm4").css({ display: "none" });
2277        $(".inner-lg-frm3").css({ display: "none" });
2278        $(".inner-lg-frm2").css({ display: "none" });
2279        $(".inner-lg-frm").css({ display: "none" });
2280      }
2281      if (msg == 2) {
2282        $("#invalid_vrfemail").html("Please Put Your Registered Email ID !");
2283        $("#invalid_vrfemail").show();
2284        var x = document.getElementById("invalid_vrfemail");
2285        setTimeout(function () {
2286          $("#invalid_vrfemail").hide();
2287        }, 2500);
2288      }
2289      $(".loading-overlay").hide();
2290    },
2291    error: function (err) {
2292      //alert(err);
2293      //alert('Check your internet connection!');
2294    },
2295  });
2296}
2297function verifyotp() {
2298  var error = 0;
2299  var vrfyotp = $("#vrfyotp").val();
2300  var vrfypaswrd = $("#vrfypaswrd").val();
2301  var cnfrmvrfypaswrd = $("#cnfrmvrfypaswrd").val();
2302
2303  $.ajax({
2304    type: "POST",
2305    crossDomain: true,
2306    dataType: "json",
2307    cache: false,
2308    url: project_path + "verify-otp.php",
2309    data: { votp: vrfyotp, vrpwd: vrfypaswrd },
2310    beforeSend: function () {
2311      if (vrfyotp == "") {
2312        error += 1;
2313        $("#vrfyotp").css("border", "1px solid red");
2314        $("#vrfyotp").val("");
2315      } else {
2316        $("#vrfyotp").css("border", "1px solid #e1e1e1");
2317      }
2318      if (vrfypaswrd == "") {
2319        error += 1;
2320        $("#vrfypaswrd").css("border", "1px solid red");
2321        $("#vrfypaswrd").val("");
2322      } else {
2323        $("#vrfypaswrd").css("border", "1px solid #e1e1e1");
2324      }
2325      if (cnfrmvrfypaswrd == "") {
2326        error += 1;
2327        $("#cnfrmvrfypaswrd").css("border", "1px solid red");
2328        $("#cnfrmvrfypaswrd").val("");
2329      } else {
2330        if (vrfypaswrd != cnfrmvrfypaswrd) {
2331          $("#cnfrmvrfypaswrd").css("border", "1px solid red");
2332          $("#cnfrmvrfypaswrd").val("");
2333          $("#cnfrmvrfypaswrd").attr(
2334            "placeholder",
2335            "Confirm password should be same with New password!",
2336          );
2337        } else {
2338          $("#cnfrmvrfypaswrd").css("border", "1px solid #e1e1e1");
2339        }
2340      }
2341      if (error > 0) {
2342        return false;
2343      }
2344      //$("#lodr").show();
2345      //$("#lodr_layr").show();
2346    },
2347    success: function (msg) {
2348      if (msg == 1) {
2349        window.location.href = base_path + "login";
2350      }
2351      if (msg == 2) {
2352        $("#invld_lgnerr").html("Inavalid OTP !");
2353        $("#invld_lgnerr").show();
2354        var x = document.getElementById("invld_lgnerr");
2355        setTimeout(function () {
2356          $("#invld_lgnerr").hide();
2357        }, 2500);
2358      }
2359    },
2360    error: function (err) {
2361      //alert(err);
2362      //alert('Check your internet connection!');
2363    },
2364  });
2365}
2366
2367function loadmoreproduct(page_num) {
2368  $(window).scrollTop(0);
2369  page_num = page_num ? page_num : 0;
2370  var catid = $("#catid").val();
2371  filterfabric = [];
2372  $("input:checkbox[name=filter_fabric]:checked").each(function () {
2373    filterfabric.push($(this).val());
2374  });
2375  filterdesign = [];
2376  $("input:checkbox[name=filter_design]:checked").each(function () {
2377    filterdesign.push($(this).val());
2378  });
2379  filteroccasion = [];
2380  $("input:checkbox[name=filter_occasion]:checked").each(function () {
2381    filteroccasion.push($(this).val());
2382  });
2383  filterblouse = [];
2384  $("input:checkbox[name=filter_blouse]:checked").each(function () {
2385    filterblouse.push($(this).val());
2386  });
2387  filtercolor = [];
2388  $("input:checkbox[name=filter_color]:checked").each(function () {
2389    filtercolor.push($(this).val());
2390  });
2391  pricebet = [];
2392  $("input:checkbox[name=filter_price]:checked").each(function () {
2393    pricebet.push($(this).val());
2394  });
2395  var pricstrng = pricebet.toString();
2396  var nameArr = pricstrng.split(",");
2397  var prc_ragmin = nameArr[0];
2398  var prc_ragmax = nameArr[nameArr.length - 1];
2399
2400  var catid = getUrlParameter("catid");
2401  var catnam = getUrlParameter("catnam");
2402  if (pathArray == ",product.php") {
2403    history.pushState(
2404      { page: 1 },
2405      "title 1",
2406      "?catid=" +
2407        catid +
2408        "&catnam=" +
2409        catnam +
2410        "&pag=" +
2411        page_num +
2412        "&fbrc=" +
2413        filterfabric +
2414        "&dsgn=" +
2415        filterdesign +
2416        "&ocsn=" +
2417        filteroccasion +
2418        "&clr=" +
2419        filtercolor +
2420        "&blos=" +
2421        filterblouse +
2422        "&mnprc=" +
2423        prc_ragmin +
2424        "&mxprc=" +
2425        prc_ragmax,
2426    );
2427  }
2428  var fltrallproducthtml = "";
2429  $.ajax({
2430    type: "POST",
2431    url: project_path + "loadmoreproduct.php",
2432    data:
2433      "minprice=" +
2434      prc_ragmin +
2435      "&maxprice=" +
2436      prc_ragmax +
2437      "&blouseid=" +
2438      filterblouse +
2439      "&colorid=" +
2440      filtercolor +
2441      "&occasionid=" +
2442      filteroccasion +
2443      "&designid=" +
2444      filterdesign +
2445      "&fabricid=" +
2446      filterfabric +
2447      "&page=" +
2448      page_num +
2449      "&prdctcatid=" +
2450      catid,
2451    beforeSend: function () {
2452      $(".loading-overlay").show();
2453    },
2454    success: function (response) {
2455      $(".loading-overlay").hide();
2456      $("#postContent").html(response);
2457    },
2458  });
2459}
2460
2461function loginasguest(gst) {
2462  if (gst == 1) {
2463    $(".loginguestdiv").show();
2464    $(".logindiv").hide();
2465  } else {
2466    $("#votplog").hide();
2467    $(".loginguestdiv").hide();
2468    $(".logindiv").show();
2469  }
2470}
2471
2472function sendotp() {
2473  var error = 0;
2474  var gustfirstname = $("#gustfirstname").val();
2475  var gustlastname = $("#gustlastname").val();
2476  var gustemail = $("#gustemail").val();
2477  var gustmobile = $("#gustmobile").val();
2478  var userfrom = "WEB";
2479  $.ajax({
2480    type: "POST",
2481    crossDomain: true,
2482    dataType: "json",
2483    cache: false,
2484    url: project_path + "add-tempguest-user.php",
2485    data: {
2486      firstname: gustfirstname,
2487      lastname: gustlastname,
2488      email: gustemail,
2489      mobl: gustmobile,
2490      usrfrom: userfrom,
2491    },
2492    beforeSend: function () {
2493      if (gustfirstname == "") {
2494        error += 1;
2495        $("#gustfirstname").css("border", "1px solid red");
2496        $("#gustfirstname").val("");
2497      } else {
2498        $("#gustfirstname").css("border", "1px solid #e1e1e1");
2499      }
2500      if (gustlastname == "") {
2501        error += 1;
2502        $("#gustlastname").css("border", "1px solid red");
2503        $("#gustlastname").val("");
2504      } else {
2505        $("#gustlastname").css("border", "1px solid #e1e1e1");
2506      }
2507      if (gustemail == "") {
2508        error += 1;
2509        $("#gustemail").css("border", "1px solid red");
2510        $("#gustemail").val("");
2511      } else {
2512        if (IsEmail(gustemail) == false) {
2513          error += 1;
2514          $("#invld_lgnerr").html("Invalid Email ID");
2515          $("#invld_lgnerr").show();
2516          var x = document.getElementById("invld_lgnerr");
2517          x.className = "show";
2518          setTimeout(function () {
2519            $("#invld_lgnerr").hide();
2520          }, 2500);
2521          $("#gustemail").css("border", "1px solid red");
2522        } else {
2523          $("#gustemail").css("border", "1px solid #e1e1e1");
2524        }
2525      }
2526      if (gustmobile == "") {
2527        error += 1;
2528        $("#gustmobile").css("border", "1px solid red");
2529        $("#gustmobile").val("");
2530      } else {
2531        $("#gustmobile").css("border", "1px solid #e1e1e1");
2532      }
2533
2534      if (error > 0) {
2535        return false;
2536      }
2537      $(".loading-overlay").show();
2538    },
2539    success: function (msg) {
2540      if (msg == 1) {
2541        location.reload();
2542      }
2543      if (msg == 2) {
2544        $("#invld_lgnerr").html("Email Id or Mobile No. already exist !");
2545        $("#invld_lgnerr").show();
2546        setTimeout(function () {
2547          $("#invld_lgnerr").hide();
2548        }, 2500);
2549      }
2550      $(".loading-overlay").hide();
2551      $("body").removeClass("fixbody");
2552    },
2553    error: function (err) {
2554      //alert(err);
2555      //alert('Check your internet connection!');
2556    },
2557  });
2558}
2559function veryfyguestotp() {
2560  var error = 0;
2561  var veryfyotp = $("#veryfyotp").val();
2562  $.ajax({
2563    type: "POST",
2564    crossDomain: true,
2565    dataType: "json",
2566    cache: false,
2567    url: project_path + "add-guest-user.php",
2568    data: { veryfotp: veryfyotp },
2569    beforeSend: function () {
2570      if (veryfyotp == "") {
2571        error += 1;
2572        $("#veryfyotp").css("border", "1px solid red");
2573        $("#veryfyotp").val("");
2574      } else {
2575        $("#veryfyotp").css("border", "1px solid #e1e1e1");
2576      }
2577      if (error > 0) {
2578        return false;
2579      }
2580      $(".loading-overlay").show();
2581    },
2582    success: function (msg) {
2583      if (msg == 1) {
2584        location.reload();
2585      }
2586      if (msg == 2) {
2587        $("#invld_lgnerr").html("Invalid OTP !");
2588        $("#invld_lgnerr").show();
2589        setTimeout(function () {
2590          $("#invld_lgnerr").hide();
2591        }, 2500);
2592      }
2593      $(".loading-overlay").hide();
2594      $("body").removeClass("fixbody");
2595    },
2596    error: function (err) {
2597      //alert(err);
2598      //alert('Check your internet connection!');
2599    },
2600  });
2601}
2602
2603function guestuserlogintype(gstlgty) {
2604  if (gstlgty == 1) {
2605    $("#loginwithemail").show();
2606    $("#loginwithotp").hide();
2607  } else {
2608    $("#loginwithemail").hide();
2609    $("#loginwithotp").show();
2610  }
2611}
2612
2613function guestuserlogin() {
2614  var error = 0;
2615  var guestuseremail = $("#guestuseremail").val();
2616  $.ajax({
2617    type: "POST",
2618    crossDomain: true,
2619    dataType: "json",
2620    cache: false,
2621    url: project_path + "guestuserlogin.php",
2622    data: { email: guestuseremail },
2623    beforeSend: function () {
2624      if (guestuseremail == "") {
2625        error += 1;
2626        $("#guestuseremail").css("border", "1px solid red");
2627        $("#guestuseremail").val("");
2628      } else {
2629        if (IsEmail(guestuseremail) == false) {
2630          error += 1;
2631          $("#invld_lgnerr").html("Invalid Email ID");
2632          $("#invld_lgnerr").show();
2633          var x = document.getElementById("invld_lgnerr");
2634          x.className = "show";
2635          setTimeout(function () {
2636            $("#invld_lgnerr").hide();
2637          }, 2500);
2638          $("#guestuseremail").css("border", "1px solid red");
2639        } else {
2640          $("#guestuseremail").css("border", "1px solid #e1e1e1");
2641        }
2642      }
2643      if (error > 0) {
2644        return false;
2645      }
2646      $(".loading-overlay").show();
2647    },
2648    success: function (msg) {
2649      if (msg == 1) {
2650        location.reload();
2651      }
2652      if (msg == 2) {
2653        $("#invld_lgnerr").html("Wrong Email Id !");
2654        $("#invld_lgnerr").show();
2655        setTimeout(function () {
2656          $("#invld_lgnerr").hide();
2657        }, 2500);
2658      }
2659      $(".loading-overlay").hide();
2660      $("body").removeClass("fixbody");
2661    },
2662    error: function (err) {
2663      //alert(err);
2664      //alert('Check your internet connection!');
2665    },
2666  });
2667}
2668
2669function guestuserloginwithotp() {
2670  var error = 0;
2671  var guestuserotp = $("#guestuserotp").val();
2672  $.ajax({
2673    type: "POST",
2674    crossDomain: true,
2675    dataType: "json",
2676    cache: false,
2677    url: project_path + "guestuserloginwithotp.php",
2678    data: { veryfotp: guestuserotp },
2679    beforeSend: function () {
2680      if (guestuserotp == "") {
2681        error += 1;
2682        $("#guestuserotp").css("border", "1px solid red");
2683        $("#guestuserotp").val("");
2684      } else {
2685        $("#guestuserotp").css("border", "1px solid #e1e1e1");
2686      }
2687      if (error > 0) {
2688        return false;
2689      }
2690      $(".loading-overlay").show();
2691    },
2692    success: function (msg) {
2693      if (msg == 1) {
2694        window.location.href = base_path + "profile";
2695      }
2696      if (msg == 2) {
2697        $("#invld_lgnerr").html("Invalid OTP !");
2698        $("#invld_lgnerr").show();
2699        setTimeout(function () {
2700          $("#invld_lgnerr").hide();
2701        }, 2500);
2702      }
2703      $(".loading-overlay").hide();
2704      $("body").removeClass("fixbody");
2705    },
2706    error: function (err) {
2707      //alert(err);
2708      //alert('Check your internet connection!');
2709    },
2710  });
2711}
2712
2713function loadevent() {
2714  var evntlistid = "";
2715  var evntlistid1 = "";
2716  $.ajax({
2717    type: "POST",
2718    dataType: "JSON",
2719    crossDomain: true,
2720    cache: false,
2721    url: project_path + "loadevent.php",
2722    ContentType: "application/json",
2723    beforeSend: function () {
2724      //$("#lodr").show();
2725      //$("#lodr_layr").show();
2726    },
2727    success: function (response) {
2728      $.each(response.araeventlist, function () {
2729        if (this.nodt != 0) {
2730          if (this.eventtype == 1) {
2731            evntlistid +=
2732              '<div class="ev-tp1"> <a href="event-details?eventid=' +
2733              this.evnt_id +
2734              '"> <img src="public/images/uploads/' +
2735              this.imag +
2736              '" alt=""> </a> <div class="ev-tp1-txt"> <h2>' +
2737              this.eventtitle +
2738              "</h2> </div></div>";
2739          }
2740          if (this.eventtype == 2) {
2741            evntlistid1 +=
2742              '<div class="ev-tp1"> <a href="event-details?eventid=' +
2743              this.evnt_id +
2744              '"> <img src="public/images/uploads/' +
2745              this.imag +
2746              '" alt=""> </a> <div class="ev-tp1-txt"> <h2>' +
2747              this.eventtitle +
2748              "</h2> </div></div>";
2749          }
2750        } else {
2751          evntlistid +=
2752            '<div class=""><p style="color:red;text-align:center;">No data found !</p></div>';
2753          evntlistid1 +=
2754            '<div class=""><p style="color:red;text-align:center;">No data found !</p></div>';
2755        }
2756        $("#eventid").html(evntlistid);
2757        $("#eventid1").html(evntlistid1);
2758      });
2759    },
2760    error: function (err) {
2761      //alert(err);
2762      //alert('Check your internet connection!');
2763    },
2764  });
2765}
2766function searchproduct() {
2767  var search = $("#myInput").val();
2768  $.ajax({
2769    type: "POST",
2770    crossDomain: true,
2771    dataType: "json",
2772    cache: false,
2773    url: project_path + "searchproduct.php",
2774    data: { searchprdct: search },
2775    beforeSend: function () {
2776      //$("#lodr").show();
2777      //$("#lodr_layr").show();
2778    },
2779    success: function (response) {
2780      $.each(response.araysrchprdctlist, function () {
2781        window.location.href =
2782          base_path + "details/" + this.prdcod + "/" + this.prdvrnt;
2783      });
2784    },
2785    error: function (err) {
2786      //alert(err);
2787      //alert('Check your internet connection!');
2788    },
2789  });
2790}
2791
2792function loadsubscribedtl() {
2793  var magazinelist = pathArray[2];
2794
2795  var allsbscrlistt = "";
2796  $.ajax({
2797    type: "POST",
2798    dataType: "JSON",
2799    crossDomain: true,
2800    cache: false,
2801    url: project_path + "loadsubscribe.php",
2802    ContentType: "application/json",
2803    data: { magazincat: magazinelist },
2804    beforeSend: function () {
2805      $(".loading-overlay").show();
2806    },
2807    success: function (response) {
2808      $.each(response.araysbsrblist, function () {
2809        if (this.img != "" || this.img != null) {
2810          var igg = base_path + "public/images/products/" + this.img;
2811        }
2812        if (this.img == "" || this.img == null) {
2813          var igg = base_path + "public/images/products/nomig.jpg";
2814        }
2815        if (this.nodt != 0) {
2816          $(".magzndiv").show();
2817          $("#no-product").hide();
2818          allsbscrlistt +=
2819            '<div class="col"><div class="mag-no mag-no11"> <a href="' +
2820            base_path +
2821            "subscribe-sub-details/" +
2822            this.sbscid +
2823            '/Soft-Copy"> <img src="' +
2824            igg +
2825            '"/></a> <h5 class="hc">' +
2826            this.subscrptntitle +
2827            '</h5> <div class="price-chart"> <h3 class="new-price">₹ ' +
2828            this.softprice +
2829            '</h3> <div class="add"> <a href="' +
2830            base_path +
2831            "subscribe-sub-details/" +
2832            this.sbscid +
2833            '/Soft-Copy" >Subscribe</a> </div></div></div></div>';
2834        } else {
2835          $(".magzndiv").hide();
2836          $("#no-product").show();
2837        }
2838      });
2839      $("#allsbscrbrlistid").html(allsbscrlistt);
2840      $(".loading-overlay").hide();
2841    },
2842    error: function (err) {
2843      //alert(err);
2844      //alert('Check your internet connection!');
2845    },
2846  });
2847}
2848
2849function loadSubscribe() {
2850  var magazinelist = $("#magazinelist").val();
2851  var plan_for = $("#plan_for").val();
2852  var plan_year = $("#plan_year").val();
2853  var allsbscrlist = "";
2854  $.ajax({
2855    type: "POST",
2856    dataType: "JSON",
2857    crossDomain: true,
2858    cache: false,
2859    url: project_path + "loadsubscribe.php",
2860    ContentType: "application/json",
2861    data: { magazincat: magazinelist, planfor: plan_for, planyear: plan_year },
2862    beforeSend: function () {
2863      $(".loading-overlay").show();
2864    },
2865    success: function (response) {
2866      $.each(response.araysbsrblist, function () {
2867        if (this.img != "" || this.img != null) {
2868          var igg = base_path + "public/images/products/" + this.img;
2869        }
2870        if (this.img == "" || this.img == null) {
2871          var igg = base_path + "public/images/products/nomig.jpg";
2872        }
2873        if (this.nodt != 0) {
2874          $(".magzndiv").show();
2875          $("#no-product").hide();
2876          allsbscrlist +=
2877            '<div class="col"><div class="mag-no mag-no11"> <a href="' +
2878            base_path +
2879            "subscribe-sub-details/" +
2880            this.sbscid +
2881            '/Soft-Copy"> <img src="' +
2882            igg +
2883            '"/></a> <h5 class="hc">' +
2884            this.subscrptntitle +
2885            '</h5> <div class="price-chart"> <h3 class="new-price">₹ ' +
2886            this.softprice +
2887            '</h3> <div class="add"> <a href="' +
2888            base_path +
2889            "subscribe-sub-details/" +
2890            this.sbscid +
2891            '/Soft-Copy" >Subscribe</a> </div></div></div></div>';
2892        } else {
2893          $(".magzndiv").hide();
2894          $("#no-product").show();
2895        }
2896      });
2897      $("#allsbscrbrlistid").html(allsbscrlist);
2898      $(".loading-overlay").hide();
2899    },
2900    error: function (err) {
2901      //alert(err);
2902      //alert('Check your internet connection!');
2903    },
2904  });
2905}
2906
2907function loadsubscriptiondetails() {
2908  var prdvt = prdvarnt.replaceAll("-", " ");
2909  $.ajax({
2910    type: "POST",
2911    dataType: "JSON",
2912    crossDomain: true,
2913    cache: false,
2914    url: project_path + "loadsubscriptiondetails.php",
2915    data: { subscrptnid: prdcode, prdctvarnt: prdvt },
2916    ContentType: "application/json",
2917    beforeSend: function () {
2918      //$("#lodr").show();
2919      //$("#lodr_layr").show();
2920    },
2921    success: function (response) {
2922      $.each(response.mysubsvrptndtl, function () {
2923        if (prdvt == "Soft Copy") {
2924          $("#sbdesp").html(this.descriptin);
2925          var sftchk = "CHECKED";
2926        } else {
2927          var sftchk = "";
2928        }
2929        if (prdvt == "Hard Copy") {
2930          $("#sbdesp").html(this.harddescription);
2931          var hrdchk = "CHECKED";
2932        } else {
2933          var hrdchk = "";
2934        }
2935        if (this.hardprice != "0.00") {
2936          var hrdcpy =
2937            '<div class="chk2"><input type="radio" ' +
2938            hrdchk +
2939            ' id="hardid" name="copy_type" value="Hard Copy" onclick="getcopytype(' +
2940            "'" +
2941            prdcode +
2942            "'" +
2943            "," +
2944            "'Hard-Copy'" +
2945            ');"><label for="hardid" class="hrdcpy"> <span>Hard Copy</span></label></div>';
2946        } else {
2947          var hrdcpy = "";
2948        }
2949        $("#sbprdnm").html(this.subscrptntitle);
2950        $("#sbprd_code").html(this.prodcode);
2951        $("#sbmagimg").html(
2952          '<img class="w-100" src="' +
2953            base_path +
2954            "public/images/products/" +
2955            this.img +
2956            '" alt="' +
2957            this.subscrptntitle +
2958            '" title="' +
2959            this.subscrptntitle +
2960            '">',
2961        );
2962        $("#sbprdprc").html("<p>₹" + this.pric + "</p>");
2963        $("#copytyp").html(
2964          '<div class="chk1"><input type="radio" ' +
2965            sftchk +
2966            ' id="softid" name="copy_type" value="Soft Copy" onclick="getcopytype(' +
2967            "'" +
2968            prdcode +
2969            "'" +
2970            "," +
2971            "'Soft-Copy'" +
2972            ');"><label for="softid" class="sftcpy"> <span>Soft Copy</span></label></div>' +
2973            hrdcpy,
2974        );
2975        if (this.addcart == 1) {
2976          $("#sbcartbtn").html(
2977            '<a href="javascript:void(0);" onclick="addtocart(' +
2978              "'" +
2979              prdcode +
2980              "'" +
2981              "," +
2982              "'" +
2983              prdvt +
2984              "'" +
2985              "," +
2986              "'" +
2987              this.subscrptntitle +
2988              "'" +
2989              "," +
2990              "'" +
2991              this.pric +
2992              "'" +
2993              "," +
2994              "'" +
2995              this.pric +
2996              "'" +
2997              "," +
2998              "'" +
2999              this.catid +
3000              "'" +
3001              "," +
3002              "'" +
3003              this.img +
3004              "'" +
3005              ',1);">
3005Add to Cart</a>',
3006          );
3007        } else {
3008          if (pathArray[1] == "subscribe-sub-details") {
3009            $("#sbcartbtn").html(
3010              '<a href="' + base_path + 'checkout">Go to Cart</a>',
3011            );
3012          } else {
3013            $("#sbcartbtn").html(
3014              '<a href="' + base_path + 'cart">Go to Cart</a>',
3015            );
3016          }
3017        }
3018      });
3019    },
3020    error: function (err) {
3021      //alert(err);
3022      //alert('Check your internet connection!');
3023    },
3024  });
3025}
3026
3027function getcopytype(catid, prdvt) {
3028  window.location.href =
3029    base_path + "subscribe-sub-details/" + catid + "/" + prdvt;
3030}
3031
3032function loadmysubscription() {
3033  var subscrptnlistid = "";
3034  $.ajax({
3035    type: "POST",
3036    dataType: "JSON",
3037    crossDomain: true,
3038    cache: false,
3039    url: project_path + "loadmysubscriptionlist.php",
3040    ContentType: "application/json",
3041    beforeSend: function () {
3042      //$("#lodr").show();
3043      //$("#lodr_layr").show();
3044    },
3045    success: function (response) {
3046      $.each(response.mysubscrptnlist, function () {
3047        if (this.nodt != 0) {
3048          if (this.orderstatus == "DELIVERED" && this.vriant == "Soft Copy") {
3049            var ordsts = "SUBSCRIBED";
3050          } else {
3051            var ordsts = this.orderstatus;
3052          }
3053          subscrptnlistid +=
3054            '<div class="col-lg-6 col-md-12 col-sm-12"><div class="ord w-100"><div class="order-type"><div class="order-hd"><h3>Subscription Accomplished</h3><div class="order-id"><h6>' +
3055            this.orderid +
3056            " <span>" +
3057            this.orderdate +
3058            '</span></h6></div><div class="pending-bt"><a href="#" style="color:' +
3059            this.clrcls +
3060            '">' +
3061            ordsts +
3062            '</a></div></div><div class="order-img"><img src="public/image/kdm.png" alt=""><div class="order-price"><h6>₹' +
3063            this.totalamnt +
3064            '</h6></div></div></div><hr><div class="dts-bt"><a href="' +
3065            base_path +
3066            "subscription-details/" +
3067            this.orderid +
3068            '">View Details</a></div></div></div>';
3069        } else {
3070          subscrptnlistid +=
3071            '<div class="col-lg-6 col-md-12 col-sm-12"><div class="ord w-100"><div class="order-type"><div class="order-hd"><h3 style="color:red;text-align:center;">No subscription found !</h3></div></div></div></div>';
3072        }
3073      });
3074      $("#mysubscription").html(subscrptnlistid);
3075    },
3076    error: function (err) {
3077      //alert(err);
3078      //alert('Check your internet connection!');
3079    },
3080  });
3081}
3082
3083function loadmysubscriptiondetails() {
3084  var ordrid = $("#ordrid").val();
3085  var sborddtlid = "";
3086  $.ajax({
3087    type: "POST",
3088    dataType: "JSON",
3089    crossDomain: true,
3090    cache: false,
3091    url: project_path + "loadmysubscriptiondetails.php",
3092    data: { orderid: ordrid },
3093    ContentType: "application/json",
3094    beforeSend: function () {
3095      //$("#lodr").show();
3096      //$("#lodr_layr").show();
3097    },
3098    success: function (response) {
3099      $.each(response.mysubscrptndtl, function () {
3100        var sltstmagznlst = this.sltstmagznlst.split(",");
3101        var sltstyearlst = this.sltstyearlst.split(",");
3102        var sltstmonthlst = this.sltstmonthlst.split(",");
3103        var sltprodcodelst = this.sltprodcodelst.split(",");
3104
3105        var sbrdmor = "";
3106        if (this.varant == "Soft Copy") {
3107          if (this.ordersts == "DELIVERED") {
3108            $.each(sltstmagznlst, function (key, value) {
3109              if (value != "") {
3110                sbrdmor +=
3111                  '<div class="year-bt"><span class="fa fa-book" aria-hidden="true"><a href="' +
3112                  base_path +
3113                  "user-magazine/" +
3114                  sltprodcodelst[key] +
3115                  '/" target="_blank">' +
3116                  sltstmonthlst[key] +
3117                  ", " +
3118                  sltstyearlst[key] +
3119                  "</a></span></div>";
3120              } else {
3121                sbrdmor += "";
3122              }
3123            });
3124          } else {
3125            var sbrdmor =
3126              '<div class="rd-mr"><span style="color: #e10f0f;letter-spacing: 1px;">
3126You can read the magazine once admin verifies your order.</span></div>';
3127          }
3128
3129          // else if(this.prdocatid ==3)
3130          // {
3131          // if(this.ordersts =='DELIVERED')
3132          // {
3133          // $.each(sltstmagznlst, function(key,value)
3134          // {
3135          // if(value !='')
3136          // {
3137          // sbrdmor+='<div class="year-bt"><span class="fa fa-book" aria-hidden="true"><a href="'+base_path+'user-magazine/'+sltprodcodelst[key]+'/" target="_blank">'+sltstmonthlst[key]+', '+sltstyearlst[key]+'</a></span></div>';
3138          // }
3139          // else
3140          // {
3141          // sbrdmor+='';
3142          // }
3143          // });
3144          // }
3145          // else
3146          // {
3147          // var sbrdmor='<div class="rd-mr"><span style="color: #e10f0f;letter-spacing: 1px;">You can read the magazine once admin verifies your order.</span></div>';
3148          // }
3149          // }
3150          // else
3151          // {
3152          // var sbrdmor='';
3153          // }
3154        } else {
3155          var sbrdmor = "";
3156        }
3157        if (this.nodt != 0) {
3158          if (this.ordersts == "DELIVERED") {
3159            if (this.issub > 0) {
3160              var subscdate =
3161                "<span>" +
3162                this.subscriptdat +
3163                " - " +
3164                this.endsubscriptdat +
3165                "</span>";
3166            } else {
3167              var subscdate = "";
3168            }
3169            $("#sbordsts").html("SUBSCRIBED");
3170          } else {
3171            var subscdate = "";
3172            $("#sbordsts").html(this.ordersts);
3173          }
3174
3175          sborddtlid +=
3176            '<li class="od-li"> <div class="mgm-img"> <img src="' +
3177            base_path +
3178            "public/images/products/" +
3179            this.prdimg +
3180            '" alt="' +
3181            this.prodname +
3182            '" title="' +
3183            this.prodname +
3184            '"> </div><div class="mg-name-prc"> <h3>' +
3185            this.prodname +
3186            '</h3> <div class="price-crs"> <span>One Time Plan, ₹' +
3187            this.prchsunitprice +
3188            " × " +
3189            this.quantity +
3190            "</span><br>" +
3191            subscdate +
3192            ' </div><div class="bokbxlst">' +
3193            sbrdmor +
3194            '</div></div><div class="prccc"> <p>₹' +
3195            this.totalamnt +
3196            "</p></div></li><hr>";
3197        } else {
3198          sborddtlid +=
3199            '<li class="od-li"> <div class="mgm-img" style="text-align:center;color:red">No data found !</div></li>';
3200        }
3201        $("#mysubscrptndtl").html(sborddtlid);
3202        $("#sbordiddate").html(this.orddate);
3203        $("#sbordnumb").html(ordrid);
3204        if (this.shpngcharge != "0.00") {
3205          $("#shpngcharge").html(
3206            '<div class="od-date1"><p>Shipping charge : </p><p>₹' +
3207              this.shpngcharge +
3208              "</p></div>",
3209          );
3210        }
3211        $("#sbgdtot").html("₹" + this.subtotal);
3212        $("#sbgrndtot").html("₹" + this.totalamnt);
3213        if (this.razorpaymentid != null) {
3214          $("#sbtransid").html("Online (TXN ID: " + this.razorpaymentid + ")");
3215        } else {
3216          $("#sbtransid").html("Offline");
3217        }
3218        if (this.dlvrid != 0) {
3219          $(".sh-address").show();
3220          $("#sbdlvradrs").html(
3221            "<h3>" +
3222              this.delname +
3223              '</h3><div class="s-dt-ad"><p>' +
3224              this.delflatno +
3225              ", " +
3226              this.deladrs +
3227              "<br>" +
3228              this.landmrk +
3229              "<br>" +
3230              this.pincod +
3231              ", " +
3232              this.state +
3233              "</p><h3>Contact : " +
3234              this.delmobl +
3235              "</h3></div>",
3236          );
3237        } else {
3238          $(".sh-address").hide();
3239        }
3240        if (this.ordersts == "DELIVERED") {
3241          if (this.varant == "Hard Copy") {
3242            $("#sbordrftrlink").html(
3243              '<a href="' +
3244                base_path +
3245                "order-receipt?ordr=" +
3246                ordrid +
3247                '" target="_blank"> <div class="print"> <span class="fa fa-print"></span> <span>Print Invoice</span> </div></a> <a href="contact-us"> <div class="print"> <span class="fa fa-cloud"></span> <span>Connect With Us</span> </div></a>',
3248            );
3249          } else {
3250            $("#sbordrftrlink").html(
3251              '<a href="' +
3252                base_path +
3253                'contact-us"> <div class="print"> <span class="fa fa-cloud"></span> <span>Connect With Us</span> </div></a>',
3254            );
3255          }
3256        } else {
3257          $("#sbordrftrlink").html(
3258            '<a href="' +
3259              base_path +
3260              'contact-us"> <div class="print"> <span class="fa fa-cloud"></span> <span>Connect With Us</span> </div></a>',
3261          );
3262        }
3263      });
3264    },
3265    error: function (err) {
3266      //alert(err);
3267      //alert('Check your internet connection!');
3268    },
3269  });
3270}
3271
3272function getmagazincopytype(prdctcod, copytype) {
3273  window.location.href = base_path + "details/" + prdctcod + "/" + copytype;
3274}
3275$("#btnpayment").click(function () {
3276  $(".loading-overlay").show();
3277});
3278
3279function loadstory() {
3280  var storylistid = "";
3281  $.ajax({
3282    type: "POST",
3283    dataType: "JSON",
3284    crossDomain: true,
3285    cache: false,
3286    url: project_path + "loadstory.php",
3287    ContentType: "application/json",
3288    beforeSend: function () {
3289      //$("#lodr").show();
3290      //$("#lodr_layr").show();
3291    },
3292    success: function (response) {
3293      $.each(response.mystorylist, function () {
3294        if (this.nodt != 0) {
3295          var myString = this.ttle;
3296          var urlString = myString.replace(/\s+/g, "-");
3297          storylistid +=
3298            '<div class="col-lg-4 col-md-4 col-sm-6"><a href="story-details/' +
3299            this.stryid +
3300            "/" +
3301            urlString +
3302            '" class="ev-tp1 w-100 d-block"> <div> <img src="public/images/uploads/' +
3303            this.imag +
3304            '" alt=""> </div> <div class="ev-tp1-txt1"> <div class="auth"> <span class="fa fa-pen"></span> <div class="story-by"><p>' +
3305            this.nam +
3306            "</p><p>" +
3307            this.ttle +
3308            "</p></div></div></div></a></div>";
3309        } else {
3310          storylistid +=
3311            '<div class="col-lg-4 col-md-4 col-sm-6"><div class="ev-tp1"><h3 style="color:red;text-align:center;">No story found !</h3></div></div>';
3312        }
3313      });
3314      $("#mystory").html(storylistid);
3315    },
3316    error: function (err) {
3317      //alert(err);
3318      //alert('Check your internet connection!');
3319    },
3320  });
3321}
3322
3323function loadStoryForHome() {
3324  var storylistidhm = "";
3325  $.ajax({
3326    type: "POST",
3327    dataType: "JSON",
3328    crossDomain: true,
3329    cache: false,
3330    url: project_path + "loadstoryhome.php",
3331    ContentType: "application/json",
3332    beforeSend: function () {
3333      //$("#lodr").show();
3334      //$("#lodr_layr").show();
3335    },
3336    success: function (response) {
3337      $.each(response.mystorylist, function () {
3338        if (this.nodt != 0) {
3339          var myString = this.ttle;
3340          var urlString = myString.replace(/\s+/g, "-");
3341          storylistidhm +=
3342            '<div class="col-lg-4 col-md-4 col-sm-6"><a href="story-details/' +
3343            this.stryid +
3344            "/" +
3345            urlString +
3346            '" class="ev-tp1 w-100 d-block"> <div> <img src="public/images/uploads/' +
3347            this.imag +
3348            '" alt=""> </div> <div class="ev-tp1-txt1"> <div class="auth"> <span class="fa fa-pen"></span> <div class="story-by"><p>' +
3349            this.nam +
3350            "</p><p>" +
3351            this.ttle +
3352            "</p></div></div></div></a></div>";
3353        } else {
3354          storylistidhm +=
3355            '<div class="col-lg-4 col-md-4 col-sm-6"><div class="ev-tp1"><h3 style="color:red;text-align:center;">No story found !</h3></div></div>';
3356        }
3357      });
3358      $("#mystoryhm").html(storylistidhm);
3359    },
3360    error: function (err) {
3361      //alert(err);
3362      //alert('Check your internet connection!');
3363    },
3364  });
3365}
3366function loadstorydetails() {
3367  var storylistid = "";
3368  $.ajax({
3369    type: "POST",
3370    dataType: "JSON",
3371    crossDomain: true,
3372    cache: false,
3373    url: project_path + "loadstorydetails.php",
3374    data: { storyid: prdcatid },
3375    ContentType: "application/json",
3376    beforeSend: function () {
3377      //$("#lodr").show();
3378      //$("#lodr_layr").show();
3379    },
3380    success: function (response) {
3381      $.each(response.mystorydetail, function () {
3382        $("#left-event-details-image").html(
3383          '<img class="w-100" src="' +
3384            base_path +
3385            "public/images/uploads/" +
3386            this.imag +
3387            '" alt="' +
3388            this.ttle +
3389            '">',
3390        );
3391        $("#right-event-details").html(
3392          "<h1>" + this.ttle + "</h1><p>" + this.shrtdes + "</p>",
3393        );
3394      });
3395    },
3396    error: function (err) {
3397      //alert(err);
3398      //alert('Check your internet connection!');
3399    },
3400  });
3401}
3402function addcomment() {
3403  var hidestoryid = $("#hidestoryid").val();
3404  var comment = $("#comment").val();
3405  var error = 0;
3406  if (comment == "") {
3407    error += 1;
3408    $("#comment").css("border", "1px solid red");
3409  }
3410  if (error > 0) {
3411    return false;
3412  }
3413  $.ajax({
3414    type: "POST",
3415    crossDomain: true,
3416    dataType: "json",
3417    cache: false,
3418    url: project_path + "addcomment.php",
3419    data: { coment: comment, hidstryid: hidestoryid },
3420    beforeSend: function () {
3421      $(".loading-overlay").show();
3422    },
3423    success: function (response) {
3424      location.reload();
3425    },
3426    success: function (msg) {
3427      if (msg == 1) {
3428        $("#pop1").show();
3429      }
3430      $(".loading-overlay").hide();
3431    },
3432    error: function (err) {
3433      //alert(err);
3434      //alert('Check your internet connection!');
3435    },
3436  });
3437}
3438
3439function loadstorycomment() {
3440  var hidestoryid = $("#hidestoryid").val();
3441  var comntlistid = "";
3442  $.ajax({
3443    type: "POST",
3444    dataType: "JSON",
3445    crossDomain: true,
3446    cache: false,
3447    url: project_path + "loadstorycomment.php",
3448    data: { hidstryid: hidestoryid },
3449    ContentType: "application/json",
3450    beforeSend: function () {
3451      //$("#lodr").show();
3452      //$("#lodr_layr").show();
3453    },
3454    success: function (response) {
3455      $.each(response.storycmntdetail, function () {
3456        if (this.nodt == 1) {
3457          comntlistid +=
3458            '<div class="xyz"><div class="lf-cm"><img src="' +
3459            base_path +
3460            'public/image/account.png" alt=""></div><div class="rh-cm"><div class="name-hr"><h4>' +
3461            this.fulnam +
3462            "</h4><span>" +
3463            this.createddate +
3464            '</span></div><div class="cmm"><p>' +
3465            this.coment +
3466            "</p></div></div></div>";
3467        } else {
3468          $("#cmntlistid").html("");
3469          $("#cmntlistid").css("border-bottom", "none");
3470        }
3471      });
3472      $("#cmntlistid").html(comntlistid);
3473    },
3474    error: function (err) {
3475      //alert(err);
3476      //alert('Check your internet connection!');
3477    },
3478  });
3479}
3480function addapanankmanch() {
3481  var error = 0;
3482  var fd = new FormData();
3483  var manch_name = $("#manch_name").val();
3484  var manch_purpose = $("#manch_purpose").val();
3485  var manch_email = $("#manch_email").val();
3486  var manch_message = $("#manch_message").val();
3487  var manchfile = $("#manchfile")[0].files[0];
3488
3489  fd.append("manchname", manch_name);
3490  fd.append("manchpurpose", manch_purpose);
3491  fd.append("manchemail", manch_email);
3492  fd.append("manchmessage", manch_message);
3493  fd.append("manchfil", manchfile);
3494  if (manch_name == "") {
3495    error += 1;
3496    $("#manchnamerr").html("Your Name should not be blank!");
3497    setTimeout(function () {
3498      $("#manchnamerr").html("");
3499    }, 2500);
3500  }
3501  if (manch_purpose == "") {
3502    error += 1;
3503    $("#mancherr").html("Your Purpose should not be blank!");
3504    setTimeout(function () {
3505      $("#mancherr").html("");
3506    }, 2500);
3507  }
3508  if (manch_email == "") {
3509    error += 1;
3510    $("#manchdupeml").html("Put your valid Email ID");
3511    setTimeout(function () {
3512      $("#manchdupeml").html("");
3513    }, 2500);
3514  } else {
3515    if (IsEmail(manch_email) == false) {
3516      error += 1;
3517      $("#manchdupeml").html("Invalid Email ID");
3518      setTimeout(function () {
3519        $("#manchdupeml").html("");
3520      }, 2500);
3521    }
3522  }
3523  if (error > 0) {
3524    return false;
3525  }
3526  $.ajax({
3527    url: project_path + "addapanankmanch.php",
3528    type: "POST",
3529    data: fd,
3530    contentType: false,
3531    processData: false,
3532    beforeSend: function () {
3533      if (Object.keys(jQuery.browser)[0] == "mozilla") {
3534        $(".loading-overlay").show();
3535        setTimeout(function () {
3536          $(".loading-overlay").hide();
3537          $("#pop").show();
3538          $("input, textarea").val("");
3539        }, 1000);
3540      } else {
3541        $(".loading-overlay").show();
3542      }
3543    },
3544    success: function (msg) {
3545      if (msg == 1) {
3546        $("#pop").show();
3547      }
3548      $(".loading-overlay").hide();
3549    },
3550    error: function (err) {
3551      //alert(err);
3552      //alert('Check your internet connection!');
3553    },
3554  });
3555}

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.