$value[click] = "front_panel.php";
                $message1 = $common->direct_replace($db_object, $message, $value);
                $common->send_mail($to, $subject, $message1, $from);
                $value[user] = $res1[username];
                $value[boss] = $res_mail[username];
                $value[emp] = $res1[username];
                $value[click] = "front_panel.php";
                $to = $res1[email];
                $message1 = $common->direct_replace($db_object, $message, $value);
                $common->send_mail($to, $subject, $message1, $from);
                echo $res_mail[username];
                echo $error_msg['cAssignedtoUpdate'];
                echo $res1[position_name];
                echo "<br>";
            }
        }
    }
}
$obj = new assign();
if ($fAssign) {
    $action = "assign";
}
switch ($action) {
    case NULL:
        $obj->assign_plan($db_object, $common, $user_id, $fBoss, $error_msg, $pos_id_sel);
        break;
    case "assign":
        $obj->assign_succession_plan($db_object, $common, $user_id, $fPosition, $fUser, $error_msg);
        break;
}
include_once "footer.php";
        if ($users1[0] == "") {
            echo $error_msg['cNoBossUnderBoss'];
            include_once "footer.php";
            exit;
        }
        $path = $common->path;
        $xtemplate = $path . "templates/career/assign_succession_plan.html";
        $file = $common->return_file_content($db_object, $xtemplate);
        $pattern = "/<{boss_loopstart}>(.*?)<{boss_loopend}>/s";
        preg_match($pattern, $file, $match);
        $match = $match[0];
        for ($a = 0; $a < count($users1); $a++) {
            $boss_id = $users1[$a][user_id];
            $boss_name = $common->name_display($db_object, $boss_id);
            $str .= preg_replace("/<{(.*?)}>/e", "\$\$1", $match);
        }
        $file = preg_replace($pattern, $str, $file);
        $file = $common->direct_replace($db_object, $file, $xArray);
        echo $file;
    }
}
$obj = new assign();
switch ($action) {
    case NULL:
        $obj->assign_plan($db_object, $common, $user_id, $fBoss_id, $error_msg);
        break;
    case "assign":
        $obj->succession_plan_alert($db_object, $common, $user_id, $error_msg);
        break;
}
include_once "footer.php";