/*file: badge_script.js*/
devent.click( "._sve_btn_bdge521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#bdge_ad_frm" )[ 0 ] );
  $data_ref.append( "action", "badge_add_edit_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      popup_close();
      _load_data_sect.init();
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );
devent.click( "._dt_doc_typ_bdg11", function ( e, $this ) {
  var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
  var $data_ref = {
    action: "add_doc_typ_bdg",
    data: this_id
  };
  popup_init( undefined, undefined, true );
  data_mn_popup( $data_ref );

} );


devent.click( "._sv_docTyp_btn521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#doc_type_frm" )[ 0 ] );
  $data_ref.append( "action", "badge_lbl_add_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      var data_ref = {
        action: "add_doc_typ_bdg",
        data: result.data_id
      };
      data_mn_popup( data_ref );
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );/*file: community_script.js*/
devent.click("._sve_btn_cmty521", function(e, $this) {
  _formLoader_load(true, $this, "SAVING...");
  var $data_ref = new FormData($("#commty_ad_frm")[0]);
  $data_ref.append("action", "community_add_edit_funct");
  _load_http_form.json($data_ref, pathname + "request", function(result) {
    _formLoader_load(false);
    $this.html("SAVE");
    if (result.status == "success") {
      popup_close();
      _load_data_sect.init();
      messagebox(result.status, result.msg, 3000);
    }
    if (result.status == "error") {
      messagebox(result.status, result.msg, 3000);
    }
  });
});
/*file: country_script.js*/
devent.click("._sve_btn_cntry521", function(e, $this) {
    _formLoader_load(true, $this, "SAVING...");
    var $data_ref = new FormData($("#cntry_add_frm")[0]);
    $data_ref.append("action", "country_add_edit_funct");
    _load_http_form.json($data_ref, pathname + "request", function(result) {
      _formLoader_load(false);
      $this.html("SAVE");
      if (result.status == "success") {
        popup_close();
        _load_data_sect.init();
        messagebox(result.status, result.msg, 3000);
      }
      if (result.status == "error") {
        messagebox(result.status, result.msg, 3000);
      }
    });
  });
  /*file: dosham_script.js*/
devent.click( "._sve_btn_dshm521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#dshm_ad_frm" )[ 0 ] );
  $data_ref.append( "action", "doshm_add_edit_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      popup_close();
      _load_data_sect.init();
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );
devent.click( "._dt_dshm_typ11", function ( e, $this ) {
  var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
  var $data_ref = {
    action: "dosham_lbl_chnge_pop",
    data: this_id
  };
  popup_init( undefined, undefined, true );
  data_mn_popup( $data_ref );
} );


devent.click( "._sv_doshm_dt_btn521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#lbl_data_frm" )[ 0 ] );
  $data_ref.append( "action", "dosham_lbl_add_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      var data_ref = {
        action: "dosham_lbl_chnge_pop",
        data: result.ref_dosham_id
      };
      data_mn_popup( data_ref );
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );/*file: education_script.js*/
devent.click( "._sve_btn_edu521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#edu_ad_frm" )[ 0 ] );
  $data_ref.append( "action", "edu_add_edit_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      popup_close();
      _load_data_sect.init();
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );
devent.click( "._dt_edu_det531", function ( e, $this ) {
  var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
  var $data_ref = {
    action: "add_edu_type_pop",
    data: this_id
  };
  popup_init( undefined, undefined, true );
  data_mn_popup( $data_ref );

} );

