Subversion Repositories SmartDukaan

Rev

Rev 17580 | Rev 17582 | 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-->
17581 manish.sha 105
<script type="text/javascript">
106
  var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
107
  if(orderConfirmation != undefined){
108
    var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
109
    var orderId = orderConfirmation['response'].rechargeDisplayId;
110
    var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
17580 manish.sha 111
 
17581 manish.sha 112
	ga('ecommerce:addTransaction', {
113
	  'id': orderId,                     // Transaction ID. Required
114
	  'affiliation': 'Saholic',   // Affiliation or store name
115
	  'revenue': amount,               // Grand Total
116
	  'shipping': '0',                  // Shipping
117
	  'tax': '0'                     // Tax
118
	});
119
	// addItem should be called for every item in the shopping cart.
120
	ga('ecommerce:addItem', {
121
	  'id': orderId,                     // Transaction ID. Required
122
	  'sku': deviceNumber,                    // SKU/code
123
	  'name': orderConfirmation['response'].rechargeProvider,                // Product name. Required
124
	  'category': 'Digital',       // Category or variation
125
	  'price': amount,                 // Unit price
126
	  'quantity': '1'                   // Quantity
127
	});
128
	ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
129
  }
130
  var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
131
  var value = localStorage.getItem('rechargeValue');
132
  if(parseInt(value) == 1){
133
	 ga('send', 'event', 'Recharge', 'Recharge Result','Mobile-Result');
134
  }else if(parseInt(value) == 2){    
135
	 ga('send', 'event', 'Recharge', 'Recharge Result','Recharge-Result');
136
  }
137
  // if(document.getElementsByClassName('order-conf')[0] != undefined){
138
  //     document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';  
139
  // }
140
</script>
141
 
17580 manish.sha 142
<?php $rechargestatus = array("RECHARGE IN PROCESS");?>
143
<?php
144
        if(isset($privatedeals['response']['items']) && (!empty($privatedeals['response']['items']))){ 
145
		?>
146
<input type="hidden" id="email" value="<?php echo $authorized['email']?>">
147
<div class="recommended-cart-pd">
148
        <div class="head">
149
            <div>Recommended For You</div>
150
            <div id="view-more-deals" style="display:block;" onclick="showMoreDeals()">View More</div>
151
         </div>
152
        <div class="rec-cart-hldr" id="swipe_0">
153
        <div class="rec-cart-wrapper">
154
        <?php foreach ($privatedeals['response']['items'] as $product) {?>
155
	<input type="hidden" id="<?php echo $product['itemPojos'][0]['id'] ;?>-url" value="<?php echo $product['url'];?>">
156
        <div class="rec-cart-product">
157
    <?php if (in_array($recharge_orderconfirmation[0]->response->rechargeStatus, $rechargestatus)){ ?>
158
    	<img src="<?php echo $product['image_url']; ?>" alt="recomended" onerror="imgDefault()"/>
159
	<?php } else {?>
160
		<a  href="<?php echo base_url().$product['url'];?>"><img src="<?php echo $product['image_url']; ?>" alt="recomended" onerror="imgDefault()"/></a>
161
	<?php }?>
162
          <div class="pd-cart-name"><?php echo $product['title']; ?></div>
163
          <div class="pd-cart-desc"><?php echo $product['description']; ?></div>
164
          <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>
165
          <?php if(!in_array($recharge_orderconfirmation[0]->response->rechargeStatus, $rechargestatus)){?>
166
	<div class="quickbuy-hldr clear" onclick="quickAddToCart(<?php echo $product['itemPojos'][0]['id'] ;?>,<?php echo $product['id']; ?>)">
167
                                <div class="quickbuy-btn btn">
168
                                        add to cart
169
                               </div>
170
                                  </div>
171
          <?php }?>
172
			        </div>
173
			        <?php } ?>
174
        </div>
175
        </div><!--rec-hldr-->
176
      </div><!--recomended-pd-->
177
<?php
178
}?>