Beispiel #1
0
 function add_image_process()
 {
     global $settings;
     $this->layout = "";
     $ufn = make_upload("media/editor_temp/", "upload_file");
     $img_info = @getimagesize($this->settings->root_path . "media/editor_temp/" . $ufn);
     if ($img_info[0] > 670) {
         GD2_make_thumb_new(670, 3000, $this->settings->root_path . "media/editor_temp/" . $ufn, $this->settings->root_path . "media/editor_temp/" . $ufn);
     }
     $this->assigns["path"] = "media/editor_temp/" . $ufn;
     $this->assigns["smu"] = $this->settings->service_main_url;
     $this->assigns["position"] = $_REQUEST["position"];
     $this->assigns["caption"] = $_REQUEST["caption"];
 }
Beispiel #2
0
 public function edit($_id = '')
 {
     header("Location: /benefit/edit/" . $_id);
     if (!$_SESSION["s"]) {
         $_SESSION["msg"] = "로그인 후 이용하실 수 있습니다.";
         header("Location: /");
     }
     if ($_REQUEST["title"]) {
         if ($_REQUEST["a_start"]) {
             $_REQUEST["a_start"] = $_REQUEST["a_start_d"] . " " . $_REQUEST["a_start_t"];
             $_REQUEST["a_end"] = $_REQUEST["a_end_d"] . " " . $_REQUEST["a_end_t"];
         } else {
             $_REQUEST["a_start"] = '';
             $_REQUEST["a_end"] = '';
         }
         if ($_REQUEST["cnt_c"] == 0) {
             $_REQUEST["cnt"] = 0;
         }
         $_id = $this->Program->add($_REQUEST);
         if ($_REQUEST["img"]) {
             $img_temp_name = str_replace(" ", "", $_REQUEST['img']);
             $ck = substr($img_temp_name, 0, 1);
             if ($ck == '/') {
                 $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
             }
             $file_ext = explode('.', $img_temp_name);
             $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
             $original_file = $this->settings->root_path . $img_temp_name;
             $copy_file = $this->settings->root_path . 'media/program/' . $_id . $file_ext;
             GD2_make_thumb_x(300, "", $original_file);
             //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
             copy($original_file, $copy_file);
             unlink($original_file);
             $_pic = '/media/program/' . $_id . $file_ext;
             $this->Program->add_picture($_id, $_pic);
         }
         if ($_REQUEST["del_file"]) {
             $this->Program->add_file($_id, '');
             unlink('media/program/' . $_REQUEST["del_file"]);
         }
         if ($_FILES["file"]["name"]) {
             $file = make_upload("/media/program/", "file");
             if ($file) {
                 $this->Program->add_file($_id, $file, str_replace(" ", "_", $_FILES["file"]["name"]));
             }
         }
         $this->assigns["msgt"] = 1;
     }
     if ($_id) {
         $res = $this->Program->get($_id);
         if (!$res) {
             header("Location: /error_404");
         }
         $this->assigns["res"] = $res;
     }
     $this->assigns["category"] = $this->Program->get_category();
 }