devent.click( "._sv_edtDet_btn521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#edu_det_frm" )[ 0 ] );
  $data_ref.append( "action", "edu_lbl_add_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      var data_ref = {
        action: "add_edu_type_pop",
        data: result.data_id
      };
      data_mn_popup( data_ref );
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );/*file: faq_script.js*/
devent.click( "._sve_btn_faq521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#faq_ad_frm" )[ 0 ] );
  $data_ref.append( "action", "faq_add_edit_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      popup_close();
      _load_data_sect.init();
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );/*file: hmt_write_script.js*/
devent.click( "._sve_btn_hmtw521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#hmt_wrt_ad_frm" )[ 0 ] );
  $data_ref.append( "action", "hmt_wrt_add_edit_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      popup_close();
      _load_data_sect.init();
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );/*file: lang_script.js*/
devent.click("._sve_btn_lang521", function(e, $this) {
    _formLoader_load(true, $this, "SAVING...");
    var $data_ref = new FormData($("#lang_add_frm")[0]);
    $data_ref.append("action", "lang_add_edit_funct");
    _load_http_form.json($data_ref, pathname + "request", function(result) {
      _formLoader_load(false);
      $this.html("SAVE");
      if (result.status == "success") {
        popup_close();
        _load_data_sect.init();
        messagebox(result.status, result.msg, 3000);
      }
      if (result.status == "error") {
        messagebox(result.status, result.msg, 3000);
      }
    });
  });
  /*file: location_script.js*/
devent.click("._sve_btn_loc521", function(e, $this) {
    _formLoader_load(true, $this, "SAVING...");
    var $data_ref = new FormData($("#loc_add_frm")[0]);
    $data_ref.append("action", "loc_add_edit_funct");
    _load_http_form.json($data_ref, pathname + "request", function(result) {
      _formLoader_load(false);
      $this.html("SAVE");
      if (result.status == "success") {
        popup_close();
        _load_data_sect.init();
        messagebox(result.status, result.msg, 3000);
      }
      if (result.status == "error") {
        messagebox(result.status, result.msg, 3000);
      }
    });
  });
  /*file: profession_script.js*/
devent.click( "._sve_btn_prof521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#prof_ad_frm" )[ 0 ] );
  $data_ref.append( "action", "prof_add_edit_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      popup_close();
      _load_data_sect.init();
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );
devent.click( "._dt_prof_typ531", function ( e, $this ) {
  var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
  var $data_ref = {
    action: "add_prof_type_pop",
    data: this_id
  };
  popup_init( undefined, undefined, true );
  prof_typ_popup( $data_ref );

} );

function prof_typ_popup( $data_ref ) {
  _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
    popup_data( result, function ( resp ) {
      if ( resp.current_status == "success" ) {
        componentHandler.upgradeDom();
      }
    } );
  } );
}
devent.click( "._sv_profTp_btn521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#prof_type_frm" )[ 0 ] );
  $data_ref.append( "action", "prof_lbl_add_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      var data_ref = {
        action: "add_prof_type_pop",
        data: result.data_id
      };
      prof_typ_popup( data_ref );
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );/*file: raasi_script.js*/
devent.click( "._sve_btn_rsi521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#rasi_ad_frm" )[ 0 ] );
  $data_ref.append( "action", "rasi_add_edit_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      popup_close();
      _load_data_sect.init();
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );
devent.click( "._dt_lbl_zod11", function ( e, $this ) {
  var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
  var $data_ref = {
    action: "lbl_popup_templ",
    data: this_id
  };
  popup_init( undefined, undefined, true );
  data_mn_popup( $data_ref );

} );

function data_mn_popup( $data_ref ) {
  _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
    popup_data( result, function ( resp ) {
      if ( resp.current_status == "success" ) {
        componentHandler.upgradeDom();
        search_snippet_init();
      }
    } );
  } );
}
devent.click( "._sv_rsilbl_btn521", function ( e, $this ) {
  _formLoader_load( true, $this, "SAVING..." );
  var $data_ref = new FormData( $( "#lbl_data_frm" )[ 0 ] );
  $data_ref.append( "action", "rasi_lbl_add_funct" );
  _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
    _formLoader_load( false );
    $this.html( "SAVE" );
    if ( result.status == "success" ) {
      var data_ref = {
        action: "lbl_popup_templ",
        data: result.ref_rasi_id
      };
      data_mn_popup( data_ref );
      messagebox( result.status, result.msg, 3000 );
    }
    if ( result.status == "error" ) {
      messagebox( result.status, result.msg, 3000 );
    }
  } );
} );/*file: star_script.js*/
devent.click( "._sv_btn_star521", function ( e, $this ) {
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#star_dt_frm" )[ 0 ] );
    $data_ref.append( "action", "star_add_edit_funct" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        $this.html( "SAVE" );
        if ( result.status == "success" ) {
            popup_close();
            _load_data_sect.init();
            messagebox( result.status, result.msg, 3000 );
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 3000 );
        }
    } );
} );
devent.click( "._dt_str_lbl523", function ( e, $this ) {
    var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
    var $data_ref = {
        action: "lbl_popup_templ_str",
        data: this_id
    };
    popup_init( undefined, undefined, true );
    data_mn_popup( $data_ref );

} );

