src/ApplicationBundle/Resources/views/footer/buddybee_new_footer.html.twig line 1

Open in your IDE?
  1. {# <script src="{{ asset('condensed_assets/javascript.js',) }}"></script> #}
  2. {# {{  dump( constant('ApplicationBundle\\Constants\\GeneralConstant::NOTIFICATION_SERVER')) }}; #}
  3.     {% if not include_html is defined %}
  4.         {% set include_html=1 %}
  5.         {% if  app.request.request.get('skipHTML') !='' %}
  6.             {% set include_html= 0 %}
  7.         {% endif %}
  8.     {% endif %}
  9. {% if include_html!=1 %}
  10. {% endif %}
  11. {% include '@Application/framework/_deeplinkmodal_css.html.twig' %}
  12. {% set BUDDYBEE_ADMIN_LEVEL= session[UserConstants.BUDDYBEE_ADMIN_LEVEL] is defined? session[UserConstants.BUDDYBEE_ADMIN_LEVEL]:0 %}
  13. {% include '@Application/modals/input_forms/verify_otp_modal.html.twig' %}
  14. <script>
  15.     var notificationDetailBaseUrl = '{{ url('buddybee_notification_view', {'id': 0}) }}';
  16. </script>
  17. {% if system_type=='_BUDDYBEE_' %}
  18. <footer class="footer">
  19.     <a class="nav-link cta book_now_cta" href="{{ url('consultant_search_page') }}" style="text-transform: none;"
  20.     ><span class="trn" data-trn-key="_BOOK_NOW_CTA_" style="vertical-align: middle;padding: 2px 6px;
  21.     display: inline-block;"></span> <i class="fa fa-arrow-right"></i></a>
  22.     {#    <a class="nav-link cta twus" style=" #}
  23.     {#    border: 2px solid #22b14c; #}
  24.     {#    text-transform: capitalize; #}
  25.     {#    color: #22b14c !important; #}
  26.     {#    z-index: 9999999; #}
  27.     {#    /*display: flex;*/ #}
  28.     {#    flex-direction: row; #}
  29.     {#    vertical-align: middle;" href="{{ url('live_support_page_applicant') }}" #}
  30.     {#    ><span style="background: url('{{ absolute_url(path('dashboard')) }}buddybee_assets/images/video_call_icon.png'); #}
  31.     {#                width: 30px; #}
  32.     {#                height: 30px; #}
  33.     {#                display: inline-block; #}
  34.     {#                background-size: contain; #}
  35.     {#                background-repeat: no-repeat; #}
  36.     {#                background-position: center; #}
  37.     {#                "></span> <span class="trn" data-trn-key="_TALK_WITH_US_CTA_" style="vertical-align: middle;padding: 2px 6px; #}
  38.     {#    display: block; #}
  39.     {#    "></span></a> #}
  40.     <div class="modal  fade" style="z-index: 99999;" id="bookNowModal" tabindex="-1" aria-labelledby="exampleModalLabel"
  41.          aria-hidden="true">
  42.         <div class="modal-dialog modal-dialog-centered">
  43.             <div class="modal-content">
  44.                 <div class="modal-header" style="text-align: center;display: block;">
  45.                     <h5 class="modal-title" id="exampleModalLabel" style="text-align: center;">Select your
  46.                         Preference</h5>
  47.                     {# <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> #}
  48.                 </div>
  49.                 {% include '@Application/framework/_constypeselectorbtn_css.html.twig' %}
  50.                 <div class="modal-body">
  51.                     <div class="row">
  52.                         <div class="col-md-12" style="text-align: left;">
  53.                             <a class="consTypeSelectorBtn " id=""
  54.                                href="{{ url('admin_consultant_search_page') }}">
  55.                                 <div class="">
  56.                                     <p style="margin: 0px;text-transform: none;">
  57.                                         {#                                                <span class="" src="" #}
  58.                                         {#                                                      style="font-weight: normal; background:url({{ absolute_url(path('dashboard')) }}condensed_assets/images/bkash_logo.png); #}
  59.                                         {#                                                              background-size: contain; #}
  60.                                         {#                                                              background-repeat: no-repeat; #}
  61.                                         {#                                                              background-position: left; #}
  62.                                         {#                                                              width:3rem; #}
  63.                                         {#                                                              height: 1rem; #}
  64.                                         {#                                                              display: inline-block; #}
  65.                                         {#                                                              margin: auto; #}
  66.                                         {#                                                              vertical-align: middle;"></span> #}
  67.                                         Primary Consultancy</p>
  68.                                 </div>
  69.                             </a>
  70.                             <a class="consTypeSelectorBtn " id=""
  71.                                href="{{ url('consultant_search_page') }}">
  72.                                 <div class="">
  73.                                     <p style="margin: 0px;text-transform: none;">
  74.                                         {#                                                <span class="" src="" #}
  75.                                         {#                                                      style="font-weight: normal; background:url({{ absolute_url(path('dashboard')) }}condensed_assets/images/bkash_logo.png); #}
  76.                                         {#                                                              background-size: contain; #}
  77.                                         {#                                                              background-repeat: no-repeat; #}
  78.                                         {#                                                              background-position: left; #}
  79.                                         {#                                                              width:3rem; #}
  80.                                         {#                                                              height: 1rem; #}
  81.                                         {#                                                              display: inline-block; #}
  82.                                         {#                                                              margin: auto; #}
  83.                                         {#                                                              vertical-align: middle;"></span> #}
  84.                                         Expert Consultancy</p>
  85.                                 </div>
  86.                             </a>
  87.                         </div>
  88.                     </div>
  89.                 </div>
  90.             </div>
  91.         </div>
  92.     </div>
  93.     <form action="{{ path('recharge_account') }}" method="post" id="rechargeForm">
  94.         {# <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#reviewModal"> #}
  95.         {# Rate your Consultant #}
  96.         {# </button> #}
  97.         <!-- Modal -->
  98.         <div class="modal fade" id="rechargeAccountOwnModal" tabindex="-1" aria-labelledby="exampleModalLabel"
  99.              aria-hidden="true">
  100.             <div class="modal-dialog modal-dialog-centered">
  101.                 <div class="modal-content">
  102.                     <div class="modal-header" style="text-align: center;display: block;">
  103.                         <h5 class="modal-title" id="exampleModalLabel" style="text-align: center;">Add Fund to Your
  104.                             Account</h5>
  105.                         {# <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> #}
  106.                     </div>
  107.                     <div class="modal-body">
  108.                         <div class="row">
  109.                             <div class="col-md-12" style="text-align: left;">
  110.                                 <div class="form-group">
  111.                                     <label for="">Recharge Amount (Euro)</label>
  112.                                     <input type="number" class="form-control" name="rechargeAmount" id="rechargeAmount">
  113.                                 </div>
  114.                                 <div class="form-group">
  115.                                     <label for="">Bee Code</label>
  116.                                     <input type="text" class="form-control" name="rechargeBeeCode" id="rechargeBeeCode"
  117.                                            placeholder="if you have" value="">
  118.                                     <input type="hidden" class="form-control" name="rechargeApplicantId"
  119.                                            id="rechargeApplicantId" placeholder="if you have"
  120.                                            value="{{ session[UserConstants.USER_ID] is defined ?session[UserConstants.USER_ID]:0 }}">
  121.                                 </div>
  122.                                 <br>
  123.                                 <button type="button" style="width: 48%;height: 3rem;"
  124.                                         class="btn btn-secondary" data-bs-dismiss="modal">Close
  125.                                 </button>
  126.                                 <button type="button" style="width: 48%;height: 3rem;"
  127.                                         class="btn btn-primary recharge_submit">Proceed
  128.                                 </button>
  129.                             </div>
  130.                         </div>
  131.                     </div>
  132.                     <div class="modal-footer">
  133.                     </div>
  134.                 </div>
  135.             </div>
  136.         </div>
  137.     </form>
  138.     <div class="modal fade " style="z-index:9999999999999999999" id="deepLinkModal" tabindex="-1"
  139.          aria-labelledby="exampleModalLabel"
  140.          aria-hidden="true" data-bs-backdrop="false">
  141.         <div class="modal-dialog modal-dialog-centered modal-xl" style="
  142.    /*position:fixed;*/
  143.    align-items: end;
  144.    margin-bottom: 0px;
  145.    margin-left: 0px;
  146.    margin-right: 0px;
  147.    width: 100%;
  148.    top:auto;
  149.    right:auto;
  150.    left:auto;
  151.    bottom:0;">
  152.             <div class="modal-content" style="    text-align: center;
  153.     border-radius: 15px 15px 0 0;
  154.     ">
  155.                 <div class="modal-body">
  156.                     <h5 class="modal-title" id="exampleModalLabel" style="    text-align: center;
  157.     font-size: 1rem;
  158.     color: #616467;
  159.     margin-bottom: 1rem;
  160.     margin-top: .5rem;
  161.     ">Explore BuddyBee with...</h5>
  162.                     <div class="row deep_link_choice _AND_" style="margin-bottom:10px;">
  163.                         <div class="col-md-8 col-sm-8"
  164.                              style="text-align: left; display: flex; justify-content: space-evenly;">
  165.                             <div style="background:url({{ absolute_url(path('dashboard')) }}buddybee_assets/android-icon-192x192.png);
  166.                                     height: 40px;
  167.                                     width: 40px;
  168.                                     background-size: 100%;
  169.                                     background-repeat: no-repeat;
  170.                                     background-position: center;
  171.                                     border-radius: 29%;
  172.                                     display: inline-block;
  173.                                     border: 1px solid #d7dbe1;" class="cons_image_view">
  174.                             </div>
  175.                             <div style="
  176.                                         height: 40px;
  177.                                         width: 200px;
  178.                                         padding-top: 10px;;
  179.                                         padding-left: 10px;;
  180.                                         border-radius: 50%;display: inline-block" class="">
  181.                                 <p>BuddyBee App</p>
  182.                             </div>
  183.                         </div>
  184.                         <div class="col-md-4 col-sm-4" style="text-align: left; padding-top: 5px;">
  185.                             <button type="button" style="width: 100%;
  186.     height: 33px;
  187.         font-size: 12px;
  188.     /*margin-top: 10px;    */
  189. color: #ffffff;
  190.     background-color: #1d5b9e;
  191.                                     font-weight: bold;
  192.                                     border: none;"
  193.                                     class="btn btn_deep_link_selector btn-primary" data-deeplink-choice="_AND_"
  194.                                     data-bs-dismiss="modal">Open
  195.                             </button>
  196.                         </div>
  197.                     </div>
  198.                     <div class="row deep_link_choice _IPHONE_" style="margin-bottom:10px;">
  199.                         <div class="col-md-8 col-sm-8"
  200.                              style="text-align: left; display: flex; justify-content: space-evenly;">
  201.                             <div style="background:url({{ absolute_url(path('dashboard')) }}buddybee_assets/android-icon-192x192.png);
  202.                                     height: 40px;
  203.                                     width: 40px;
  204.                                     background-size: 100%;
  205.                                     background-repeat: no-repeat;
  206.                                     background-position: center;
  207.                                     border-radius: 29%;
  208.                                     display: inline-block;
  209.                                     border: 1px solid #d7dbe1;" class="cons_image_view">
  210.                             </div>
  211.                             <div style="
  212.                                         height: 40px;
  213.                                         width: 200px;
  214.                                         padding-top: 10px;;
  215.                                         padding-left: 10px;;
  216.                                         border-radius: 50%;display: inline-block" class="">
  217.                                 <p>BuddyBee App</p>
  218.                             </div>
  219.                         </div>
  220.                         <div class="col-md-4 col-sm-4" style="text-align: left; padding-top: 5px;">
  221.                             <button type="button" style="width: 100%;
  222.     height: 33px;
  223.         font-size: 12px;
  224.     /*margin-top: 10px;    */
  225.     /*color: #261a0c;*/
  226.                                     /*background-color: #fac53a;*/
  227.                                     color: #ffffff;
  228.     background-color: #1d5b9e;
  229.                                     font-weight: bold;
  230.                                     border: none;"
  231.                                     class="btn btn_deep_link_selector  btn-primary" data-deeplink-choice="_IPHONE_"
  232.                                     data-bs-dismiss="modal">Open
  233.                             </button>
  234.                         </div>
  235.                     </div>
  236.                     <div class="row deep_link_choice _BROWSER_" style="margin-bottom:10px;">
  237.                         <div class="col-md-8 col-sm-8"
  238.                              style="text-align: left; display: flex; justify-content: space-evenly;">
  239.                             <div style="background:url({{ absolute_url(path('dashboard')) }}buddybee_assets/chrome_logo.png);
  240.                                     height: 40px;
  241.                                     width: 40px;
  242.                                     background-size: 100%;
  243.                                     background-repeat: no-repeat;
  244.                                     background-position: center;
  245.                                     border-radius: 29%;
  246.                                     display: inline-block;
  247.                                     border: none;" class="cons_image_view">
  248.                             </div>
  249.                             <div style="
  250.                                         height: 40px;
  251.                                         width: 200px;
  252.                                         padding-top: 10px;;
  253.                                         padding-left: 10px;;
  254.                                         border-radius: 50%;display: inline-block" class="">
  255.                                 <p>Browser</p>
  256.                             </div>
  257.                         </div>
  258.                         <div class="col-md-4 col-sm-4" style="text-align: left; padding-top: 5px;">
  259.                             <button type="button" style="width: 100%;
  260.     height: 33px;
  261.     font-size: 12px;
  262.     /*margin-top: 10px;*/
  263.     color: #1d5b9e;
  264.     /*color: #261a0c;*/
  265.                                     background-color: #dddad3;
  266.                                     font-weight: bold;
  267.                                     border: none;"
  268.                                     class="btn btn_deep_link_selector btn-primary" data-deeplink-choice="_BROWSER_"
  269.                                     data-bs-dismiss="modal">Continue
  270.                             </button>
  271.                         </div>
  272.                     </div>
  273.                 </div>
  274.             </div>
  275.         </div>
  276.     </div>
  277.     <div class="download-app">
  278.         <div class="container">
  279.             <div class="row">
  280.                 <div class="col-md-8 my-auto">
  281.                     <div class="download-app-content">
  282.                         <span>BuddyBee on the go</span>
  283.                         <p>Start or schedule consultants anytime, anywhere with Android and iPhone apps</p>
  284.                         <div class="download-store">
  285.                             {# <a href="#" target="_blank"><img #}
  286.                             {# src="{{ absolute_url(path('dashboard')) }}buddybee_assets/images/app-store.png" #}
  287.                             {# alt="app-store"></a> #}
  288.                             <a href="https://play.google.com/store/apps/details?id=eu.buddybee.consultancy"
  289.                                target="_blank"><img
  290.                                         src="{{ absolute_url(path('dashboard')) }}buddybee_assets/images/google-play.png"
  291.                                         alt="google-play"></a>
  292.                         </div>
  293.                     </div>
  294.                 </div>
  295.                 <div class="col-md-4">
  296.                     <div class="download-app-img">
  297.                         <img src="{{ absolute_url(path('dashboard')) }}buddybee_assets/images/video-call.png"
  298.                              alt="video-call">
  299.                     </div>
  300.                 </div>
  301.             </div>
  302.         </div>
  303.     </div>
  304.     <div class="container">
  305.         <div class="image" style="text-align: center;">
  306.             <img src="https://buddybee.eu/buddybee_assets/images/aamarpay-footer.png" alt="" style="max-width: 50%;">
  307.         </div>
  308.     </div>
  309.     <div class="footer-menu">
  310.         <div class="container">
  311.             <div class="row">
  312.                 <div class="col-md-12">
  313.                     <ul class="d-flex justify-content-between m-0">
  314.                         <li><a href="#">Copyright &copy;{{ 'now'|date('Y') }} BuddyBee</a></li>
  315.                         <li><a href="#">Powered by &copy;{{ 'now'|date('Y') }} HoneyBee IoT Ltd. </a></li>
  316.                         {# <li><a href="#">&copy;2021 Buddybee</a></li> #}
  317.                         <li><a href="{{ url('contact_page') }}">Contact</a></li>
  318.                         <li><a href="{{ url('buddybee_terms_of_service') }}">Terms of Service</a></li>
  319.                         <li><a href="{{ url('buddybee_privacy_policy') }}">Privacy Policy</a></li>
  320.                         <li><a href="{{ url('buddybee_refund_policy') }}">Refund Policy</a></li>
  321.                         <li><a href="{{ url('buddybee_cancellation_policy') }}">Cancellation Policy</a></li>
  322.                         <li><a href="{{ url('help_page') }}">Help</a></li>
  323.                         {#                        <li><a href="{{ url('under_construction') }}">Mission Statement</a></li> #}
  324.                     </ul>
  325.                 </div>
  326.             </div>
  327.         </div>
  328.     </div>
  329. </footer>
  330. {% include '@Application/framework/_stepindicator_css.html.twig' %}
  331. {% include '@Application/framework/_promptforinfomodal_css.html.twig' %}
  332. {% include '@Application/framework/_selectpurchasemodal_css.html.twig' %}
  333. <div class="modal fade" id="promptForInfoModal" tabindex="-1" aria-labelledby="exampleModalLabel"
  334.      aria-hidden="true">
  335.     <div class="modal-dialog modal-dialog-centered">
  336.         <div class="modal-content">
  337.             <div class="modal-header" style="">
  338.                 <h6 class="modal-title" id="exampleModalLabel" style="text-align: left;">
  339.                     Please Fill up Your Info for Better Communication</h6>
  340.                 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
  341.                     {# <span aria-hidden="true">&times;</span> #}
  342.                 </button>
  343.             </div>
  344.             <div class="modal-body">
  345.                 <div class="row">
  346.                     {% if session['triggerPromptInfoModalFlag'] is defined %}
  347.                         {% if session['triggerPromptInfoModalFlag'] == 1 %}
  348.                             {% if session['relevantRequiredPromptFields'] is defined %}
  349.                                 {% set relevantRequiredPromptFields =session['relevantRequiredPromptFields']|jsonDecode() %}
  350.                                 {% if not relevantRequiredPromptFields is empty %}
  351.                                     <form id="promptForInfoModalForm" action="#!">
  352.                                         <!-- start step indicators -->
  353.                                         <div class="form-header d-flex mb-4">
  354.                                             {% if 'email' in relevantRequiredPromptFields  or 'phone' in relevantRequiredPromptFields or 'currentCountryId' in relevantRequiredPromptFields %}
  355.                                                 <span class="stepIndicator">Contact Info</span>
  356.                                             {% endif %}
  357.                                             {% if 'preferredTopicIdsAsConsultant' in relevantRequiredPromptFields
  358.                                                 or 'preferredTopicIdsAsStudent' in relevantRequiredPromptFields
  359.                                                 or 'preferredConsultancyTopicCountryIds' in relevantRequiredPromptFields %}
  360.                                                 <span class="stepIndicator">Preferences</span>
  361.                                             {% endif %}
  362.                                             {# <span class="stepIndicator">Relevant Info</span> #}
  363.                                             {# <span class="stepIndicator">Preferences</span> #}
  364.                                         </div>
  365.                                         <!-- end step indicators -->
  366.                                         <!-- step one -->
  367.                                         {% if 'email' in relevantRequiredPromptFields  or 'phone' in relevantRequiredPromptFields or 'currentCountryId' in relevantRequiredPromptFields %}
  368.                                             {# <span class="stepIndicator">Contact Info</span> #}
  369.                                             <div class="step">
  370.                                                 {# <p class="text-center mb-4">Your Email Address</p> #}
  371.                                                 {% if 'email' in relevantRequiredPromptFields %}
  372.                                                     <div class="mb-3">
  373.                                                         <input type="email" class="promptForInfoAutoUpdateData required"
  374.                                                                data-set-method="setOAuthEmail"
  375.                                                                data-field-type="_TEXT_"
  376.                                                                data-relevant-prompt-field="email"
  377.                                                                data-modify-trans-date="0"
  378.                                                                placeholder="Your Email">
  379.                                                     </div>
  380.                                                 {% endif %}
  381.                                                 {% if 'phone' in relevantRequiredPromptFields %}
  382.                                                     <div class="mb-3">
  383.                                                         <input type="phone" class="promptForInfoAutoUpdateData required"
  384.                                                                data-set-method="setPhone"
  385.                                                                data-field-type="_TEXT_"
  386.                                                                data-relevant-prompt-field="phone"
  387.                                                                data-modify-trans-date="0"
  388.                                                                placeholder="Your Phone No.">
  389.                                                     </div>
  390.                                                 {% endif %}
  391.                                                 {% if 'currentCountryId' in relevantRequiredPromptFields %}
  392.                                                     <p class=" mb-4">Your Current Country</p>
  393.                                                     <div class="mb-3">
  394.                                                         <select class="promptForInfoAutoUpdateData required"
  395.                                                                 data-set-method="setCurrentCountryId,setCountry"
  396.                                                                 data-field-type="_VALUE_"
  397.                                                                 data-relevant-prompt-field="currentCountryId"
  398.                                                                 data-modify-trans-date="0"
  399.                                                                 id="currentCountryIdPromptForInfo"
  400.                                                                 name="currentCountryIdPromptForInfo[]">
  401.                                                         </select>
  402.                                                     </div>
  403.                                                 {% endif %}
  404.                                             </div>
  405.                                         {% endif %}
  406.                                         <!-- step two -->
  407.                                         {% if 'preferredTopicIdsAsConsultant' in relevantRequiredPromptFields
  408.                                             or 'preferredTopicIdsAsStudent' in relevantRequiredPromptFields
  409.                                             or 'preferredConsultancyTopicCountryIds' in relevantRequiredPromptFields %}
  410.                                             <div class="step">
  411.                                                 {% if  'preferredTopicIdsAsStudent' in relevantRequiredPromptFields %}
  412.                                                     <p class=" mb-4">Your Preferred topics as Student</p>
  413.                                                     <div class="mb-3">
  414.                                                         <select class=" promptForInfoAutoUpdateData"
  415.                                                                 data-set-method="setPreferredTopicIdsAsStudent"
  416.                                                                 data-field-type="_JSON_"
  417.                                                                 data-relevant-prompt-field="preferredTopicIdsAsStudent"
  418.                                                                 data-modify-trans-date="0"
  419.                                                                 id="preferredTopicIdsAsStudentPromptForInfo"
  420.                                                                 name="preferredTopicIdsAsStudentPromptForInfo[]"
  421.                                                                 multiple>
  422.                                                         </select>
  423.                                                     </div>
  424.                                                 {% endif %}
  425.                                                 {% if 'preferredTopicIdsAsConsultant' in relevantRequiredPromptFields %}
  426.                                                     <p class=" mb-4">Your Preferred topics as Consultant</p>
  427.                                                     <div class="mb-3">
  428.                                                         <select class=" promptForInfoAutoUpdateData"
  429.                                                                 data-set-method="setPreferredTopicIdsAsConsultant"
  430.                                                                 data-field-type="_JSON_"
  431.                                                                 data-relevant-prompt-field="preferredTopicIdsAsConsultant"
  432.                                                                 data-modify-trans-date="0"
  433.                                                                 id="preferredTopicIdsAsConsultantPromptForInfo"
  434.                                                                 name="preferredTopicIdsAsConsultantPromptForInfo[]"
  435.                                                                 multiple>
  436.                                                         </select>
  437.                                                     </div>
  438.                                                 {% endif %}
  439.                                                 {% if 'preferredConsultancyTopicCountryIds' in relevantRequiredPromptFields %}
  440.                                                     <p class=" mb-4">Countries you wish to go</p>
  441.                                                     <div class="mb-3">
  442.                                                         <select class=" promptForInfoAutoUpdateData"
  443.                                                                 data-set-method="setPreferredConsultancyTopicCountryIds"
  444.                                                                 data-field-type="_JSON_"
  445.                                                                 data-relevant-prompt-field="preferredConsultancyTopicCountryIds"
  446.                                                                 data-modify-trans-date="0"
  447.                                                                 id="preferredConsultancyTopicCountryIdsPromptForInfo"
  448.                                                                 name="preferredConsultancyTopicCountryIdsPromptForInfo[]"
  449.                                                                 multiple>
  450.                                                         </select>
  451.                                                     </div>
  452.                                                 {% endif %}
  453.                                             </div>
  454.                                         {% endif %}
  455.                                         <!-- step three -->
  456.                                         <!-- start previous / next buttons -->
  457.                                         <div class="form-footer d-flex">
  458.                                             <button type="button" class="prevBtn" id="promptForInfo_prevBtn"
  459.                                                     onclick="promptInfo_nextPrev(-1)">
  460.                                                 Previous
  461.                                             </button>
  462.                                             <button type="button" class="nextBtn" id="promptForInfo_nextBtn"
  463.                                                     onclick="promptInfo_nextPrev(1)">
  464.                                                 Next
  465.                                             </button>
  466.                                         </div>
  467.                                         <!-- end previous / next buttons -->
  468.                                     </form>
  469.                                 {% endif %}
  470.                             {% endif %}
  471.                         {% endif %}
  472.                     {% endif %}
  473.                 </div>
  474.             </div>
  475.             {# <div class="modal-footer"> #}
  476.             {# </div> #}
  477.         </div>
  478.     </div>
  479. </div>
  480. <div class="modal fade" id="selectPurchaseModal" tabindex="-1" aria-labelledby="exampleModalLabel"
  481.      aria-hidden="true">
  482.     <div class="modal-dialog modal-dialog-centered">
  483.         <div class="modal-content">
  484.             <div class="modal-header" style="">
  485.                 <h6 class="modal-title" id="exampleModalLabel" style="text-align: left;">
  486.                     Get Consultation</h6>
  487.                 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
  488.                     {# <span aria-hidden="true">&times;</span> #}
  489.                 </button>
  490.             </div>
  491.             <div class="modal-body">
  492.                 <div class="row">
  493.                     {% include '@Application/framework/_box_selector_css.html.twig' %}
  494.                     <form id="selectPurchaseModalForm" action="#">
  495.                         <!-- start step indicators -->
  496.                         <div class="form-header d-flex mb-4">
  497.                             <span class="stepIndicator seq_0" data-seq-id="0">Select Country</span>
  498.                             <span class="stepIndicator seq_1" data-seq-id="1">Select Topic</span>
  499.                             <span class="stepIndicator seq_2" data-seq-id="2">Select Consultant</span>
  500.                             <span class="stepIndicator seq_3" data-seq-id="3">Select Schedule</span>
  501.                             <span class="stepIndicator seq_4" data-seq-id="4">Confirm</span>
  502.                             <span class="stepIndicator seq_5" data-seq-id="5">Payment</span>
  503.                         </div>
  504.                         <div class="step seq_0 ">
  505.                             <h5 class=" ">Select a Country</h5>
  506.                             <div class="row clearfix cn_holder">
  507.                                 {% if not countries_data is defined %}
  508.                                     {% set countries_data=''|getCountriesBuddyBee %}
  509.                                 {% endif %}
  510.                                 {% for ind,cntry in countries_data %}
  511.                                     <div class="box-selector cn_selector cn_{{ cntry.id }}  col-md-3 col-sm-6"
  512.                                          data-id="{{ cntry.id }}"
  513.                                          data-gen-class="cn_selector"
  514.                                     >
  515.                                         <div class="inside">
  516.                                             <div class="img" href="{{ url('dashboard') }}" style="
  517.                                                     background:url(' {{ absolute_url(path('dashboard')) }}{{ cntry.flagImage }}');
  518.                                                     height: 50px !important;
  519.                                                     width: 100%;
  520.                                                     /* max-width: 30% !important; */
  521.                                                     background-position: center;
  522.                                                     background-size: contain;
  523.                                                     background-repeat: no-repeat;
  524.                                                     ">
  525.                                             </div>
  526.                                             <h6 class="title" style="height: 2rem;">{{ cntry.name }}</h6>
  527.                                             {#                                            <p class="sub-title">&nbsp;</p> #}
  528.                                         </div>
  529.                                     </div>
  530.                                 {% endfor %}
  531.                             </div>
  532.                         </div>
  533.                         <div class="step seq_1 ">
  534.                             <h5 class=" ">Select a Topic</h5>
  535.                             <div class="row clearfix topic_holder">
  536.                             </div>
  537.                         </div>
  538.                         <div class="step seq_2">
  539.                             <h5 class=" ">Select a Consultant</h5>
  540.                             <div class="row clearfix cons_holder">
  541.                             </div>
  542.                         </div>
  543.                         <div class="step seq_3">
  544.                             <h5 class="view_if_has_schedules">Select Month</h5>
  545.                             <div class="row clearfix sch_holder_month view_if_has_schedules"></div>
  546.                             <h5 class="view_if_has_schedules">Select Day</h5>
  547.                             <div class="row clearfix sch_holder_day view_if_has_schedules"></div>
  548.                             <h5 class="view_if_has_schedules">Select Time</h5>
  549.                             <div class="row clearfix sch_holder_time view_if_has_schedules"></div>
  550.                             <p class="view_if_has_schedules"> -------or------- </p>
  551.                             <h5 class=" ">Select Preferred Schedule (Upto 3)</h5>
  552.                             <div class="row clearfix sch_holder">
  553.                                 {% for hh in 1..3 %}
  554.                                     <div class="box-selector man_sch_selector man_sch_{{ hh }}  col-md-4 col-sm-6"
  555.                                          data-id="{{ hh }}"
  556.                                          data-gen-class="man_sch_selector"
  557.                                     >
  558.                                         <div class="inside">
  559.                                         <textarea
  560.                                                 class="add_basic_day_picker man_sch_selector_dp man_sch_selector_dp{{ hh }}  "
  561.                                                 data-id="{{ hh }}" placeholder="Click to set Schedule"
  562.                                                 data-gen-class="man_sch_selector_dp"></textarea>
  563.                                         </div>
  564.                                     </div>
  565.                                 {% endfor %}
  566.                             </div>
  567.                         </div>
  568.                         <div class="step seq_4">
  569.                             <h5 class=" ">Your Purchase Summary</h5>
  570.                             <div class="row clearfix summary_holder">
  571.                                 <p class="cntry_p">Country : <span>Germany</span></p>
  572.                                 <p class="topic_p"> Name & Type: <span>Single Consultation</span></p>
  573.                                 <p class="cons_p">Consultant : <span>Ahmed Zahid Omar</span></p>
  574.                                 <p class="coins_p">Coins : <span class="routineCoinNeededTotalSpan"></span></p>
  575.                             </div>
  576.                             {% include '@Application/framework/_selectpurchasemodal_2_css.html.twig' %}
  577.                             <table class="table table-condensed table-striped routineTable">
  578.                                 <tbody></tbody>
  579.                                 <tfoot>
  580.                                 <tr>
  581.                                     <td>Total Bee Coins Needed</td>
  582.                                     <td style="text-align: left;"><b class="routineCoinNeededTotalSpan">0</b><br>
  583.                                     </td>
  584.                                     <td></td>
  585.                                 </tr>
  586.                                 </tfoot>
  587.                             </table>
  588.                         </div>
  589.                         <div class="step seq_5">
  590.                             <h5 class=" ">Direct Payment</h5>
  591.                             <div class="row">
  592.                                 <div class="box-selector pm_selector pm_1  col-md-4 col-sm-6 paymentMethodSelectorBtn"
  593.                                      data-id="1"
  594.                                      data-gen-class="pm_selector"
  595.                                 >
  596.                                     <div class="inside">
  597.                                         <div class="img" href="{{ url('dashboard') }}" style="
  598.                                                 background:url({{ absolute_url(path('dashboard')) }}condensed_assets/images/stripe_logo.png);
  599.                                                 height: 50px !important;
  600.                                                 width: 100%;
  601.                                                 /* max-width: 30% !important; */
  602.                                                 background-position: center;
  603.                                                 background-size: contain;
  604.                                                 background-repeat: no-repeat;
  605.                                                 ">
  606.                                         </div>
  607.                                         <h6 class="title" style="height: 2rem;">Stripe</h6>
  608.                                         {#                                            <p class="sub-title">&nbsp;</p> #}
  609.                                     </div>
  610.                                 </div>
  611.                                 <div class="box-selector pm_selector pm_2  col-md-4 col-sm-6 paymentMethodSelectorBtn"
  612.                                      data-id="2"
  613.                                      data-gen-class="pm_selector"
  614.                                 >
  615.                                     <div class="inside">
  616.                                         <div class="img" href="{{ url('dashboard') }}" style="
  617.                                                 background:url({{ absolute_url(path('dashboard')) }}condensed_assets/images/bkash_logo.png);
  618.                                                 height: 50px !important;
  619.                                                 width: 100%;
  620.                                                 /* max-width: 30% !important; */
  621.                                                 background-position: center;
  622.                                                 background-size: contain;
  623.                                                 background-repeat: no-repeat;
  624.                                                 ">
  625.                                         </div>
  626.                                         <h6 class="title" style="height: 2rem;">Bkash</h6>
  627.                                         {#                                            <p class="sub-title">&nbsp;</p> #}
  628.                                     </div>
  629.                                 </div>
  630.                                 <div class="box-selector pm_selector pm_3  col-md-4 col-sm-6 paymentMethodSelectorBtn"
  631.                                      data-id="3"
  632.                                      data-gen-class="pm_selector"
  633.                                 >
  634.                                     <div class="inside">
  635.                                         <div class="img" href="{{ url('dashboard') }}" style="
  636.                                                 background:url({{ absolute_url(path('dashboard')) }}condensed_assets/images/aamarpay_logo.png);
  637.                                                 height: 50px !important;
  638.                                                 width: 100%;
  639.                                                 /* max-width: 30% !important; */
  640.                                                 background-position: center;
  641.                                                 background-size: contain;
  642.                                                 background-repeat: no-repeat;
  643.                                                 ">
  644.                                         </div>
  645.                                         <h6 class="title" style="height: 2rem;">Card</h6>
  646.                                         {#                                            <p class="sub-title">&nbsp;</p> #}
  647.                                     </div>
  648.                                 </div>
  649.                             </div>
  650.                             <h5 class=" ">Purchase Bee Card</h5>
  651.                             <div class="row">
  652.                                 {% set encData={
  653.                                 } %}
  654.                                 {#                                {% set encData={ #}
  655.                                 {#                                    "rtlId": retailerId is defined?retailerId:0 , #}
  656.                                 {#                                    "schTs": scheduleId is defined?scheduleId:0 , #}
  657.                                 {#                                    "cnsId":consultantDetails is defined and not consultantDetails is null ?consultantDetails.applicantId:0, #}
  658.                                 {#                                    "stdntId": session[UserConstants.USER_ID] is defined ?session[UserConstants.USER_ID]:0 , #}
  659.                                 {#                                    "aams": autoAssignMeetingSession is defined ?autoAssignMeetingSession:0  , #}
  660.                                 {#                                    "rpsc": requiredPurchaseSessionCount is defined ?requiredPurchaseSessionCount:0, #}
  661.                                 {#                                    "scc":sessionConsumeCount is defined?sessionConsumeCount:0, #}
  662.                                 {#                                    "tId":topic is defined and not topic is null? topic.id:0, #}
  663.                                 {#                                    "dur":sessionDuration is defined?sessionDuration:0, #}
  664.                                 {#                                    "sem":topicSessionValue is defined? topicSessionValue:0 , #}
  665.                                 {#                                } %} #}
  666.                                 {% set link_data=url('purchase_bee_card_page',{ 'encData':(encData|json_encode) | nzo_encrypt  } ) %}
  667.                                 <div class="box-selector pm_selector pm_4  col-md-4 col-sm-6 paymentMethodSelectorBtn"
  668.                                      data-id="4"
  669.                                      data-gen-class="pm_selector"
  670.                                 >
  671.                                     <div class="inside">
  672.                                         <div class="img" href="{{ url('dashboard') }}" style="
  673.                                                 background: url({{ absolute_url(path('dashboard')) }}buddybee_assets/ms-icon-310x310.png);
  674.                                                 height: 50px !important;
  675.                                                 width: 100%;
  676.                                                 /* max-width: 30% !important; */
  677.                                                 background-position: center;
  678.                                                 background-size: contain;
  679.                                                 background-repeat: no-repeat;
  680.                                                 ">
  681.                                         </div>
  682.                                         <h6 class="title" style="height: 2rem;">Claim Bee Card</h6>
  683.                                         {#                                            <p class="sub-title">&nbsp;</p> #}
  684.                                     </div>
  685.                                 </div>
  686.                                 {#                                <div class="box-selector pm_selector pm_5  col-md-4 col-sm-6 paymentMethodSelectorBtn" #}
  687.                                 {#                                     data-id="5" #}
  688.                                 {#                                     data-gen-class="pm_selector" #}
  689.                                 {#                                > #}
  690.                                 {#                                    <div class="inside"> #}
  691.                                 {#                                        <div class="img" href="{{ url('dashboard') }}" style=" #}
  692.                                 {#                                                background:url({{ absolute_url(path('dashboard')) }}condensed_assets/images/bkash_logo.png); #}
  693.                                 {#                                                height: 50px !important; #}
  694.                                 {#                                                width: 100%; #}
  695.                                 {#                                                /* max-width: 30% !important; */ #}
  696.                                 {#                                                background-position: center; #}
  697.                                 {#                                                background-size: contain; #}
  698.                                 {#                                                background-repeat: no-repeat; #}
  699.                                 {#                                                "> #}
  700.                                 {#                                        </div> #}
  701.                                 {#                                        <h6 class="title" style="height: 2rem;">Bkash</h6> #}
  702.                                 {#                                        #}{#                                            <p class="sub-title">&nbsp;</p> #}
  703.                                 {#                                    </div> #}
  704.                                 {#                                </div> #}
  705.                                 {#                                <div class="box-selector pm_selector pm_6  col-md-4 col-sm-6 paymentMethodSelectorBtn" #}
  706.                                 {#                                     data-id="6" #}
  707.                                 {#                                     data-gen-class="pm_selector" #}
  708.                                 {#                                > #}
  709.                                 {#                                    <div class="inside"> #}
  710.                                 {#                                        <div class="img" href="{{ url('dashboard') }}" style=" #}
  711.                                 {#                                                background:url({{ absolute_url(path('dashboard')) }}condensed_assets/images/aamarpay_logo.png); #}
  712.                                 {#                                                height: 50px !important; #}
  713.                                 {#                                                width: 100%; #}
  714.                                 {#                                                /* max-width: 30% !important; */ #}
  715.                                 {#                                                background-position: center; #}
  716.                                 {#                                                background-size: contain; #}
  717.                                 {#                                                background-repeat: no-repeat; #}
  718.                                 {#                                                "> #}
  719.                                 {#                                        </div> #}
  720.                                 {#                                        <h6 class="title" style="height: 2rem;">Card</h6> #}
  721.                                 {#                                        #}{#                                            <p class="sub-title">&nbsp;</p> #}
  722.                                 {#                                    </div> #}
  723.                                 {#                                </div> #}
  724.                             </div>
  725. {#                            <h5 class=" ">Others</h5>#}
  726.                             <div class="row clearfix ">
  727.                                 <div class="box-selector  col-md-12 col-sm-6"
  728.                                      data-id="promo"
  729.                                      data-gen-class="">
  730.                                     <div class="inside">
  731.                                         <h6 class="title" style="height: 2rem;font-size: 14px;">Promo Code</h6>
  732.                                         <input class="form-control    "
  733.                                                data-id="promo" placeholder="Promo Code"
  734.                                                data-gen-class="">
  735.                                         <h6 class="title" style="height: 2rem;font-size: 14px;">&nbsp;</h6>
  736.                                     </div>
  737.                                 </div>
  738.                             </div>
  739.                         </div>
  740.                         <div class="form-footer d-flex">
  741.                             <button type="button" class="prevBtn" id="selectPurchaseModal_prevBtn">
  742.                                 Previous
  743.                             </button>
  744.                             <button type="button" class="nextBtn" id="selectPurchaseModal_nextBtn">
  745.                                 Next
  746.                             </button>
  747.                         </div>
  748.                     </form>
  749.                 </div>
  750.             </div>
  751.             {# <div class="modal-footer"> #}
  752.             {# </div> #}
  753.         </div>
  754.     </div>
  755. </div>
  756. {% endif %}
  757. {# some over riding css for buttons and stuffs #}
  758. <!-- back to top btn -->
  759. <a id="back-top"><i class="fas fa-chevron-up"></i></a>
  760. <!-- back to top btn -->
  761. <!-- Option 1: Bootstrap Bundle with Popper -->
  762. {# <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" #}
  763.         {#        integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" #}
  764.         {#        crossorigin="anonymous"> #}
  765.         {# </script> #}
  766. {# temp start #}
  767. <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js"
  768.         integrity=""
  769.         crossorigin="anonymous"></script>
  770. {# temp end #}
  771. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  772. {# <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script> #}
  773. <!-- jquery cdn -->
  774. <script type="text/javascript"
  775.         src="https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.13.3/js/standalone/selectize.min.js"></script>
  776. <script type="text/javascript" src="{{ absolute_url(path('dashboard')) }}jqueryui/jquery.form.js"></script>
  777. <!-- calender js -->
  778. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/mini-event-calendar.min.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  779. <!-- countdown js -->
  780. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/jquery.countdown.min.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  781. <!-- process circle js -->
  782. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/progresscircle.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  783. <!-- custom js-->
  784. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/main.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  785. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/imgProgress.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  786. <!-- owl carousel -->
  787. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/owl.carousel.min.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  788. <!-- wow js -->
  789. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/wow.min.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  790. {# <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/AppOffcanvas.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script> #}
  791. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/moment.min.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  792. <script type="text/javascript" src="{{ absolute_url(path('dashboard')) }}alertify/lib/alertify.min.js"></script>
  793. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/plugin/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  794. <script src="{{ absolute_url(path('dashboard')) }}js/jquery.translate.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  795. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/bindWithDelay.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  796. <script src="{{ absolute_url(path('dashboard')) }}buddybee_assets/js/generic.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  797. {% include '@Application/footer/activity_tracker_script.html.twig' %}
  798. <script src="{{ absolute_url(path('dashboard')) }}js/language_pack.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  799. <script src="{{ absolute_url(path('dashboard')) }}condensed_assets/ifvisible.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script>
  800. <link rel="stylesheet" href="{{ absolute_url(path('dashboard')) }}js/adminbsb/plugins/sweetalert/sweetalert.css">
  801. <script src="{{ absolute_url(path('dashboard')) }}js/adminbsb/plugins/sweetalert/sweetalert.min.js"></script>
  802. <link rel="stylesheet" href="{{ asset('css/cal_print.css') }}" media="print">
  803. <script type="text/javascript"
  804.         src="{{ absolute_url(path('dashboard')) }}buddybee_assets/plugin/fullcalendar3/fullcalendar.min.js"></script>
  805. <script type="text/javascript"
  806.         src="{{ absolute_url(path('dashboard')) }}buddybee_assets/plugin/fullcalendar3/scheduler/scheduler.min.js"></script>
  807. <script type="text/javascript"
  808.         src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js"></script>
  809. {% include '@Application/framework/_btn_css.html.twig' %}
  810. </body>
  811. <script>
  812.     var socketInitiated = 0;
  813.     var offcanvasCalendarInitiated = 0;
  814.     var offCalendarLastRefreshedTs = 0;
  815.     var tb_pathToImage = "{{ absolute_url(path('dashboard'))~'buddybee_assets/images/circle-pending-image.png' }}";
  816.     var buddybee_socket = '';
  817.     var buddybee_socket_user_name = '{{ session[UserConstants.USER_NAME] is defined? session[UserConstants.USER_NAME]:'' }}';
  818.     var buddybee_socket_user_id = 'BBEE_{{ session[UserConstants.USER_ID] is defined? session[UserConstants.USER_ID]:0 }}';
  819.     var current_user_user_id = {{ session[UserConstants.USER_ID] is defined? session[UserConstants.USER_ID]:0 }};
  820.     var buddybee_socket_user_session_token = '{{ session['token'] is defined? session['token']:'_GEN_' }}';
  821.     {% set curr_route=app.request.attributes.get('_route') %}
  822.     var CURRENT_ROUTE = '{{ curr_route }}';
  823.     var deepLinkModalLastShown = window.localStorage.getItem('deepLinkModalLastShown');
  824.     //    var deepLinkModalLastShown = 0;
  825.     var currTsForDlM = {{ ''|date('U') }};
  826.     if (deepLinkModalLastShown == 'null' || deepLinkModalLastShown == null) {
  827.         deepLinkModalLastShown = 0
  828.     }
  829.     var upcomingMeetingDataForRedirect = window.localStorage.getItem('UNMData');
  830.     var upcomingNextMeetingIdForRedirect = window.localStorage.getItem('UNMId');
  831.     var upcomingNextMeetingTsForRedirect = window.localStorage.getItem('UNMTs');
  832.     if (upcomingMeetingDataForRedirect == 'null' || upcomingMeetingDataForRedirect == null) {
  833.         upcomingMeetingDataForRedirect = "[]"
  834.     }
  835.     if (upcomingNextMeetingIdForRedirect == 'null' || upcomingNextMeetingIdForRedirect == null) {
  836.         upcomingNextMeetingIdForRedirect = 0
  837.     }
  838.     if (upcomingNextMeetingTsForRedirect == 'null' || upcomingNextMeetingTsForRedirect == null) {
  839.         upcomingNextMeetingTsForRedirect = 0
  840.     }
  841.     upcomingMeetingDataForRedirect = JSON.parse(upcomingMeetingDataForRedirect);
  842.     var deepLinkModal = new bootstrap.Modal(document.getElementById('deepLinkModal'), {
  843.         keyboard: false
  844.     });
  845.     var bookNowModal = new bootstrap.Modal(document.getElementById('bookNowModal'), {
  846.         keyboard: false
  847.     });
  848.     var promptForInfoModal = new bootstrap.Modal(document.getElementById('promptForInfoModal'), {
  849.         keyboard: false
  850.     });
  851.     var selectPurchaseModal = new bootstrap.Modal(document.getElementById('selectPurchaseModal'), {
  852.         keyboard: false
  853.     });
  854.     {% if not countries_data is defined %}
  855.     {% set countries_data=''|getCountriesBuddyBee %}
  856.     {% endif %}
  857.     var countries_data ={{ countries_data|json_encode()|raw() }}
  858.     var topic_data_by_id = {}
  859.     var perSessionMinute = 20; // Current tab is set to be the first tab (0)
  860.     var COIN_GENERAL_MULT = 100; // Current tab is set to be the first tab (0)
  861.     var currentTab = 0; // Current tab is set to be the first tab (0)
  862.     var currentTabSelectPurchaseModal = 0; // Current tab is set to be the first tab (0)
  863.     var triggerRefreshUpcomingSession = 0; // Current tab is set to be the first tab (0)
  864.     // promptInfo_showTab(currentTab); // Display the current tab
  865.     {% if (session[UserConstants.USER_ID] is defined ) %}
  866.     function refreshOffCanvasCalendar(force) {
  867.         force = force || 0
  868.         if (offcanvasCalendarInitiated == 0) {
  869. //            alert('here')
  870.             $('#calendarHere').fullCalendar({
  871. //            $('#scheduleCalendar').fullCalendar({
  872.                 schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
  873.                 height: 554,
  874. //            header: false,
  875.                 header: {
  876.                     left: 'today prev,next',
  877.                     center: 'title',
  878.                     right: 'timelineDay,timelineWeek,timelineMonth,timelineYear,month',
  879.                 },
  880.                 buttonText: {
  881.                     month: 'calendar',
  882.                     timelineMonth: 'month',
  883.                 },
  884.                 eventClick: function (calEvent, jsEvent, view) {
  885.                     //    console.log(calEvent)
  886.                     swal({
  887.                         title: calEvent.title,
  888.                         text: 'Meeting On ' + calEvent.topic_name + ' on ' + moment.unix(calEvent.scheduled_time_ts).format('MMM DD, YYYY HH:mm'),
  889.                         type: "info",
  890.                         showCancelButton: true,
  891. //            confirmButtonColor: "#DD6B55",
  892.                         confirmButtonText: "View!",
  893.                         cancelButtonText: "Exit",
  894.                         closeOnConfirm: false,
  895.                         closeOnCancel: true,
  896.                         timer: 10000,
  897.                     }, function (isConfirm) {
  898.                         if (isConfirm) {
  899.                             {% if BUDDYBEE_ADMIN_LEVEL >=1 %}
  900.                             window.location.href = '{{ path('consultancy_session') }}/' + calEvent.id + '?adminView=1'
  901.                             {% else %}
  902.                             window.location.href = '{{ path('consultancy_session') }}/' + calEvent.id + ''
  903.                             {% endif %}
  904.                             swal("Sweet!", "Taking you there. Please Wait", "success");
  905.                         } else {
  906. //                        swal("Oops", "You cannot do that!", "error");
  907.                         }
  908.                     });
  909. //                alert('Event: ' + calEvent.title);
  910. //                alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
  911. //                alert('View: ' + view.name);
  912. //
  913. //                // change the border color just for fun
  914. //                $(this).css('border-color', 'red');
  915.                 },
  916. //            themeSystem:'jquery-ui',
  917.                 editable: true,
  918.                 eventStartEditable: true,
  919.                 eventDurationEditable: true,
  920.                 droppable: true,
  921.                 slotDuration: '00:30:00',
  922.                 defaultView: 'month',
  923.                 eventRender: function (eventObj, $el) {
  924. //                $('#example').popover(options)
  925.                     $el.popover({
  926.                         title: eventObj.topic_name,
  927.                         content: 'Meeting Between ' + eventObj.title + ' on ' + moment.unix(eventObj.scheduled_time_ts).format('MMM DD, YYYY HH:mm'),
  928.                         trigger: 'hover',
  929.                         placement: 'top',
  930.                         container: 'body',
  931.                         html: true,
  932.                         template: '<div class="popover" role="tooltip">' +
  933.                             '<div class="arrow">' +
  934.                             '</div' +
  935.                             '><h3 class="popover-header">' +
  936.                             '</h3>' +
  937.                             '<div class="popover-body">' +
  938.                             '</div>' +
  939.                             '<button class="btn btn-success">PIKA</button>' +
  940.                             '</div>'
  941.                     });
  942.                 },
  943. //            resourceAreaHeaderContent: 'Rooms',
  944.                 resourceColumns: [
  945.                     {
  946.                         labelText: 'Schedule',
  947.                         field: 'title'
  948.                     }
  949. //                {
  950. //                    labelText: 'Occupancy',
  951. //                    field: 'occupancy'
  952. //                }
  953.                 ],
  954.                 resources: [],
  955.                 views: {
  956.                     basic: {
  957.                         // options apply to basicWeek and basicDay views
  958.                     },
  959.                     agenda: {
  960.                         slotDuration: '00:30:00',
  961.                         // options apply to agendaWeek and agendaDay views
  962.                     },
  963.                     week: {
  964.                         // options apply to basicWeek and agendaWeek views
  965.                     },
  966.                     day: {
  967.                         // options apply to basicDay and agendaDay views
  968.                     },
  969.                     timelineWeek: {
  970.                         groupByResource: true,
  971.                         slotDuration: '00:30:00',
  972.                         // options apply to basicDay and agendaDay views
  973.                     }
  974.                 },
  975.                 drop: function (date, allDay) {
  976.                     // this function is called when something is dropped
  977.                     // retrieve the dropped element's stored Event Object
  978.                     var originalEventObject = $(this).data('eventObject');
  979.                     // we need to copy it, so that multiple events don't have a reference to the same object
  980.                     var copiedEventObject = $.extend({}, originalEventObject);
  981.                     // assign it the date that was reported
  982.                     copiedEventObject.start = date;
  983.                     copiedEventObject.allDay = allDay;
  984.                     copiedEventObject.className = originalEventObject.className;
  985.                     // render the event on the calendar
  986.                     // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
  987.                     $('#scheduleCalendar').fullCalendar('renderEvent', copiedEventObject, true);
  988.                     // is the "remove after drop" checkbox checked?
  989.                     if ($('#drop-remove').is(':checked')) {
  990.                         // if so, remove the element from the "Draggable Events" list
  991.                         $(this).remove();
  992.                     }
  993.                 },
  994.                 events: [],
  995.             });
  996.             offcanvasCalendarInitiated = 1;
  997.         }
  998.         var currOpTs = moment().unix();
  999.         if ((offCalendarLastRefreshedTs + 120) < currOpTs || force == 1) {
  1000.             var pika_ind_id = 'NNNAI';
  1001.             $.ajax({
  1002.                 url: BaseURL + "select_data_ajax_public",
  1003.                 type: 'POST',
  1004.                 dataType: 'json',
  1005.                 data: {
  1006.                     //returnJson: 1,     //required for CORS
  1007.                     //sessionData: sessionData   //required only if using cordova for CORS
  1008.                     query: '_EMPTY_',
  1009.                     tableName: "entity_meeting_session",
  1010.                     entity_group: 1,
  1011.                     valueField: "session_id",
  1012.                     textField: "meeting_room_id",
  1013. //                selectFieldList:[   ///skip this property for all fields
  1014. //                    'client_name','client_id','address'
  1015. //
  1016. //                ],
  1017.                     selectorId: 7,
  1018.                     isMultiple: 1,
  1019.                     itemLimit: '_ALL_',  // for all : '_ALL_'
  1020.                     offset: 0,  // default value:0 (from start)
  1021.                     orderByConditions: [  //sequential
  1022. //                    {
  1023. //                        field: 'rating',
  1024. //                        fieldValues: [5,1,9],
  1025. //                        sortType:'ASC'
  1026. //                    },
  1027. //                    {
  1028. //                        field: 'is_featured',
  1029. //                        sortType:'DESC'
  1030. //                    },
  1031.                         {
  1032.                             field: 'scheduled_time_ts',
  1033.                             sortType: 'ASC'
  1034.                         }
  1035.                     ],
  1036.                     dataId: pika_ind_id,
  1037. //                        textField: "rendered_text",
  1038. //
  1039. //                        renderTextFormat: "#__id__ __name__",
  1040. //                        andConditions: [
  1041. //                            //{type: "like", field: "name", value: query},
  1042. //                            {type: "=", field: "delivery_receipt_id", value: $('.dr_id' + pika_ind_id).val()},
  1043. //                            {type: "=", field: "product_id", value: $('.selectize_me_ssp' + pika_ind_id).val()},
  1044. //                            {type: "=", field: "position", value: 3}
  1045. //                        ],
  1046.                     mustConditions: [
  1047.                         //{type: "like", field: "name", value: query},
  1048.                         //{type: "=", field: "delivery_rceipt_id", value: $('.dr_id' + pika_ind_id).val()},
  1049.                         //{type: "in", field: "alottment_tagged", value: [0,'null','']},
  1050. //                            {type: "<=", field: "scheduled_time_ts", value: moment().add('60', 'days').unix()},
  1051.                         {type: ">=", field: "scheduled_time_ts", value: moment().subtract('45', 'days').unix()},
  1052. //                    {type: "=", field: "product_id", value: $('.ssp' + pika_ind_id).val()},
  1053. //                    {type: "=", field: "warehouse_id", value: $('#warehouseId').val()},
  1054. //                    {type: "=", field: "warehouse_action_id", value: $('.wa' + pika_ind_id).val()},
  1055. //                    {type: "=", field: "position", value: 1}
  1056.                     ],
  1057.                     andOrConditions: [
  1058.                         {% if BUDDYBEE_ADMIN_LEVEL>=5 %}
  1059.                         {% elseif BUDDYBEE_ADMIN_LEVEL >=1 %}
  1060.                         {# { #}
  1061.                         {# type: "in", #}
  1062.                         {# field: "is_admin", #}
  1063.                         {# value: [0, 'null'] #}
  1064.                         {# }, #}
  1065.                         {# { #}
  1066.                         {# type: "in", #}
  1067.                         {# field: "assigned_sales_representative_id", #}
  1068.                         {# value: [0, 'null',{{ session[UserConstants.USER_ID] }}] #}
  1069.                         {# }, #}
  1070.                         {% else %}
  1071.                         {type: "=", field: "student_id", value: {{ session[UserConstants.USER_ID] }}},
  1072.                         {type: "=", field: "consultant_id", value: {{ session[UserConstants.USER_ID] }}},
  1073.                         {% endif %}
  1074. //                    {type: "like", field: "client_numerical_code", value: query},
  1075. //                    {type: "like", field: "client_name", value: query},
  1076. //                    {type: "like", field: "client_id", value: query},
  1077. //                    {type: "like", field: "contact_number", value: query},
  1078. //                    {type: "like", field: "email", value: query},
  1079.                     ],
  1080.                     joinTableData: [
  1081.                         {
  1082.                             tableName: "entity_applicant_details",
  1083.                             joinFieldPrimary: "student_id",
  1084.                             joinOn: 'applicant_id',
  1085.                             selectPrefix: 'student_',
  1086.                             selectFieldList: [
  1087.                                 'firstname', 'lastname', 'image', 'professional_title'
  1088.                             ]
  1089.                         },
  1090.                         {
  1091.                             tableName: "entity_create_topic",
  1092.                             joinFieldPrimary: "topic_id",
  1093.                             joinOn: 'id',
  1094.                             selectPrefix: 'topic_',
  1095.                             selectFieldList: [
  1096.                                 'topic_name',
  1097.                             ]
  1098.                         },
  1099.                         {
  1100.                             tableName: "entity_applicant_details",
  1101.                             joinFieldPrimary: "consultant_id",
  1102.                             joinOn: 'applicant_id',
  1103.                             selectPrefix: 'consultant_',
  1104.                             selectFieldList: [
  1105.                                 'firstname', 'lastname', 'image', 'professional_title', 'current_country_id'
  1106.                             ]
  1107.                         },
  1108.                     ],
  1109.                     convertDateToStringFieldList: [
  1110.                         {field: 'created_at', format: 'U'}
  1111.                     ],
  1112.                     convertToObject: [
  1113. //                    'carton_product_by_code_ids','another'
  1114.                     ],
  1115.                     // setDataForSingle: 1,
  1116.                 },
  1117.                 error: function () {
  1118.                     // callback();
  1119.                 },
  1120.                 success: function (res) {
  1121.                     offCalendarLastRefreshedTs = moment().unix()
  1122. //                callback(res.data);
  1123.                     var str = '';
  1124.                     var currUnix = moment().unix();
  1125.                     var added_cntry_id = [];
  1126.                     var added_event_id = [];
  1127.                     $('#calendarHere').fullCalendar('addResource', {
  1128.                         id: 'cntry__OTHER_COUNTRIES_',
  1129. //                    parentId: 'a',
  1130.                         title: 'Others'
  1131.                     });
  1132.                     for (var t = 0; t < res.data.length; t++) {
  1133.                         var c_data = res.data[t];
  1134.                         if (c_data.consultant_current_country_id == '' || c_data.consultant_current_country_id == 0 || c_data.consultant_current_country_id == null)
  1135.                             c_data.consultant_current_country_id = '_OTHER_COUNTRIES_';
  1136. //                        //    console.log('added_cntry_id')
  1137. //                        //    console.log(added_cntry_id)
  1138.                         if (added_cntry_id.indexOf(c_data.consultant_current_country_id) != -1) {
  1139.                         } else {
  1140.                             $('#calendarHere').fullCalendar('addResource', {
  1141.                                 id: 'cntry_' + c_data.consultant_current_country_id,
  1142. //                            parentId: 'a',
  1143.                                 title: typeof countries_data[c_data.consultant_current_country_id] !== 'undefined' ? countries_data[c_data.consultant_current_country_id]['name'] : ''
  1144.                             });
  1145.                             added_cntry_id.push(c_data.consultant_current_country_id)
  1146.                         }
  1147.                         if (added_event_id.indexOf(c_data.consultant_id + '_' + c_data.student_id) != -1) {
  1148.                         } else {
  1149.                             $('#calendarHere').fullCalendar('addResource', {
  1150.                                 id: 'r_' + c_data.consultant_id + '_' + c_data.student_id,
  1151.                                 parentId: 'cntry_' + c_data.consultant_current_country_id,
  1152.                                 title: c_data.consultant_firstname + ' -- ' + c_data.student_firstname
  1153.                             });
  1154.                             added_event_id.push(c_data.consultant_id + '_' + c_data.student_id)
  1155.                         }
  1156.                         var eventColor = 'darkgreen';
  1157.                         var textColor = '#fff';
  1158.                         var endTimeMoment = moment.unix(c_data.scheduled_time_ts).add(c_data.duration_left_min, 'minutes');
  1159.                         if (currUnix < c_data.scheduled_time_ts) {
  1160.                             //upcoming
  1161.                             if (c_data.is_paid_full == 1)
  1162.                                 eventColor = '#fb7400';
  1163.                             else
  1164.                                 eventColor = '#d586a3';
  1165. //                        textColor='#212529';
  1166.                         } else if (currUnix < endTimeMoment.unix())
  1167.                             eventColor = '#1d5b9e';  //ongoing
  1168.                         else
  1169.                             eventColor = 'darkgreen';  //completed
  1170.                         var eventObj2 = {
  1171.                             id: c_data.session_id,
  1172.                             color: eventColor,
  1173.                             textColor: textColor,
  1174.                             resourceId: 'r_' + c_data.consultant_id + '_' + c_data.student_id,
  1175.                             title: c_data.consultant_firstname + ' -- ' + c_data.student_firstname,
  1176.                             consultant_id: c_data.consultant_id,
  1177.                             student_id: c_data.student_id,
  1178.                             meeting_room_id: c_data.meeting_room_id,
  1179.                             scheduled_time_ts: c_data.scheduled_time_ts,
  1180.                             topic_id: c_data.topic_id,
  1181.                             topic_name: c_data.topic_topic_name,
  1182.                             session_value: c_data.session_value,
  1183.                             consultant_firstname: c_data.consultant_firstname,
  1184.                             consultant_lastname: c_data.consultant_lastname,
  1185.                             student_firstname: c_data.student_firstname,
  1186.                             student_lastname: c_data.student_lastname,
  1187.                             start: moment.unix(c_data.scheduled_time_ts).add(0, 'days'),
  1188.                             end: endTimeMoment,
  1189.                             allDay: false
  1190.                         };
  1191. //                    eventArray.push(eventObj2)
  1192.                         $('#calendarHere').fullCalendar('renderEvent', eventObj2, true);
  1193.                     }
  1194.                 }
  1195.             });
  1196.         }
  1197.     }
  1198.     {% endif %}
  1199.     function stepShowTab(n, parentSelector) {
  1200.         // alert('here')
  1201.         // This function will display the specified tab of the form...
  1202.         parentSelector = parentSelector || '#selectPurchaseModal'
  1203.         var prevN = -1;
  1204.         $(parentSelector + ' .stepIndicator.active').each(function (gg, elem) {
  1205.             prevN = 1 * $(elem).data('seqId');
  1206.         });
  1207.         var newN = 0;
  1208.         if (n === '+1') {
  1209.             newN = (1 * prevN) + 1;
  1210.         } else if (n === '-1') {
  1211.             newN = (1 * prevN) - 1;
  1212.         } else
  1213.             newN = n;
  1214.         if (!$(parentSelector + ' .stepIndicator.seq_' + newN).length)
  1215.             newN = (1 * prevN);
  1216.         if (!$(parentSelector + ' .stepIndicator.seq_' + (newN + 1)).length)
  1217.             $(parentSelector + " .nextBtn").text('Confirm');
  1218.         else
  1219.             $(parentSelector + " .nextBtn").text('Next');
  1220.         if (!$(parentSelector + ' .stepIndicator.seq_' + (newN - 1)).length)
  1221.             $(parentSelector + " .prevBtn").hide();
  1222.         else
  1223.             $(parentSelector + " .prevBtn").show();
  1224.         // alert(prevN)
  1225.         // alert(newN)
  1226.         // alert($(parentSelector+' .stepIndicator.seq_'+(newN+1)).length)
  1227.         if (prevN == newN) {
  1228.             $(parentSelector).modal('hide')
  1229.             return false;
  1230.         }
  1231.         $(parentSelector + ' .stepIndicator').removeClass('active')
  1232.         $(parentSelector + ' .step').hide()
  1233.         $(parentSelector + '  .step.seq_' + newN).show()
  1234.         for (var gg = 0; gg <= newN; gg++)
  1235.             $(parentSelector + '  .stepIndicator.seq_' + gg).addClass('active')
  1236.         var triggerFunc = $(parentSelector + '  .step.seq_' + newN).attr('data-trigger-function');
  1237.         if (typeof triggerFunc !== 'undefined' && triggerFunc !== false) {
  1238.             window[triggerFunc]();
  1239.         }
  1240.     }
  1241.     function selectDataOnPurchaseModal(cntry_id, t_id, cons_id, sch_ids, additional_coins) {
  1242.         options = {
  1243.             countryId: 0,
  1244.             topicId: 0,
  1245.             consultantId: 0,
  1246.             scheduleIds: [],
  1247.         }
  1248.     }
  1249.     function submitPurchaseModalData() {
  1250.         var data = {}
  1251.     }
  1252.     function populateTopicListOnPurchaseModal(countryId, query) {
  1253.         var pika_ind_id = "_NA_";
  1254.         $('#selectPurchaseModal .topic_holder').empty();
  1255.         $.ajax({
  1256.             url: BaseURL + "select_data_ajax_public",
  1257.             type: 'POST',
  1258.             dataType: 'json',
  1259.             data: {
  1260.                 //returnJson: 1,
  1261.                 //sessionData: sessionData
  1262.                 query: query,
  1263.                 tableName: "entity_create_topic",
  1264.                 valueField: "id",
  1265.                 textField: "topic_name",
  1266.                 entity_group: 1,
  1267.                 selectorId: '_NA_',
  1268.                 isMultiple: 0,
  1269.                 dataId: pika_ind_id,
  1270. //                        isMultiple: 0,
  1271.                 //textField: "rendered_text",
  1272. //
  1273.                 //renderTextFormat: "#__id__ __name__",
  1274.                 andConditions: [],
  1275.                 andOrConditions: [],
  1276.                 mustConditions: [
  1277.                     {type: "=", field: "consultancy_enabled", value: 1},
  1278.                     {type: "=", field: "country_id", value: countryId},
  1279.                     {#                    {% if not curr_data is empty %} #}
  1280.                     {#                    {type: "in", field: "id", value: {{ curr_data|json_encode|raw() }} }, #}
  1281.                     {#                    {% else %} #}
  1282.                     {#                    {% if consultantDetails.isAdmin>0 %} #}
  1283.                     {#                    {type: "like", field: "topic_marker", value: '_support_ _report_to_admin_'}, #}
  1284.                     {#                    {% else %} #}
  1285.                     {#                    {type: "!=", field: "only_bookable_by_admin", value: '1'}, #}
  1286.                     {#                    {type: "not like", field: "topic_marker", value: '_support_'}, #}
  1287.                     {#                    {type: "not like", field: "topic_marker", value: '_report_to_admin_'}, #}
  1288.                     {#                    {% endif %} #}
  1289.                     {#                    {% endif %} #}
  1290.                 ],
  1291.                 convertToObject: [
  1292.                     'routine_data'
  1293.                 ],
  1294.                 skipDefaultCompanyId: 1
  1295.                 // setDataForSingle: 1,
  1296.             },
  1297.             error: function () {
  1298.                 // callback();
  1299.             },
  1300.             success: function (res) {
  1301.                 topic_data_by_id = res.dataById
  1302.                 for (var jj = 0; jj < res.data.length; jj++) {
  1303.                     var dt = res.data[jj];
  1304.                     var is_package = 0;
  1305.                     if (dt['topic_marker'] != null)
  1306.                         if (dt['topic_marker'].indexOf('_package_') !== -1)
  1307.                             is_package = 1;
  1308.                     var ggStr = ' <div class="box-selector tp_selector tp_' + dt['id'] + '  col-md-3 col-sm-6"' +
  1309.                         ' data-id="' + dt['id'] + '" ' +
  1310.                         ' data-gen-class="tp_selector" ' +
  1311.                         '>' +
  1312.                         '<div class="inside">' +
  1313.                         ' <div class="img"  style="' +
  1314.                         "background:url(' {{ absolute_url(path('dashboard')) }}" + dt['topic_image'] + "');" +
  1315.                         ' height: 50px !important;width: 100%;background-position: center;background-size: contain;background-repeat: no-repeat;"></div>' +
  1316.                         '<h6 class="title" style="height: 3rem; font-size:12px">' + dt['topic_name'] + '</h6> ' +
  1317.                         // '<p class="sub-title">'+dt['topic_summary']+'</p>' +
  1318.                         '<p class="sub-title" style="text-align:center;">' + (is_package == 1 ? 'Package' : (dt['meeting_type'] == 2 ? 'Offline Process' : 'Online Session')) + '</p>' +
  1319.                         // '<p class="sub-title">'+dt['topic_summary']+'</p>' +
  1320.                         '</div></div>';
  1321.                     $('#selectPurchaseModal .topic_holder').append(ggStr);
  1322.                 }
  1323.             }
  1324.         });
  1325.     }
  1326.     function populateConsultantListOnPurchaseModal(tpId, query) {
  1327.         var pika_ind_id = "_NA_";
  1328.         $('#selectPurchaseModal .cons_holder').empty();
  1329.         $.ajax({
  1330.             url: BaseURL + "select_data_ajax_public",
  1331.             type: 'POST',
  1332.             dataType: 'json',
  1333.             data: {
  1334.                 //returnJson: 1,
  1335.                 //sessionData: sessionData
  1336.                 query: query,
  1337.                 tableName: "entity_applicant_details",
  1338.                 valueField: "applicant_id",
  1339.                 textField: "firstname",
  1340.                 entity_group: 1,
  1341.                 selectorId: '_NA_',
  1342.                 isMultiple: 0,
  1343.                 dataId: pika_ind_id,
  1344. //                        isMultiple: 0,
  1345.                 //textField: "rendered_text",
  1346. //
  1347.                 //renderTextFormat: "#__id__ __name__",
  1348.                 andConditions: [],
  1349.                 andOrConditions: [
  1350.                     {type: "like", field: "preferred_topic_ids_as_consultant", value: '"' + tpId + '"'},
  1351.                     {type: "like", field: "preferred_topic_ids_as_consultant", value: '[]'},
  1352.                     // {type: "like", field: "preferred_topic_ids_as_consultant", value: ''},
  1353.                     // {type: "like", field: "preferred_topic_ids_as_consultant", value: 'null'},
  1354.                     {type: "=", field: "preferred_topic_ids_as_consultant", value: 'null'},
  1355.                 ],
  1356.                 mustConditions: [
  1357.                     {type: "=", field: "is_consultant", value: 1},
  1358.                     {#                    {% if not curr_data is empty %} #}
  1359.                     {#                    {type: "in", field: "id", value: {{ curr_data|json_encode|raw() }} }, #}
  1360.                     {#                    {% else %} #}
  1361.                     {#                    {% if consultantDetails.isAdmin>0 %} #}
  1362.                     {#                    {type: "like", field: "topic_marker", value: '_support_ _report_to_admin_'}, #}
  1363.                     {#                    {% else %} #}
  1364.                     {#                    {type: "!=", field: "only_bookable_by_admin", value: '1'}, #}
  1365.                     {#                    {type: "not like", field: "topic_marker", value: '_support_'}, #}
  1366.                     {#                    {type: "not like", field: "topic_marker", value: '_report_to_admin_'}, #}
  1367.                     {#                    {% endif %} #}
  1368.                     {#                    {% endif %} #}
  1369.                 ],
  1370.                 convertToObject: [
  1371.                     'routine_data'
  1372.                 ],
  1373.                 skipDefaultCompanyId: 1
  1374.                 // setDataForSingle: 1,
  1375.             },
  1376.             error: function () {
  1377.                 // callback();
  1378.             },
  1379.             success: function (res) {
  1380.                 // topic_data_by_id = res.dataById
  1381.                 for (var jj = 0; jj < res.data.length; jj++) {
  1382.                     var dt = res.data[jj];
  1383.                     var ggStr = ' <div class="box-selector cons_selector cons_' + dt['id'] + '  col-md-3 col-sm-6"' +
  1384.                         ' data-id="' + dt['applicant_id'] + '" ' +
  1385.                         ' data-gen-class="cons_selector" ' +
  1386.                         '>' +
  1387.                         '<div class="inside">' +
  1388.                         ' <div class="img"  style="' +
  1389.                         "background:url(' {{ absolute_url(path('dashboard')) }}" + dt['image'] + "');" +
  1390.                         ' height: 50px !important;width: 100%;background-position: center;background-size: contain;background-repeat: no-repeat;"></div>' +
  1391.                         '<h6 class="title" style="height: 2rem; font-size:12px">' + dt['firstname'] + ' ' + dt['lastname'] + '</h6> ' +
  1392.                         // '<p class="sub-title">'+dt['topic_summary']+'</p>' +
  1393.                         '</div></div>';
  1394.                     $('#selectPurchaseModal .cons_holder').append(ggStr);
  1395.                 }
  1396. //                        alert('pika master')
  1397.             }
  1398.         });
  1399.     }
  1400.     function populateScheduleListOnPurchaseModal(consId, durValue, query) {
  1401.         var pika_ind_id = "_NA_";
  1402.         // $('#selectPurchaseModal .sch_holder').empty();
  1403.         $('#selectPurchaseModal .sch_holder_month').empty();
  1404.         $('#selectPurchaseModal .sch_holder_day').empty();
  1405.         $('#selectPurchaseModal .sch_holder_time').empty();
  1406.         durValue = durValue || 30;
  1407.         var options = {
  1408.             '_NEXT_60_DAYS_': 1,
  1409. //                        '_THIS_DAY_':1,
  1410. //                        '_NEXT_DAYS_':20,
  1411.         }
  1412.         $.ajax({
  1413.             url: BaseURL + 'get_consultant_schedules',
  1414.             type: 'POST',
  1415.             dataType: 'json',
  1416.             data: {
  1417.                 consultantId: consId,
  1418.                 startDateStr: '@' + moment().unix(),
  1419. //                    endDateStr: $('#preferredScheduleDate').val() + ' 23:59:59 ' + moment().format("ZZ"),
  1420.                 endDateStr: '',
  1421.                 durationMin: durValue,
  1422.                 // durationMin: sessionDurationSelector.getValue() != '' ? perSessionMinute * sessionDurationSelector.getValue() : 90,
  1423.                 options: options,
  1424.                 returnJson: 1
  1425.             },
  1426.             error: function () {
  1427.                 // callback();
  1428.             },
  1429.             success: function (res) {
  1430.                 ;
  1431.                 // $('#').val(res.);
  1432.                 $('#selectPurchaseModal .view_if_has_schedules').hide();
  1433.                 if (res.success == true) {
  1434. ////                            for (var l = 0; l < res.sessionsArray.length; l++) {
  1435. ////                                $('#rescheduledSemesterSelector').append($("<option></option>").attr("value", res.sessionsArray[l].id).text(res.sessionsArray[l].name));
  1436. ////                            }
  1437.                     for (var jj = 0; jj < res.data.scheduleList.length; jj++) {
  1438.                         var sch_dt = res.data.scheduleList[jj];
  1439.                         var ggStr = ' <div class="box-selector sch_selector_time ' +
  1440.                             'sch_mon_' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM') + ' ' +
  1441.                             'sch_day_' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM_DD') + ' ' +
  1442.                             'sch_' + sch_dt['timeUnix'] + ' ' +
  1443.                             'sch_' + sch_dt['timeUnix'] + '  col-md-3 col-sm-6"' +
  1444.                             ' data-id="' + sch_dt['timeUnix'] + '" ' +
  1445.                             ' data-gen-class="sch_selector_time" ' +
  1446.                             '>' +
  1447.                             '<div class="inside">' +
  1448.                                 {# ' <div class="img"  style="' + #}
  1449.                                 {# "background:url(' {{ absolute_url(path('dashboard')) }}"+dt['image']+"');"+ #}
  1450.                                 {# ' height: 50px !important;width: 100%;background-position: center;background-size: contain;background-repeat: no-repeat;"></div>' + #}
  1451.                             '<h6 class="title" style="">' + (moment.unix(sch_dt['timeUnix']).format('HH:mm')) + '</h6> ' +
  1452.                             // '<p class="sub-title">'+dt['topic_summary']+'</p>' +
  1453.                             '</div></div>';
  1454.                         var ggStrday = ' <div class="box-selector sch_selector_day ' +
  1455.                             'sch_mon_' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM') + ' ' +
  1456.                             'sch_day_' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM_DD') + '  col-md-3 col-sm-6"' +
  1457.                             ' data-id="' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM_DD') + '" ' +
  1458.                             ' data-gen-class="sch_selector_day" ' +
  1459.                             '>' +
  1460.                             '<div class="inside">' +
  1461.                                 {# ' <div class="img"  style="' + #}
  1462.                                 {# "background:url(' {{ absolute_url(path('dashboard')) }}"+dt['image']+"');"+ #}
  1463.                                 {# ' height: 50px !important;width: 100%;background-position: center;background-size: contain;background-repeat: no-repeat;"></div>' + #}
  1464.                             '<h6 class="title" style="">' + (moment.unix(sch_dt['timeUnix']).format('DD')) + '</h6> ' +
  1465.                             // '<p class="sub-title">'+dt['topic_summary']+'</p>' +
  1466.                             '</div></div>';
  1467.                         var ggStrmon = ' <div class="box-selector sch_selector_mon ' +
  1468.                             'sch_mon_' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM') + ' ' +
  1469.                             // 'sch_day'+moment.unix(sch_dt['timeUnix']).format('YYYY_MM')+' ' +
  1470.                             ' col-md-3 col-sm-6"' +
  1471.                             ' data-id="' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM') + '" ' +
  1472.                             ' data-gen-class="sch_selector_mon" ' +
  1473.                             '>' +
  1474.                             '<div class="inside">' +
  1475.                                 {# ' <div class="img"  style="' + #}
  1476.                                 {#    #}{# "background:url(' {{ absolute_url(path('dashboard')) }}"+dt['image']+"');"+ #}
  1477.                                 {# ' height: 50px !important;width: 100%;background-position: center;background-size: contain;background-repeat: no-repeat;"></div>' + #}
  1478.                             '<h6 class="title" style="">' + (moment.unix(sch_dt['timeUnix']).format('MMM')) + '</h6> ' +
  1479.                             // '<p class="sub-title">'+dt['topic_summary']+'</p>' +
  1480.                             '</div></div>';
  1481.                         if (!$('.sch_selector_mon.sch_mon_' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM')).length)
  1482.                             $('#selectPurchaseModal .sch_holder_month').append(ggStrmon);
  1483.                         if (!$('.sch_selector_day.sch_day_' + moment.unix(sch_dt['timeUnix']).format('YYYY_MM_DD')).length)
  1484.                             $('#selectPurchaseModal .sch_holder_day').append(ggStrday);
  1485.                         $('#selectPurchaseModal .sch_holder_time').append(ggStr);
  1486.                     }
  1487.                     if (res.data.scheduleList.length > 0) {
  1488.                         $('#selectPurchaseModal h5.view_if_has_schedules').css('display', 'block');
  1489.                         $('#selectPurchaseModal p.view_if_has_schedules').css('display', 'block');
  1490.                         $('#selectPurchaseModal div.row.view_if_has_schedules').css('display', 'flex');
  1491.                     }
  1492.                     $('.sch_' + res.data.closestDateTs).trigger('click');
  1493. //                     rescheduledconsultancyScheduleSelector.clear();
  1494. //                     rescheduledconsultancyScheduleSelector.disable();
  1495. //                     rescheduledconsultancyScheduleSelector.clearOptions();
  1496. //                     rescheduledconsultancyScheduleSelector.load(function (callback) {
  1497. //
  1498. //                         rescheduledconsultancyScheduleSelector.enable();
  1499. //                         var modifiedList = [];
  1500. //                         for (var l = 0; l < res.data.scheduleList.length; l++) {
  1501. //                             var sch_dt = res.data.scheduleList[l];
  1502. //                             sch_dt['time_user_zone'] = moment.unix(sch_dt['timeUnix']).format('MMM DD, YYYY HH:mm');
  1503. // //                                sch_dt['time_user_zone']=sch_dt['time'];
  1504. //                             modifiedList.push(sch_dt);
  1505. //                         }
  1506. //
  1507. //
  1508. //                         callback(modifiedList);
  1509. //
  1510. //
  1511. //                     });
  1512. //                     rescheduledconsultancyScheduleSelector.setValue(res.data.closestDateTs)
  1513.                 } else {
  1514.                 }
  1515.             }
  1516.         });
  1517.     }
  1518.     function refreshRoutinePackageListOnPurchaseModal(t_id) {
  1519.         var dt = [];
  1520.         $('#selectPurchaseModal .routineTable tbody').empty();
  1521.         var topicIdForRoutine = t_id;
  1522.         // var sessionDurationSelectorValue=sessionDurationSelector.getValue();
  1523.         var sessionDurationSelectorValue = 100;
  1524.         // var scheduledTimeTsValue=consultancyScheduleSeletor.getValue();
  1525.         var scheduledTimeTsValue = moment().unix();
  1526.         if (typeof topic_data_by_id[topicIdForRoutine] !== 'undefined') {
  1527.             if (topic_data_by_id[topicIdForRoutine]['routine_data'].length) {
  1528.                 dt = topic_data_by_id[topicIdForRoutine]['routine_data'];
  1529.             } else {
  1530.                 dt = [
  1531.                     {
  1532.                         sequence: 1,
  1533.                         topicId: topicIdForRoutine,
  1534.                         topicName: topic_data_by_id[topicIdForRoutine]['topic_name'],
  1535.                         meetingType: topic_data_by_id[topicIdForRoutine]['meeting_type'],
  1536.                         duration: sessionDurationSelectorValue != '' ? (perSessionMinute * sessionDurationSelectorValue) / (COIN_GENERAL_MULT * 1) : 0,
  1537.                         offset: 0,
  1538.                         coins: sessionDurationSelectorValue != '' ? (1 * sessionDurationSelectorValue) : 0,
  1539.                         scheduledTimeTs: scheduledTimeTsValue != '' ? (1 * scheduledTimeTsValue) : 0,
  1540.                         nextSequenceStart: 0,
  1541.                         modifiable: 0,
  1542.                     }
  1543.                 ];
  1544.             }
  1545.         }
  1546.         for (var poi = 0; poi < dt.length; poi++) {
  1547.             var cc_pika = dt[poi];
  1548.             if (cc_pika['meetingType'] == 2) //offline
  1549.             {
  1550.                 $('#selectPurchaseModal .routineTable tbody').append(
  1551.                     '<tr>' +
  1552.                     '<td>' + cc_pika.topicName + '</td>' +
  1553.                     '<td style="text-align: left;"><b>Deliverable</b><br>' +
  1554.                     'Bee Coins: ' + cc_pika.coins + '<br>' +
  1555.                     (typeof cc_pika.scheduledDateTs !== 'undefined' ?
  1556.                             ('Lead Dt.<br>' + (cc_pika.scheduledTimeTs == 0 ? '' : moment.unix(cc_pika.scheduledDateTs).format('MMMM DD, YYYY HH:mm ZZ'))) :
  1557.                             ('')
  1558.                     ) +
  1559.                     '</td>' +
  1560.                     '<td>' +
  1561.                     '<input class="routineCoinNeeded" name="routine_coins[]" type="hidden" value="' + cc_pika.coins + '">' +
  1562.                     '<input class="routineTopicId" name="routine_topic_id[]" type="hidden" value="' + cc_pika.topicId + '">' +
  1563.                     (typeof cc_pika.modifiable == 1 ? '<a class="icon-check isChecked modifiable" href="javascript:void(0);"><i class="fa fa-check"></i></a>' : '<a class="icon-check isChecked modifiable" href="javascript:void(0);"><i class="fa fa-check"></i></a>') +
  1564.                     // '<a class="icon-delete" href="javascript:void(0);"><i class="fa fa-times"></i></a>' +
  1565.                     '</td>' +
  1566.                     '</tr>'
  1567.                 )
  1568.             } else {
  1569.                 {
  1570.                     $('#selectPurchaseModal .routineTable tbody').append(
  1571.                         '<tr>' +
  1572.                         '<td>' + cc_pika.topicName + '</td>' +
  1573.                         '<td style="text-align: left;"><b>Online</b><br>' +
  1574.                         'Bee Coins: ' + cc_pika.coins + '<br>' +
  1575.                         'Duration: ' + cc_pika.duration + '<br>' +
  1576.                         (typeof cc_pika.scheduledTimeTs !== 'undefined' ?
  1577.                                 ('Scheduled Time: <br>' + (cc_pika.scheduledTimeTs == 0 ? '' : moment.unix(cc_pika.scheduledTimeTs).format('MMMM DD, YYYY HH:mm ZZ'))) :
  1578.                                 ('')
  1579.                         ) +
  1580.                         '</td>' +
  1581.                         '<td>' +
  1582.                         '<input class="routineCoinNeeded" name="routine_coins[]" type="hidden" value="' + cc_pika.coins + '">' +
  1583.                         '<input class="routineTopicId" name="routine_topic_id[]" type="hidden" value="' + cc_pika.topicId + '">' +
  1584.                         (typeof cc_pika.modifiable == 1 ? '<a class="icon-check isChecked modifiable" href="javascript:void(0);"><i class="fa fa-check"></i></a>' :
  1585.                             '<a class="icon-check isChecked " href="javascript:void(0);"><i class="fa fa-check"></i></a>') +
  1586.                         // '<a class="icon-delete"  href="javascript:void(0);"><i class="fa fa-check"></i></a>' +
  1587.                         // '<a class="icon-delete" href="javascript:void(0);"><i class="fa fa-times"></i></a>' +
  1588.                         '</td>' +
  1589.                         '</tr>'
  1590.                     )
  1591.                 }
  1592.             }
  1593.         }
  1594.         recalculateRoutinePackageOnPurchaseModal();
  1595.     }
  1596.     function recalculateRoutinePackageOnPurchaseModal() {
  1597.         var tot_coin = 0;
  1598.         $('#selectPurchaseModal .routineTable .icon-check').each(function (indy, elem) {
  1599.             if ($(elem).hasClass('isChecked'))
  1600.                 tot_coin += (1 * $('#selectPurchaseModal .routineTable .routineCoinNeeded').eq(indy).val())
  1601.         })
  1602.         $('#selectPurchaseModal .routineCoinNeededTotalInput').val(tot_coin)
  1603.         $('#selectPurchaseModal .routineCoinNeededTotalSpan').text(tot_coin)
  1604.     }
  1605.     function initiate_prompt_info_modal() {
  1606.         if ($('#promptForInfoModal #currentCountryIdPromptForInfo').length)
  1607.             $('#promptForInfoModal #currentCountryIdPromptForInfo').selectize({
  1608.                 placeholder: 'Select Your Current Country',
  1609. //            options: APTL.productListArray,
  1610.                 options: [],
  1611.                 valueField: 'value',
  1612.                 labelField: 'text',
  1613.                 preload: 'focus',
  1614.                 searchField: ['text', 'value'],
  1615. //            render: {
  1616. //                option: function (item, escape) {
  1617. //                    return '<div class="p-l-10 p-r-10">'
  1618. //                            + '<h6>' + escape(item[label_for_product]) + '</h6> '
  1619. //                            + '<span>Code:' + escape(item.productCode) + '</span> '
  1620. //                                //+ '<span>Name:'+item.name+'</span> '
  1621. //                                //+ '<span>DEBUG:'+item.score+'</span>'
  1622. //                            + '</div>';
  1623. //                }
  1624. //            },
  1625.                 onChange: function (value) {
  1626.                     if (!value) return;
  1627. //                productId = preliminary_reg_data_by_id[value]['product_id']
  1628. //                getbomData();
  1629. //
  1630.                 },
  1631.                 load: function (query, callback) {
  1632. //                        if (!query.length) return // callback();
  1633.                     if (!query.length) query = '_EMPTY_';
  1634.                     var pika_ind_id = $($(this)[0].$input["0"]).attr('data-id')
  1635.                     $.ajax({
  1636.                         url: BaseURL + "select_data_ajax",
  1637.                         type: 'POST',
  1638.                         dataType: 'json',
  1639.                         data: {
  1640.                             //returnJson: 1,
  1641.                             //sessionData: sessionData
  1642.                             query: query,
  1643.                             tableName: "entity_countries",
  1644.                             valueField: "country_id",
  1645.                             textField: "name_en",
  1646.                             entity_group: 1,
  1647.                             selectorId: $($(this)[0].$input["0"]).attr('id'),
  1648.                             isMultiple: 0,
  1649.                             dataId: pika_ind_id,
  1650. //                        isMultiple: 0,
  1651.                             //textField: "rendered_text",
  1652. //
  1653.                             //renderTextFormat: "#__id__ __name__",
  1654.                             andConditions: [
  1655.                                 {type: "like", field: "name_en", value: query}
  1656.                             ],
  1657.                             mustConditions: [
  1658. //                            {type: "=", field: "approved", value: 1}
  1659.                             ],
  1660.                             convertToObject: [
  1661. //                            'accessories', 'issues'
  1662.                             ],
  1663.                             skipDefaultCompanyId: 1
  1664.                             // setDataForSingle: 1,
  1665.                         },
  1666.                         error: function () {
  1667.                             // callback();
  1668.                         },
  1669.                         success: function (res) {
  1670. //                        preliminary_reg_data_by_id = res.dataById
  1671.                             callback(res.data);
  1672.                             if (res.setValueArray.length != 0 && res.selectorId != '') {
  1673.                                 if (res.isMultiple == 1)
  1674.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValueArray)
  1675.                                 else
  1676.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValue)
  1677.                             }
  1678. //                        alert('pika master')
  1679.                         }
  1680.                     });
  1681.                 },
  1682.                 onLoad: function (data) {
  1683. //                //    console.log(data)
  1684. //                alert('here')
  1685.                     if (!data.length) return;
  1686. //                pbcs.open()
  1687.                     if (data.length == 1) {
  1688. //                    alert('hi')
  1689. //                    productionScheduleSelector.setValue(data[0].value)
  1690.                     }
  1691.                 }
  1692.             });
  1693.         if ($('#promptForInfoModal #preferredConsultancyTopicCountryIdsPromptForInfo').length)
  1694.             $('#promptForInfoModal #preferredConsultancyTopicCountryIdsPromptForInfo').selectize({
  1695.                 placeholder: 'Select Your Preferred Country',
  1696. //            options: APTL.productListArray,
  1697.                 options: [],
  1698.                 valueField: 'value',
  1699.                 labelField: 'text',
  1700.                 preload: 'focus',
  1701.                 searchField: ['text', 'value'],
  1702. //            render: {
  1703. //                option: function (item, escape) {
  1704. //                    return '<div class="p-l-10 p-r-10">'
  1705. //                            + '<h6>' + escape(item[label_for_product]) + '</h6> '
  1706. //                            + '<span>Code:' + escape(item.productCode) + '</span> '
  1707. //                                //+ '<span>Name:'+item.name+'</span> '
  1708. //                                //+ '<span>DEBUG:'+item.score+'</span>'
  1709. //                            + '</div>';
  1710. //                }
  1711. //            },
  1712.                 onChange: function (value) {
  1713.                     if (!value) return;
  1714. //                productId = preliminary_reg_data_by_id[value]['product_id']
  1715. //                getbomData();
  1716. //
  1717.                 },
  1718.                 load: function (query, callback) {
  1719. //                        if (!query.length) return // callback();
  1720.                     if (!query.length) query = '_EMPTY_';
  1721.                     var pika_ind_id = $($(this)[0].$input["0"]).attr('data-id')
  1722.                     $.ajax({
  1723.                         url: BaseURL + "select_data_ajax",
  1724.                         type: 'POST',
  1725.                         dataType: 'json',
  1726.                         data: {
  1727.                             //returnJson: 1,
  1728.                             //sessionData: sessionData
  1729.                             query: query,
  1730.                             tableName: "entity_countries",
  1731.                             valueField: "country_id",
  1732.                             textField: "name_en",
  1733.                             entity_group: 1,
  1734.                             selectorId: $($(this)[0].$input["0"]).attr('id'),
  1735.                             isMultiple: 1,
  1736.                             dataId: pika_ind_id,
  1737. //                        isMultiple: 0,
  1738.                             //textField: "rendered_text",
  1739. //
  1740.                             //renderTextFormat: "#__id__ __name__",
  1741.                             andConditions: [
  1742.                                 {type: "like", field: "name_en", value: query}
  1743.                             ],
  1744.                             mustConditions: [
  1745. //                            {type: "=", field: "approved", value: 1}
  1746.                             ],
  1747.                             convertToObject: [
  1748. //                            'accessories', 'issues'
  1749.                             ],
  1750.                             skipDefaultCompanyId: 1
  1751.                             // setDataForSingle: 1,
  1752.                         },
  1753.                         error: function () {
  1754.                             // callback();
  1755.                         },
  1756.                         success: function (res) {
  1757. //                        preliminary_reg_data_by_id = res.dataById
  1758.                             callback(res.data);
  1759.                             if (res.setValueArray.length != 0 && res.selectorId != '') {
  1760.                                 if (res.isMultiple == 1)
  1761.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValueArray)
  1762.                                 else
  1763.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValue)
  1764.                             }
  1765. //                        alert('pika master')
  1766.                         }
  1767.                     });
  1768.                 },
  1769.                 onLoad: function (data) {
  1770. //                //    console.log(data)
  1771. //                alert('here')
  1772.                     if (!data.length) return;
  1773. //                pbcs.open()
  1774.                     if (data.length == 1) {
  1775. //                    alert('hi')
  1776. //                    productionScheduleSelector.setValue(data[0].value)
  1777.                     }
  1778.                 }
  1779.             });
  1780.         if ($('#promptForInfoModal #preferredTopicIdsAsStudentPromptForInfo').length)
  1781.             $('#promptForInfoModal #preferredTopicIdsAsStudentPromptForInfo').selectize({
  1782.                 placeholder: 'Preferred Topic Ids as Student',
  1783.                 multiple: true,
  1784. //            options: APTL.productListArray,
  1785.                 options: [],
  1786.                 valueField: 'value',
  1787.                 labelField: 'text',
  1788.                 preload: 'focus',
  1789.                 searchField: ['text', 'value'],
  1790. //            render: {
  1791. //                option: function (item, escape) {
  1792. //                    return '<div class="p-l-10 p-r-10">'
  1793. //                            + '<h6>' + escape(item[label_for_product]) + '</h6> '
  1794. //                            + '<span>Code:' + escape(item.productCode) + '</span> '
  1795. //                                //+ '<span>Name:'+item.name+'</span> '
  1796. //                                //+ '<span>DEBUG:'+item.score+'</span>'
  1797. //                            + '</div>';
  1798. //                }
  1799. //            },
  1800.                 onChange: function (value) {
  1801.                     if (!value) return;
  1802. //                productId = preliminary_reg_data_by_id[value]['product_id']
  1803. //                getbomData();
  1804. //
  1805.                 },
  1806.                 load: function (query, callback) {
  1807. //                        if (!query.length) return // callback();
  1808.                     if (!query.length) query = '_EMPTY_';
  1809.                     var pika_ind_id = $($(this)[0].$input["0"]).attr('data-id')
  1810.                     $.ajax({
  1811.                         url: BaseURL + "select_data_ajax",
  1812.                         type: 'POST',
  1813.                         dataType: 'json',
  1814.                         data: {
  1815.                             //returnJson: 1,
  1816.                             //sessionData: sessionData
  1817.                             query: query,
  1818.                             tableName: "entity_create_topic",
  1819.                             valueField: "id",
  1820.                             textField: "topic_name",
  1821.                             entity_group: 1,
  1822.                             selectorId: $($(this)[0].$input["0"]).attr('id'),
  1823.                             isMultiple: 1,
  1824.                             dataId: pika_ind_id,
  1825. //                        isMultiple: 0,
  1826.                             //textField: "rendered_text",
  1827. //
  1828.                             //renderTextFormat: "#__id__ __name__",
  1829.                             andConditions: [
  1830.                                 {type: "like", field: "topic_name", value: query}
  1831.                             ],
  1832.                             mustConditions: [
  1833.                                 {type: "=", field: "consultancy_enabled", value: 1}
  1834.                             ],
  1835.                             convertToObject: [
  1836. //                            'accessories', 'issues'
  1837.                             ],
  1838.                             skipDefaultCompanyId: 1
  1839.                             // setDataForSingle: 1,
  1840.                         },
  1841.                         error: function () {
  1842.                             // callback();
  1843.                         },
  1844.                         success: function (res) {
  1845. //                        preliminary_reg_data_by_id = res.dataById
  1846.                             callback(res.data);
  1847.                             if (res.setValueArray.length != 0 && res.selectorId != '') {
  1848.                                 if (res.isMultiple == 1)
  1849.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValueArray)
  1850.                                 else
  1851.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValue)
  1852.                             }
  1853. //                        alert('pika master')
  1854.                         }
  1855.                     });
  1856.                 },
  1857.                 onLoad: function (data) {
  1858.                     //    console.log(data)
  1859. //                alert('here')
  1860.                     if (!data.length) return;
  1861. //                pbcs.open()
  1862.                     if (data.length == 1) {
  1863. //                    alert('hi')
  1864. //                    productionScheduleSelector.setValue(data[0].value)
  1865.                     }
  1866.                 }
  1867.             });
  1868.         if ($('#promptForInfoModal #preferredTopicIdsAsConsultantPromptForInfo').length)
  1869.             $('#promptForInfoModal #preferredTopicIdsAsConsultantPromptForInfo').selectize({
  1870.                 placeholder: 'Preferred Topic Ids as Consultant',
  1871.                 multiple: true,
  1872. //            options: APTL.productListArray,
  1873.                 options: [],
  1874.                 valueField: 'value',
  1875.                 labelField: 'text',
  1876.                 preload: 'focus',
  1877.                 searchField: ['text', 'value'],
  1878. //            render: {
  1879. //                option: function (item, escape) {
  1880. //                    return '<div class="p-l-10 p-r-10">'
  1881. //                            + '<h6>' + escape(item[label_for_product]) + '</h6> '
  1882. //                            + '<span>Code:' + escape(item.productCode) + '</span> '
  1883. //                                //+ '<span>Name:'+item.name+'</span> '
  1884. //                                //+ '<span>DEBUG:'+item.score+'</span>'
  1885. //                            + '</div>';
  1886. //                }
  1887. //            },
  1888.                 onChange: function (value) {
  1889.                     if (!value) return;
  1890. //                productId = preliminary_reg_data_by_id[value]['product_id']
  1891. //                getbomData();
  1892. //
  1893.                 },
  1894.                 load: function (query, callback) {
  1895. //                        if (!query.length) return // callback();
  1896.                     if (!query.length) query = '_EMPTY_';
  1897.                     var pika_ind_id = $($(this)[0].$input["0"]).attr('data-id')
  1898.                     $.ajax({
  1899.                         url: BaseURL + "select_data_ajax",
  1900.                         type: 'POST',
  1901.                         dataType: 'json',
  1902.                         data: {
  1903.                             //returnJson: 1,
  1904.                             //sessionData: sessionData
  1905.                             query: query,
  1906.                             tableName: "entity_create_topic",
  1907.                             valueField: "id",
  1908.                             textField: "topic_name",
  1909.                             entity_group: 1,
  1910.                             selectorId: $($(this)[0].$input["0"]).attr('id'),
  1911.                             isMultiple: 1,
  1912.                             dataId: pika_ind_id,
  1913. //                        isMultiple: 0,
  1914.                             //textField: "rendered_text",
  1915. //
  1916.                             //renderTextFormat: "#__id__ __name__",
  1917.                             andConditions: [
  1918.                                 {type: "like", field: "topic_name", value: query}
  1919.                             ],
  1920.                             mustConditions: [
  1921.                                 {type: "=", field: "consultancy_enabled", value: 1}
  1922.                             ],
  1923.                             convertToObject: [
  1924. //                            'accessories', 'issues'
  1925.                             ],
  1926.                             skipDefaultCompanyId: 1
  1927.                             // setDataForSingle: 1,
  1928.                         },
  1929.                         error: function () {
  1930.                             // callback();
  1931.                         },
  1932.                         success: function (res) {
  1933. //                        preliminary_reg_data_by_id = res.dataById
  1934.                             callback(res.data);
  1935.                             if (res.setValueArray.length != 0 && res.selectorId != '') {
  1936.                                 if (res.isMultiple == 1)
  1937.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValueArray)
  1938.                                 else
  1939.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValue)
  1940.                             }
  1941. //                        alert('pika master')
  1942.                         }
  1943.                     });
  1944.                 },
  1945.                 onLoad: function (data) {
  1946.                     //    console.log(data)
  1947. //                alert('here')
  1948.                     if (!data.length) return;
  1949. //                pbcs.open()
  1950.                     if (data.length == 1) {
  1951. //                    alert('hi')
  1952. //                    productionScheduleSelector.setValue(data[0].value)
  1953.                     }
  1954.                 }
  1955.             });
  1956.         $('.promptForInfoAutoUpdateData').not('.selectize-control').change(function () {
  1957. //            //    console.log('* The text was changed');
  1958.             $.post('{{ url('update_inline_value') }}', {
  1959. //                        returnJson: 1,
  1960. //                        sessionData: sessionData
  1961.                 entityName: typeof $(this).data('entityName') !== 'undefined' ? $(this).data('entityName') : 'EntityApplicantDetails',
  1962.                 entityBundle: typeof $(this).data('entityBundle') !== 'undefined' ? $(this).data('entityBundle') : 'CompanyGroup',
  1963.                 setValue: $(this).val(),
  1964.                 relevantRequiredPromptField: $(this).data('relevantPromptField'),
  1965.                 clearRequiredPromptFlag: 1,
  1966.                 setMethod: $(this).data('setMethod'),
  1967.                 findField: typeof $(this).data('findField') !== 'undefined' ? $(this).data('findField') : 'applicantId',
  1968.                 findValue: typeof $(this).data('findValue') !== 'undefined' ? $(this).data('findValue') : '{{ session[UserConstants.USER_ID] is defined? session[UserConstants.USER_ID]:0 }}',
  1969.                 fieldType: typeof $(this).data('fieldType') !== 'undefined' ? $(this).data('fieldType') : '_TEXT_',
  1970.                 modifyTransDateFlag: typeof $(this).data('modifyTransDate') !== 'undefined' ? $(this).data('modifyTransDate') : 0,
  1971.                 {# findValue: {{ consultantDetails.applicantId }}, #}
  1972.             })
  1973.                 .done(function (data) {
  1974.                     //    console.log(data);
  1975. //                                if (data.success == true) {
  1976. //                                    swal({
  1977. //                                        title: "Sweet!",
  1978. //                                        text: "Updated",
  1979. //                                        imageUrl: BaseURL + "images/thumbs-up.png"
  1980. //                                    });
  1981. ////                                    alertify.success("Order Confirmation Done");
  1982. //
  1983. //
  1984. //                                } else {
  1985. //                                    swal({
  1986. //                                        title: "Sorry!",
  1987. //                                        text: "Your Action failed !",
  1988. //                                        imageUrl: BaseURL + "images/Bee_Sad_Emote.png"
  1989. //                                    });
  1990. ////                                    alertify.success("Order Confirmation Failed");
  1991. //
  1992. ////                            $('#barcode_selector_cont').waitMe('hide');
  1993. //
  1994. //                                }
  1995.                 })
  1996.                 .fail(function () {
  1997.                 });
  1998.         });
  1999.         document.getElementById('promptForInfoModal').addEventListener('hidden.bs.modal', function (event) {
  2000.             $('.promptForInfoAutoUpdateData').not('.selectize-control').trigger('change');
  2001.         })
  2002.         promptForInfoModal.show();
  2003.         promptInfo_showTab(currentTab); // Display the current tab
  2004.     }
  2005.     function promptInfo_showTab(n) {
  2006.         // This function will display the specified tab of the form...
  2007. //         stepShowTab(n,'#promptForInfoModal')
  2008. // retrunb false;
  2009.         $('#promptForInfoModal .step').eq(n).show();
  2010.         //... and fix the Previous/Next buttons:
  2011.         if (n == 0) {
  2012.             document.getElementById("promptForInfo_prevBtn").style.display = "none";
  2013.         } else {
  2014.             document.getElementById("promptForInfo_prevBtn").style.display = "inline";
  2015.         }
  2016.         if (n == ($('#promptForInfoModal .step').length - 1)) {
  2017.             document.getElementById("promptForInfo_nextBtn").innerHTML = "Finish";
  2018.         } else {
  2019.             document.getElementById("promptForInfo_nextBtn").innerHTML = "Next";
  2020.         }
  2021.         //... and run a function that will display the correct step indicator:
  2022.         $('#promptForInfoModal .stepIndicator').removeClass('active')
  2023.         for (var gg = 0; gg <= n; gg++)
  2024.             $('#promptForInfoModal .stepIndicator').eq(gg).addClass('active')
  2025.     }
  2026.     function promptInfo_nextPrev(n) {
  2027.         // Exit the function if any field in the current tab is invalid:
  2028.         if (n == 1 && !promptInfo_validateForm()) return false;
  2029.         $('#promptForInfoModal  .step').eq(currentTab).hide();
  2030.         // Increase or decrease the current tab by 1:
  2031.         currentTab = currentTab + n;
  2032.         // if you have reached the end of the form...
  2033.         if (currentTab >= $('#promptForInfoModal .step').length) {
  2034.             // ... the form gets submitted:
  2035.             // //    console.log($('#selectPurchaseModal .step'))
  2036.             // alert($('#selectPurchaseModal .step').length)
  2037. //            document.getElementById("signUpForm").submit();
  2038.             promptForInfoModal.hide();
  2039.             return false;
  2040.         }
  2041.         // Otherwise, display the correct tab:
  2042.         promptInfo_showTab(currentTab);
  2043.     }
  2044.     function promptInfo_validateForm() {
  2045.         // This function deals with validation of the form fields
  2046.         var x, y, i, valid = true;
  2047. //        x = document.getElementsByClassName("step");
  2048. //        y = x[currentTab].getElementsByTagName("input");
  2049. //
  2050. //
  2051. //
  2052. //
  2053. //        // A loop that checks every input field in the current tab:
  2054. //        for (i = 0; i < y.length; i++) {
  2055. //            // If a field is empty...
  2056. //            if (y[i].value == "") {
  2057. //                // add an "invalid" class to the field:
  2058. //                y[i].className += " invalid";
  2059. //                // and set the current valid status to false
  2060. //                valid = false;
  2061. //            }
  2062. //        }
  2063. //        // If the valid status is true, mark the step as finished and valid:
  2064. //        if (valid) {
  2065. //            document.getElementsByClassName("stepIndicator")[currentTab].className += " finish";
  2066. //        }
  2067.         $('#promptForInfoModal .step input').each(function (indumia, elemele) {
  2068.             if ($(elemele).hasClass('required') && $(elemele).val() == '') {
  2069.                 $(elemele).addClass('invalid')
  2070.                 valid = false;
  2071.             } else {
  2072.             }
  2073.         })
  2074.         if (valid) {
  2075.             $('#promptForInfoModal .stepIndicator').eq(currentTab).addClass('finish')
  2076. //            document.getElementsByClassName("stepIndicator")[currentTab].className += " finish";
  2077.         }
  2078.         return valid; // return the valid status
  2079.     }
  2080.     function promptInfo_fixStepIndicator(n) {
  2081.         // This function removes the "active" class of all steps...
  2082.         var i, x = document.getElementsByClassName("stepIndicator");
  2083.         for (i = 0; i < x.length; i++) {
  2084.             x[i].className = x[i].className.replace(" active", "");
  2085.         }
  2086.         //... and adds the "active" class on the current step:
  2087.         x[n].className += " active";
  2088.     }
  2089.     function addScript(src) {
  2090.         var s = document.createElement('script');
  2091.         s.type = 'text/javascript';
  2092.         s.src = src;
  2093.         document.getElementsByTagName('head')[0].appendChild(s);
  2094.         return s;  // to remove it later
  2095.     }
  2096.     {% if system_type=='_BUDDYBEE_' %}
  2097.     function checkAndRedirectToMeeting(force) {
  2098.         var curr_ts_now = moment().unix();
  2099. //        if(CURRENT_ROUTE=='consultancy_session' && force==0)
  2100. //        {
  2101. //            if(typeof currentMeetingSessionId !== 'undefined')
  2102. //            {
  2103. //                if(upcomingNextMeetingIdForRedirect==currentMeetingSessionId)
  2104. //                {
  2105. //                  return;
  2106. //                }
  2107. //
  2108. //            }
  2109. //
  2110. //        }
  2111.         if (upcomingNextMeetingTsForRedirect != 0) {
  2112.             if (curr_ts_now >= (upcomingNextMeetingTsForRedirect - 120))   //redirect before 2 min
  2113.             {
  2114.                 window.localStorage.setItem('UNMId', 0);
  2115.                 window.localStorage.setItem('UNMTs', 0);
  2116.                 window.location.href = "{{ url('consultancy_session') }}/" + upcomingNextMeetingIdForRedirect;
  2117.             }
  2118.         }
  2119.     }
  2120.     function refreshUpcomingMeetingList() {
  2121. //        //    console.log('_______________________TRIGGERED_______________________')
  2122.         if (current_user_user_id != 0) {
  2123.             $.ajax({
  2124.                 url: BaseURL + "select_data_ajax_public",
  2125.                 type: 'POST',
  2126.                 dataType: 'json',
  2127.                 data: {
  2128.                     //returnJson: 1,
  2129.                     //sessionData: sessionData
  2130.                     query: '',
  2131.                     tableName: "entity_meeting_session",
  2132.                     valueField: "session_id",
  2133. //                        textField: "topic_name",
  2134.                     entity_group: 1,
  2135.                     selectorId: '_NO_NEED_',
  2136.                     isMultiple: 0,
  2137.                     dataId: 0,
  2138. //                        isMultiple: 0,
  2139.                     textField: "session_id",
  2140. //
  2141.                     andOrConditions: [
  2142.                         {type: "=", field: "consultant_id", value: current_user_user_id},
  2143.                         {type: "=", field: "student_id", value: current_user_user_id}
  2144.                     ],
  2145.                     mustConditions: [
  2146. //                        {type: "=", field: "is_paid_full", value: 1},
  2147.                         {type: ">=", field: "scheduled_time_ts", value: moment().unix()},
  2148.                         {# {% if not curr_data is empty %} #}
  2149. //                            {type: "!=", field: "applicant_id", value: $('#rescheduledStudentId').val()}
  2150.                         {# {% endif %} #}
  2151.                     ],
  2152.                     orderByConditions: [
  2153.                         {
  2154.                             field: 'scheduled_time_ts',
  2155.                             sortType: 'ASC'
  2156.                         }
  2157.                         {# {% if not curr_data is empty %} #}
  2158. //                            {type: "!=", field: "applicant_id", value: $('#rescheduledStudentId').val()}
  2159.                         {# {% endif %} #}
  2160.                     ],
  2161.                     convertToObject: [
  2162. //                            'accessories', 'issues'
  2163.                     ],
  2164.                     skipDefaultCompanyId: 1
  2165.                     // setDataForSingle: 1,
  2166.                 },
  2167.                 error: function () {
  2168.                     // callback();
  2169.                 },
  2170.                 success: function (res) {
  2171. //                        preliminary_reg_data_by_id = res.dataById
  2172.                     upcomingNextMeetingIdForRedirect = 0;
  2173.                     upcomingNextMeetingTsForRedirect = 0;
  2174.                     upcomingMeetingDataForRedirect = [];
  2175.                     for (var bogu = 0; bogu < res.data.length; bogu++) {
  2176.                         if (res.data[bogu].is_paid_full == 1) {
  2177.                             upcomingMeetingDataForRedirect.push({
  2178.                                 id: res.data[bogu].session_id,
  2179.                                 ts: res.data[bogu].scheduled_time_ts,
  2180.                             })
  2181.                         }
  2182.                     }
  2183.                     if (upcomingMeetingDataForRedirect.length != 0) {
  2184.                         upcomingNextMeetingIdForRedirect = upcomingMeetingDataForRedirect[0]['id'];
  2185.                         upcomingNextMeetingTsForRedirect = upcomingMeetingDataForRedirect[0]['ts'];
  2186.                     }
  2187.                     if (typeof refresh_upcoming_meeting_on_dashboard !== 'undefined')
  2188.                         refresh_upcoming_meeting_on_dashboard(res.data);
  2189. //                    if(CURRENT_ROUTE=='consultancy_session')
  2190. //                    {
  2191. //                        if(typeof currentMeetingSessionId !== 'undefined')
  2192. //                        {
  2193. //                            if(upcomingNextMeetingIdForRedirect==currentMeetingSessionId)
  2194. //                            {
  2195. //                                clearInterval(triggerRefreshUpcomingSession);
  2196. //                            }
  2197. //                            else
  2198. //                                checkAndRedirectToMeeting(0);
  2199. //
  2200. //                        }
  2201. //                        else
  2202. //                            checkAndRedirectToMeeting(0);
  2203. //
  2204. ////                        clearInterval(triggerRefreshUpcomingSession);
  2205. //
  2206. //                    }
  2207. //                    else
  2208.                     checkAndRedirectToMeeting(0);
  2209.                 }
  2210.             });
  2211.         }
  2212.     }
  2213.     function triggerRefreshUpcomingMeetingList(intervalHere) {
  2214.         if (current_user_user_id != 0) {
  2215.             triggerRefreshUpcomingSession = setInterval(function () {
  2216.                 refreshUpcomingMeetingList();
  2217.                 //seconds
  2218.             }, intervalHere)
  2219.         }
  2220.     }
  2221.     {% endif %}
  2222. </script>
  2223. {% if constant('ApplicationBundle\\Constants\\GeneralConstant::BUDDYBEE_SOCKET_ENABLED')==1 %}
  2224.     {# now check softone #}
  2225.     {# {% if notification_enabled==1 %} #}
  2226.     {% if session[UserConstants.USER_ID] is defined %}
  2227.         {% set buddybee_socket_server=constant('ApplicationBundle\\Constants\\GeneralConstant::BUDDYBEE_SOCKET_SERVER') %}
  2228.         {% set buddybee_socket_server_full = 'https://'~buddybee_socket_server %}
  2229.         {% if 'localhost:' in buddybee_socket_server %}
  2230.             {% set buddybee_socket_server_full = url_wo_port ~':'~ buddybee_socket_server|split('localhost:')[1] %}
  2231.         {% else %}
  2232.             {% set buddybee_socket_server_full = 'https://'~buddybee_socket_server %}
  2233.         {% endif %}
  2234.         {# <script type="text/javascript" src="{{ constant('ApplicationBundle\\Constants\\GeneralConstant::NOTIFICATION_SERVER')=='localhost:5000'?url_wo_port~':5000':constant('ApplicationBundle\\Constants\\GeneralConstant::NOTIFICATION_SERVER') }}/socket.io/socket.io.js"></script> #}
  2235.         {# <script type="text/javascript" src="{{ buddybee_socket_server_full }}/socket.io/socket.io.js"></script> #}
  2236.         <script type="text/javascript">
  2237.             var buddybeeKeepAliveCall = {};
  2238.             var lastActivityTs = 0;
  2239.             function refreshKeepAliveCall() {
  2240.                 buddybeeKeepAliveCall = setInterval(function () {
  2241.                     var nowTs = moment().unix(),
  2242.                         differenceFromStartTime = meetingStartTime.diff(now), // 86400000;
  2243.                         differenceFromEndTime = meetingEndTime.diff(now); // 86400000;
  2244.                     if (nowTs - lastActivityTs > 60) {
  2245.                         clearInterval(buddybeeKeepAliveCall);
  2246.                     } else {
  2247.                         buddybee_socket.emit('update_my_socket', {
  2248.                             userId: buddybee_socket_user_id,
  2249.                             token: buddybee_socket_user_session_token,
  2250.                         });
  2251.                     }
  2252.                     //seconds
  2253.                 }, 30000)
  2254.             }
  2255.             // //    console.log(io)
  2256.             function initiateBuddybeeSocket() {
  2257.                 lastActivityTs = moment().unix();
  2258.                 $.getScript('{{ buddybee_socket_server_full }}/socket.io/socket.io.js', function () {
  2259.                     {# $.getScript('{{ absolute_url(path('dashboard')) }}buddybee_assets/js/socket-io.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}', function () { #}
  2260.                     if (io) {
  2261.                         {# socket=io.connect( '{{ constant('ApplicationBundle\\Constants\\GeneralConstant::NOTIFICATION_SERVER') }}' ); #}
  2262.                         buddybee_socket = io.connect('{{ buddybee_socket_server_full }}');
  2263.                         buddybee_socket.emit('update_my_socket', {
  2264.                             userId: buddybee_socket_user_id,
  2265.                             token: buddybee_socket_user_session_token,
  2266.                             user_status: '_ON_',
  2267.                             force_broadcast: 1,
  2268.                         });
  2269. //                        buddybee_socket.on('_SEND_TEXT_TO_MOBILE_', function (dataObj) {
  2270. //                            //    console.log('_SEND_TEXT_TO_MOBILE__SEND_TEXT_TO_MOBILE__SEND_TEXT_TO_MOBILE__SEND_TEXT_TO_MOBILE__SEND_TEXT_TO_MOBILE__SEND_TEXT_TO_MOBILE__SEND_TEXT_TO_MOBILE__SEND_TEXT_TO_MOBILE_')
  2271. //                            //    console.log(dataObj)
  2272. //
  2273. //
  2274. //                        });
  2275.                         addScript("{{ absolute_url(path('dashboard')) }}buddybee_assets/js/generic_buddybee_sockets.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}")
  2276.                         {% if curr_route =='consultancy_session' or  curr_route =='_nothing_new_' %}
  2277.                         {% else %}
  2278.                         ifvisible.setIdleDuration(120);
  2279.                         ifvisible.onEvery(30, function () {
  2280. //                            //    console.log('not idle')
  2281.                             buddybee_socket.emit('update_my_socket', {
  2282.                                 userId: buddybee_socket_user_id,
  2283.                                 token: buddybee_socket_user_session_token,
  2284.                             });
  2285.                         });
  2286. //                        ifvisible.onEvery(300, function () {
  2287. ////                            //    console.log('not idle')
  2288. //                            buddybee_socket.emit('update_my_socket', {
  2289. //                                userId: buddybee_socket_user_id,
  2290. //                                token: buddybee_socket_user_session_token,
  2291. //                            });
  2292. //                        });
  2293.                         ifvisible.idle(function () {
  2294.                             document.body.style.opacity = 0.5;
  2295.                             buddybee_socket.emit('update_my_socket', {
  2296.                                 userId: buddybee_socket_user_id,
  2297.                                 token: buddybee_socket_user_session_token,
  2298.                                 user_status: '_AWAY_',
  2299.                                 force_broadcast: 1,
  2300.                             });
  2301.                         });
  2302.                         ifvisible.wakeup(function () {
  2303.                             document.body.style.opacity = 1;
  2304.                             buddybee_socket.emit('update_my_socket', {
  2305.                                 userId: buddybee_socket_user_id,
  2306.                                 token: buddybee_socket_user_session_token,
  2307.                                 user_status: '_ON_',
  2308.                                 force_broadcast: 1,
  2309.                             });
  2310.                         });
  2311.                         {% endif %}
  2312.                         // buddybee_socket.emit('update_my_socket', {
  2313.                         //     userId: buddybee_socket_user_id,
  2314.                         //     token: buddybee_socket_user_session_token,
  2315.                         // });
  2316.                         if (typeof pageSocketInit !== 'undefined')
  2317.                             pageSocketInit();
  2318.                         buddybee_socket.on('user_status_update', function (dataObj) {
  2319.                             //    console.log(dataObj)
  2320.                         });
  2321.                         buddybee_socket.on('_SOCKET_NOTIFICATION_HERE_', function (dataObj) {
  2322.                             if (typeof dataObj.targetRoute !== 'undefined') {
  2323.                                 if (dataObj.targetRoute == 'consultancy_session')
  2324.                                     refreshUpcomingMeetingList();
  2325.                             }
  2326.                             //    console.log(dataObj)
  2327.                         });
  2328.                         buddybee_socket.on('refresh_upcoming_meeting_list', function (dataObj) {
  2329.                             refreshUpcomingMeetingList();
  2330.                             //    console.log(dataObj)
  2331.                         });
  2332.                         //    console.log(buddybee_socket);
  2333.                     }
  2334.                 });
  2335.             }
  2336.         </script>
  2337.         {# <script src="{{ absolute_url(path('dashboard')) }}js/inno_notify.js?version={{ constant('ApplicationBundle\\Constants\\GeneralConstant::ENTITY_APP_VERSION') }}"></script> #}
  2338.     {% endif %}
  2339.     {# {% endif %} #}
  2340. {% endif %}
  2341. <script>
  2342.     var honeybeeLocale = 'en';
  2343.     jQuery.browser = {
  2344.         msie: false,
  2345. //        version: 0
  2346.     };
  2347.     function check_filters_default() {
  2348. //                    alert("here")
  2349.         $('.filter_this').hide()
  2350.         $('.filter_with_this').each(function () {
  2351. //            alert($(this).attr('id'))
  2352. //            alert($(this).val())
  2353.             if ($(this).attr('type') == 'checkbox' && $(this).prop('checked') == false)
  2354.                 return;
  2355.             if ($(this).attr('type') == 'radio' && $(this).is(':checked') == false)
  2356.                 return;
  2357.             var selector_name = '.filter_' + ($(this).attr('id')) + '_' + $(this).val();
  2358. //                        alert(selector_name)
  2359.             $(selector_name).show()
  2360.         })
  2361.     }
  2362.     var userAgent = navigator.userAgent || navigator.vendor || window.opera;
  2363.     $(document).ready(function () {
  2364.         {% if session['triggerPromptInfoModalFlag'] is defined %}
  2365.         {% if session['triggerPromptInfoModalFlag'] == 1 %}
  2366.         initiate_prompt_info_modal();
  2367.         {% endif %}
  2368.         {% endif %}
  2369.         {% if app.session.get('devAdminMode') ==1 %}
  2370.         {% endif %}
  2371.         $('.book_now_cta').click(function (ev) {
  2372.             ev.preventDefault();
  2373.             selectPurchaseModal.show();
  2374.         })
  2375.         stepShowTab(currentTabSelectPurchaseModal, '#selectPurchaseModal')
  2376.         $(document).on('click', '#selectPurchaseModal .routineTable tbody .icon-check.modifiable', function () {
  2377.             if ($(this).hasClass('isChecked'))
  2378.                 $(this).removeClass('isChecked');
  2379.             else
  2380.                 $(this).addClass('isChecked')
  2381.             recalculateRoutinePackageOnPurchaseModal();
  2382.         })
  2383.         $(document).on('click', '.offCanvasCalendarTrigger', function () {
  2384.             refreshOffCanvasCalendar()
  2385.         })
  2386.         $(document).on('click', '.box-selector', function () {
  2387.             $('.' + $(this).data('genClass')).removeClass('active')
  2388.             $(this).addClass('active')
  2389.         })
  2390.         $(document).on('click', '#selectPurchaseModal .prevBtn', function () {
  2391.             //validate action here
  2392.             // if (!validateForm()) return false;
  2393.             stepShowTab('-1', '#selectPurchaseModal')
  2394.         })
  2395.         $(document).on('click', '#selectPurchaseModal .stepIndicator', function () {
  2396.             //validate action here
  2397.             // if (!validateForm()) return false;
  2398.             stepShowTab($(this).data('seqId'), '#selectPurchaseModal')
  2399.         })
  2400.         $(document).on('click', '#selectPurchaseModal .nextBtn', function () {
  2401.             //validate action here
  2402.             // if (!validateForm()) return false;
  2403.             stepShowTab('+1', '#selectPurchaseModal')
  2404.         })
  2405.         $(document).on('click', '#selectPurchaseModal .cn_selector', function () {
  2406.             populateTopicListOnPurchaseModal($(this).data('id'));
  2407.             stepShowTab('+1', '#selectPurchaseModal')
  2408.             if ($('.box-selector.cn_selector.active').length)
  2409.                 $('.cntry_p span').text($('.box-selector.cn_selector.active .title').text())
  2410.         })
  2411.         $(document).on('click', '#selectPurchaseModal .tp_selector', function () {
  2412.             refreshRoutinePackageListOnPurchaseModal($(this).data('id'));
  2413.             populateConsultantListOnPurchaseModal($(this).data('id'));
  2414.             stepShowTab('+1', '#selectPurchaseModal');
  2415.             if ($('.box-selector.tp_selector.active').length)
  2416.                 $('.topic_p span').text($('.box-selector.tp_selector.active .title').text() + ' ( ' + $('.box-selector.tp_selector.active .sub-title').text() + ' )')
  2417.         })
  2418.         $(document).on('click', '#selectPurchaseModal .cons_selector', function () {
  2419.             populateScheduleListOnPurchaseModal($(this).data('id'));
  2420.             stepShowTab('+1', '#selectPurchaseModal')
  2421.             if ($('.box-selector.cons_selector.active').length)
  2422.                 $('.cons_p span').text($('.box-selector.cons_selector.active .title').text())
  2423.         })
  2424.         $(document).on('click', '#selectPurchaseModal .sch_selector_mon', function () {
  2425.             $('#selectPurchaseModal .sch_selector_day').hide();
  2426.             // alert($(this).data('id'))
  2427.             $('#selectPurchaseModal .sch_selector_day.sch_mon_' + $(this).data('id')).show();
  2428.             // populateScheduleListOnPurchaseModal($(this).data('id'));
  2429.             // stepShowTab('+1','#selectPurchaseModal')
  2430.         })
  2431.         $(document).on('click', '#selectPurchaseModal .sch_selector_day', function () {
  2432.             $('#selectPurchaseModal .sch_selector_time').hide();
  2433.             $('#selectPurchaseModal .sch_selector_time.sch_day_' + $(this).data('id')).show();
  2434.             // populateScheduleListOnPurchaseModal($(this).data('id'));
  2435.             // stepShowTab('+1','#selectPurchaseModal')
  2436.         })
  2437.         $(document).on('click', '#selectPurchaseModal .sch_selector_time', function () {
  2438.             // alert('here')
  2439.             $('#selectPurchaseModal .sch_selector_mon.sch_mon_' + moment.unix($(this).data('id')).format('YYYY_MM')).trigger('click');
  2440.             $('#selectPurchaseModal .sch_selector_day.sch_day_' + moment.unix($(this).data('id')).format('YYYY_MM_DD')).trigger('click');
  2441.         })
  2442.         if (CURRENT_ROUTE == 'consultancy_session') {
  2443. //            if (typeof currentMeetingSessionId !== 'undefined') {
  2444. //                if (upcomingNextMeetingIdForRedirect == currentMeetingSessionId) {
  2445. //                    clearInterval(triggerRefreshUpcomingSession);
  2446. //                }
  2447. //                else
  2448. //                    checkAndRedirectToMeeting(0);
  2449. //
  2450. //            }
  2451. //            else
  2452. //                checkAndRedirectToMeeting(0);
  2453. //                        clearInterval(triggerRefreshUpcomingSession);
  2454.         } else
  2455.             setTimeout(function () {
  2456.                 refreshUpcomingMeetingList();
  2457.                 triggerRefreshUpcomingMeetingList(60000);
  2458.             }, 20000);
  2459.         // Windows Phone must come first because its UA also contains "Android"
  2460.         // alert(userAgent);
  2461.         if ((currTsForDlM - deepLinkModalLastShown) > (3600 * 24)) {
  2462.             // alert('in DLM');
  2463.             if (/windows phone/i.test(userAgent)) {
  2464. //                alert("Android");
  2465.                 $('.deep_link_choice').hide();
  2466.                 $('.deep_link_choice._AND_').show();
  2467.                 // $('.deep_link_choice._IPHONE_').show();
  2468.                 $('.deep_link_choice._BROWSER_').show();
  2469.                 deepLinkModal.show()
  2470.             }
  2471.             if (/Android/i.test(userAgent)) {
  2472. //                alert("Android");
  2473.                 $('.deep_link_choice').hide();
  2474.                 $('.deep_link_choice._AND_').show();
  2475.                 // $('.deep_link_choice._IPHONE_').show();
  2476.                 $('.deep_link_choice._BROWSER_').show();
  2477.                 deepLinkModal.show()
  2478.             }
  2479.             // iOS detection from: http://stackoverflow.com/a/9039885/177710
  2480.             if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
  2481. //                alert("iOS");
  2482.                 $('.deep_link_choice').hide();
  2483.                 // $('.deep_link_choice._AND_').show();
  2484.                 $('.deep_link_choice._IPHONE_').show();
  2485.                 $('.deep_link_choice._BROWSER_').show();
  2486.                 deepLinkModal.show()
  2487.             }
  2488.             window.localStorage.setItem('deepLinkModalLastShown', currTsForDlM)
  2489.         }
  2490.         // deepLinkModal.show()
  2491.         $('#buddybee_preloader').fadeOut('slow', function () {
  2492.             $(this).remove();
  2493.         });
  2494.         if (typeof initiateOtpModal !== 'undefined') {
  2495. //            initiateOtpModal()
  2496.         }
  2497.         {% if system_type=='_BUDDYBEE_' %}
  2498.         $(document).on('click', 'a', function (e) {
  2499.             if ($(this).attr('href') == '{{ url('under_construction') }}') {
  2500.                 e.preventDefault();
  2501.                 swal({
  2502.                     title: "Oh Snap!",
  2503.                     type: 'warning',
  2504.                     text: "This page is Under Construction.",
  2505.                     timer: 3000,
  2506.                     showConfirmButton: false
  2507.                 });
  2508.             }
  2509.             if ($(this).attr('href') == '{{ url('user_logout') }}') {
  2510. //                e.preventDefault();
  2511.                 if (buddybee_socket != '') {
  2512.                     buddybee_socket.emit('update_my_socket', {
  2513.                         userId: buddybee_socket_user_id,
  2514.                         user_status: '_OFF_',
  2515.                         force_broadcast: 1,
  2516.                     });
  2517.                 }
  2518.             }
  2519.         });
  2520.         {% endif %}
  2521.         $(document).on('click', '.admin-menu-toggler', function (e) {
  2522.             $('.buddybee_admin_sidebar').toggle()
  2523.         })
  2524.         $(document).on('click', 'a.book_now_cta', function (e) {
  2525. //            e.preventDefault();
  2526. //            bookNowModal.show()
  2527.         })
  2528.         $(document).on('change', '.filter_with_this', function () {
  2529.             check_filters_default()
  2530.         })
  2531.         $(document).on('click', '.btn_deep_link_selector', function () {
  2532.             if ($(this).attr('data-deeplink-choice') == '_AND_')
  2533.                 window.location.href = "https://play.google.com/store/apps/details?id=eu.buddybee.consultancy";
  2534.             // deepLinkModal.hide()
  2535.         })
  2536.         check_filters_default();
  2537.         $('#currentClientTime').val(moment().format('YYYY-MM-DD HH:mm:ss'))
  2538.         {% if constant('ApplicationBundle\\Constants\\GeneralConstant::BUDDYBEE_SOCKET_ENABLED')==1 %}
  2539.         {# now check softone #}
  2540.         {# {% if notification_enabled==1 %} #}
  2541.         {% if session[UserConstants.USER_ID] is defined %}
  2542.         initiateBuddybeeSocket();
  2543.         {% endif %}
  2544.         {% endif %}
  2545.         $('.schedule_date_picker').not('.datepicker').bootstrapMaterialDatePicker({
  2546.             format: 'MMMM DD, YYYY',
  2547.             clearButton: true,
  2548.             weekStart: 6,
  2549.             time: false,
  2550.             switchOnClick: true,
  2551.             monthPicker: true
  2552.             // format: 'HH:mm',
  2553.             // clearButton: true,
  2554.             // date: false,
  2555.             // switchOnClick:true
  2556.         });
  2557.         $('.schedule_date_time_picker').not('.datepicker').bootstrapMaterialDatePicker({
  2558.             //format: 'dddd DD MMMM YYYY',
  2559.             // format: ' HH:mm',
  2560.             // clearButton: true,
  2561.             // weekStart: 6,
  2562.             // time: true,
  2563.             // switchOnClick: true,
  2564.             // monthPicker: false
  2565.             format: 'HH:mm',
  2566.             clearButton: true,
  2567.             date: false,
  2568.             switchOnClick: true
  2569.         });
  2570.         {# alert('{{ curr_route }}') #}
  2571.         {% if curr_route=='applicant_dashboard' or  curr_route=='dashboard' or curr_route=='consultant_dashboard' or curr_route=='buddybee_admin_dashboard' %}
  2572.         {% if session[UserConstants.USER_ID] is defined %}
  2573.         {% if session[UserConstants.USER_ID]!=0 %}
  2574.         var globLsDataStr = window.localStorage.getItem('lsData');
  2575.         var globLsData = {};
  2576.         if (globLsDataStr != 'null' && globLsDataStr != null)
  2577.             globLsData = JSON.parse(globLsDataStr);
  2578.         //    console.log(globLsData)
  2579.         if (typeof globLsData['checkoutPending'] !== 'undefined') {
  2580.             if (globLsData['checkoutPending'] == 1)
  2581.                 window.location.href = "{{ url('pricing_plan_page') }}?autoRedirected=1";
  2582.         }
  2583.         {% endif %}
  2584.         {% endif %}
  2585.         {% endif %}
  2586. //        //    console.log(globLsData)
  2587.         $('#small_search_button').click(function () {
  2588. //            $( '.small_search_content .selectize-control.searchbox.small_search' ).animate({
  2589. //                opacity: 0.25,
  2590. //                left: "+=50",
  2591. //                width: "0"
  2592. //            }, 5000, function() {
  2593. //                // Animation complete.
  2594. //            });
  2595.             if ($('.small_search_content .selectize-control.searchbox.small_search').hasClass('search_shown')) {
  2596. //                $('.small_search_content .selectize-control.searchbox.small_search').hide();
  2597.                 $('.small_search_content .selectize-control.searchbox.small_search').removeClass('search_shown');
  2598. //                $('.searchbar-content.small_search_content').css('border','1px solid #1d5b9e33;');
  2599.                 $('.small_search_content .selectize-control.searchbox.small_search').animate({
  2600. //                opacity: 0.25,
  2601. //                left: "+=50",
  2602.                     width: "0"
  2603.                 }, 500, function () {
  2604.                     // Animation complete.
  2605.                     $('.small_search_content .selectize-control.searchbox.small_search').hide();
  2606.                     $('.small_search_content .selectize-control.searchbox.small_search').removeClass('search_shown');
  2607.                     $('.searchbar-content.small_search_content').removeClass('search_shown');
  2608.                 });
  2609.             } else {
  2610. //                $('.small_search_content .selectize-control.searchbox.small_search').show();
  2611. //                $('.searchbar-content.small_search_content').css('border','1px solid #1d5b9e33;');
  2612.                 $('.small_search_content .selectize-control.searchbox.small_search').css('display', 'inline-flex')
  2613.                 $('.small_search_content .selectize-control.searchbox.small_search').addClass('search_shown');
  2614.                 $('.searchbar-content.small_search_content').addClass('search_shown');
  2615.                 $('.small_search_content .selectize-control.searchbox.small_search').animate({
  2616. //                opacity: 0.25,
  2617. //                left: "+=50",
  2618.                     width: "224"
  2619.                 }, 500, function () {
  2620.                     // Animation complete.
  2621. //                    $('.searchbar-content.small_search_content').css('border','1px solid #1d5b9e33;');
  2622.                 });
  2623.             }
  2624.         })
  2625.         {# var small_search_box=$(".searchbox").selectize({ #}
  2626.         {# valueField: "url", #}
  2627.         {# labelField: "name", #}
  2628.         {# searchField: "name", #}
  2629.         {# create: false, #}
  2630.         {# preload:true, #}
  2631.         {# score: function (search) { #}
  2632.         {# var score = this.getScoreFunction(search); #}
  2633.         {# return function (item) { #}
  2634.         {# return score(item) * (1 + Math.min(item.watchers / 100, 1)); #}
  2635.         {# }; #}
  2636.         {# }, #}
  2637.         {# onChange: function (value) { #}
  2638.         {# if (!value.length) return; #}
  2639.         {# window.location.href=value; #}
  2640.         {# //addProductToListById(value); #}
  2641.         {# // alert(value) #}
  2642.         {# // small_search_box.clear() #}
  2643.         {# // small_search_box.focus() #}
  2644.         {# }, #}
  2645.         {# load: function (query, callback) { #}
  2646.         {# if (!query.length) return callback(); #}
  2647.         {# $.ajax({ #}
  2648.         {# url: "{{ url('search_buddybee') }}/" + encodeURIComponent(query), #}
  2649.         {# type: "GET", #}
  2650.         {# error: function () { #}
  2651.         {# callback(); #}
  2652.         {# }, #}
  2653.         {# success: function (res) { #}
  2654.         {# //    console.log(res.data) #}
  2655.         {# callback(res.data.slice(0, 10)); #}
  2656.         {# }, #}
  2657.         {# }); #}
  2658.         {# }, #}
  2659.         {# })[0].selectize; #}
  2660.         {% if system_type=='_BUDDYBEE_' %}
  2661.         var small_search_box = $(".searchbox").selectize({
  2662.             valueField: "url",
  2663.             labelField: "name",
  2664.             searchField: "name",
  2665.             create: false,
  2666.             maxItems: 1,
  2667.             preload: 'focus',
  2668.             render: {
  2669.                 option: function (item, escape) {
  2670.                     return (
  2671.                         '<div style="padding: 10px;">' +
  2672.                         '<span class="title">' +
  2673.                         '<span class="name" style="display:block;font-size: 18px;">' +
  2674.                         //                        '<i class="icon ' +
  2675.                         //                        (item.type == 1 ? "fa fa-list" : "fa fa-clock") +
  2676.                         //                        '"></i>' +
  2677.                         //                        "<div class='form-control mainDiv'>" +
  2678.                         //                        '<span class="name">' +
  2679.                         escape(item.name) +
  2680.                         "</span>" +
  2681.                         '<span class="description" style="padding-top:2px; display: block">' +
  2682.                         escape(item.description) +
  2683.                         "</span>" +
  2684.                         // '<span class="description">' +
  2685.                         // escape(item.description) +
  2686.                         "</span>" +
  2687.                         "</div>"
  2688.                     );
  2689.                     // return (
  2690.                     //     "<div>" +
  2691.                     //     '<span class="title">' +
  2692.                     //     '<span class="name"><i class="icon ' +
  2693.                     //     (item.type == 1 ? "fa fa-list" : "fa fa-clock") +
  2694.                     //     '"></i>' +
  2695.                     //     escape(item.name) +
  2696.                     //     "</span>" +
  2697.                     //
  2698.                     //     "</span>" +
  2699.                     //     '<span class="description">' +
  2700.                     //     escape(item.description) +
  2701.                     //     "</span>" +
  2702.                     //
  2703.                     //     "</div>"
  2704.                     // );
  2705.                 },
  2706.             },
  2707.             onChange: function (value) {
  2708.                 if (!value.length) return;
  2709.                 var sval = value
  2710.                 small_search_box.setValue([])
  2711.                 window.location.href = sval;
  2712.                 //addProductToListById(value);
  2713.                 // alert(value)
  2714.                 // small_search_box.clear()
  2715.                 // small_search_box.focus()
  2716.             },
  2717.             load: function (query, callback) {
  2718. //                if (!query.length) return callback();
  2719.                 $.ajax({
  2720.                     url: "{{ url('search_buddybee') }}/" + encodeURIComponent(query),
  2721.                     type: "GET",
  2722.                     error: function () {
  2723.                         callback();
  2724.                     },
  2725.                     success: function (res) {
  2726.                         //    console.log(res.data)
  2727.                         callback(res.data);
  2728.                     },
  2729.                 });
  2730.             },
  2731.         })[0].selectize;
  2732.         {% endif %}
  2733.         $('.selectize-control.searchbox .selectize-input.items input').addClass('trn')
  2734.         $('.selectize-control.searchbox .selectize-input.items input').attr('data-trn-key', '_SMALL_SEARCH_PH_');
  2735.         _t = $('body').translate({
  2736.             lang: "en",
  2737.             t: lang_pack
  2738.         });
  2739.         if (typeof (window.localStorage) !== "undefined")
  2740.             honeybeeLocale = window.localStorage.getItem('honeybeeLocale');
  2741. //    alert(honeybeeLocale)
  2742.         if (honeybeeLocale !== "undefined" && honeybeeLocale != 'null' && honeybeeLocale != null) {
  2743.             _t.lang(honeybeeLocale);
  2744.         } else {
  2745.             honeybeeLocale = 'en'
  2746.         }
  2747.         $(".locale_changer").click(function (ev) {
  2748.             var lang = $(this).attr("data-locale");
  2749.             _t.lang(lang);
  2750.             honeybeeLocale = lang;
  2751.             $(".locale_changer").removeClass('activeLocale')
  2752.             $(this).addClass('activeLocale');
  2753.             $(".curr_locale_text").text($(this).text());
  2754.             if (typeof (window.localStorage) !== "undefined")
  2755.                 honeybeeLocale = window.localStorage.setItem('honeybeeLocale', honeybeeLocale);
  2756. //            //    console.log(lang);
  2757.             ev.preventDefault();
  2758.         });
  2759.         {% if system_type=='_BUDDYBEE_' %}
  2760.         if ($('#viewAsId').length) {
  2761.             $('#viewAsId').selectize({
  2762.                 placeholder: 'Choose User',
  2763.                 multiple: false,
  2764. //            options: APTL.productListArray,
  2765.                 options: [],
  2766.                 valueField: 'value',
  2767.                 labelField: 'text',
  2768.                 searchField: ['text', 'value', 'phone', 'email', 'o_auth_email', 'firstname', 'lastname'],
  2769.                 preload: 'focus',
  2770.                 render: {
  2771.                     option: function (item, escape) {
  2772.                         return (
  2773.                             '<div style="padding: 2px; display:flex;">' +
  2774.                             '<span class="title" style="    min-width: 2rem;display: inline-block;">' +
  2775.                             ((item.image != null && item.image != '') ? '<img style="border-radius: 50%;height: 2rem;width: 2rem;" src="' + item.image + '" alt="" class="img-fluid" >' :
  2776.                                 '<img style="border-radius: 50%;height: 2rem;width: 2rem;" src="{{ absolute_url(path('dashboard')) }}buddybee_assets/images/consultant_image_ph_male.png" alt="" class="img-fluid" >') +
  2777.                             "</span>" +
  2778.                             '<span class="name" style="padding-left:0.5rem;font-size: 12px; display:inline-block;">' +
  2779.                             //                        '<i class="icon ' +
  2780.                             //                        (item.type == 1 ? "fa fa-list" : "fa fa-clock") +
  2781.                             //                        '"></i>' +
  2782.                             //                        "<div class='form-control mainDiv'>" +
  2783.                             //                        '<span class="name">' +
  2784.                             '#' + escape(item.applicant_id) + ' ' + escape(item.firstname) + ' ' + escape(item.lastname) + '<br> ' + escape(item.phone) + ' - ' + escape(item.o_auth_email) +
  2785.                             "</span>" +
  2786.                             // '<span class="description">' +
  2787.                             // escape(item.description) +
  2788.                             //                    "</span>" +
  2789.                             "</div>"
  2790.                         );
  2791.                         // return (
  2792.                         //     "<div>" +
  2793.                         //     '<span class="title">' +
  2794.                         //     '<span class="name"><i class="icon ' +
  2795.                         //     (item.type == 1 ? "fa fa-list" : "fa fa-clock") +
  2796.                         //     '"></i>' +
  2797.                         //     escape(item.name) +
  2798.                         //     "</span>" +
  2799.                         //
  2800.                         //     "</span>" +
  2801.                         //     '<span class="description">' +
  2802.                         //     escape(item.description) +
  2803.                         //     "</span>" +
  2804.                         //
  2805.                         //     "</div>"
  2806.                         // );
  2807.                     },
  2808.                 },
  2809.                 onChange: function (value) {
  2810.                     if (!value.length) return;
  2811.                     window.location.href = '{{ absolute_url(path('view_as_user_buddybee')) }}/' + value;
  2812.                     //addProductToListById(value);
  2813.                     // alert(value)
  2814.                     // small_search_box.clear()
  2815.                     // small_search_box.focus()
  2816.                 },
  2817.                 load: function (query, callback) {
  2818. //                        if (!query.length) return // callback();
  2819.                     if (!query.length) query = '_EMPTY_';
  2820.                     var pika_ind_id = $($(this)[0].$input["0"]).attr('data-id')
  2821.                     $.ajax({
  2822.                         url: BaseURL + "select_data_ajax_public",
  2823.                         type: 'POST',
  2824.                         dataType: 'json',
  2825.                         data: {
  2826.                             //returnJson: 1,
  2827.                             //sessionData: sessionData
  2828.                             query: query,
  2829.                             tableName: "entity_applicant_details",
  2830.                             valueField: "applicant_id",
  2831. //                        textField: "topic_name",
  2832.                             entity_group: 1,
  2833.                             selectorId: $($(this)[0].$input["0"]).attr('id'),
  2834.                             isMultiple: 0,
  2835.                             dataId: pika_ind_id,
  2836. //                        isMultiple: 0,
  2837.                             textField: "rendered_text",
  2838. //
  2839.                             renderTextFormat: " __firstname__  __lastname__",
  2840.                             andOrConditions: [
  2841.                                 {type: "like", field: "firstname", value: query},
  2842.                                 {type: "like", field: "lastname", value: query},
  2843.                                 {type: "like", field: "phone", value: query},
  2844.                                 {type: "like", field: "email", value: query},
  2845.                                 {type: "=", field: "applicant_id", value: isNaN(query) ? '' : query}
  2846.                             ],
  2847.                             mustConditions: [
  2848.                                 {% if BUDDYBEE_ADMIN_LEVEL>=5 %}
  2849.                                 {% elseif BUDDYBEE_ADMIN_LEVEL >=1 %}
  2850.                                 {
  2851.                                     type: "in",
  2852.                                     field: "is_admin",
  2853.                                     value: [0, 'null']
  2854.                                 },
  2855.                                 {
  2856.                                     type: "in",
  2857.                                     field: "assigned_sales_representative_id",
  2858.                                     value: [0, 'null',{{ session[UserConstants.USER_ID] }}]
  2859.                                 },
  2860.                                 {% else %}
  2861.                                 {% endif %}
  2862.                                 // {type: "=", field: "is_consultant", value: 1},
  2863.                                 {# {% if not curr_data is empty %} #}
  2864. //                            {type: "!=", field: "applicant_id", value: $('#rescheduledStudentId').val()}
  2865.                                 {# {% endif %} #}
  2866.                             ],
  2867.                             convertToObject: [
  2868. //                            'accessories', 'issues'
  2869.                             ],
  2870.                             skipDefaultCompanyId: 1
  2871.                             // setDataForSingle: 1,
  2872.                         },
  2873.                         error: function () {
  2874.                             // callback();
  2875.                         },
  2876.                         success: function (res) {
  2877. //                        preliminary_reg_data_by_id = res.dataById
  2878.                             callback(res.data);
  2879.                             if (res.setValueArray.length != 0 && res.selectorId != '') {
  2880.                                 if (res.isMultiple == 1)
  2881.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValueArray)
  2882.                                 else
  2883.                                     $('#' + res.selectorId).selectize()[0].selectize.setValue(res.setValue)
  2884.                             }
  2885. //                        alert('pika master')
  2886.                         }
  2887.                     });
  2888.                 },
  2889.             })[0].selectize;
  2890.         }
  2891.         $('.recharge_submit').click(function (e) {
  2892.             e.preventDefault();
  2893.             $('#rechargeForm').submit();
  2894.         });
  2895. //        alert('.locale_changer.'+honeybeeLocale)
  2896. //        alert($('.locale_changer.'+honeybeeLocale).text())
  2897.         $(".curr_locale_text").text($('.locale_changer.' + honeybeeLocale).text());
  2898.         {% endif %}
  2899.         $('.add_basic_day_picker').not('.datepicker').bootstrapMaterialDatePicker({
  2900.             //format: 'dddd DD MMMM YYYY',
  2901.             format: 'MMMM DD, YYYY HH:mm',
  2902.             clearButton: true,
  2903.             weekStart: 6,
  2904.             time: true,
  2905.             switchOnClick: true,
  2906.             monthPicker: true
  2907.         });
  2908.     });
  2909. </script>
  2910. </html>