Beispiel #3
0
 public function edit($_id = '')
 {
     $this->assigns_layout["gnb_left"] = 'program';
     if ($_REQUEST["title"]) {
         if ($_REQUEST["a_start"]) {
             $_REQUEST["a_start"] = $_REQUEST["a_start_d"] . " " . $_REQUEST["a_start_t"];
             $_REQUEST["a_end"] = $_REQUEST["a_end_d"] . " " . $_REQUEST["a_end_t"];
         } else {
             $_REQUEST["a_start"] = '';
             $_REQUEST["a_end"] = '';
         }
         if ($_REQUEST["cnt_c"] == 0) {
             $_REQUEST["cnt"] = 0;
         }
         if ($_REQUEST["status"] != 2) {
             $_REQUEST["status_des"] = "";
         }
         $_id = $this->Program->add($_REQUEST);
         if ($_REQUEST["img"]) {
             $img_temp_name = str_replace(" ", "", $_REQUEST['img']);
             $ck = substr($img_temp_name, 0, 1);
             if ($ck == '/') {
                 $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
             }
             $file_ext = explode('.', $img_temp_name);
             $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
             $original_file = $this->settings->root_path . $img_temp_name;
             $copy_file = $this->settings->root_path . 'media/program/' . $_id . $file_ext;
             GD2_make_thumb_x(300, "", $original_file);
             //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
             copy($original_file, $copy_file);
             unlink($original_file);
             $_pic = '/media/program/' . $_id . $file_ext;
             $this->Program->add_picture($_id, $_pic);
         }
         if ($_REQUEST["del_file"]) {
             $this->Program->add_file($_id, '');
             unlink('media/program/' . $_REQUEST["del_file"]);
         }
         if ($_FILES["file"]["name"]) {
             $file = make_upload("/media/program/", "file");
             if ($file) {
                 $this->Program->add_file($_id, $file, str_replace(" ", "_", $_FILES["file"]["name"]));
             }
         }
         if ($_REQUEST["o_status"] != $_REQUEST["status"] && $_REQUEST["status"] != 0) {
             $_st = "승인";
             if ($_REQUEST["status"] == 2) {
                 $_st = "반려";
             }
             $ev = $this->Program->get_list('', '', "c.id = " . $_id);
             $_ev = $ev[0];
             $m = new TF_mailer($this->settings);
             $m->mailto = $_ev["memail"];
             $m->subject = "[D.CAMP] " . $_ev["name"] . "님의 스타트업 지원 프로그램이 " . $_st . "되었습니다.";
             $m->tpl_name = "program_accept";
             $m->assigns["res"] = $_ev;
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
         }
         $this->assigns["msgt"] = 1;
     }
     if ($_id) {
         $res = $this->Program->get($_id);
         $u = $this->Members->get($res["user_id"]);
         $u["com"] = $this->Startup_member->get_by_user($res["user_id"]);
         if (!$res) {
             header("Location: /error_404");
         }
         $this->assigns["res"] = $res;
         $this->assigns["u"] = $u;
     }
     $this->assigns["category"] = $this->Program->get_category();
 }
Beispiel #4
0
 public function add_process()
 {
     $payment = 0;
     if (array_key_exists('payment1', $_REQUEST)) {
         $payment = $payment | $this->settings->payment1;
     } else {
         $payment = $payment & ~$this->settings->payment1;
     }
     if (array_key_exists('payment2', $_REQUEST)) {
         $payment = $payment | $this->settings->payment2;
     } else {
         $payment = $payment & ~$this->settings->payment2;
     }
     if (array_key_exists('payment3', $_REQUEST)) {
         $payment = $payment | $this->settings->payment3;
     } else {
         $payment = $payment & ~$this->settings->payment3;
     }
     if (array_key_exists('payment4', $_REQUEST)) {
         $payment = $payment | $this->settings->payment4;
     } else {
         $payment = $payment & ~$this->settings->payment4;
     }
     $_REQUEST['payment'] = $payment;
     if ($_REQUEST["space"] == 0) {
         $_REQUEST["space_id"] = 0;
     } else {
         $_REQUEST["space_etc"] = null;
     }
     $_id = $this->Event->add($_REQUEST);
     if ($_REQUEST["pic"]) {
         $img_temp_name = str_replace(" ", "", $_REQUEST['pic']);
         $ck = substr($img_temp_name, 0, 1);
         if ($ck == '/') {
             $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
         }
         $file_ext = explode('.', $img_temp_name);
         //$filename = basename($_FILES['file']['name']);
         $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
         $original_file = $this->settings->root_path . $img_temp_name;
         $copy_file = $this->settings->root_path . 'media/event/' . $_id . $file_ext;
         GD2_make_thumb_x(300, "", $original_file);
         //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
         copy($original_file, $copy_file);
         unlink($original_file);
         $_pic = '/media/event/' . $_id . $file_ext;
         $this->Event->add_picture($_id, $_pic);
     }
     if ($_REQUEST["del_file"]) {
         $this->Event->add_file($_id, '');
         unlink('media/event_file/' . $_REQUEST["del_file"]);
     }
     if ($_FILES["file"]["name"]) {
         $file = make_upload("/media/event_file/", "file");
         if ($file) {
             $this->Event->add_file($_id, $file, $_FILES["file"]["name"]);
         }
     }
     add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 0, "", Activity_model::A_TYPE_EVENT, $_id, 1);
     $_SESSION["msg"] = "이벤트가 신청되었습니다.<br />관리자 승인이 완료되면 이벤트 페이지에 노출됩니다.";
     header("Location: /member/edit_event_m");
 }