devent.click( "._sv_strlbl_btn521", function ( e, $this ) {
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#lbl_data_frm" )[ 0 ] );
    $data_ref.append( "action", "star_lbl_add_funct" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        $this.html( "SAVE" );
        if ( result.status == "success" ) {
            var data_ref = {
                action: "lbl_popup_templ_str",
                data: result.data_id
            };
            data_mn_popup( data_ref );
            messagebox( result.status, result.msg, 3000 );
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 3000 );
        }
    } );
} );/*file: star_percent_script.js*/
devent.click( "._sv_btn_strpr1", function ( e, $this ) {
    $( ".mn_err_cls" ).html( '' );
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#star_dt_frm" )[ 0 ] );
    $data_ref.append( "action", "get_star_percent" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        if ( result.status == "success" ) {
            popup_close();
            _load_data_sect.init();
            messagebox( result.status, result.msg, 3000 );
        }
        if ( result.status == "error_msg" ) {
            $.each( result.error_st, function ( key ) {
                if ( key == 0 ) {
                    $( "#cdn-ld-frm" ).animate( {
                        scrollTop: ( $( "." + result.error_st[ key ].class + "" ).offset().top - 250 )
                    }, 200 );
                    messagebox( "error", result.error_st[ key ].msg, 2000 );
                }
                $( "." + result.error_st[ key ].class + "" ).html( result.error_st[ key ].msg );

            } );

        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 3000 );
        }
    } );
} )/*file: sub_caste_script.js*/
devent.click( "._sv_btn_kula521", function ( e, $this ) {
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#sub_cast_frm" )[ 0 ] );
    $data_ref.append( "action", "sub_cast_add_edit_funct" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        $this.html( "SAVE" );
        if ( result.status == "success" ) {
            popup_close();
            _load_data_sect.init();
            messagebox( result.status, result.msg, 3000 );
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 3000 );
        }
    } );
} );/*file: sub_loc_script.js*/
devent.click( "._sv_btn_sbloc521", function ( e, $this ) {
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#sub_loc_frm" )[ 0 ] );
    $data_ref.append( "action", "sub_loc_add_edit_funct" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        $this.html( "SAVE" );
        if ( result.status == "success" ) {
            popup_close();
            _load_data_sect.init();
            messagebox( result.status, result.msg, 3000 );
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 3000 );
        }
    } );
} );/*file: feed_bk_script.js*/
devent.click( "._cls_fd_bk", function ( e, $this ) {
    messagebox(
        "confirm",
        "Are you sure to want to close this feedback?",
        null,
        undefined, {
            class: "cls_fdbk_cl11",
            label: "Yes",
            value: $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val(),
            close_btn: true
        }
    );
} )
devent.click( ".cls_fdbk_cl11", function ( e, $this ) {
    var data_ref = {
        action: "close_feedbk_func",
        data: $this.attr( "data-val" )
    };
    _load_http_form.json( data_ref, pathname + "request", function ( result ) {
        if ( result.status == "success" ) {
            _load_data_sect.init( true );
            messagebox( result.status, result.msg, 3000 );
            popup_close();
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 3000 );
        }
    } );
} )/*file: profile_list_script.js*/
devent.click( "._dt_ovr_viu_st52", function ( e, $this ) {
    var page_type = $( ".extnl_vl74" ).val();
    var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
    view_profile_det( this_id, page_type );
} )
devent.click( "._dt_ovr_viu_bdg", function ( e, $this ) {
    var page_type = $( ".extnl_vl74" ).val();
    var this_id = $this.closest( ".trb75_dt" ).find( "._data_prof_id1" ).val();
    view_profile_det( this_id, page_type );
} )
let view_profile_det = ( this_id, page_type ) => {
    var $data_ref = {
        action: "overvw_prof_funct",
        data: this_id,
        page_type: page_type
    };
    popup_init();
    _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
        popup_data( result, function(resp){
            if(resp.current_status == "success")
            {
              $( ".def_upl_img" ).each( function () {
                img_load_buffer( $( this ), 200 );
              } );
            }
            $(document).ready(function() {
                $(".fancybox").fancybox();
            });
          } );
    } );
}
devent.click( ".verf_btn_st52", function ( e, $this ) {
    let this_id;
    let popst;

    if ( $( ".prof_dt_id" ).val() !== undefined ) {
        this_id = $( ".prof_dt_id" ).val();
        popup_init_support( undefined, undefined, true );
        popst = 1;
    } else {
        popst = 0;
        this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
        popup_init( undefined, undefined, true );
    }
    var $data_ref = {
        action: "verif_dt_pop",
        data: this_id,
        pop_state: popst
    };
    _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
        if ( popst == 1 ) {
            popup_data_support( result );
        } else {
            popup_data( result );
        }
    } );
} )
devent.click( "._prof_verf_bt5", function ( e, $this ) {
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#alrt_frm" )[ 0 ] );
    $data_ref.append( "action", "verif_prof_funct" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        if ( result.status == "success" ) {
            popup_close();
            popup_close_support();
            _load_data_sect.init( true );
            messagebox( result.status, result.msg, 2000 );
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 2000 );
        }
    } );
} );
devent.click( ".dctv_prof_dt21", function ( e, $this ) {
    var this_id = $this.attr( "data-val" );
    var $data_ref = {
        action: "save_actv_deactv_funct",
        data: this_id,
        type: $this.attr( "data-support" ),
        notes: $( "._nts_bx_cnfrm75" ).val()
    };
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        if ( result.status == "success" ) {
            _load_data_sect.init( true );
            messagebox( result.status, result.msg, 2000 );
            popup_close();
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg );
        }
    } );
} );
devent.click( "._mk_enqr_dt11", function ( e, $this ) {
    var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
    var $data_ref = {
        action: "vu_det_enqr",
        data: this_id
    };
    popup_init();
    _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
        popup_data( result );
    } );
} )

