Example #1
0
             $mail = send_mail($body, $subject, $to, $from, "", "");
             unset($_SESSION['addcv']);
             redirect_to(BASE_URL . "curriculum_vitae/");
         } else {
             $message = "<div class='error'> \r\n\t\t\t\t\t\t\t\t" . format_lang('following_errors') . "\r\n\t\t\t\t\t\t\t<ul> <li />";
             $message .= join(" <li /> ", $cv_setting->errors);
             $message .= " </ul> \r\n\t\t\t\t\t\t\t</div>";
         }
     }
     $html_title = SITE_NAME . " - " . format_lang('page_title', 'cv_add_new') . " " . $employee->full_name();
     $smarty->assign('message', $message);
     $smarty->assign('rendered_page', $smarty->fetch('addcv.tpl'));
     //exit;
     break;
 case "rename":
     $cv = CVSetting::find_by_user_and_id($id, $user_id);
     $name = $cv->cv_title;
     $notes = $cv->cv_description;
     $smarty->assign('name', $name);
     $smarty->assign('notes', $notes);
     $smarty->assign('id', $id);
     if (isset($_POST['bt_save'])) {
         $cv_name = $_POST['txt_title'];
         $cv->cv_description = $_POST['txt_desc'];
         $cv->cv_title = $cv_name;
         if ($cv->save()) {
             $session->message("<div class='success'>" . format_lang('success', 'cv_rename_success') . "</div>");
             redirect_to(BASE_URL . "curriculum_vitae/");
         } else {
             $message = "<div class='error'>" . format_lang('errormsg', 53) . "</div>";
         }