templates/panel/modules/user/vpn/service/enter.html.twig line 1

Open in your IDE?
  1. <div class="card">
  2.     <div class="card-body">
  3.         <div class="col-12 col-md-12">
  4.             <div class="alert alert-primary">
  5.                 <p class="m-0 p-0">
  6.                     قیمت ها با
  7.                     <strong>
  8.                         احتساب تخفیف پلکانی
  9.                     </strong>
  10.                     و
  11.                     <strong>
  12.                         شارژ هدیه
  13.                     </strong>
  14.                     موجود حساب شما محاسبه می گردد
  15.                     <a href="{{ path('app_user_vpn_dynamic_price') }}">
  16.                         اطلاعات بیشتر
  17.                     </a>
  18.                 </p>
  19.             </div>
  20.         </div>
  21.         <ul class="nav nav-pills mb-3 w-100" id="pills-tab" role="tablist">
  22.             <li class="nav-item " style="width: 100% !important;" role="presentation">
  23.                 <button  class="mb-1 w-100 nav-link" id="pills-vip-tab" data-bs-toggle="pill" data-bs-target="#pills-vip"
  24.                         type="button" role="tab" aria-controls="pills-vip" aria-selected="true">
  25.                     میکس
  26.                     <br>
  27.                     تمام پروتکل ها V2ray + OpenVPN + Cisco
  28.                     <br>
  29.                     PC-Mobile-TV
  30.                 </button>
  31.             </li>
  32.             <li class="nav-item " style="width: 33% !important;" role="presentation">
  33.                 <button class="mb-1 w-100 nav-link active" id="pills-v2ray-tab" data-bs-toggle="pill" data-bs-target="#pills-v2ray"
  34.                         type="button" role="tab" aria-controls="pills-v2ray" aria-selected="true">
  35.                     V2RAY
  36.                     <br>
  37.                     سرویس وی تو ری
  38.                     <br>
  39.                     PC-Mobile-TV
  40.                 </button>
  41.             </li>
  42.             <li class="nav-item " style="width: 33% !important;" role="presentation">
  43.                 <button class="mb-1 w-100 nav-link" id="pills-cisco-tab" data-bs-toggle="pill" data-bs-target="#pills-cisco" type="button"
  44.                         role="tab" aria-controls="pills-cisco" aria-selected="false">
  45.                     Cisco
  46.                     <br>
  47.                     سرویس سیسکو انی کانکت
  48.                     <br>
  49.                     PC-Mobile-TV
  50.                 </button>
  51.             </li>
  52.             <li class="nav-item " style="width: 33% !important;" role="presentation">
  53.                 <button class="mb-1 w-100 nav-link" id="pills-open-tab" data-bs-toggle="pill" data-bs-target="#pills-open" type="button"
  54.                         role="tab" aria-controls="pills-open" aria-selected="false">
  55.                     OpenVPN/L2TP
  56.                     <br>
  57.                     سرویس اوپن وی پی ان / ال تو تی پی
  58.                     <br>
  59.                     PC-Mobile-TV
  60.                 </button>
  61.             </li>
  62.         </ul>
  63.         <div class="tab-content" id="pills-tabContent">
  64.             <div class="tab-pane fade show active" id="pills-v2ray" role="tabpanel" aria-labelledby="pills-v2ray-tab"
  65.                  tabindex="0">
  66.                 {% include 'panel/pages/user/vpn/service/v2ray-form.html.twig' with {'sizedV2rayForm' : sizedV2rayForm , 'unlimitedV2rayForm' : unlimitedV2rayForm}  %}
  67.             </div>
  68.             <div class="tab-pane fade" id="pills-cisco" role="tabpanel" aria-labelledby="pills-cisco-tab" tabindex="0">
  69.                 {% include 'panel/pages/user/vpn/service/cisco-form.html.twig' with {'sizedOcServForm' : sizedOcServForm , 'unlimitedOcServForm' : unlimitedOcServForm} %}
  70.             </div>
  71.             <div class="tab-pane fade" id="pills-open" role="tabpanel" aria-labelledby="pills-open-tab" tabindex="0">
  72.                 {% include 'panel/pages/user/vpn/service/open-form.html.twig' with {'sizedOpenForm' : sizedOpenForm , 'unlimitedOpenForm' : unlimitedOpenForm}%}
  73.             </div>
  74.             <div class="tab-pane fade" id="pills-vip" role="tabpanel" aria-labelledby="pills-vip-tab"
  75.                  tabindex="0">
  76.                 {% include 'panel/pages/user/vpn/service/vip-form.html.twig' with {'sizedVipForm' : sizedVipForm}  %}
  77.             </div>
  78.         </div>
  79.     </div>
  80. </div>
  81. {% block footer %}
  82.     <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  83.     <script>
  84.             $(document).ready(function() {
  85.                 // Vip Limited
  86.                 $(document).ready(function() {
  87.                     $('.ajax-vipLimited').on('change', function() {
  88.                         let formElement = $(this).closest('form'); // Find the closest form element
  89.                         let formName = formElement.attr('name'); // Get the form's name attribute
  90.                         let rawData = $("form[name='" + formName + "']").serializeArray(); // Serialize form fields
  91.                         let formData = {}; // Object to store cleaned data
  92.                         // Remove the form name prefix
  93.                         $.each(rawData, function(index, field) {
  94.                             let fieldName = field.name.replace(formName + "[", "").replace("]", ""); // Clean field name
  95.                             formData[fieldName] = field.value;
  96.                         });
  97.                         $.ajax({
  98.                             url: "{{ path('app_panel_user_vpn_service_get_price_ajax') }}", // Symfony route
  99.                             type: "POST",
  100.                             data: formData, // Send cleaned data
  101.                             success: function(response) {
  102.                                 $('#limited_vip_price').val(response.message);
  103.                             }
  104.                         });
  105.                     });
  106.                 });
  107.                 // V2ray Limited
  108.                 $(document).ready(function() {
  109.                     $('.ajax-v2rayLimited').on('change', function() {
  110.                         let formElement = $(this).closest('form'); // Find the closest form element
  111.                         let formName = formElement.attr('name'); // Get the form's name attribute
  112.                         let rawData = $("form[name='" + formName + "']").serializeArray(); // Serialize form fields
  113.                         let formData = {}; // Object to store cleaned data
  114.                         // Remove the form name prefix
  115.                         $.each(rawData, function(index, field) {
  116.                             let fieldName = field.name.replace(formName + "[", "").replace("]", ""); // Clean field name
  117.                             formData[fieldName] = field.value;
  118.                         });
  119.                         $.ajax({
  120.                             url: "{{ path('app_panel_user_vpn_service_get_price_ajax') }}", // Symfony route
  121.                             type: "POST",
  122.                             data: formData, // Send cleaned data
  123.                             success: function(response) {
  124.                                 $('#limited_v2ray_price').val(response.message);
  125.                             }
  126.                         });
  127.                     });
  128.                 });
  129.                 // V2ray UnLimited
  130.                 $(document).ready(function() {
  131.                     $('.ajax-v2rayUnLimited').on('change', function() {
  132.                         let formElement = $(this).closest('form'); // Find the closest form element
  133.                         let formName = formElement.attr('name'); // Get the form's name attribute
  134.                         let rawData = $("form[name='" + formName + "']").serializeArray(); // Serialize form fields
  135.                         let formData = {}; // Object to store cleaned data
  136.                         // Remove the form name prefix
  137.                         $.each(rawData, function(index, field) {
  138.                             let fieldName = field.name.replace(formName + "[", "").replace("]", ""); // Clean field name
  139.                             formData[fieldName] = field.value;
  140.                         });
  141.                         $.ajax({
  142.                             url: "{{ path('app_panel_user_vpn_service_get_price_ajax') }}", // Symfony route
  143.                             type: "POST",
  144.                             data: formData, // Send cleaned data
  145.                             success: function(response) {
  146.                                 $('#unlimited_v2ray_price').val(response.message);
  147.                             }
  148.                         });
  149.                     });
  150.                 });
  151.                 // open Limited
  152.                 $(document).ready(function() {
  153.                     $('.ajax-openLimited').on('change', function() {
  154.                         let formElement = $(this).closest('form'); // Find the closest form element
  155.                         let formName = formElement.attr('name'); // Get the form's name attribute
  156.                         let rawData = $("form[name='" + formName + "']").serializeArray(); // Serialize form fields
  157.                         let formData = {}; // Object to store cleaned data
  158.                         // Remove the form name prefix
  159.                         $.each(rawData, function(index, field) {
  160.                             let fieldName = field.name.replace(formName + "[", "").replace("]", ""); // Clean field name
  161.                             formData[fieldName] = field.value;
  162.                         });
  163.                         $.ajax({
  164.                             url: "{{ path('app_panel_user_vpn_service_get_price_ajax') }}", // Symfony route
  165.                             type: "POST",
  166.                             data: formData, // Send cleaned data
  167.                             success: function(response) {
  168.                                 $('#limited_open_price').val(response.message);
  169.                             }
  170.                         });
  171.                     });
  172.                 });
  173.                 // open UnLimited
  174.                 $(document).ready(function() {
  175.                     $('.ajax-openUnLimited').on('change', function() {
  176.                         let formElement = $(this).closest('form'); // Find the closest form element
  177.                         let formName = formElement.attr('name'); // Get the form's name attribute
  178.                         let rawData = $("form[name='" + formName + "']").serializeArray(); // Serialize form fields
  179.                         let formData = {}; // Object to store cleaned data
  180.                         // Remove the form name prefix
  181.                         $.each(rawData, function(index, field) {
  182.                             let fieldName = field.name.replace(formName + "[", "").replace("]", ""); // Clean field name
  183.                             formData[fieldName] = field.value;
  184.                         });
  185.                         $.ajax({
  186.                             url: "{{ path('app_panel_user_vpn_service_get_price_ajax') }}", // Symfony route
  187.                             type: "POST",
  188.                             data: formData, // Send cleaned data
  189.                             success: function(response) {
  190.                                 $('#unlimited_open_price').val(response.message);
  191.                             }
  192.                         });
  193.                     });
  194.                 });
  195.                 // ocserv Limited
  196.                 $(document).ready(function() {
  197.                     $('.ajax-ocservLimited').on('change', function() {
  198.                         let formElement = $(this).closest('form'); // Find the closest form element
  199.                         let formName = formElement.attr('name'); // Get the form's name attribute
  200.                         let rawData = $("form[name='" + formName + "']").serializeArray(); // Serialize form fields
  201.                         let formData = {}; // Object to store cleaned data
  202.                         // Remove the form name prefix
  203.                         $.each(rawData, function(index, field) {
  204.                             let fieldName = field.name.replace(formName + "[", "").replace("]", ""); // Clean field name
  205.                             formData[fieldName] = field.value;
  206.                         });
  207.                         $.ajax({
  208.                             url: "{{ path('app_panel_user_vpn_service_get_price_ajax') }}", // Symfony route
  209.                             type: "POST",
  210.                             data: formData, // Send cleaned data
  211.                             success: function(response) {
  212.                                 $('#limited_oc_serv_price').val(response.message);
  213.                             }
  214.                         });
  215.                     });
  216.                 });
  217.                 // ocserv UnLimited
  218.                 $(document).ready(function() {
  219.                     $('.ajax-ocservUnLimited').on('change', function() {
  220.                         let formElement = $(this).closest('form'); // Find the closest form element
  221.                         let formName = formElement.attr('name'); // Get the form's name attribute
  222.                         let rawData = $("form[name='" + formName + "']").serializeArray(); // Serialize form fields
  223.                         let formData = {}; // Object to store cleaned data
  224.                         // Remove the form name prefix
  225.                         $.each(rawData, function(index, field) {
  226.                             let fieldName = field.name.replace(formName + "[", "").replace("]", ""); // Clean field name
  227.                             formData[fieldName] = field.value;
  228.                         });
  229.                         $.ajax({
  230.                             url: "{{ path('app_panel_user_vpn_service_get_price_ajax') }}", // Symfony route
  231.                             type: "POST",
  232.                             data: formData, // Send cleaned data
  233.                             success: function(response) {
  234.                                 $('#unlimited_oc_serv_price').val(response.message);
  235.                             }
  236.                         });
  237.                     });
  238.                 });
  239.             });
  240.     </script>
  241. {% endblock %}