예제 #1
0
    if ($total_max_cv >= MAX_CV) {
        $session->message("<div class='error'>" . format_lang('errormsg', 52) . "</div>");
        redirect_to(BASE_URL . "curriculum_vitae/");
        die;
    }
}
$lang["max_file_size"] = size_as_text(MAX_CV_SIZE);
//Are you sure you want to do this? You will lose this CV.
switch ($action) {
    case "add":
        check_total();
        if (isset($_POST['bt_cv_add'])) {
            $_SESSION['addcv']['name'] = $cv_setting->cv_title = $_POST['txt_title'];
            $_SESSION['addcv']['desc'] = $cv_setting->cv_description = $_POST['txt_desc'];
            $cv_setting->fk_employee_id = $user_id;
            $cv_setting->attach_file($_FILES['txt_file_cv']);
            $cv = array();
            $cv = $_FILES['txt_file_cv'];
            if ($cv_setting && $cv_setting->save()) {
                destroy_my_session();
                $session->message("<div class='success'>" . format_lang('success', 'cv_save_success') . "</div>");
                $email_template = get_lang('email_template', 'save_cv');
                $subject = str_replace("#SiteName#", SITE_NAME, $email_template['email_subject']);
                $body = $email_template['email_text'];
                $body = str_replace("#FullName#", $employee->full_name(), $body);
                $body = str_replace("#SiteName#", SITE_NAME, $body);
                $body = str_replace("#Domain#", $_SERVER['HTTP_HOST'], $body);
                //$body = str_replace("#Link#", 		BASE_URL, $body);
                $to = array("email" => $employee->email_address, "name" => $employee->full_name());
                $from = array("email" => NO_REPLY_EMAIL, "name" => SITE_NAME);
                $mail = send_mail($body, $subject, $to, $from, "", "");