function load_badge_approved_front( receiver_id ) {

    let socket_msg = {
        action: "load_badge_front",
        receiver_dt: receiver_id
    };
    socket_msg_send( socket_msg );
}
devent.click( "._dt_badg_apprvdt11", function ( e, $this ) {
    var this_id = $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val();
    var $data_ref = {
        action: "badg_apprv_pop",
        data: this_id
    }
    popup_init( undefined, undefined, true );
    _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
        popup_data( result );
    } );
} )
devent.click( ".sve_apprv_req11", function ( e, $this ) {
    _formLoader_load( true, $this, "SAVING..." );
    var data_ref = new FormData( $( "#delg_addfrm" )[ 0 ] );
    data_ref.append( "action", "apprv_bdgfunt" );
    _load_http_form.json( data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        if ( result.status == "success" ) {
            _load_data_sect.init( true );
            messagebox( result.status, result.msg, 2000 );
            load_badge_approved_front( result.receiver_dt );
            popup_close();
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 2000 );
            _formLoader_load( false );
        }
    } );
} )
devent.click( ".cncl_dt_rem1", function ( e, $this ) {
    messagebox(
        "confirm",
        "Please give some reason?",
        null,
        undefined, {
            class: "rej_cl_bdg52",
            label: "Yes",
            value: $( ".dt_unq_id" ).val(),
            close_btn: true,
            notes_state: 1,
            notes_field_label: "Give some notes"
        }
    );
} );
devent.click( ".rej_cl_bdg52", function ( e, $this ) {
    let data_ref = {
        action: "rej_bdge_funt",
        data: $this.attr( "data-val" ),
        notes: $( "._nts_bx_cnfrm75" ).val()
    }
    _load_http_form.json( data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        if ( result.status == "success" ) {
            _load_data_sect.init( true );
            messagebox( result.status, result.msg, 2000 );
            load_badge_approved_front( result.receiver_dt );
            popup_close();
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 2000 );
            _formLoader_load( false );
        }
    } );
} );

