<?php

// session_start();
// echo "<pre>";print_r($_SESSION);die;
function mres($value)
{
    $search = array("\\", "", "\n", "\r", "'", '"', "");
    $replace = array("\\\\", "\\0", "\\n", "\\r", "\\'", '\\"', "\\Z");
    return str_replace($search, $replace, $value);
}
if (isset($_POST['submit'])) {
    set_site_message('my-certificates', 'success', "The request for scope extension has been successfully sent.");
    global $wpdb;
    $bnfw = BNFW::factory();
    if ($bnfw->notifier->notification_exists('scope-ext-notifier')) {
        $notifications = $bnfw->notifier->get_notifications('scope-ext-notifier');
        foreach ($notifications as $notification) {
            $sql = "select `first_name`,`last_name` from " . $wpdb->prefix . "users where `ID` = '" . get_current_user_id() . "'";
            $customer_user = $wpdb->get_row($sql);
            $firstname = $customer_user->first_name;
            $lastname = $customer_user->last_name;
            $certificate_name = $_POST['scope_certificate_name'];
            $list_of_standards = $_POST['standards'];
            $scopefilename = $_POST['scope_filename'];
            $scopefilename = explode('~IASfilename~', $scopefilename);
            $scopefilename = array_filter($scopefilename);
            $scopefileurl = $_POST['scope_fileurl'];
            $scopefileurl = explode('~IASurl~', stripslashes($scopefileurl));
            $scopefileurl = array_filter($scopefileurl);
            $date = date('Y-m-d');
            $setting = $bnfw->notifier->read_settings($notification->ID);
function delete_application_company()
{
    global $wpdb;
    $wpdb->delete($wpdb->prefix . 'company', array('id' => $_GET['hash']));
    if (isset($_GET['redirect_url']) && !empty($_GET['redirect_url'])) {
        set_site_message('my-companies', 'success', "Company Deleted Successfully");
        //  $_SESSION['wp_notices']['company_deleted'] = __("Company Deleted Successfully");
        wp_redirect(base64_decode($_GET['redirect_url']));
    } else {
        set_site_message('my-companies', 'success', "Company Deleted Successfully");
        //$_SESSION['wp_notices']['company_deleted'] = __("Company Deleted Successfully");
        wp_redirect(admin_url() . 'admin.php?page=' . $_GET['page']);
    }
}