Beispiel #5
0
 public function add_process()
 {
     $payment = 0;
     if (array_key_exists('payment1', $_REQUEST)) {
         $payment = $payment | $this->settings->payment1;
     } else {
         $payment = $payment & ~$this->settings->payment1;
     }
     if (array_key_exists('payment2', $_REQUEST)) {
         $payment = $payment | $this->settings->payment2;
     } else {
         $payment = $payment & ~$this->settings->payment2;
     }
     if (array_key_exists('payment3', $_REQUEST)) {
         $payment = $payment | $this->settings->payment3;
     } else {
         $payment = $payment & ~$this->settings->payment3;
     }
     if (array_key_exists('payment4', $_REQUEST)) {
         $payment = $payment | $this->settings->payment4;
     } else {
         $payment = $payment & ~$this->settings->payment4;
     }
     $_REQUEST['payment'] = $payment;
     if ($_REQUEST["space"] == 0) {
         $_REQUEST["space_id"] = 0;
     } else {
         $_REQUEST["space_etc"] = null;
     }
     $_id = $this->Event->add($_REQUEST);
     if ($_REQUEST["pic"]) {
         $img_temp_name = str_replace(" ", "", $_REQUEST['pic']);
         $ck = substr($img_temp_name, 0, 1);
         if ($ck == '/') {
             $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
         }
         $file_ext = explode('.', $img_temp_name);
         //$filename = basename($_FILES['file']['name']);
         $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
         $original_file = $this->settings->root_path . $img_temp_name;
         $copy_file = $this->settings->root_path . 'media/event/' . $_id . $file_ext;
         GD2_make_thumb_x(300, "", $original_file);
         //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
         copy($original_file, $copy_file);
         unlink($original_file);
         $_pic = '/media/event/' . $_id . $file_ext;
         $this->Event->add_picture($_id, $_pic);
     }
     if ($_REQUEST["del_file"]) {
         $this->Event->add_file($_id, '');
         unlink('media/event_file/' . $_REQUEST["del_file"]);
     }
     if ($_FILES["file"]["name"]) {
         $file = make_upload("/media/event_file/", "file");
         if ($file) {
             $this->Event->add_file($_id, $file, $_FILES["file"]["name"]);
         }
     }
     // if ($_REQUEST["id"]) {
     //     $apply = $this->Event_reserve->cnt("event_id = ".$_REQUEST["id"]);
     //     if ($apply <= $_REQUEST["cnt"]) {
     //         $this->Event_reserve->edit_state_by_cnt($_REQUEST["id"], $_REQUEST["cnt"]);
     //     }
     // }
     header("Location: /admin_event");
 }
Beispiel #6
0
 public function add_comp_apply()
 {
     $this->tpl_name = '';
     if ($_REQUEST["user_id"]) {
         if ($_FILES["file"]) {
             $_REQUEST["file"] = make_upload("/media/comp_file/", "file");
         }
         $this->Competitions_apply->add($_REQUEST);
         $_SESSION["msg"] = "경진 대회 참가 신청이 접수되었습니다.";
     }
 }