devent.click( "._notf_vw_b74", function ( e, $this ) {
    var data_ref = {
        action: "notif_viewed_state",
        msg_id: $this.attr( "data-msg" )
    };
    $( ".load_n_ntfy" ).removeClass( "actv" );
    _load_http_form.json( data_ref, pathname + "admin_funct", function ( result ) {
        if ( result.status == "success" ) {
            window.location.assign( $this.attr( "data-link" ) );
        }
    } );
} )
devent.click( "._viw_badg_dt", function ( e, $this ) {
    var $data_ref = {
        action: "view_badg_det",
        data: $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val()
    };
    popup_init();
    _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
        popup_data( result );
    } );
} )
devent.click( ".deactv_prof_dt", function ( e, $this ) { 
    let lbl = "Deactivate"; 
    let notes_state = 1;
    if($this.attr( "data-val" ) === "")
    {
        lbl = "Activate";
        notes_state = 0;
    }
    messagebox(
        "confirm",
        "Are you sure to want to "+lbl+" this profile?",
        null,
        undefined, {
            class: "dctv_prof_dt21",
            label: "Yes",
            value: $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val(),
            data_support: $this.attr( "data-val" ),
            close_btn: true,
            notes_state: notes_state,
            notes_field_label: "Give some notes"
        }
    );
} );
devent.click( ".blcls1", function ( e, $this ) {
    copyToClipboard( $this );
  } )
  
  function copyToClipboard( element ) {
    var $temp = $( "<input>" );
    $( "body" ).append( $temp );
    $temp.val( $( element ).text() ).select();
    document.execCommand( "copy" );
    messagebox( "success", "Copied", 3000 );
    $temp.remove();
  }
