Subversion Repositories SmartDukaan

Rev

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