Subversion Repositories SmartDukaan

Rev

Rev 13488 | Rev 17579 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11024 lgm 1
<?php $orderConfirmation = $recharge_orderconfirmation[0];?>
10582 lgm 2
<div class="r-hldr"> 
3
  <div class="r-head">Recharge Details</div>
4
  <div class="r-cont clearfix">
5
    <div>Order Id</div>
6
    <div><?php echo $recharge_orderconfirmation[0]->response->rechargeDisplayId; ?></div>
7
  </div>
8
  <div class="r-cont clearfix">
9
    <div>Status</div>
10
    <div><?php echo $recharge_orderconfirmation[0]->response->rechargeStatus; ?></div>
12990 anikendra 11
<?php if(isset($recharge_orderconfirmation[0]->response->isOperatorAsynchronous) && $recharge_orderconfirmation[0]->response->isOperatorAsynchronous ==1):?>
12
<div id="countdown" style="margin:10px auto;display:block;"></div>
12997 anikendra 13
<div id="rechargestatus"><?php echo $orderConfirmation->response->detailDisplayMessage;?></div>
17571 manish.sha 14
 
15
<?php
16
        if(isset($privatedeals['response']['items']) && (!empty($privatedeals['response']['items']))){ 
17
		?>
18
<input type="hidden" id="email" value="<?php echo $authorized['email']?>">
19
<div class="recommended-cart-pd">
20
        <div class="head">
21
            <div>Recommended For You</div>
22
            <div id="view-more-deals" style="display:block;" onclick="showMoreDeals()">View More</div>
23
         </div>
24
        <div class="rec-cart-hldr" id="swipe_0">
25
        <div class="rec-cart-wrapper">
26
        <?php foreach ($privatedeals['response']['items'] as $product) {?>
27
	<input type="hidden" id="<?php echo $product['itemPojos'][0]['id'] ;?>-url" value="<?php echo $product['url'];?>">
28
        <div class="rec-cart-product">
29
    <?php if($recharge_orderconfirmation[0]->response->rechargeStatus!='RECHARGE IN PROCESS'):?>
30
	 <a  href="<?php echo base_url().$product['url'];?>"><img src="<?php echo $product['image_url']; ?>" alt="recomended" onerror="imgDefault()"/></a>
31
	<?php else:?>
32
		<img src="<?php echo $product['image_url']; ?>" alt="recomended" onerror="imgDefault()"/>
33
	<?php endif;?>
34
          <div class="pd-cart-name"><?php echo $product['title']; ?></div>
35
          <div class="pd-cart-desc"><?php echo $product['description']; ?></div>
36
          <div class="pd-cart-price"><span>Rs</span><span><?php if(isset($product['itemPojos'][0]['sellingPrice'])){echo $product['itemPojos'][0]['sellingPrice']; }?> </span><span style="color: red"><?php echo $product['itemPojos'][0]['dealPojo']['dealPrice']; ?></span></div>
37
          <?php if($recharge_orderconfirmation[0]->response->rechargeStatus!='RECHARGE IN PROCESS'):?>
38
	<div class="quickbuy-hldr clear" onclick="quickAddToCart(<?php echo $product['itemPojos'][0]['id'] ;?>,<?php echo $product['id']; ?>)">
39
                                <div class="quickbuy-btn btn">
40
                                        add to cart
41
                               </div>
42
                                  </div>
43
          <?php endif;?>
44
			        </div>
45
			        <?php } ?>
46
        </div>
47
        </div><!--rec-hldr-->
48
      </div><!--recomended-pd-->
49
<?php
50
}?>
51
 
12990 anikendra 52
	<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
13010 anikendra 53
  <script src="/assets/js/jquery.countdown360.js" type="text/javascript" charset="utf-8"></script>
12990 anikendra 54
 
13010 anikendra 55
  <script type="text/javascript" charset="utf-8">
56
    var callCounter = 0;
57
    $("#countdown").countdown360({
58
      radius: 50,
13266 amit.gupta 59
      seconds: 90,
13010 anikendra 60
      fontColor: 'white',
61
      fillStyle: '#6699ff',
62
      strokeStyle: '#F6F47A',
63
      autostart: true,
64
      onComplete: function() {
65
        hideCountDown()
66
      }
67
    })
68
 
69
    function hideCountDown() {
70
      $('#countdown').hide();
71
      jQuery.ajax({
72
        type: "GET",
13013 anikendra 73
        url: "/recharge-status?rechargeOrderId=<?php echo substr($recharge_orderconfirmation[0]->response->rechargeDisplayId,4);?>&finalCall=true",
13010 anikendra 74
        success: function(response) {},
75
        error: function() {}
76
      });
77
      window.setTimeout(reload, 5000);
78
    }