Beispiel #7
0
 public function edit($_id = '')
 {
     $this->assigns_layout["gnb_left"] = "competition";
     if ($_REQUEST["cancel"]) {
     }
     if ($_REQUEST["subject"]) {
         $_id = $this->Competitions->add($_REQUEST);
         if ($_REQUEST["pic"]) {
             $img_temp_name = str_replace(" ", "", $_REQUEST['pic']);
             $ck = substr($img_temp_name, 0, 1);
             if ($ck == '/') {
                 $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
             }
             $file_ext = explode('.', $img_temp_name);
             //$filename = basename($_FILES['file']['name']);
             $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
             $original_file = $this->settings->root_path . $img_temp_name;
             $copy_file = $this->settings->root_path . 'media/comp/' . $_id . $file_ext;
             GD2_make_thumb_x(300, "", $original_file);
             //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
             copy($original_file, $copy_file);
             unlink($original_file);
             $_pic = '/media/comp/' . $_id . $file_ext;
             $this->Competitions->add_pic($_id, $_pic);
         }
         if ($_FILES["source"]["name"]) {
             $file = make_upload("/media/comp_file/", "source");
             $this->Competitions->add_file($_id, $file, $_FILES["source"]["name"]);
         }
         $this->assigns["msg"] = "저장되었습니다.";
         if ($_REQUEST["status_o"] != $_REQUEST["status"] && $_REQUEST["status"] == 1) {
             // accept mail
             $us = $this->Members->get($_REQUEST["user_id"]);
             $res = $this->Competitions->get($_id);
             $m = new TF_mailer($this->settings);
             $m->mailto = $us["email"];
             $m->subject = "[D.CAMP] " . $us["name"] . "님의 경진대회가 승인되었습니다.";
             $m->tpl_name = "competition_accept";
             $m->assigns["res"] = $res;
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
         }
     }
     if ($_id) {
         $res = $this->Competitions->get($_id);
         $this->assigns["res"] = $res;
         $this->get_process($res);
     }
 }
Beispiel #8
0
 public function save_apply()
 {
     $this->tpl_name = "";
     if ($_SESSION["s"]) {
         if ($_FILES["file"]) {
             $_REQUEST["file"] = make_upload("/media/office/hours/", "file");
         }
         $_REQUEST["user_id"] = $_SESSION["s"]["id"];
         $id = $this->Office_hours_apply->add($_REQUEST);
         $form = $this->Office_hours_apply_form->get_by_oh($_REQUEST["oh_id"]);
         if ($form) {
             for ($i = 0; $i < sizeof($form); $i++) {
                 $arr["apply_id"] = $id;
                 $arr["form_id"] = $form[$i]["id"];
                 $arr["contents"] = $_REQUEST["form_" . $form[$i]["id"]];
                 $this->Office_hours_apply_etc->add($arr);
             }
         }
         if (!$_REQUEST["id"]) {
             // activity
             $arr["com_type"] = 1;
             $arr["com_id"] = $_SESSION["s"]["id"];
             $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
             $arr["act_id"] = $_SESSION["s"]["id"];
             $arr["target_type"] = Activity_model::O_TYPE_OFFICE_HOURS;
             $arr["target_id"] = $_REQUEST["oh_id"];
             $arr["is_made"] = 0;
             $arr["act_result"] = 0;
             $act->add($arr);
         }
     }
 }
