templates/front.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>{% block title %}Konso+  - Home{% endblock %}</title>
  8.         <link rel="shortcut icon" type="image/x-icon" href="{{asset('app-assets/dist/img/AdminLTELogo.png')}}">
  9.         <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  10.         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css">
  11.         <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
  12.        
  13.         <link href="{{asset('assets/css/style.css') }}" rel="stylesheet">   
  14.       {# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
  15.       {% block stylesheets %}
  16.           {{ encore_entry_link_tags('app') }}
  17.       {% endblock %}
  18.     </head>
  19.     <body>
  20.         
  21.    <div class="page-loader">
  22.         <div class="spinner"></div>
  23.         <img src="{{asset('assets/img/logo.jpg') }}" class="img-fluid">
  24.     </div>
  25.     <div class="content">
  26.         <header class="header bg_blue">
  27.             <div class="container-fluid">
  28.                <nav class="navbar navbar-expand-lg navbar-light p-0">
  29.                     <a class="navbar-brand" href="{{ path('app_front') }}"><img src="{{asset('assets/img/logo.jpg') }}" class="img-fluid"></a>
  30.                   
  31.                     <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
  32.                       <span class="navbar-toggler-icon"></span>
  33.                     </button>
  34.                    
  35.                     <div class="collapse navbar-collapse" id="navbarNav">
  36.                       <ul class="navbar-nav ml-auto">
  37.                         <form class="form-inline my-2 my-lg-0">
  38.                             <i class="fa fa-search iconnameleft"></i>
  39.                             <input class=" inputleft form-control mr-sm-2" id="myInput"   type="search" placeholder="{{ pageContent['search'] }}" aria-label="Search">
  40.                         </form>
  41.                         <li class="nav-item  active px-3">
  42.                           <a class="nav-link navbar-text " href="{{ path('app_front') }}">{{ pageContent['home'] }} </a>
  43.                         </li>
  44.                         {# <li class="nav-item px-3">
  45.                           <a class="nav-link navbar-text" href="#" data-toggle="modal" data-target="#MarkcomplaintModal">Complaints</a>
  46.                         </li> #}
  47.                         <li class="nav-item px-3">
  48.                           <a class="nav-link navbar-text" href="{{ path('app_product_campaign') }}">{{ pageContent['product_campaign'] }}</a>
  49.                         </li>
  50.                         <li class="nav-item  active px-3">
  51.                           <a class="nav-link navbar-text " href="{{ path('app_privacy_policy') }}">{{ pageContent['privacy_policy'] }} </a>
  52.                         </li>
  53.                         {% if app.request.get('_route') == 'app_front' %}
  54.                         <li class="nav-item px-3">
  55.                           <a class="nav-link navbar-text" href="{{ path('app_switch_lang',{lang:1,page:1}) }}">
  56.                             <img src="{{asset('assets/img/usa.png') }}" style="height: 40px;width: 80%;">
  57.                           </a>
  58.                         </li>
  59.                         <li class="nav-item px-3">
  60.                           <a class="nav-link navbar-text" href="{{ path('app_switch_lang',{lang:2,page:1}) }}">
  61.                             <img src="{{asset('assets/img/france.png') }}" style="height: 40px;width: 80%;">
  62.                           </a>
  63.                         </li>
  64.                         {% elseif app.request.get('_route') == 'app_product_campaign' %}
  65.                         <li class="nav-item px-3">
  66.                           <a class="nav-link navbar-text" href="{{ path('app_switch_lang',{lang:1,page:2}) }}">
  67.                             <img src="{{asset('assets/img/usa.png') }}" style="height: 40px;width: 80%;">
  68.                           </a>
  69.                         </li>
  70.                         <li class="nav-item px-3">
  71.                           <a class="nav-link navbar-text" href="{{ path('app_switch_lang',{lang:2,page:2}) }}">
  72.                             <img src="{{asset('assets/img/france.png') }}" style="height: 40px;width: 80%;">
  73.                           </a>
  74.                         </li>
  75.                         {% else %}
  76.                         <li class="nav-item px-3">
  77.                           <a class="nav-link navbar-text" href="{{ path('app_switch_lang',{lang:1,page:3}) }}">
  78.                             <img src="{{asset('assets/img/usa.png') }}" style="height: 40px;width: 80%;">
  79.                           </a>
  80.                         </li>
  81.                         <li class="nav-item px-3">
  82.                           <a class="nav-link navbar-text" href="{{ path('app_switch_lang',{lang:2,page:3}) }}">
  83.                             <img src="{{asset('assets/img/france.png') }}" style="height: 40px;width: 80%;">
  84.                           </a>
  85.                         </li>
  86.                         {% endif %}
  87.                      </ul>
  88.                     </div>
  89.                 
  90.                </nav>
  91.             </div><!--container end-->
  92.           </header>
  93.         {% block body %}{% endblock %}
  94.   
  95.         {% block javascripts %}
  96.         {% for message in app.flashes('green') %}
  97.           <!--page load Modal for register complaint-->
  98.          <div class="modal fade" id="registerComplaint" tabindex="-1" role="dialog" aria-labelledby="registerComplaintLabel" aria-hidden="true">
  99.           <div class="modal-dialog" role="document">
  100.             <div class="modal-content">
  101.                <div class="modal-header">
  102.                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  103.                  <span aria-hidden="true">&times;</span>
  104.                  </button>
  105.                </div>
  106.                <div class="modal-body">
  107.                   <img class=" img-fluid tick-img " src="{{asset('assets/img/tick.jpg')}}" alt="">
  108.                   <h5 style="text-align: center;" class="pt-3"> {{ message }} </h5>
  109.                      <div class="row pt-5">
  110.                         <div class="col-lg-12 col-md-12 col-sm-12 text-center"> 
  111.                           <button type="button" class="btn btn-primary btn-block"  data-dismiss="modal" aria-label="Close">{{ pageContent['back'] }}</button>
  112.                         </div>
  113.                       </div>
  114.                </div>
  115.             </div>
  116.           </div>
  117.         </div>
  118.         {% endfor %}
  119.         {% for message in app.flashes('red') %}
  120.           <!--page load Modal for register complaint-->
  121.          <div class="modal fade" id="registerComplaint" tabindex="-1" role="dialog" aria-labelledby="registerComplaintLabel" aria-hidden="true">
  122.           <div class="modal-dialog" role="document">
  123.             <div class="modal-content">
  124.                <div class="modal-header">
  125.                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  126.                  <span aria-hidden="true">&times;</span>
  127.                  </button>
  128.                </div>
  129.                <div class="modal-body">
  130.                   <img class=" img-fluid tick-img " src="{{asset('assets/img/images.png')}}" alt="">
  131.                   <h5 style="text-align: center;" class="pt-3"> {{ message }} </h5>
  132.                      <div class="row pt-5">
  133.                         <div class="col-lg-12 col-md-12 col-sm-12 text-center"> 
  134.                           <button type="button" class="btn btn-primary btn-block"  data-dismiss="modal" aria-label="Close">{{ pageContent['back'] }}</button>
  135.                         </div>
  136.                       </div>
  137.                </div>
  138.             </div>
  139.           </div>
  140.         </div>
  141.         {% endfor %}
  142.         <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
  143.         <script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
  144.          <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  145.         <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  146.         <script src="https://kit.fontawesome.com/a12c53d1f0.js" crossorigin="anonymous"></script>
  147.         <script>
  148.           var x=document.getElementById("demo");
  149.           $( document ).ready(function() {
  150.               console.log( "document loaded" );
  151.               if (navigator.geolocation){
  152.                  navigator.geolocation.getCurrentPosition(showPosition);
  153.                }
  154.                else{
  155.                  x.innerHTML="Geolocation is not supported by this browser.";
  156.                }
  157.           });
  158.             function showPosition(position){
  159.               document.getElementById('lat').value = position.coords.latitude;
  160.               document.getElementById('lng').value = position.coords.longitude;  
  161.            }
  162.           </script> 
  163.           <script>
  164.         function GFG_click(clicked) {
  165.                 console.log(clicked);
  166.           document.getElementById('product_id').value = clicked;      
  167.         } 
  168.       </script>
  169.         <script>
  170.             var _URL = window.URL || window.webkitURL;
  171.           $("#fileimg").change(function(e) {
  172.                     var fileimg, img;
  173.                     if ((fileimg = this.files[0])) {
  174.                             if (this.files.length < 4){
  175.                                 
  176.                                 img = new Image();
  177.                                 img.onload = function() {
  178.                                     
  179.                                 };
  180.                                 document.getElementById("imagemessage").innerHTML ="";
  181.                             } else {
  182.                                 document.getElementById("imagemessage").innerHTML ="You are only allowed to upload a maximum of 4 files";
  183.                                     document.getElementById('fileimg').value = "";
  184.                             }  
  185.                         
  186.                         img.onerror = function() {
  187.                             alert( "not a valid fileimg: " + fileimg.type);
  188.                         };
  189.                         img.src = _URL.createObjectURL(fileimg);
  190.                     }
  191.                 });
  192.         </script>
  193.         <script type="text/javascript">
  194.           var $rows = $('#myUL li');
  195.             $('#myInput').keyup(function() {
  196.                 var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
  197.                 
  198.                 $rows.show().filter(function() {
  199.                     var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
  200.                     return !~text.indexOf(val);
  201.                 }).hide();
  202.                 // if ($row == 0) {
  203.                 //     document.getElementById("msg").innerHTML = "No matching records found";
  204.                 // }
  205.             });
  206.         </script>
  207.        
  208.         <script>
  209.             $(document).ready(function(){
  210.               var $filterCheckboxes = $('input[type="checkbox"]');
  211.               $filterCheckboxes.on('change', function() {
  212.                   var selectedFilters = {};
  213.                   $filterCheckboxes.filter(':checked').each(function() {
  214.                     if (!selectedFilters.hasOwnProperty(this.name)) {
  215.                       selectedFilters[this.name] = [];
  216.                     }
  217.                     selectedFilters[this.name].push(this.value);
  218.                     // selectedFilters=['3', '2', '1', '4'];
  219.                   });
  220.                 console.log(selectedFilters[this.name]);
  221.                 var urls = "{{ path('app_get_subcategoryall') }}";
  222.                 var cacheckboxValues_1=selectedFilters[this.name];
  223.                 // cacheckboxValues_1.push($(this).val());
  224.                 // let text = cacheckboxValues_1.join();
  225.                 
  226.                 $.ajax({
  227.                     type: "POST",
  228.                     url: urls,
  229.                     data: {cacheckboxValues:cacheckboxValues_1},
  230.                     success: function (response) {
  231.                    
  232.                     var  j_data = eval(response);
  233.                     var show_info='';
  234.                     for (var i = 0; i < j_data.length; i++)
  235.                      {
  236.                         show_info +='<div class="form-check"><input class="form-check-input" type="checkbox" name="subcategory[]" value="'+j_data[i].id+'" id="flexCheckDefault"><label class="form-check-label" for="flexCheckDefault">'+j_data[i].name+'</label></div>';
  237.                      }
  238.                       // console.log(show_info);
  239.                       $('#subcat').html(show_info);
  240.                     }
  241.                  });
  242.               });
  243.             });
  244.              
  245.           </script>  
  246.           <script >
  247.             $(document).ready(function(){
  248.               var $filterCheckboxe =$('input[type="checkbox"]');
  249.               $filterCheckboxe.on('change', function() {
  250.                   var selectedFilters = {};
  251.                   $filterCheckboxe.filter(':checked').each(function() {
  252.                     if (!selectedFilters.hasOwnProperty(this.name)) {
  253.                       selectedFilters[this.name] = [];
  254.                     }
  255.                     selectedFilters[this.name].push(this.value);
  256.                   });
  257.                 console.log(selectedFilters[this.name]);
  258.                 var urlcat = "{{ path('app_get_subcategoryall') }}";
  259.                 var cacheckboxValues_1=selectedFilters[this.name];
  260.                 
  261.                 $.ajax({
  262.                     type: "POST",
  263.                     url: urlcat,
  264.                     data: {cacheckboxValues:cacheckboxValues_1},
  265.                     success: function (response) {
  266.                    
  267.                     var  j_data = eval(response);
  268.                     var show_info='';
  269.                     for (var i = 0; i < j_data.length; i++)
  270.                      {
  271.                         show_info +='<div class="form-check"><input class="form-check-input" type="checkbox" name="subcategory[]" value="'+j_data[i].id+'" id="flexCheckDefault"><label class="form-check-label" for="flexCheckDefault">'+j_data[i].name+'</label></div>';
  272.                      }
  273.                       console.log(show_info);
  274.                       $('#subcats').html(show_info);
  275.                     }
  276.                  });
  277.               });
  278.             });
  279.           </script>
  280.           {% if app.request.get('_route') == 'app_front' %}
  281.           <script type="text/javascript">
  282.             function get_city(province)
  283.             {
  284.                // alert(country);
  285.                var url = "{{ path('app_get_city') }}";
  286.                 $.ajax({
  287.                     type: "POST",
  288.                     url: url,
  289.                     data: {province:province},
  290.                     success: function (response) {
  291.                    
  292.                     var  j_data = eval(response);
  293.                     var show_info='<option value="" selected="true" disabled="disabled">{{ pageContent['selectcity'] }}</option>';
  294.                     for (var i = 0; i < j_data.length; i++)
  295.                      {
  296.                         show_info +='<option value="'+j_data[i].id+'">'+j_data[i].name+'</option>';
  297.                      }
  298.                       $('#city').html(show_info);
  299.                     }
  300.                  });
  301.             }
  302.           </script>   
  303.           
  304.         <!--file upload script-->
  305.     <script>
  306.       //Reference: 
  307. //https://www.onextrapixel.com/2012/12/10/how-to-create-a-custom-file-input-with-jquery-css3-and-php/
  308. ;(function($) {
  309. // Browser supports HTML5 multiple file?
  310. var multipleSupport = typeof $('<input/>')[0].multiple !== 'undefined',
  311.     isIE = /msie/i.test( navigator.userAgent );
  312. $.fn.customFile = function() {
  313.   return this.each(function() {
  314.     var $file = $(this).addClass('custom-file-upload-hidden'), // the original file input
  315.         $wrap = $('<div class="file-upload-wrapper">'),
  316.         $input = $('<input type="text" class="file-upload-input" placeholder="{{ pageContent['placeholdimage'] }}"/>'),
  317.         // Button that will be used in non-IE browsers
  318.         $button = $('<button type="button" class="file-upload-button">Upload</button>'),
  319.         // Hack for IE
  320.         $label = $('<label class="file-upload-button" for="'+ $file[0].id +'">{{ pageContent['placeholdimage'] }}</label>');
  321.     // Hide by shifting to the left so we
  322.     // can still trigger events
  323.     $file.css({
  324.       position: 'absolute',
  325.       left: '-9999px'
  326.     });
  327.     $wrap.insertAfter( $file )
  328.       .append( $file, $input, ( isIE ? $label : $button ) );
  329.     // Prevent focus
  330.     $file.attr('tabIndex', -1);
  331.     $button.attr('tabIndex', -1);
  332.     $button.click(function () {
  333.       $file.focus().click(); // Open dialog
  334.     });
  335.     $file.change(function() {
  336.       var files = [], fileArr, filename;
  337.       // If multiple is supported then extract
  338.       // all filenames from the file array
  339.       if ( multipleSupport ) {
  340.         fileArr = $file[0].files;
  341.         for ( var i = 0, len = fileArr.length; i < len; i++ ) {
  342.           files.push( fileArr[i].name );
  343.         }
  344.         filename = files.join(', ');
  345.       // If not supported then just take the value
  346.       // and remove the path to just show the filename
  347.       } else {
  348.         filename = $file.val().split('\\').pop();
  349.       }
  350.       $input.val( filename ) // Set the value
  351.         .attr('title', filename) // Show filename in title tootlip
  352.         .focus(); // Regain focus
  353.     });
  354.     $input.on({
  355.       blur: function() { $file.trigger('blur'); },
  356.       keydown: function( e ) {
  357.         if ( e.which === 13 ) { // Enter
  358.           if ( !isIE ) { $file.trigger('click'); }
  359.         } else if ( e.which === 8 || e.which === 46 ) { // Backspace & Del
  360.           // On some browsers the value is read-only
  361.           // with this trick we remove the old input and add
  362.           // a clean clone with all the original events attached
  363.           $file.replaceWith( $file = $file.clone( true ) );
  364.           $file.trigger('change');
  365.           $input.val('');
  366.         } else if ( e.which === 9 ){ // TAB
  367.           return;
  368.         } else { // All other keys
  369.           return false;
  370.         }
  371.       }
  372.     });
  373.   });
  374. };
  375. // Old browser fallback
  376. if ( !multipleSupport ) {
  377.   $( document ).on('change', 'input.customfile', function() {
  378.     var $this = $(this),
  379.         // Create a unique ID so we
  380.         // can attach the label to the input
  381.         uniqId = 'customfile_'+ (new Date()).getTime(),
  382.         $wrap = $this.parent(),
  383.         // Filter empty input
  384.         $inputs = $wrap.siblings().find('.file-upload-input')
  385.           .filter(function(){ return !this.value }),
  386.         $file = $('<input type="file" id="'+ uniqId +'" name="'+ $this.attr('name') +'"/>');
  387.     // 1ms timeout so it runs after all other events
  388.     // that modify the value have triggered
  389.     setTimeout(function() {
  390.       // Add a new input
  391.       if ( $this.val() ) {
  392.         // Check for empty fields to prevent
  393.         // creating new inputs when changing files
  394.         if ( !$inputs.length ) {
  395.           $wrap.after( $file );
  396.           $file.customFile();
  397.         }
  398.       // Remove and reorganize inputs
  399.       } else {
  400.         $inputs.parent().remove();
  401.         // Move the input so it's always last on the list
  402.         $wrap.appendTo( $wrap.parent() );
  403.         $wrap.find('input').focus();
  404.       }
  405.     }, 1);
  406.   });
  407. }
  408. }(jQuery));
  409. $('input[type=file]').customFile();
  410.     </script>
  411. {% endif %}
  412.     <!--splash screen script-->
  413.       <script>
  414.        $(window).on('load',function(){
  415.         setTimeout(function(){ // allowing 3 secs to fade out loader
  416.         $('.page-loader').hide(6000); 
  417.         $(".content").show(6000); 
  418.         });
  419.       });
  420.       $('.page-loader').show('6000');
  421.       </script>
  422.       <script>
  423.             $(document).ready(function(){
  424.               setTimeout(function() {
  425.                   $("#registerComplaint").modal('show');
  426.                 }, 6001);
  427.               
  428.           });
  429.      </script>
  430.         {% endblock %}
  431.     </body>
  432. </html>