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";