Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
10582 lgm 1
<?php //echo '<pre>'; print_r($myrecharges[0]->response->rechargePojos); echo '</pre>';
2
$email = '';
3
$authorized = $this->session->userdata('authorized');
4
if(isset($authorized['email']) && !empty($authorized['email'])){
5
   if(strpos($authorized['email'], 'anonymous') == false){
6
      $email = $authorized['email'];
7
   }
8
}
9
//print_r($myrecharges[0]);
10
?>
10970 lgm 11
<?php if(isset($myrecharges[0]->response->rechargePojos)&& !empty($myrecharges[0]->response->rechargePojos)){ ?>
10582 lgm 12
<div class="recharge-detail-hldr">
13
    <div class="myrecharge-head">My Recharge</div>
14
    <div class="recharge-head-sub">Recharge detail and status information</div>
15
    <div id="er-message"></div>
16
    <?php 
17
      foreach($myrecharges[0]->response->rechargePojos as $key=>$value){ ?>
18
        <div class="recharge-details">
19
          <div class="re-de-head clearfix">
20
            <div data-opid="<?php echo $value->operatorId; ?> ">
21
              <?php echo $value->number;  echo " ("; if($value->operatorType == "MOBILE"){ echo "Mobile"; }else{echo "DTH"; } echo ")"; ?> 
22
            </div> 
11090 lgm 23
              <?php if(isset($value->status) && (strcasecmp($value->status, 'SUCCESS') == 0) ){ ?> 
10582 lgm 24
                  <form action="<?php echo base_url().'confirm!rechargeAgain'; ?>" method="post"> 
25
                      <input type="hidden" name="<?php if($value->operatorType == "MOBILE"){echo 'mobile-number';}else{echo 'dth-number';}?>" value="<?php echo $value->number; ?>" />
26
                      <input type="hidden" name="operatorId" value="<?php echo $value->operatorId; ?>" />
27
                      <input type="hidden" name="operator-name" value="<?php echo $value->operator; ?>" />
28
                      <input type="hidden" name="recharge-amt" value="<?php echo $value->amount; ?>" />
29
                      <input type="hidden" name="operatorType" value="<?php echo $value->operatorType; ?>" />
30
                      <input type="hidden" name="email" value="<?php echo $email; ?>" />
31
                      <input type="submit" class="btn recharge-again" value ="Recharge Again" name="submit"/>
32
                    </form>
33
                <?php }else{
34
                   if($value->canRefund == "true"){ ?>
35
                     <!-- <form action="<?php echo base_url().'my-recharges'; ?>"> -->
36
                        <!-- <input type="hidden" name="operatorId" value="<?php echo $value->orderId; ?>" /> -->
37
                        <input type="button" class="btn refund" value="Refund" onclick="refund('<?php echo $value->orderId; ?>')"/>
38
                     <!-- </form> -->
39
                 <?php }} ?>
40
          </div><!--re-de-head-->
41
          <div class="details clearfix">
42
            <div>Order Id:</div><div><?php echo $value->displayOrderId;  ?></div>
43
            <div>Date:</div><div><?php echo $value->date;  ?></div>
44
            <div>Operator:</div><div><?php echo $value->operator;  ?></div>
45
            <div>Value:</div><div><?php echo $value->amount;  ?></div>
11341 lgm 46
            <div>Status:</div><div><?php if(isset($value->status) && strcasecmp($value->status, 'SUCCESS') == 0){ echo "Recharge Successful";}else{ echo "Recharge Failed"; } ?></div>
10582 lgm 47
          </div>
48
 
49
        </div><!--recharge-details-->
50
 
51
 
10970 lgm 52
      <?php } ?>
53
 
10582 lgm 54
    <div>
55
 
56
    </div>
57
 
58
</div>
10970 lgm 59
<?php } else { ?>
60
      <div class="empty-list"></div><!--empty-msg-->
61
      <p class="empty-msg tcenter" style="min-height: 300px;">No Previous Recharge Found</p>
62
      <?php } ?>
10582 lgm 63
<script>
64
  function refund(orderid){
65
    var url = base_url+'refund/'+orderid;
66
    microAjax(url, function(res)
67
    {
68
      if(res != null){
69
        var jres = JSON.parse(res);
70
        document.getElementById('er-message').innerHTML = jres.response.message;
71
        document.getElementById('er-message').style.display = 'block';
72
      }
73
 
74
      setTimeout(function(){
75
        document.getElementById('er-message').style.display = 'none';
76
      },3000);
77
 
78
    });
79
 
80
  }
11938 anikendra 81
</script>