PageSourceSearch

https://teamex.in/assets/js/custom/purchase/productdata.js?v=1790901394

js teamex.in collected 2026-10-02 00:37:15 UTC 20,182 bytes, 674 lines download raw bytes

1function GetTotalCount(){
2    /*$.ajax({
3            url:PurchaseUrl+'FindCount',
4            data:{},
5            type:'POST',
6            async: false,
7            success:function(result)
8            { 
9             var response = $.parseJSON(result);  
10              $("#cartcount").html(response.cartcount);  
11            }
12        });*/
13    //getProductList();
14}
15
16$( document ).ready(function() {
17    var currentLocation=$(location).attr('href');
18    var getSearchingFlag = currentLocation.includes("Maincategory");
19    if(getSearchingFlag){
20        $("#searchIcon").css("display","block");
21    }  
22    else{
23       $("#searchIcon").css("display","none"); 
24    }
25
26    //GetTotalCount();
27});
28
29/*$(window).bind("load", function() { 
30     // insert your code here 
31     GetTotalCount();
32});*/
33
34function GetSubcategoryProduct(id,type,append,size,sectorid,brandid,dealFlag,sellFlag,latestFlag,starString,minVal,maxVal,userid){
35    //var LoadingClass="#productsection";
36    var LoadingClass="#productsection";
37    ShowLoading(LoadingClass);
38    
39    if(size == 0){
40        var size = $("#attr").val();     
41    }
42    else{
43        size = "";
44        $('input[name="sizesearch"]:checked').each(function() {
45           if(size != '') {
46                size = size + ",";
47           }
48           size = size + this.value;
49        });
50        $("#attr").val(size);
51    }
52
53    console.log(size);
54
55    if(type == "All"){
56        $("#attr").val('');
57    }
58
59    $(".attrclass").removeClass("selectattr");
60    $("#attrlink"+size).addClass("selectattr");
61
62    /*$(".productlinkclass").removeClass("productlinkcolorclass");
63    $("#productlink"+id).addClass("productlinkcolorclass");*/
64    //$(".sub-menu").addClass("show");
65
66    var sortby=$("#sortby").val();
67    var search=$("#search").val();
68    if(id == ''){
69        var id=$("#categoryid").val();
70    }
71    
72    if(append){
73        $("#productsection").html('');
74        startLimit = 0;
75    }
76    
77    //$("#nodatadiv").css('display','none');
78    processing = false;
79    $.ajax({
80        url:PurchaseUrl+'SubCategoryProduct',
81        data:{'id':id,'type':type,'startLimit':startLimit,'sortby':sortby,'search':search,'attr':size,'sectorid':sectorid,'brandid':brandid,'dealofd':dealFlag,'sellflag':sellFlag,'latestflag':latestFlag,'star' : starString,'minDpVal':minVal,'maxDpVal':maxVal,'userid':userid},
82        type:'POST',
83        async: false,
84        success:function(result)
85        {       
86            //if(result.status == false){
87            if(result.trim() == 'no') {
88                processing = false;    
89                $("#loadproductdiv").hide();
90                $("#nodatadiv").css('display','block');
91            }
92            else{
93                $("#productsection").append(result);
94                processing = true;
95                startLimit=parseInt(startLimit)+1;
96                var tmpcategory=$("#categoryidtmp").val();
97                $("#categoryid").val(tmpcategory); 
98                $("#loadproductdiv").show();   
99            }
100            //$("#search-popup").removeClass("popup-visible");
101            HideLoading(LoadingClass);
102            //$("#loadingimg").hide();
103        }
104    });
105}
106
107function AddToCartredirect(productid,type,pqty=0){  //B.kumar2112
108    AddToCart(productid,type,pqty);
109    window.location.href = PurchaseUrl+'ShoppingCart';
110}
111
112function AddToCart(productid,type,pqty=0){
113    /*
114    type 0 :Product List
115    type 1 :Product Detail
116    type 2 :Update Cart
117    */
118    var LoadingClass="body";
119    var qty=0;
120
121    if(type == 1){
122        qty=$("#qty"+productid+'').val();
123    }
124    else if(type==0){
125        qty=1;
126    }
127    else{
128        qty = pqty;
129    }
130
131    /*if( ($(LoadingClass).length) > 0) {
132    }
133    else {
134    	LoadingClass = "body";
135    }*/
136    var size = 1;
137    if($('input[name="size"]').length > 0) {
138        size = 0;
139        if($('input[name="size"]:checked').length > 0) {
140            size = parseInt($('input[name="size"]:checked').val());
141        }  
142    }
143
144    var prdcolor = 1;
145    if($('#attr2val').length > 0) {
146        prdcolor = parseInt($('#attr2val').val());  
147    }
148
149    if(size <= 0){
150        cust_notification('error','top right','fa fa-times','Please Select '+attr1selectname); 
151    }
152    else if(prdcolor <= 0) {
153        cust_notification('error','top right','fa fa-times','Please Select '+attr2selectname);    
154    }
155    else{
156        if(parseInt(qty) <= 0){
157            cust_notification('error','top right','fa fa-times','Enter Proper Quantity'); 
158        }
159        else{
160            ShowLoading(LoadingClass);
161            $.ajax({
162                url:PurchaseUrl+'AddProduct',
163                data:{'productid':productid,'qty':qty,'type':type},
164                type:'POST',
165                async: false,
166                success:function(result)
167                {   
168                    var response = $.parseJSON(result);
169                    if(response.status){
170                        cust_notification('success','top right','fa fa-check-circle-o',response.msg);
171                        GetTotalCount();
172                    }
173                    else{
174                        cust_notification('error','top right','fa fa-times',response.msg); 
175                    }
176                    HideLoading(LoadingClass);
177                }
178            });
179        }
180    }
181}    
182
183function closediv(){
184    $(".cart-bg-overlay").removeClass('cart-bg-overlay-on');
185    $(".right-side-cart-area").removeClass('cart-on');
186}
187
188function RemoveProduct(Detailid,type){
189    var LoadingClass="body";
190    ShowLoading(LoadingClass);
191    $.ajax({
192        url:PurchaseUrl+'RemoveProduct',
193        data:{'Detailid':Detailid,'type':type},
194        type:'POST',
195        async: false,
196        success:function(result)
197        {   
198            var response = $.parseJSON(result);
199            if(response.status){
200                $("#producttr"+Detailid+'').html('');
201                cust_notification('success','top right','fa fa-check-circle-o',response.msg);     
202                GetTotalCount();
203            }
204            else{
205                cust_notification('error','top right','fa fa-times',response.msg); 
206            }
207            HideLoading(LoadingClass);
208        }
209    });
210    window.location.reload();
211}
212
213function updateCart(){
214    var changevalid = false;
215    $('.cstmqty').each(function(index,item){
216        var oldqty = parseInt($(this).attr('qty'));
217        var newqty = parseInt($(this).val());
218        if(newqty > 0) {
219        	if(oldqty == newqty) {
220
221	        }
222	        else {
223	          changevalid = true;
224	          AddToCart($(this).attr('pid'),2,newqty);
225	        }
226        }
227    });
228    if(changevalid) {
229        window.location.reload();
230    }
231    else {
232        cust_notification('error','top right','fa fa-times','No Changes Are Done In Cart'); 
233    }
234}
235
236function getProductList(){
237    $("#cartdiv").html('');
238    $.ajax({
239            url:PurchaseUrl+'OrderProductList',
240            data:{},
241            type:'POST',
242            async: false,
243            success:function(result)
244            { 
245              $("#cartdiv").html(result);
246              var getcount=$("#cartcount").html();
247              $("#totalcartcount").html(getcount);
248
249            }
250        });
251}
252
253$("#state").change(function(){
254    //console.log("ffff");
255    var state=$("#state").val();
256    var LoadingClass=".row";
257    if(state=='')
258    {
259    }  
260    else
261    {
262        //ShowLoading(LoadingClass);
263        $("#city").html("<option value='' selected disabled>Select City</option>");
264        $.ajax({
265            url:base_url+'register/GetCity',
266            data:{'state':state},
267            type:'POST',
268            success:function(result)
269            {
270                var response = $.parseJSON(result);
271                if(response.status) {
272                    $.each(response.city, function(i) {
273                        var selected='';
274                        /*if(city !='' && parseInt(city) > 0)
275                        {
276                            if(city == response.city[i].id)
277                                selected="selected";
278
279                        }  */   
280                        $('#city').append('<option '+selected+' value="' + response.city[i].id + '">' + response.city[i].name + '</option>');
281                        });
282                }
283                //HideLoading(LoadingClass);
284            }
285        });
286    }
287});
288
289$("#delstate").change(function(){
290    //console.log("ffff");
291    var state=$("#delstate").val();
292    var LoadingClass=".row";
293    if(state=='')
294    {
295    }  
296    else
297    {
298        //ShowLoading(LoadingClass);
299        $("#delcity").html("<option value='' selected disabled>Select City</option>");
300        $.ajax({
301            url:base_url+'register/GetCity',
302            async:false, //16-09 added by Darshana
303            data:{'state':state},
304            type:'POST',
305            success:function(result)
306            {
307                var response = $.parseJSON(result);
308                if(response.status) {
309                    $.each(response.city, function(i) {
310                        var selected='';
311                        if(city !='' && parseInt(city) > 0)
312                        {
313                            if(city == response.city[i].id)
314                                selected="selected";
315
316                        }  
317                        $('#delcity').append('<option '+selected+' value="' + response.city[i].id + '">' + response.city[i].name + '</option>');
318                        });
319                }
320                //HideLoading(LoadingClass);
321            }
322        });
323    }
324});
325
326jQuery.validator.addMethod("mobileno", function(value, element) {
327    return this.optional(element) || /^[6-9]{1}[0-9]+$/.test(value);
328}, "Enter Valid Mobile Number");
329
330$('#walletuse').change(function() {
331    var showwalletamt=0;
332    var showremainamt=totalDp;
333    if(this.checked) {
334       if(parseFloat(walletBalance) > 0){
335            if(parseFloat(walletBalance) >= parseFloat(usewalletamt)){
336                if(parseFloat(usewalletamt) >= parseFloat(purchasewalletamt) ){
337                    showwalletamt=purchasewalletamt;
338                }
339                else{
340                    showwalletamt=usewalletamt;
341                }
342            }
343            else{
344                showwalletamt=walletBalance;
345            }
346            showremainamt=parseFloat(totalDp)-parseFloat(showwalletamt);     
347            
348        }
349       
350    }
351    $("#remainamt").html(showremainamt);
352    $("#payableamt").html(showwalletamt);
353});
354
355function getattrproduct() {
356    var attr1 = $('input[name="size"]:checked').val();
357    var attr2 = $("#attr2val").val();
358    var mainpid = $("#mainpid").val();
359    if(attr1 != ''){
360        console.log('Attr1 : '+ attr1);
361        console.log('Attr2 : '+ attr2);
362        window.location.href = PurchaseUrl+"Productdetail/"+mainpid+"?attr1="+attr1+"&attr2="+attr2;
363    }
364}
365    
366function getattrproduct2(attr2) {
367    var attr1 = $('input[name="size"]:checked').val();
368    $("#attr2val").val(attr2);
369    var mainpid = $("#mainpid").val();
370    if(attr2 != ''){
371        console.log('Attr1 : '+ attr1);
372        console.log('Attr2 : '+ attr2);
373        //window.location.href = PurchaseUrl+"Productdetail/"+size;
374        window.location.href = PurchaseUrl+"Productdetail/"+mainpid+"?attr1="+attr1+"&attr2="+attr2;
375    }
376}
377
378/*jQuery.validator.addMethod("validateAmount", function(value, element) {
379    var paymenttype = $("input[name='walletuse']:checked").val();
380    console.log("hekk");
381    console.log(paymenttype);
382    var status=false;
383    if(paymenttype == 'Repurchase Wallet'){
384      if(parseFloat(walletBalance) >= parseFloat(totalDp)){
385            console.log("1");
386            return true;
387        } 
388        else{
389            console.log("2");
390          return false;  
391        }  
392    }
393    else{
394        return true;
395    }
396    
397}, "You Don't Have Sufficient Balance");
398*/
399if (typeof formid !== 'undefined') {
400}
401else{
402    var formid='';
403}
404
405var formbtnclick = false;
406if(formid!=''){
407    $("#"+formid+'').validate({
408        rules: {
409            name:{
410                required: true,
411            },
412            phone:{
413                required: true,
414                mobileno:true,
415                minlength:10,
416                maxlength:10,
417            },
418            address:{
419                required: true,
420            },
421            state:{
422                required: true,
423            },
424            city:{
425                required: true,
426            },
427            pincode:{
428                required: true,
429                 digits: true,
430            },
431            delname:{
432                required: true,
433            },
434            delphone:{
435                required: true,
436                mobileno:true,
437                minlength:10,
438                maxlength:10,
439            },
440            deladdress:{
441                required: true,
442            },
443            delstate:{
444                required: true,
445            },
446            delcity:{
447                required: true,
448            },
449            delpincode:{
450                required: true,
451                digits: true,
452            },  
453        },
454        errorPlacement: function(error, element) {
455            /*if (element.attr("name") == "city" )
456                error.insertAfter(".cityerror");
457            else*/
458                error.insertAfter(element);
459        },
460        submitHandler: function() {
461            if(!formbtnclick) {
462                if(confirmbox) {
463                    swal({
464                        title: confirmtitle,
465                        text: confirmtxt,
466                        type: 'warning',
467                        showCancelButton: confirmcnshow,
468                        showConfirmButton: confirmokshow,
469                        buttonsStyling: buttonsStyling,
470                        confirmButtonClass: confirmokclass,
471                        confirmButtonText: confirmoktxt,
472                        cancelButtonText: confirmcntxt,
473                        cancelButtonClass: confirmcnclass
474                    }).then(function(){
475                        submitfun();
476                    });
477                }
478                else {
479                    submitfun();
480                }
481            } 
482        }
483    });
484}
485
486function submitfun() {
487    formbtnclick = true;
488    var LoadingClass="body";
489    ShowLoading(LoadingClass);
490
491    /*var fd = new FormData();
492    var files = $('#proof')[0].files[0];
493    fd.append('proof',files);*/
494
495    /*var form_data = $('#'+formid+'').serializeArray();
496    for (var i=0; i < form_data.length; i++) {
497      fd.append(form_data[i].name, form_data[i].value);
498    }*/
499    
500    $.ajax({
501        url: submiturl,
502        async: false,
503        type: "POST",
504        data: $("#"+formid+'').serialize(),
505        /*url: submiturl,
506        async: false,
507        type: "POST",
508        data: fd,
509        contentType: false,       
510        cache: false,            
511        processData:false,*/
512        success: function(msg)
513        {
514            formbtnclick = false;
515            var response = $.parseJSON(msg);
516            rtnstatus = response.status;
517            if(response.status) {
518                $("#"+formid+'')[0].reset();
519                var invstatus = response.invstatus;
520                var remaingamount = response.remaingamount;
521                HideLoading(LoadingClass);
522                var loadurl = PurchaseUrl+"PaymentGateway/"+response.invoice;
523                if(invstatus == '1' && parseInt(remaingamount) <= 0) {
524                    loadurl = reporturl+"/"+response.invoice;
525                }
526                console.log(loadurl);
527                window.location.href = loadurl;
528            }
529            else {
530               HideLoading(LoadingClass);
531               errorswal(response.msg, 'error', 'Error');
532            }
533        },
534        error:function()
535        {
536            HideLoading(LoadingClass);
537            errorswal('Some Error Occur.','error', 'Error');    
538        }
539    });
540}
541
542function incrementQTY(prdid, pid) {
543    var qty = $("#prdqty"+prdid+"").val();
544    console.log(qty);
545    qty = parseInt(qty) + 1;
546    $("#prdqty"+prdid+"").val(qty);
547    $("#showqty"+prdid+"").html(qty);
548    AddToCart(pid, 2, qty);
549    var cartmrp = $("#singlemrp"+prdid).val();
550    var cartdp = $("#singledp"+prdid).val();
551    $("#viewmrp"+prdid).html(parseFloat(cartmrp) * parseInt(qty));
552    $("#viewdp"+prdid).html(parseFloat(cartdp) * parseInt(qty));
553    getCartTotal();
554    if(offershowFlag) {
555        webloadOfferProducts();
556    }
557    //window.location.reload();
558}
559
560function decrementQTY(prdid, pid) {
561    var qty = $("#prdqty"+prdid+"").val();
562    if (qty <= 1) {
563        cust_notification("error", "top right", "fa fa-times", "Minimum 1 Qty Required.");
564    } else {
565        qty = parseInt(qty) - 1;
566        $("#prdqty"+prdid+"").val(qty);
567        $("#showqty"+prdid+"").html(qty);
568        AddToCart(pid, 2, qty);
569        var cartmrp = $("#singlemrp"+prdid).val();
570        var cartdp = $("#singledp"+prdid).val();
571        $("#viewmrp"+prdid).html(parseFloat(cartmrp) * parseInt(qty));
572        $("#viewdp"+prdid).html(parseFloat(cartdp) * parseInt(qty));
573        getCartTotal();
574        //window.location.reload();
575        if(offershowFlag) {
576            webloadOfferProducts();
577        }
578    }
579}
580
581$("#freeofferproduct").on("change", function () {
582    getCartTotal();
583});
584
585function getCartTotal() {
586    var offerpurdp = $("#offerfinaldp").val();
587    var freeprdDP = 0;
588    if($("#freeofferproduct").length > 0) {
589        if(document.getElementById("freeofferproduct").checked) {
590            $("#placeorder").removeClass('hide-div');
591            freeprdDP = $("#freeprddp").val();
592        }
593    }
594    offerpurdp = parseFloat(offerpurdp) + parseFloat(freeprdDP);
595    $.ajax({
596        url: PurchaseUrl+'GetCartTotal',
597        data:{'offerdp': offerpurdp},
598        type:'POST',
599        async: false,
600        success:function(result)
601        { 
602            var response = $.parseJSON(result);
603            if(response.status) {
604                if($("#visitorflag").val() == '1') {
605                    var totalnet = parseFloat(response.mrp) + parseFloat(response.deliverycharge);
606                    $("#footsubtotal").html(response.mrp);
607                }
608                else {
609                    var totalnet = parseFloat(response.dp) + parseFloat(response.deliverycharge) + parseFloat(freeprdDP);
610                    var subtot = parseFloat(response.dp) + parseFloat(freeprdDP);
611                    $("#footsubtotal").html(subtot);
612                }
613                
614                $("#footnettotal").html(totalnet);
615                $("#offeridp").val(response.totalidp);
616                $("#footdelieverycharge").html(response.deliverycharge);
617                
618            }
619        }
620    });
621}
622
623$("#usewalletamt").keyup(function(){
624    var netpay = totalDp;
625    var walletused = 0;
626    var maxwalletuse = walletBalance;
627    var currentuse = $("#usewalletamt").val();
628    if(parseInt(maxwalletuse) > parseInt(totalDp)) {
629        maxwalletuse = totalDp;
630    }
631    if(parseInt(maxwalletuse) < parseInt(currentuse)) {
632        $("#usewalletamt").val(maxwalletuse);
633        currentuse = maxwalletuse;
634    }
635    netpay = netpay - parseInt(currentuse);
636    $("#netpayshow").html(netpay);
637    $("#usewalletshow").html(currentuse);
638});
639
640$("#usewalletcheck").click(function() {
641    $(".usewalletdiv").hide();
642    $("#usewalletamt").val('0');
643    var netpay = totalDp;
644    var walletused = 0;
645    var maxwalletuse = walletBalance;
646    if(this.checked) {
647        $(".usewalletdiv").show();
648        if(parseInt(maxwalletuse) > parseInt(totalDp)) {
649            maxwalletuse = totalDp;
650        }
651        $("#usewalletamt").val(maxwalletuse);
652        walletused = maxwalletuse;
653        netpay = netpay - parseInt(maxwalletuse);
654    }
655    $("#netpayshow").html(netpay);
656    $("#usewalletshow").html(walletused);
657});
658
659$("#samebilling").click(function() {
660    $(".delieverydiv").show();
661    
662    if(this.checked) {
663        $("#0").click();
664        $(".delieverydiv").hide();
665    }
666});
667$("#sameasdel").click(function() {
668    $(".billingdiv").show();
669    
670    if(this.checked) {
671        //$("#0").click();
672        $(".billingdiv").hide();
673    }
674});

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.