devent.click("._snd_msg_dt53",function(e,$this){
    popup_init( undefined, undefined, true );
    var $data_ref = {
      action: "send_msg_funct",
      data: $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val()
    }
    _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
      popup_data( result );
    } );
})
devent.click("._sve_btn_msg521",function(e,$this){
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#msg_snd_frm" )[ 0 ] );
    $data_ref.append( "action", "send_msg_data" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
      _formLoader_load( false );
      $this.html( "SAVE" );
      if ( result.status == "success" ) {
        popup_close();
        _load_data_sect.init( true );
        messagebox( result.status, result.msg, 3000 );
      }
      if ( result.status == "error" ) {
        messagebox( result.status, result.msg, 3000 );
      }
    } );
})
devent.click("._mk_as_pid52",function(e,$this){
    popup_init( undefined, undefined, true );
    var $data_ref = {
      action: "make_as_paid_fn",
      data: $this.closest( ".trb75_dt" ).find( "._data_unid5_" ).val()
    }
    _load_http_form.http( $data_ref, pathname + "request", function ( result ) {
      popup_data( result );
    } );
})
devent.click( "._sve_btn_chkpy52", function ( e, $this ) {
    var data_ref = new FormData( $( "#pid_frm_dt" )[ 0 ] );
    data_ref.append( "action", "check_paymet_usr" );
    _formLoader_load( true, $this, "Checking..." );
    _load_http_form.json( data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        if ( result.status == "success" ) {
            popup_close();
            _load_data_sect.init( true );
            messagebox( result.status, result.msg, 3000 );
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 2000 );
        }
    } );
} )
devent.click("._blk_sms_snd52",function(e,$this){
    e.preventDefault();
    var data_ref = new FormData($("#data_sectFRM42")[0]);
    data_ref.append("action","bulk_sms_send");
    popup_init();
    _load_http_form.http( data_ref, pathname + "request", function ( result ) {
        popup_data( result ,function(resp){
            if(resp.current_status == "success")
            {
                search_snippet_init();
            }
        }); 
      } );
})
devent.click( "._sve_btn_msgbk1", function ( e, $this ) {
    _formLoader_load( true, $this, "SAVING..." );
    var $data_ref = new FormData( $( "#msgblk_snd_frm" )[ 0 ] );
    $data_ref.append( "action", "send_blk_sms_funct" );
    _load_http_form.json( $data_ref, pathname + "request", function ( result ) {
        _formLoader_load( false );
        $this.html( "SAVE" );
        if ( result.status == "success" ) {
            popup_close();
            _load_data_sect.init();
            messagebox( result.status, result.msg, 3000 );
        }
        if ( result.status == "error" ) {
            messagebox( result.status, result.msg, 3000 );
        }
    } );
} );
devent.click(".dt_op_pay_b86", function(e, $this){ 
    $this.closest(".tp_ot_b7").find(".dt_op_pay_b86").each(function(){
        $(this).removeClass("actv").find(".rdo_bx75").prop('checked', false)
   });
   $this.addClass("actv");
   $this.find(".rdo_bx75").prop('checked', true)

   let pay_info_bx = $this.data('val');
   $(".pay_dt_inf7").addClass("disbl");
   if(pay_info_bx !== undefined)
   {
       if(pay_info_bx.length > 0)
       { 
           $("."+pay_info_bx+"").removeClass("disbl");
       } 
   }  
});
// devent.click("._bill_prnt521",function(e,$this){
//     var $html_data = $this.closest( ".prod_vw_box_dsn" ).find( ".tmpl_mnst.wid_cls5236" ).html();
//     var $data_ref = {
//       action: "print_pdf_data",
//       data: "<div class='tmpl_mnst wid_cls5236'>"+$html_data+"</div>",
//       type: "profile"
//     };
//     messagebox( "on_process", "Profile Details generating...", null );
//     _load_http_form.json( $data_ref, pathname + "admin_funct", function ( result ) {
//       if ( result.status == "success" ) {
//         messagebox( result.status, result.msg, 2000 );
//         window.location.assign( result.url );
//       }
//       if ( result.status == "error" ) {
//         messagebox( result.status, result.msg, 2000 );
  
//       }
//     } );
//   })
  devent.click("._bill_prnt521", function(e,  $this){
    _formLoader_load( true, $this, "Processing..." );
    messagebox( "on_process", "Preparing for export...", null );
    let data_ref = new FormData();
    let user_id = $(".prof_dt_id").val();
    let data_type_id = $(".data_type_id").val();
    data_ref.append('action', 'print_profile_details');
    data_ref.append('user_id', user_id);
    data_ref.append('data_type_id', data_type_id);
    _load_http_form.json( data_ref, pathname + "request", function ( result ) {
        _formLoader_load(false);
        if ( result.type == "pdf" ) {
            messagebox( "success", "Export is ready to download", 3000 );
            window.location.replace( result.url );
        }
    });
});
devent.click(".dwnld_hors52", function(e,  $this){
    _formLoader_load( true, $this, "Processing..." );
    messagebox( "on_process", "Preparing for export...", null );
    let data_ref = new FormData();
    let user_id = $(".prof_dt_id").val(); 
    data_ref.append('action', 'print_horoscope_details');
    data_ref.append('user_id', user_id); 
    _load_http_form.json( data_ref, pathname + "request", function ( result ) {
        _formLoader_load(false);
        if ( result.type == "pdf" ) {
            messagebox( "success", "Export is ready to download", 3000 );
            window.location.replace( result.url );
        }
    });
});