Beispiel #9
0
 public function edit_next($_id = '')
 {
     if (!$_SESSION["s"]) {
         $_SESSION["msg"] = "로그인 후 이용하실 수 있습니다.";
         header("Location: /");
     }
     if ($_REQUEST["cancel"]) {
     }
     if ($_REQUEST["announce_d"]) {
         $_id = $this->Competitions->add($_REQUEST);
         if ($_REQUEST["pic"]) {
             $img_temp_name = str_replace(" ", "", $_REQUEST['pic']);
             $ck = substr($img_temp_name, 0, 1);
             if ($ck == '/') {
                 $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
             }
             $file_ext = explode('.', $img_temp_name);
             //$filename = basename($_FILES['file']['name']);
             $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
             $original_file = $this->settings->root_path . $img_temp_name;
             $copy_file = $this->settings->root_path . 'media/comp/' . $_id . $file_ext;
             GD2_make_thumb_x(300, "", $original_file);
             //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
             copy($original_file, $copy_file);
             unlink($original_file);
             $_pic = '/media/comp/' . $_id . $file_ext;
             $this->Competitions->add_pic($_id, $_pic);
         }
         if ($_REQUEST["top_img"]) {
             $img_temp_name = str_replace(" ", "", $_REQUEST['top_img']);
             $ck = substr($img_temp_name, 0, 1);
             if ($ck == '/') {
                 $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
             }
             $file_ext = explode('.', $img_temp_name);
             //$filename = basename($_FILES['file']['name']);
             $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
             $original_file = $this->settings->root_path . $img_temp_name;
             $copy_file = $this->settings->root_path . 'media/comp/top_' . $_id . $file_ext;
             GD2_make_thumb_x(800, "", $original_file);
             //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
             copy($original_file, $copy_file);
             unlink($original_file);
             $_pic = '/media/comp/top_' . $_id . $file_ext;
             $this->Competitions->add_pic($_id, $_pic, 'top_img');
         }
         // $this->Competitions->del_a_file($_id);
         for ($f = 1; $f < $_REQUEST["f_cnt"] + 1; $f++) {
             if ($_FILES["afile" . $f]["name"]) {
                 $file = make_upload("/media/comp_file/", "afile" . $f);
                 $this->Competitions->edit_a_file($_id, $file, $_FILES["afile" . $f]["name"]);
             }
         }
         for ($d = 2; $d < $_REQUEST["dpt_cnt"] + 1; $d++) {
             if ($_REQUEST["dpt" . $d]) {
                 if ($d == 2) {
                     $_d_arr["id"] = $_id;
                     $_d_arr["did"] = $_id;
                     $_d_arr["department"] = $_REQUEST["dpt" . $d];
                     $this->Competitions->add($_d_arr);
                 } else {
                     $_d_arr = $this->Competitions->get($_id);
                     $_d_arr["id"] = "";
                     $_d_arr["did"] = $_id;
                     $_d_arr["parent"] = $_id;
                     $_d_arr["url"] = '';
                     $_d_arr["open"] = '';
                     $_d_arr["department"] = $_REQUEST["dpt" . $d];
                     $this->Competitions->add($_d_arr);
                 }
             }
         }
         $this->assigns["msgt"] = 1;
     }
     if ($_id) {
         $res = $this->Competitions->get($_id);
         $res["a_file"] = $this->Competitions->get_a_file($_id);
         $res["dpt_l"] = $this->Competitions->get_department_group($_id);
         $opr = $this->Competitions_examiner->operator_check($res["id"], $_SESSION["s"]["id"]);
         $this->assigns["res"] = $res;
         if ($_SESSION["s"]["id"] != $res["user_id"] && !$opr) {
             header("Location: /error_404");
         }
         $this->get_process($res);
     }
     if ($_SESSION["msg"]) {
         $this->assigns_layout["msg"] = $_SESSION["msg"];
         unset($_SESSION["msg"]);
     }
 }
Beispiel #10
0
 public function edit($_id = '')
 {
     if (!$_SESSION["s"]) {
         $_SESSION["msg"] = "로그인 후 이용하실 수 있습니다.";
         header("Location: /");
     }
     if ($_REQUEST["cancel"]) {
     }
     if ($_REQUEST["subject"]) {
         $_REQUEST["contents"] = str_replace('"../../', '"' . '/', $_REQUEST["contents"]);
         $_REQUEST["contents"] = str_replace('"../', '"' . '/', $_REQUEST["contents"]);
         $_id = $this->Competitions->add($_REQUEST);
         if ($_REQUEST["pic"]) {
             $img_temp_name = str_replace(" ", "", $_REQUEST['pic']);
             $ck = substr($img_temp_name, 0, 1);
             if ($ck == '/') {
                 $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
             }
             $file_ext = explode('.', $img_temp_name);
             //$filename = basename($_FILES['file']['name']);
             $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
             $original_file = $this->settings->root_path . $img_temp_name;
             $copy_file = $this->settings->root_path . 'media/comp/' . $_id . $file_ext;
             GD2_make_thumb_x(300, "", $original_file);
             //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
             copy($original_file, $copy_file);
             unlink($original_file);
             $_pic = '/media/comp/' . $_id . $file_ext;
             $this->Competitions->add_pic($_id, $_pic);
         }
         if ($_FILES["source"]["name"]) {
             $file = make_upload("/media/comp_file/", "source");
             $this->Competitions->add_file($_id, $file, $_FILES["source"]["name"]);
         }
         $this->assigns_layout["msg"] = "저장되었습니다.";
     }
     if ($_id) {
         $res = $this->Competitions->get($_id);
         $this->assigns["res"] = $res;
         if ($_SESSION["s"]["id"] != $res["user_id"]) {
             header("Location: /error_404");
         }
         $this->get_process($res);
     }
 }
