src/ApplicationBundle/Resources/views/pages/consultancy/event_list_page.html.twig line 1

Open in your IDE?
  1. {% include '@Application/inc/buddybee_new_header.html.twig' %}
  2. <style>
  3.     .consultant-bio-img img {
  4.         height: 154px;
  5.         border-radius: 10%;
  6.     }
  7.     .small_language_img {
  8.     }
  9.     .consultant-bio-img .cons_image_view {
  10.         height: 154px;
  11.         width: 154px;
  12.         border-radius: 14px;
  13.         background-size: contain !important;
  14.         background-repeat: no-repeat !important;
  15.         background-position: center !important;
  16.     }
  17.     .consultant_search_bar.searchbar-content {
  18.         position: relative;
  19.     }
  20.     .consultant_search_bar.searchbar-content a {
  21.         position: absolute;
  22.         right: 9px;
  23.         top: 7px;
  24.     }
  25.     .filter_div img {
  26.         /*display: block;*/
  27.         color: #fff;
  28.         /*padding: 10px 0;*/
  29.         font-size: 14px;
  30.         background: #1D5B9E;
  31.         width: 40px;
  32.         height: 40px;
  33.         padding: 6px;
  34.         text-align: center;
  35.         line-height: 51px;
  36.         border-radius: 50%;
  37.     }
  38.     .filter_div_btn {
  39.     }
  40.     .filter_div {
  41.         display: inline-block;
  42.         width: 70px;
  43.         padding: 10px 0;
  44.         position: relative;
  45.     }
  46.     .consultant-title .searchbar {
  47.         width: 290px;
  48.         display: inline-block;
  49.         position: relative;
  50.     }
  51.     .filter_div_content {
  52.         padding: 20px;
  53.         width: 300px;
  54.         min-height: 400px;
  55.         height: auto;
  56.         left: -115px;
  57.         position: absolute;
  58.         z-index: 99999;
  59.         background: white;
  60.         display: none;;
  61.         /*border:1px solid darkblue;*/
  62.         box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
  63.     }
  64.     .filter_div_content .head {
  65.         display: flex;
  66.         justify-content: space-between;
  67.         border-bottom: 1px solid #f1e4e4;
  68.     }
  69.     .filter_div_content .head .title {
  70.         font-size: 13px;
  71.         display: inline-block;
  72.         float: left;
  73.         margin-bottom: 0.5rem;
  74.     }
  75.     .filter_div_content .head .title.right {
  76.         float: right;
  77.         color: #1D5B9E;
  78.         font-weight: bold;
  79.         text-decoration: none;
  80.     }
  81.     .filter_div_content .body {
  82.         text-align: left;
  83.         /*padding-top: 15px;*/
  84.     }
  85.     .filter_div_content .body .title {
  86.         margin-top: 15px;
  87.         margin-bottom: 2px;
  88.         font-size: 11px;
  89.         text-align: left;
  90.         text-transform: uppercase;
  91.         color: #6c757d;
  92.     }
  93.     .filter_div_content .body .option {
  94.     }
  95.     .filter_div_content .body .form-check {
  96.         text-align: left;
  97.         width: 49%;
  98.         display: inline-block;
  99.     }
  100.     .filter_div_content .body .form-check .form-check-label span {
  101.         font-size: 13px;;
  102.     }
  103.     .filter_div_content .body .form-check .form-check-input:checked {
  104.         background-color: #1D5B9E;
  105.         border-color: #1D5B9E;
  106.     }
  107.     @media (min-width: 320px) and (max-width: 480px) {
  108.         .consultant-title .searchbar {
  109.             width: 250px;
  110.         }
  111.         .filter_div_content {
  112.             left: unset;
  113.             right: 0;
  114.         }
  115.     }
  116.     @media (min-width: 481px) and (max-width: 540px) {
  117.         .consultant-title .searchbar {
  118.             width: 250px;
  119.         }
  120.         .filter_div_content {
  121.             left: unset;
  122.             right: 0;
  123.         }
  124.     }
  125.     @media (min-width: 320px) and (max-width: 480px) {
  126.         .consultant-bio-img .cons_image_view {
  127.             height: 60px !important;
  128.             width: 60px !important;
  129.         }
  130.         .book_btn_span {
  131.             display: none;
  132.         }
  133.         .rating_value_span {
  134.             display: block;
  135.             padding: 0 21px;;
  136.         }
  137.     }
  138.     .consultant-bio {
  139.         cursor: pointer;
  140.         flex-direction: column;
  141.     }
  142.     .consultant-bio-right, .consultant-bio-left, .consultant-bio-left .cons_image_view {
  143.         width: 100%;
  144.     }
  145.     .consultant-bio-right h3 {
  146.         color: #6E6B78;
  147.         font-size: 20px;
  148.         margin-top: 13px;;
  149.         margin-bottom: 13px;;
  150.         /*font-family: nexa;*/
  151.         font-weight: bold;;
  152.     }
  153.     .consultant-bio-right p {
  154.         color: #6E6B78;
  155.         font-size: 16px;
  156.         margin-top: 3px;;
  157.         /*font-family: nexa;*/
  158.         font-weight: 300;;
  159.     }
  160.     .consultant-bio-right i.fa {
  161.         font-weight: normal;;
  162.     }
  163.     .consultant-bio-right button.btn-event-action {
  164.         width: 48%;
  165.         height: 50px;;
  166.         background: white;
  167.         border-radius: 5px;;
  168.         border: 1px solid #1D5B9E;
  169.         color: #1D5B9E;
  170.     }
  171.     .consultant-bio-right button.btn-event-action.btn-event-going.going {
  172.         background: #1D5B9E;
  173.         border: 1px solid #1D5B9E;
  174.         color: white;
  175.     }
  176.     .consultant-bio-right button.btn-event-action.btn-event-going.not_going {
  177.     }
  178.     .consultant-bio-right button.btn-event-action.btn-event-save.saved {
  179.     }
  180.     .cta
  181.     {
  182.         display: block;;
  183.     }
  184. </style>
  185. <section class="consultant-section">
  186.     {% set countries_data='_HAS_CONSULTANT_'|getCountriesBuddyBee('object') %}
  187.     {% set language_list='_ALL_'|getLanguagesBuddyBee('object') %}
  188.     <div class="consultant-title">
  189.         <div class="container">
  190.             <div class="row mb-5">
  191.                 <div class="col-md-3"></div>
  192.                 <div class="col-md-6" style="position: relative;text-align: center">
  193.                     <h2>All Events</h2>
  194.                 </div>
  195.                 <div class="col-md-3"></div>
  196.             </div>
  197.         </div>
  198.     </div>
  199.     <div class="consultant-list">
  200.         <div class="container">
  201.             <div class="row pList" style="justify-content: space-evenly;">
  202.             </div>
  203.             <div class="row ">
  204.                 <div class="col-md-12 ">
  205.                     <div class="page-pagination  mt-5" id="consultant_pagination">
  206.                     </div>
  207.                 </div>
  208.             </div>
  209.         </div>
  210.     </div>
  211. </section>
  212. {% include '@Application/footer/buddybee_new_footer.html.twig' %}
  213. <script type="text/javascript"
  214.         src="{{ absolute_url(path('dashboard')) }}condensed_assets/pagination/pagination.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  215. <script>
  216.     var countries_data ={{ countries_data|json_encode()|raw() }}
  217.     var language_list ={{ language_list|json_encode()|raw() }}
  218.     var skipEventIds ={{ skipEventIds|json_encode()|raw() }}
  219.     var attendingEventIds ={{ attendingEventIds|json_encode()|raw() }}
  220.     var followingEventIds ={{ followingEventIds|json_encode()|raw() }}
  221.     var topic_conditional_string = ""
  222.     var config = {
  223.         'mainTableAlias': "mainTable",
  224.         'mainTableClass': "CompanyGroupBundle:EntityCreateTopic",
  225.         'mainTableIdField': "Id",
  226. //                'otherConditions': " (mainTable.CompanyId=1 and mainTable.status=1) ",
  227. //        'otherConditions': " ( mainTable.isConsultant=1 and mainTable.accountStatus=1  ) ",
  228.         {% set THIS_USER_ID= 0 %}
  229.         {% if (session[UserConstants.USER_ID] is defined ) %}
  230.         {% set THIS_USER_ID =session[UserConstants.USER_ID] %}
  231.         {% endif %}
  232.         'otherConditions': " ( mainTable.isEvent=1) ",
  233.         'dateFieldsToStr': ['createdAt'],
  234.         'dateFieldsToStrFormat': ['m-d-Y h:i'],
  235.         'convertToObjectFields': [],
  236.         'skipColumnNames': [],
  237.         'flagColNames': [],
  238.         columns:[
  239.             {
  240.                 name: 'mainTable.eventStartDateTs',
  241.                 search:{
  242.                     value:'',
  243.                     regex:false
  244.                 }
  245.             }
  246.         ],
  247.         'order': [
  248.             {
  249.                 "column": "0",
  250.                 "dir": "desc",
  251.             }
  252.         ],
  253.         'flagConversionByCols': {},
  254.         'joinTableList': [
  255. //            {
  256. //                'tableClass': "CompanyGroupBundle\\Entity\\EntityApplicantDetails",
  257. //                'tableAlias': "consultantTable",
  258. //                'onField': 'applicantId',
  259. //                "onMainTableField": "applicantId",
  260. //                "fields": {
  261. //                    //'alisaFiled':'actiual field Name'
  262. //                    'consultantFirstName': 'firstname',
  263. //                    'consultantLastName': 'lastname',
  264. //                    'consultantImage': 'image',
  265. //
  266. //                }
  267. //            },
  268. //                    {
  269. //                        'tableClass': "CompanyGroupBundle\\Entity\\EntityApplicantDetails",
  270. //                        'tableAlias': "studentTable",
  271. //                        'onField': 'applicantId',
  272. //                        "onMainTableField": "studentId",
  273. //                        "fields": {
  274. //                            //'alisaFiled':'actiual field Name'
  275. //                            'studentFirstName': 'firstname',
  276. //                            'studentLastName': 'lastname',
  277. //                            'studentImage': 'image',
  278. //
  279. //                        }
  280. //                    },
  281.         ],
  282.         'returnJson': 1,
  283.         'getUnitListFlag': 1
  284.     }
  285.     var pika = null;
  286.     function refresh_filter() {
  287.         var new_other_cond = "( mainTable.isEvent=1  )";
  288.         {#{% if topicId !=0 %}#}
  289.         {#new_other_cond+=" ) and mainTable.preferredTopicIdsAsConsultant like '%\"{{ topicId }}\"%'   ) ";#}
  290.         {#{% else %}#}
  291. //        new_other_cond += " ) "
  292.         {#{% endif %}#}
  293.         config.otherConditions = new_other_cond;
  294.         if (pika != null)
  295.             pika.pagination(1)
  296.         else
  297.             pika = $('#consultant_pagination').pagination({
  298.                 dataSource: "{{ url('generic_datatable_ajax_company_group') }}?dataTableQry=1",
  299.                 locator: 'data',
  300.                 //    totalNumberLocator: function(response) {
  301.                 //        // you can return totalNumber by analyzing response content
  302.                 //        return Math.floor(Math.random() * (1000 - 100)) + 100;
  303.                 //    },
  304.                 pageSize: 10,
  305.                 classPrefix: "pico",
  306.                 ulClassName: "pagination justify-content-center",
  307. //            totalNumber: 6,
  308.                 totalNumberLocator: function (response) {
  309.                     // you can return totalNumber by analyzing response content
  310.                     return response.totalObjectsCount != 0 ? (response.totalObjectsCount) : 0;
  311.                 },
  312.                 className: "pagination-div",
  313. //                pageRange: null,
  314. //            prevText :'<i class="material-icons">chevron_left</i>',
  315. //            nextText :'<i class="material-icons">chevron_right</i>',
  316.                 ajax: {
  317.                     beforeSend: function () {
  318.                         //            dataContainer.html('Loading data from flickr.com ...');
  319.                     },
  320.                     "type": 'POST',
  321.                     "data": {
  322.                         returnJson: 1,
  323.                         config: config
  324. //                           sessionData: sessionData,
  325. //                           getUnitListFlag:getUnitListFlag
  326.                     }
  327.                 },
  328.                 callback: function (data, pagination) {
  329.                     // template method of yourself
  330.                     var html = "";
  331.                     // alert('working')
  332.                     //    console.log(data)
  333.                     $('html,body').stop().animate({scrollTop: 0}, 500, 'swing', function () {
  334. //                    alert("Finished animating");
  335.                     });
  336.                     for (var k = 0; k < data.length; k++) {
  337.                         var row_here = data[k]
  338.                         html += '<div class="consultant-bio d-flex justify-content-between  col-md-3" onclick="return 0;window.location.href=\'{{ path('consultant_profile') }}/' + row_here.mainTable.id + '\'"> ' +
  339.                                 '<div class="consultant-bio-left" > ' +
  340.                                 '<div class="consultant-bio-img"> ' +
  341.                                 '<div style="background:url(' + row_here.mainTable.topicImage + '); "class="cons_image_view"></div> ' +
  342.                                 '</div> ' +
  343.                                 '</div> ' +
  344.                                 '<div class="consultant-bio-right" style="min-height:8rem;"><h3>' + row_here.mainTable.topicName + '</h3>' +
  345.                                 '<p><i class="fa fa-map-marker"></i> ' + row_here.mainTable.address + '</p>' +
  346.                                 '<p><i class="fa fa-calendar"></i> <span class="convert_to_moment_time" data-moment-ts-format="DD/MM/YYYY" data-moment-ts="' + row_here.mainTable.eventStartDateTs + '">15/01/2023</span> &nbsp;&nbsp; <i class="fa fa-clock"></i> <span class="convert_to_moment_time" data-moment-ts-format="HH:mm" data-moment-ts="' + row_here.mainTable.eventStartDateTs + '">11:00 AM</span> </p>' +
  347.                                 '<div class="row" style="padding-top: 10px;">' +
  348.                                 ' <div class="col-md-12" style="text-align: left;display: flex;flex-direction:row;justify-content: space-between; ">' +
  349.                                 '<button type="button" style="" class="btn btn-event-action btn-event-save btn-default '+(followingEventIds.indexOf(row_here.mainTable.id)!=-1?'saved':'')+' btn-event-save_' + row_here.mainTable.id + '" data-event-id="' + row_here.mainTable.id + '">'+(followingEventIds.indexOf(row_here.mainTable.id)!=-1?'Saved':'Save')+'' +
  350.                                 '</button>' +
  351.                                 '<button type="button" style="" class="btn btn-event-action btn-event-going  btn-default '+(attendingEventIds.indexOf(row_here.mainTable.id)!=-1?'going':'')+' btn-event-going_' + row_here.mainTable.id + '" data-event-id="' + row_here.mainTable.id + '">'+(attendingEventIds.indexOf(row_here.mainTable.id)!=-1?'Going':'Attend')+'' +
  352.                                 '</button>' +
  353.                                 '</div>' +
  354.                                 '</div>' +
  355.                                 '</div>' +
  356.                                 '</div>'
  357.                     }
  358.                     //    console.log(data)
  359.                     $('.pList').html(html);
  360.                     refresh_moment_times();
  361.                 }
  362.             })
  363.     }
  364.     $(document).ready(function () {
  365.         var lastViewedConsultantListStr = window.localStorage.getItem('lvcl');
  366.         var lastViewedConsultantList = [];
  367.         if (lastViewedConsultantListStr != 'null' && lastViewedConsultantListStr != null)
  368.             lastViewedConsultantList = JSON.parse(lastViewedConsultantListStr);
  369.         $('.consFilter').change(function () {
  370.             refresh_filter()
  371. //            op
  372.         })
  373.         $(document).on('click', '.btn-event-save', function (e) {
  374.             e.preventDefault();
  375.             var newStatus=$(this).hasClass('saved')? 0:1;
  376.             $.ajax({
  377.                 url: BaseURL + "mark_buddybee_event",
  378.                 type: 'POST',
  379.                 dataType: 'json',
  380.                 data: {
  381.                     relId: $(this).data('eventId'),
  382.                     eventId: $(this).data('eventId'),
  383.                     applicantId: {{ applicantId }},
  384.                     followStatus: newStatus,
  385.                     attendingStatus: "_UNCHANGED_",
  386.                 },
  387.                 error: function () {
  388.                     // callback();
  389.                 },
  390.                 success: function (res) {
  391.                     ;
  392.                     // $('#').val(res.);
  393.                     if (res.success == true) {
  394.                         if(res.followStatus==1) {
  395.                             $('.btn-event-save_' + res.relId).addClass('saved')
  396.                             $('.btn-event-save_' + res.relId).text('Saved')
  397.                         }
  398.                         else {
  399.                             $('.btn-event-save_' + res.relId).removeClass('saved')
  400.                             $('.btn-event-save_' + res.relId).text('Save')
  401.                         }
  402. //                        swal("Success", "Done!", "success");
  403.                     }
  404.                     else {
  405.                         if(res.applicantId==0) {
  406.                             swal("Oops", "You need to Login to perform this action!", "warning");
  407.                         }
  408.                         else {
  409.                             swal("Oops", "Could not perform the action!", "error");
  410.                         }
  411.                     }
  412.                 }
  413.             });
  414.         })
  415.         $(document).on('click', '.btn-event-going', function (e) {
  416.             e.preventDefault();
  417.             var newStatus=$(this).hasClass('going')? 0:1;
  418.             $.ajax({
  419.                 url: BaseURL + "mark_buddybee_event",
  420.                 type: 'POST',
  421.                 dataType: 'json',
  422.                 data: {
  423.                     relId: $(this).data('eventId'),
  424.                     eventId: $(this).data('eventId'),
  425.                     applicantId: {{ applicantId }},
  426.                     followStatus: "_UNCHANGED_",
  427.                     attendingStatus: newStatus,
  428.                 },
  429.                 error: function () {
  430.                     // callback();
  431.                 },
  432.                 success: function (res) {
  433.                     ;
  434.                     // $('#').val(res.);
  435.                     if (res.success == true) {
  436.                         if(res.attendingStatus==1) {
  437.                             $('.btn-event-going_'+res.relId).addClass('going')
  438.                             $('.btn-event-going_'+res.relId).text('Going')
  439.                         }
  440.                         else {
  441.                             $('.btn-event-going_'+res.relId).removeClass('going')
  442.                             $('.btn-event-going_'+res.relId).text('Attend')
  443.                         }
  444. //                        swal("Success", "Done!", "success");
  445.                     }
  446.                     else {
  447.                         if(res.applicantId==0) {
  448.                             swal("Oops", "You need to Login to perform this action!", "warning");
  449.                         }
  450.                         else {
  451.                             swal("Oops", "Could not perform the action!", "error");
  452.                         }
  453.                     }
  454.                 }
  455.             });
  456.         })
  457.         refresh_filter()
  458.         $(document).mouseup(function (e) {
  459.             var container = $(".filter_div_content");
  460.             // if the target of the click isn't the container nor a descendant of the container
  461.             if (!container.is(e.target) && container.has(e.target).length === 0) {
  462.                 container.hide();
  463.             }
  464.         });
  465.         $('.filter_div_btn').click(function (e) {
  466.             e.preventDefault();
  467.             $('.filter_div_content').toggle()
  468.         })
  469.     });
  470.     function refresh_moment_times() {
  471.         $('.convert_to_moment_time').each(function (ind, elem) {
  472.             var moment_time = moment.unix($(elem).attr('data-moment-ts'));
  473.             //    console.log($(elem).attr('data-moment-ts'));
  474.             var format = $(elem).attr('data-moment-ts-format');
  475.             var toReplaceStr = '';
  476.             if (format == '_today_or_date_') {
  477.                 toReplaceStr = moment_time.fromNow()
  478.             }
  479.             else {
  480.                 toReplaceStr = moment_time.format(format)
  481.             }
  482.             $(elem).text(toReplaceStr)
  483.         });
  484.     }
  485. </script>
  486. <style type="text/css">
  487.     body {
  488.         /*-moz-transform: scale(0.5, 0.5); !* Moz-browsers *!*/
  489.         zoom: 1; /* Other non-webkit browsers */
  490.         zoom: 100%; /* Webkit browsers */
  491.     }
  492.     /*.modal-dialog {*/
  493.     /*width: 75%;*/
  494.     /*}*/
  495.     .trans_amount {
  496.         text-align: right;
  497.     }
  498. </style>