79
 
80
    function checkUnknownTransactions() {
81
      jQuery.ajax({
82
        type: "GET",
13046 anikendra 83
        url: "/recharge-status?rechargeOrderId=<?php echo substr($recharge_orderconfirmation[0]->response->rechargeDisplayId,4);?>&finalCall=false",
13010 anikendra 84
        success: function(response) {
85
          if (response == 'RECHARGE_SUCCESSFUL' || response == 'RECHARGE_FAILED' || response == 'PAYMENT_SUCCESSFUL') {
86
            reload();
87
          }
88
          incrementCounter();
89
          if ($('#countdown').is(':visible')) {
13488 anikendra 90
            if (callCounter < 5) {
91
              window.setTimeout(checkUnknownTransactions, 10000);
13010 anikendra 92
            }
93
          }
94
        },
95
        error: function() {
96
          incrementCounter();
97
          if ($('#countdown').is(':visible')) {
13488 anikendra 98
            if (callCounter < 5) {
99
              window.setTimeout(checkUnknownTransactions, 10000);
13010 anikendra 100
            }
101
          }
12990 anikendra 102
        }
13010 anikendra 103
      });
104
    }
105
 
106
    function incrementCounter() {
107
      callCounter++;
108
    }
109
 
110
    function reload() {
111
      location.reload();
112
    }
12990 anikendra 113
</script>
114
<script type="text/javascript">
115
  $(function(){
13010 anikendra 116
    if ($('#countdown').is(':visible')){  
117
    window.setTimeout(checkUnknownTransactions, 40000);
118
  }
119
  });
12990 anikendra 120
</script>
13010 anikendra 121
 
12990 anikendra 122
<?php endif;?>
123
 
10582 lgm 124
  </div>
125
  <div class="r-info">
126
    <div class="r-info-head clearfix">
10939 lgm 127
      <?php if(strpos($recharge_orderconfirmation[0]->response->rechargeDisplayId, 'DTH') !== false){?>
128
      <div>Account Number</div>
129
      <?php } else{?>
130
      <div>Mobile Number</div><?php } ?>
10582 lgm 131
      <div>Operator</div>
132
      <div>Amount</div>
133
    </div>
134
    <div class="r-info-body clearfix">
135
      <div><?php echo $recharge_orderconfirmation[0]->response->rechargeDeviceNumber ?></div>
136
      <div><?php echo $recharge_orderconfirmation[0]->response->rechargeProvider ?></div>
137
      <div><?php echo $recharge_orderconfirmation[0]->response->totalAmount ?></div>
138
    </div>
139
  </div><!--o-info-->
140
 
141
</div><!--o-hldr-->
142
<script type="text/javascript">
12084 lgm 143
  var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
144
  if(orderConfirmation != undefined){
145
    var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
146
    var orderId = orderConfirmation['response'].rechargeDisplayId;
147
    var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
13046 anikendra 148
 
12524 anikendra 149
	ga('ecommerce:addTransaction', {
150
	  'id': orderId,                     // Transaction ID. Required
151
	  'affiliation': 'Saholic',   // Affiliation or store name
152
	  'revenue': amount,               // Grand Total
153
	  'shipping': '0',                  // Shipping
154
	  'tax': '0'                     // Tax
155
	});
156
	// addItem should be called for every item in the shopping cart.
157
	ga('ecommerce:addItem', {
158
	  'id': orderId,                     // Transaction ID. Required
12528 anikendra 159
	  'sku': deviceNumber,                    // SKU/code
160
	  'name': orderConfirmation['response'].rechargeProvider,                // Product name. Required
12524 anikendra 161
	  'category': 'Digital',       // Category or variation
162
	  'price': amount,                 // Unit price
163
	  'quantity': '1'                   // Quantity
164
	});
165
	ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
12084 lgm 166
  }
167
  var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
168
  var value = localStorage.getItem('rechargeValue');
10582 lgm 169
  if(parseInt(value) == 1){
13046 anikendra 170
	 ga('send', 'event', 'Recharge', 'Recharge Result','Mobile-Result');
171
  }else if(parseInt(value) == 2){    
172
	 ga('send', 'event', 'Recharge', 'Recharge Result','Recharge-Result');
10582 lgm 173
  }
11342 lgm 174
  // if(document.getElementsByClassName('order-conf')[0] != undefined){
175
  //     document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';  
176
  // }
13488 anikendra 177
</script>