Beispiel #11
0
 public function save_apply()
 {
     $this->tpl_name = "";
     if ($_SESSION["s"]) {
         if ($_FILES["file"]) {
             $_REQUEST["file"] = make_upload("/media/office/hours/", "file");
             $_REQUEST["filename"] = str_replace(" ", "", $_FILES["file"]["name"]);
         }
         $_REQUEST["user_id"] = $_SESSION["s"]["id"];
         $id = $this->Office_hours_apply->add($_REQUEST);
         $form = $this->Office_hours_apply_form->get_by_oh($_REQUEST["oh_id"]);
         if ($form) {
             for ($i = 0; $i < sizeof($form); $i++) {
                 if ($_REQUEST["form_" . $form[$i]["id"]]) {
                     $arr["apply_id"] = $id;
                     $arr["form_id"] = $form[$i]["id"];
                     $arr["contents"] = $_REQUEST["form_" . $form[$i]["id"]];
                     $this->Office_hours_apply_etc->add($arr);
                 }
             }
         }
         if (!$_REQUEST["id"]) {
             // activity
             $arr2["com_type"] = 1;
             $arr2["com_id"] = $_SESSION["s"]["id"];
             $arr2["act_type"] = Activity_model::C_TYPE_MEMBER;
             $arr2["act_id"] = $_SESSION["s"]["id"];
             $arr2["target_type"] = Activity_model::O_TYPE_OFFICE_HOURS;
             $arr2["target_id"] = $_REQUEST["oh_id"];
             $arr2["is_made"] = 0;
             $arr2["act_result"] = 0;
             $this->Activity->add($arr2);
         }
         if ($_REQUEST["s_description"] || $_REQUEST["s_description_p"] || $_REQUEST["s_description_s"]) {
             $arr3["startup_id"] = $_REQUEST["st_id"];
             $arr3["id"] = $_REQUEST["ser_id"];
             $arr3["name"] = $_REQUEST["s_subject"];
             $arr3["des_ele"] = $_REQUEST["s_description"];
             $arr3["des_pro"] = $_REQUEST["s_description_p"];
             $arr3["des_sol"] = $_REQUEST["s_description_s"];
             $this->Startup_service->add2($arr3);
         }
         if ($_REQUEST["id"]) {
             $_SESSION["msg"] = "수정되었습니다.";
         } else {
             $_SESSION["msg"] = "상담 신청이 성공적으로 완료되었습니다.";
         }
         // exit(1);
         header("Location: /office_hours/apply/" . $_REQUEST["oh_id"] . "/" . $id);
     } else {
         header("Location: /error_404");
     }
 }
Beispiel #12
0
    $content = trim($_POST['content']);
    $id_user = $_SESSION['id_user'];
    //var_dump($id_user);
    if (new_exists($link, $title)) {
        $message = "Такой файл уже есть, включите фантазию :)";
    } elseif ($title == '') {
        $message = "Незаполнено название статьи :)";
    } elseif ($content == '') {
        $message = "Незаполнено поле контент :)";
    } elseif (mb_strlen($content) > 1000) {
        $message = "Статья превышает 1000 знаков! Будьте лаконичны ;)";
    } elseif (isset($_FILES['file'])) {
        $check = can_upload($_FILES['file']);
        if ($check === true) {
            add_new($link, $title, $content, $id_user);
            // загружаем изображение на сервер
            echo 'Yes! Картинка успешно добавлена!';
            make_upload($_FILES['file'], $link, $title);
            echo "<meta http-equiv='refresh' content='2;url=../index.php'>";
            exit;
        } else {
            // выводим сообщение об ошибке
            $message = "<strong>{$check}</strong>";
        }
    }
} else {
    $message = '';
    $title = '';
    $content = '';
}
include '../v/v_add.php';
Beispiel #13
0
 function editor_add_remarks()
 {
     $this->tpl_name = "editor8/views/editor_add_remarks";
     $this->layout = "";
     $settings = new Settings();
     $ufn = make_upload("media/", "upload_file");
     $this->assigns["path"] = "media/" . $ufn;
     //$this->assigns["width"] = $width;
     $this->assigns["id"] = $_REQUEST["id"];
 }