ebay_subscription.twig (5862B)
1 {{ header }}{{ column_left }} 2 <div id="content"> 3 <div class="page-header"> 4 <div class="container-fluid"> 5 <div class="pull-right"> 6 <a href="{{ return }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a> 7 </div> 8 <h1>{{ heading_title }}</h1> 9 <ul class="breadcrumb"> 10 {% for breadcrumb in breadcrumbs %} 11 <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li> 12 {% endfor %} 13 </ul> 14 </div> 15 </div> 16 <div class="container-fluid"> 17 <div class="panel panel-default"> 18 <div class="panel-heading"> 19 <h3 class="panel-title"><i class="fa fa-list"></i> {{ text_subscription }}</h3> 20 </div> 21 <div class="panel-body"> 22 <div class="row"> 23 <div class="col-md-4"> 24 <a class="btn btn-primary" id="load-account" disabled="disabled"><i class="fa fa-cog fa-lg fa-spin"></i> {{ text_load_my_plan }}</a> 25 <div class="panel panel-default" id="my-plan-container"> 26 <div class="panel-heading"> 27 <h1 class="panel-title"><i class="fa fa-user fa-lg"></i> {{ text_subscription_current }}</h1> 28 </div> 29 <div class="panel-body"> 30 <table class="table" id="my-plan"></table> 31 </div> 32 </div> 33 </div> 34 <div class="col-md-8"> 35 <a class="btn btn-primary" id="load-plans" disabled="disabled"><i class="fa fa-cog fa-lg fa-spin"></i> {{ text_load_plans }}</a> 36 <div class="panel panel-default" id="openbay-plans-container"> 37 <div class="panel-heading"> 38 <h1 class="panel-title"><i class="fa fa-list fa-lg"></i> {{ text_subscription_avail }}</h1> 39 </div> 40 <div class="panel-body"> 41 <table id="openbay-plans" class="table"></table> 42 <p>{{ text_subscription_avail1 }}</p> 43 </div> 44 </div> 45 </div> 46 </div> 47 </div> 48 </div> 49 </div> 50 </div> 51 52 <script type="text/javascript"><!-- 53 function loadAccount() { 54 $.ajax({ 55 url: 'index.php?route=extension/openbay/ebay/getMyPlan&user_token={{ user_token }}', 56 type: 'post', 57 dataType: 'json', 58 beforeSend: function(){ 59 $('#my-plan-container').hide(); 60 }, 61 success: function(json) { 62 $('#load-account').hide(); 63 $('#my-plan').empty(); 64 65 htmlInj = ''; 66 67 htmlInj += '<thead>'; 68 htmlInj += '<tr>'; 69 htmlInj += '<th>{{ column_plan }}</th>'; 70 htmlInj += '<th>{{ column_price }}</th>'; 71 htmlInj += '<th>{{ column_description }}</th>'; 72 htmlInj += '<th></th>'; 73 htmlInj += '</tr>'; 74 htmlInj += '</thead>'; 75 htmlInj += '<tbody>'; 76 htmlInj += '<tr>'; 77 htmlInj += '<td>'+json.plan.title+'</td>'; 78 htmlInj += '<td>£'+json.plan.price+'</td>'; 79 htmlInj += '<td>'+json.plan.description+'</td>'; 80 htmlInj += '<td></td>'; 81 htmlInj += '</tr>'; 82 83 if (json.sub_id){ 84 htmlInj += '<tr>'; 85 htmlInj += '<td colspan="4">{{ text_ajax_acc_load_plan }}'+json.sub_id+'{{ text_ajax_acc_load_plan2 }}</td>'; 86 htmlInj += '</tr>'; 87 } 88 89 htmlInj += '</tbody>'; 90 91 $('#my-plan').append(htmlInj); 92 $('#my-plan-container').show(); 93 }, 94 error: function (xhr, ajaxOptions, thrownError) { 95 if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } 96 } 97 }); 98 } 99 100 function loadPlans() { 101 $.ajax({ 102 url: 'index.php?route=extension/openbay/ebay/getPlans&user_token={{ user_token }}', 103 type: 'post', 104 dataType: 'json', 105 beforeSend: function(){ 106 $('#openbay-plans-container').hide(); 107 }, 108 success: function(json) { 109 $('#load-plans').hide(); 110 $('#openbay-plans').empty(); 111 112 htmlInj = ''; 113 htmlInj += '<thead>'; 114 htmlInj += '<tr>'; 115 htmlInj += '<th>{{ column_plan }}</th>'; 116 htmlInj += '<th>{{ column_price }}</th>'; 117 htmlInj += '<th>{{ column_description }}</th>'; 118 htmlInj += '<th></td>'; 119 htmlInj += '</tr>'; 120 htmlInj += '</thead>'; 121 htmlInj += '<tbody>'; 122 $.each(json.plans, function(key,val){ 123 htmlInj += '<tr>'; 124 htmlInj += '<td>'+val.title+'</td>'; 125 htmlInj += '<td>£'+val.price+'</td>'; 126 htmlInj += '<td>'+val.description+'</td>'; 127 if (val.myplan == 1){ 128 htmlInj += '<td><a class="btn btn-success" disabled="disabled"><i class="fa fa-check-circle-o fa-lg"></i> {{ column_current }}</a></td>'; 129 }else{ 130 if (val.user_plan_id == 1) { 131 htmlInj += '<td></td>'; 132 }else{ 133 htmlInj += '<td>'; 134 htmlInj += '<a href="https://uk.openbaypro.com/account/live/subscription_setup.php?plan_id='+val.user_plan_id+'&subscriber_id={{ obp_token }}" class="btn btn-primary" target="_BLANK"><i class="fa fa-arrow-right fa-lg"></i> {{ button_plan_change }}</a>'; 135 htmlInj += '</td>'; 136 } 137 } 138 htmlInj += '</tr>'; 139 }); 140 htmlInj += '<tbody>'; 141 142 $('#openbay-plans').append(htmlInj); 143 $('#openbay-plans-container').show(); 144 }, 145 error: function (xhr, ajaxOptions, thrownError) { 146 if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } 147 } 148 }); 149 } 150 151 $(document).ready(function() { 152 loadAccount(); 153 loadPlans(); 154 }); 155 //--></script> 156 {{ footer }}