Exemple #1
0
 public function checkin_pass($_id)
 {
     $this->assigns_layout["gnb_left"] = "checkin";
     if ($_REQUEST["user_id"]) {
         // first visit mailling - > daily p)161
         // $ch_first = $this->Entrance->check_first($_REQUEST["user_id"]);
         // if ( ! $ch_first ) {
         $us = $this->Members->get($_REQUEST["user_id"]);
         $m = new TF_mailer($this->settings);
         $m->mailto = $us["email"];
         $m->subject = "D.CAMP 방문을 환영합니다.";
         $m->tpl_name = "mail-welcome";
         $m->assigns["res"] = $us;
         $m->assigns["cnt"] = $this->Entrance->cnt('', 'e.user_id = ' . $us["id"]);
         $m->assigns["main_service_url"] = $this->globals->my_host;
         $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
         $m->send();
         // }
         $this->Members->add_login($_REQUEST["user_id"]);
         $_REQUEST["date_in"] = date('Y-m-d H:i:s');
         $_REQUEST["is_mailed"] = 1;
         $this->Entrance->add($_REQUEST);
         header("Location: /admin_entrance/checkin");
     }
     $res = $this->Members->get($_id);
     $res["date_ms"] = $this->Recommend->get_by_user($_id);
     $res["login_all"] = $this->Entrance->get_cnt_by_user($_id);
     $res["login_mon"] = $this->Entrance->get_cnt_by_user($_id, 'date_in like "' . date('Y-m') . '%"');
     $res["mem"] = $this->Recommend->get_by_user($res["id"]);
     if ($res["mem"]["rec_com"]) {
         $res["com"] = $this->Startup->get($res["mem"]["rec_com"]);
     }
     if ($res["mem"]["rec_mem"]) {
         $res["mem_"] = $this->Members->get($res["mem"]["rec_mem"]);
     }
     $this->assigns["res"] = $res;
     $this->assigns["locker"] = $this->Entrance->locker_today();
     $this->assigns["pass"] = $this->Entrance->pass_today();
 }
Exemple #2
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();
 }
Exemple #3
0
 public function edit_qna($_id)
 {
     $this->assigns_layout["gnb"] = "qna";
     $this->assigns_layout["gnb_title"] = "Q&A";
     $this->assigns_layout["gnb_left"] = "qna";
     if ($_REQUEST["content"]) {
         $_a["id"] = $_REQUEST["parent"];
         $_a["open"] = $_REQUEST["open"];
         $_a["re_suc"] = 1;
         $this->Faq->add($_a);
         $_REQUEST["id"] = $_REQUEST["p_id"];
         $this->Faq->add($_REQUEST);
         $_SESSION["msg"] = "답변이 저장되었습니다.";
         //maliing
         $q = $this->Faq->list_(2, 1, 1, "f.id = " . $_id);
         $staff = $this->Faq->get_category($q[0]["cat"], 2);
         $ans = $this->Faq->get_reply($_id);
         $m = new TF_mailer($this->settings);
         $m->mailto = $_REQUEST["emailer"];
         $m->subject = "[D.CAMP] 작성하신 Q&A의 답변이 등록되었습니다.";
         $m->tpl_name = "support_qna_re";
         $m->assigns["res"] = $q[0];
         $m->assigns["cat"] = $q[0]["category"];
         $m->assigns["s"] = $staff;
         $m->assigns["ans"] = $ans;
         $m->assigns["main_service_url"] = $this->globals->my_host;
         $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
         $m->send();
         //activity
         $ar["com_type"] = 1;
         $ar["com_id"] = $q[0]["user_id"];
         $ar["act_type"] = 1;
         $ar["act_id"] = $q[0]["user_id"];
         $ar["msg"] = "<a href='/support/views/" . $q[0]["id"] . "'>Q&A</a>의 답변이 등록되었습니다.";
         $this->Activity->add($ar);
     }
     $category = $this->Faq->list_category(1, 1000, 2);
     $q = $this->Faq->list_(2, 1, 1, "f.id = " . $_id);
     $staff = $this->Faq->get_category($q[0]["cat"], 2);
     $ans = $this->Faq->get_reply($_id);
     $this->assigns["cat"] = $category;
     $this->assigns["q"] = $q[0];
     $this->assigns["s"] = $staff;
     $this->assigns["ans"] = $ans;
     if ($_SESSION["msg"]) {
         $this->assigns["msg"] = $_SESSION["msg"];
         unset($_SESSION["msg"]);
     }
 }
Exemple #4
0
 public function mailling()
 {
     // mailing
     $this->tpl_name = "";
     $code = $this->Code->get_by_key("rec_m");
     $len_code = sizeof($code);
     if ($len_code < 1) {
         return;
     }
     for ($i = 0; $i < $len_code; $i++) {
         $em = $this->Recruit->get_email_by_interist($code[$i]["_value"], 7);
         $len_em = sizeof($em);
         for ($ee = 0; $ee < $len_em; $ee++) {
             $_id = $code[$i]["_value"];
             $r = $this->Recruit->get($_id);
             $iv = $this->Recruit_opt->get_detail($_id, 7, 1);
             $r["inv"] = $iv["_value"];
             $local = $this->Recruit_opt->get_detail($_id, 1, 1);
             $r["local"] = $local["_value"];
             $career = $this->Recruit_opt->get_detail($_id, 2, 1);
             $r["career"] = $career["_value"];
             $dev = $this->Recruit_opt->get_detail($_id, 3, 1);
             $r["dev"] = $dev["_value"];
             $term = $this->Recruit_opt->get_detail($_id, 4, 1);
             $r["term"] = $term["_value"];
             $lang = $this->Recruit_opt->get_detail($_id, 5, 1);
             $r["lang"] = $lang["_value"];
             $job = $this->Recruit_opt->get_detail($_id, 6, 1);
             $r["job"] = $job["_value"];
             $iv = $this->Recruit_opt->get_detail($_id, 7, 1);
             $r["inv"] = $iv["_value"];
             if ($em[$ee]["email"]) {
                 $m = new TF_mailer($this->settings);
                 $m->mailto = $em[$ee]["email"];
                 $m->subject = "[D.CAMP] " . $em[$ee]["name"] . "님, 업무분야에 해당하는 채용공고를 알려드립니다.";
                 $m->tpl_name = "recruit";
                 $m->assigns["us"] = $em[$ee];
                 $m->assigns["res"] = $r;
                 $m->assigns["main_service_url"] = $this->globals->my_host;
                 $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                 $m->send();
                 echo $em[$ee]["email"];
             }
         }
         $this->Code->delete_c("rec_m", $code[$i]["_value"]);
     }
     exit(1);
 }
Exemple #5
0
 public function approve($_id)
 {
     $this->assigns_layout["gnb_left"] = "reserve";
     $this->assigns["res"] = $this->Space_reserve->get_detail($_id);
     if ($_REQUEST["state"] || $_REQUEST["state"] == "0") {
         $this->Space_reserve->permit($_id, $_REQUEST);
         if ($_REQUEST["state"] == 1) {
             $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
             $arr["act_id"] = $this->assigns["res"]["user_id"];
             $arr["target_type"] = Activity_model::A_TYPE_SPACE;
             $arr["target_id"] = $_id;
             $arr["act_result"] = 1;
             $this->Activity->edit($arr);
             $ev = $this->Space_reserve->get_detail($_REQUEST["id"]);
             $m = new TF_mailer($this->settings);
             $m->mailto = $ev["memail"];
             $m->subject = "[D.CAMP] 공간 예약이 승인되었습니다.";
             $m->tpl_name = "space";
             $m->assigns["res"] = $ev;
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
         }
         if ($_REQUEST["state"] == 2) {
             $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
             $arr["act_id"] = $this->assigns["res"]["user_id"];
             $arr["target_type"] = Activity_model::A_TYPE_SPACE;
             $arr["target_id"] = $_id;
             $arr["act_result"] = 2;
             $this->Activity->edit($arr);
             $ev = $this->Space_reserve->get_detail($_REQUEST["id"]);
             if (date("Y.m.d") < $ev["date"]) {
                 $m = new TF_mailer($this->settings);
                 $m->mailto = $ev["memail"];
                 $m->subject = "[D.CAMP] 공간 예약이 반려되었습니다.";
                 $m->tpl_name = "space";
                 $m->assigns["res"] = $ev;
                 $m->assigns["main_service_url"] = $this->globals->my_host;
                 $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                 $m->send();
             }
         }
         header("Location: /admin_space");
     }
 }
Exemple #6
0
 public function daily_review()
 {
     $this->tpl_name = "";
     $date = date('Y.m.d');
     $_date = date("Y.m.d", strtotime(str_replace(".", "-", $date) . " -1 day"));
     $res = $this->Event->list_($_page, $pagesize, 'e.date_e = "' . $_date . '" and e.state = 1 and e.open = 1');
     $len_res = sizeof($res);
     for ($i = 0; $i < $len_res; $i++) {
         $ap = $this->Event_reserve->list_(1, 1000, 'er.state = 1 and event_id = ' . $res[$i]["id"]);
         $len_ap = sizeof($ap);
         for ($a = 0; $a < $len_ap; $a++) {
             echo $ap[$a]["email"] . "<br>";
             $m = new TF_mailer($this->settings);
             $m->mailto = $ap[$a]["email"];
             $m->subject = "[D.CAMP] " . $ap[$a]["mname"] . "님, 어제 참여한 이벤트의 후기를 남겨주세요.";
             $m->tpl_name = "event_review";
             $m->assigns["res"] = $res[$i];
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
         }
     }
     echo "<br>" . date('Y-m-d H:i');
     exit(1);
 }
Exemple #7
0
 public function dormant($_i)
 {
     $this->layout = "";
     $this->tpl_name = "";
     if ($_i == 7) {
         // // mailling
         $day = date("Y-m-d", strtotime(date(date("Y-m-d", strtotime(date("Y-m-d") . " -1 year"))) . " +7 day"));
         $res = $this->Members->list_m('', '', "last_login LIKE '" . $day . "%'");
         $len_res = sizeof($res);
         for ($i = 0; $i < $len_res; $i++) {
             if ($res[$i]["email"]) {
                 $m = new TF_mailer($this->settings);
                 $m->mailto = $res[$i]["email"];
                 $m->subject = "D.CAMP 장기 미사용 계정의 회원정보 휴면 파기안내";
                 $m->tpl_name = "dormant-account";
                 $m->assigns["day"] = date_to_kr(date("Y-m-d", strtotime(date(date("Y-m-d", strtotime(date("Y-m-d") . " -1 year"))) . " +7 day")));
                 $m->assigns["t_day"] = date_to_kr(date("Y-m-d", strtotime(date("Y-m-d") . " +7 day")));
                 $m->send();
             }
         }
     } else {
         if ($_i == 1) {
             // q
             $d_day = date("Y-m-d", strtotime(date(date("Y-m-d", strtotime(date("Y-m-d") . " -1 year"))) . " -2 day"));
             $this->Members->dormant($d_day);
             // mailling
             $day = date("Y-m-d", strtotime(date(date("Y-m-d", strtotime(date("Y-m-d") . " -1 year"))) . " +1 day"));
             $res = $this->Members->list_m('', '', "last_login LIKE '" . $day . "%'");
             $len_res = sizeof($res);
             for ($i = 0; $i < $len_res; $i++) {
                 if ($res[$i]["email"]) {
                     $m = new TF_mailer($this->settings);
                     $m->mailto = $res[$i]["email"];
                     $m->subject = "D.CAMP 장기 미사용 계정의 회원정보 휴면 파기안내";
                     $m->tpl_name = "dormant-account";
                     $m->assigns["day"] = date_to_kr(date("Y-m-d", strtotime(date(date("Y-m-d", strtotime(date("Y-m-d") . " -1 year"))) . " +1 day")));
                     $m->assigns["t_day"] = date_to_kr(date("Y-m-d", strtotime(date("Y-m-d") . " +1 day")));
                     $m->send();
                 }
             }
         }
     }
 }
Exemple #8
0
 public function edit_rsv_apr($_id)
 {
     $this->assigns_layout["sideb"] = "edit";
     $res = $this->Space_reserve->get_detail($_id);
     if ($res["type"] == 3) {
         if ($this->Code->check("rep2", $_SESSION["s"]["id"])) {
             if (array_key_exists("state", $_REQUEST)) {
                 $this->Space_reserve->permit($_REQUEST["id"], $_REQUEST);
                 $res["state"] = $_REQUEST["state"];
                 if ($_REQUEST["state"] == 1) {
                     $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
                     $arr["act_id"] = $res["user_id"];
                     $arr["target_type"] = Activity_model::A_TYPE_SPACE;
                     $arr["target_id"] = $_REQUEST["id"];
                     $arr["act_result"] = 1;
                     $this->Activity->edit($arr);
                     $m = new TF_mailer($this->settings);
                     $m->mailto = $res["memail"];
                     $m->subject = "[D.CAMP] 공간 예약이 승인되었습니다.";
                     $m->tpl_name = "space";
                     $m->assigns["res"] = $res;
                     $m->assigns["main_service_url"] = $this->globals->my_host;
                     $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                     $m->send();
                 }
                 if ($_REQUEST["state"] == 2) {
                     $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
                     $arr["act_id"] = $res["user_id"];
                     $arr["target_type"] = Activity_model::A_TYPE_SPACE;
                     $arr["target_id"] = $_REQUEST["id"];
                     $arr["act_result"] = 2;
                     $this->Activity->edit($arr);
                     // if (date("Y.m.d")<$res["date"]) {
                     $m = new TF_mailer($this->settings);
                     $m->mailto = $res["memail"];
                     $m->subject = "[D.CAMP] 공간 예약이 반려되었습니다.";
                     $m->tpl_name = "space";
                     $m->assigns["res"] = $res;
                     $m->assigns["main_service_url"] = $this->globals->my_host;
                     $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                     $m->send();
                     // }
                 }
                 $_SESSION["msg"] = "공간 예약 승인 상태가 저장되었습니다.";
                 header("Location: /member/edit_rsv2");
             }
             $this->assigns["res"] = $res;
         } else {
             $_SESSION["msg"] = "권한이 없는 접근입니다.";
             header("Location: /");
         }
     } else {
         if ($this->Code->check("rep1", $_SESSION["s"]["id"])) {
             $this->assigns["res"] = $res;
             $this->assigns["space"] = $this->Space->list_(1, 100, "visible = 1");
             if (array_key_exists("state", $_REQUEST)) {
                 $this->Space_reserve->permit($_REQUEST["id"], $_REQUEST);
                 $res["state"] = $_REQUEST["state"];
                 if ($_REQUEST["state"] == 1) {
                     $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
                     $arr["act_id"] = $res["user_id"];
                     $arr["target_type"] = Activity_model::A_TYPE_SPACE;
                     $arr["target_id"] = $_REQUEST["id"];
                     $arr["act_result"] = 1;
                     $this->Activity->edit($arr);
                     $m = new TF_mailer($this->settings);
                     $m->mailto = $res["memail"];
                     $m->subject = "[D.CAMP] 공간 예약이 승인되었습니다.";
                     $m->tpl_name = "space";
                     $m->assigns["res"] = $res;
                     $m->assigns["main_service_url"] = $this->globals->my_host;
                     $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                     $m->send();
                 }
                 if ($_REQUEST["state"] == 2) {
                     $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
                     $arr["act_id"] = $res["user_id"];
                     $arr["target_type"] = Activity_model::A_TYPE_SPACE;
                     $arr["target_id"] = $_REQUEST["id"];
                     $arr["act_result"] = 2;
                     $this->Activity->edit($arr);
                     // if (date("Y.m.d")<$res["date"]) {
                     $m = new TF_mailer($this->settings);
                     $m->mailto = $res["memail"];
                     $m->subject = "[D.CAMP] 공간 예약이 반려되었습니다.";
                     $m->tpl_name = "space";
                     $m->assigns["res"] = $res;
                     $m->assigns["main_service_url"] = $this->globals->my_host;
                     $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                     $m->send();
                     // }
                 }
                 $_SESSION["msg"] = "공간 예약 승인 상태가 저장되었습니다.";
                 header("Location: /member/edit_rsv1");
             }
         } else {
             $_SESSION["msg"] = "권한이 없는 접근입니다.";
             header("Location: /");
         }
     }
 }
Exemple #9
0
 public function approve($_id)
 {
     $this->assigns_layout["gnb_left"] = "event";
     if ($_REQUEST["id"]) {
         $this->Event->edit($_REQUEST);
         if ($_REQUEST["state"] > 0) {
             $ev = $this->Event->get_detail($_REQUEST["id"]);
             $arr["act_type"] = Activity_model::C_TYPE_MEMBER;
             $arr["act_id"] = $ev["user_id"];
             $arr["target_type"] = Activity_model::A_TYPE_EVENT;
             $arr["target_id"] = $ev["id"];
             $arr["is_made"] = 1;
             $arr["act_result"] = $_REQUEST["state"];
             $this->Activity->edit($arr);
             if ($ev["state"] == 2 && date("Y.m.d") > $ev["date"]) {
             } else {
                 $st = "승인";
                 if ($ev["state"] == 2) {
                     $st = "반려";
                 }
                 $m = new TF_mailer($this->settings);
                 $m->mailto = $ev["memail"];
                 $m->subject = "[D.CAMP] " . $ev["mname"] . "님의 이벤트가 " . $st . "되었습니다.";
                 $m->tpl_name = "event_approve";
                 $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["msg"] = "수정되었습니다.";
     }
     $this->assigns["res"] = $this->Event->get_detail($_id);
 }
Exemple #10
0
 public function change_cat_qna($_id, $_cat)
 {
     $this->tpl_name = "";
     if (($_SESSION["s"]["per"] & $this->settings->permission1) == $this->settings->permission1 || $this->Faq->check_cat_u($_SESSION["s"]["id"])) {
         $_arr["id"] = $_id;
         $_arr["cat"] = $_cat;
         $id = $this->Faq->add($_arr);
         if ($id) {
             $cat = $this->Faq->get_category($_cat, 2);
             if ($cat) {
                 $m = new TF_mailer($this->settings);
                 $m->mailto = $cat["email"];
                 $m->subject = "[D.CAMP] 새로운 Q&A가 등록되었습니다.";
                 $m->tpl_name = "support_qna";
                 $m->assigns["res"] = $this->Faq->get($_id);
                 $m->assigns["id"] = $_id;
                 $m->assigns["cat"] = $cat["category"];
                 $m->assigns["main_service_url"] = $this->globals->my_host;
                 $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                 $m->send();
                 $_SESSION["msg"] = "담당자가 변경되었습니다.";
             } else {
                 echo "error1";
             }
         } else {
             echo "error2";
         }
     } else {
         echo "error3";
     }
 }
Exemple #11
0
 public function examiner_add()
 {
     $this->assigns_layout["gnb_left"] = "competition_pool";
     if ($_REQUEST["ex_email"]) {
         $_email = explode(",", $_REQUEST["ex_email"]);
         if ($_email) {
             $len_email = sizeof($_email);
             for ($i = 0; $i < $len_email; $i++) {
                 $_exn = $this->Members->get_by_email($_email[$i]);
                 $arr["user_id"] = $_exn["id"];
                 if (!$_exn) {
                     $arr["email"] = $_email[$i];
                 }
                 $arr["public"] = 1;
                 $check = $this->Competitions_examiner->check($arr);
                 if (!$check) {
                     $_id = $this->Competitions_examiner->add($arr);
                     // mail, activity
                     if (email_valid($_email[$i])) {
                         $m = new TF_mailer($this->settings);
                         $m->mailto = $_email[$i];
                         $m->subject = "[D.CAMP] DCAMP에서 경진대회 심사위원단으로 초대하였습니다.";
                         $m->tpl_name = "competition_pool";
                         $m->assigns["id"] = $_id;
                         $m->assigns["e"] = $_email[$i];
                         $m->assigns["con"] = $_REQUEST["ex_con"];
                         $m->assigns["main_service_url"] = $this->globals->my_host;
                         $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                         $m->send();
                     }
                 } else {
                     $_SESSION["msg"] = "이미 초대된 회원이 있습니다.";
                 }
             }
         }
         header("Location: /admin_competition/examiner_list");
     }
 }
Exemple #12
0
 public function winner($_id = '')
 {
     if (!$_SESSION["s"]) {
         $_SESSION["msg"] = "로그인 후 이용하실 수 있습니다.";
         header("Location: /");
     }
     if (!$_id) {
         header("Location: /error_404");
     }
     if ($_REQUEST["winner"]) {
         $this->Competitions->add($_REQUEST);
         $res = $this->Competitions_apply->list_(1, 1000, "ca.win = 1 and ca.competition_id = " . $_id);
         for ($i = 0; $i < sizeof($res); $i++) {
             //mailing
             $com = $this->Competitions->get($_REQUEST["id"]);
             $m = new TF_mailer($this->settings);
             $m->mailto = $res[$i]["memail"];
             $m->subject = "[D.CAMP] " . $res[$i]["name"] . "님이 신청하신 경진대회의 수상자가 발표되었습니다.";
             $m->tpl_name = "competition_winner";
             $m->assigns["res"] = $com;
             $m->assigns["user"] = $res[$i];
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
         }
     }
     $result = $this->Competitions->get($_id);
     $this->assigns["res"] = $result;
     $this->sub();
     $this->assigns["m_list"] = $this->Competitions->get_list(1, 5, "c.user_id = " . $_SESSION["s"]["id"]);
     $this->assigns["e_list"] = $this->Competitions_examiner->list_all(1, 5, "ce.user_id = " . $_SESSION["s"]["id"]);
     $this->assigns["a_list"] = $this->Competitions_apply->list_all(1, 5, "ca.user_id = " . $_SESSION["s"]["id"]);
     $this->assigns["op"] = $op;
     $opr = $this->Competitions_examiner->operator_check($result["id"], $_SESSION["s"]["id"]);
     $this->get_process($result);
     if ($_SESSION["s"]["id"] != $result["user_id"] && !$opr) {
         header("Location: /error_404");
     }
 }
Exemple #13
0
 public function notice()
 {
     $res = $this->Office_hours->list_('', '', "a_end like '" . date("Y.m.d", strtotime("-1 day")) . "%'");
     for ($i = 0; $i < sizeof($res); $i++) {
         $mento = $this->Office_mento->get_by_member($res[$i]["mento_id"]);
         $m = new TF_mailer($this->settings);
         $m->mailto = $mento["email"];
         $m->subject = "[D.CAMP] " . date_to_kr($res[$i]["e_start"]) . " 진행 예정인 Office hours의 신청자 접수가 마감되었습니다.";
         $m->tpl_name = "mail-officehours-notify";
         $m->assigns["title"] = date_to_kr($res[$i]["e_start"]) . " 진행 예정인 Office hours의 신청자 접수가 마감되었습니다. 상담을 진행할 기업 선정을 부탁드립니다.";
         $m->assigns["oh"] = $res[$i];
         $m->assigns["m"] = $mento;
         $m->assigns["main_service_url"] = $this->globals->my_host;
         $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
         $m->send();
     }
     $this->layout = "";
     $this->tpl_name = "";
 }
Exemple #14
0
 public function save_apply()
 {
     $this->tpl_name = "";
     if ($_REQUEST["user_id"]) {
         $_id = $this->Program_apply->add($_REQUEST);
         $form = $this->Program_form->get_by_comp($_REQUEST["program_id"]);
         if ($form) {
             $this->Program_form->del_form_res($_id);
             for ($f = 0; $f < sizeof($form); $f++) {
                 if ($_REQUEST["form" . $form[$f]["id"]]) {
                     $arr["apply_id"] = $_id;
                     $arr["c_form_id"] = $form[$f]["id"];
                     $arr["res"] = $_REQUEST["form" . $form[$f]["id"]];
                     $this->Program_form->res_add($arr);
                 }
             }
         }
         $file = $this->Program_file->get_by_comp($_REQUEST["program_id"]);
         if ($file) {
             $file_date_dir = $_REQUEST["program_id"];
             if (!is_dir($this->settings->upload_path . "/media/program_file/" . $file_date_dir)) {
                 @mkdir($this->settings->upload_path . "/media/program_file/" . $file_date_dir, 0777);
                 exec("chmod 777 " . $this->settings->upload_path . "/media/program_file/" . $file_date_dir);
             }
             $len_file = sizeof($file);
             for ($i = 0; $i < $len_file; $i++) {
                 $f = null;
                 if ($_FILES["file_" . $file[$i]["id"]]["name"]) {
                     $f = make_upload("/media/program_file/" . $file_date_dir . '/', "file_" . $file[$i]["id"]);
                     $_ar["file"] = $f;
                     $_ar["c_file_id"] = $file[$i]["id"];
                     $_ar["apply_id"] = $_id;
                     $this->Program_file->add_res($_ar);
                     if ($_REQUEST["o_file_" . $file[$i]["id"]]) {
                         unlink($this->settings->root_path . "media/program_file/" . $file_date_dir . '/' . $_REQUEST["o_file_" . $file[$i]["id"]]);
                     }
                 }
             }
         }
         if ($_REQUEST["f_s_des"] && $_REQUEST["f_service"] && $_REQUEST["ser_id"]) {
             $arr3["startup_id"] = $_REQUEST["st_id"];
             $arr3["id"] = $_REQUEST["ser_id"];
             $arr3["name"] = $_REQUEST["f_service"];
             $arr3["des_ele"] = $_REQUEST["f_s_des"];
             $this->Startup_service->add2($arr3);
         }
         $ev = $this->Program->get_list('', '', "c.id = " . $_REQUEST["program_id"]);
         $_ev = $ev[0];
         $m = new TF_mailer($this->settings);
         $m->mailto = $ev["memail"];
         $m->subject = "[D.CAMP] " . $_SESSION["s"]["name"] . "님의 '" . $_ev["title"] . "'' 스타트업 지원 프로그램에 지원하었습니다.";
         $m->tpl_name = "program_apply";
         $m->assigns["res"] = $_ev;
         $m->assigns["u"] = $_SESSION["s"]["name"];
         $m->assigns["main_service_url"] = $this->globals->my_host;
         $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
         $m->send();
         $_SESSION["msg"] = "스타트업 지원 프로그램 신청이 접수되었습니다.";
         header("Location: /member/edit_program/");
         exit(1);
     }
 }
Exemple #15
0
 public function doffice_send_mail()
 {
     $m = new TF_mailer($this->settings);
     $m->mailto = "*****@*****.**";
     $m->subject = "[D.Office] BOOK A TOUR 신청";
     $m->tpl_name = "doffice";
     $m->assigns["name"] = $_REQUEST["name"];
     $m->assigns["email"] = $_REQUEST["email"];
     $m->assigns["phone"] = $_REQUEST["phone"];
     $m->assigns["needs"] = $_REQUEST["needs"];
     $m->assigns["main_service_url"] = $this->globals->my_host;
     $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
     $m->send();
     $this->tpl_name = "";
 }
Exemple #16
0
 public function views($_id)
 {
     $res = $this->Faq->get($_id);
     if (!$res) {
         header("Location: /support");
     }
     if ($res["type"] == 1) {
         $res["cat"] = $this->Faq->get_category($res["cat"], 1);
         $this->assigns["res"] = $res;
     } elseif ($res["type"] == 2) {
         $check = $this->Faq->check_cat_u($_SESSION["s"]["id"], $res["cat"]);
         if ($res["open"] == 0 && $res["user_id"] != $_SESSION["s"]["id"] && !$check) {
             $_SESSION["msg"] = "접근 권한이 없습니다.";
             header("Location: /support/qna");
         }
         if ($_REQUEST["content"] && $check) {
             // parent
             $_a["id"] = $_REQUEST["parent"];
             $_a["re_suc"] = 1;
             $this->Faq->add($_a);
             // reply
             $_aa["content"] = $_REQUEST["content"];
             $_aa["parent"] = $_REQUEST["parent"];
             $_aa["id"] = $_REQUEST["p_id"];
             $an = $this->Faq->add($_aa);
             $_SESSION["msg"] = "답변이 저장되었습니다.";
             //maliing
             $q = $this->Faq->list_(2, 1, 1, "f.id = " . $_REQUEST["parent"]);
             $staff = $this->Faq->get_category($q[0]["cat"], 2);
             $m = new TF_mailer($this->settings);
             $m->mailto = $_REQUEST["emailer"];
             $m->subject = "[D.CAMP] 작성하신 Q&A의 답변이 등록되었습니다.";
             $m->tpl_name = "support_qna_re";
             $m->assigns["res"] = $q[0];
             $m->assigns["cat"] = $q[0]["category"];
             $m->assigns["s"] = $staff;
             $m->assigns["ans"]["content"] = $_REQUEST["content"];
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
             //activity
             $ar["com_type"] = 1;
             $ar["com_id"] = $q[0]["user_id"];
             $ar["act_type"] = 1;
             $ar["act_id"] = $q[0]["user_id"];
             $ar["msg"] = "<a href='/support/views/" . $q[0]["id"] . "'>Q&A</a>의 답변이 등록되었습니다.";
             $this->Activity->add($ar);
             header("Location: /support/qna");
         }
         $res["cat"] = $this->Faq->get_category($res["cat"], 2);
         $res["act"] = $this->Faq->get_reply($_id);
         $category = $this->Faq->list_category(1, 1000, 2);
         $this->assigns["res"] = $res;
         $this->assigns["category"] = $category;
     }
 }
Exemple #17
0
 public function permit_membership()
 {
     $this->Recommend->permit($_REQUEST["id"], $_REQUEST["user_id"], $_REQUEST["state"], $_REQUEST["state_des"]);
     $this->tpl_name = "";
     $user = $this->Members->get($_REQUEST["user_id"]);
     if ($_REQUEST["state"] == 1) {
         $msg = "D.CAMP 멤버십 가입이 승인되었습니다.";
         $arr["com_type"] = 1;
         $arr["com_id"] = $user["id"];
         $arr["act_type"] = 1;
         $arr["act_id"] = $user["id"];
         $arr["msg"] = $msg;
         $this->Activity->add($arr);
         $m = new TF_mailer($this->settings);
         $m->mailto = $user["email"];
         $m->subject = "[D.CAMP] 멤버십 승인 메일입니다.";
         $m->tpl_name = "membership";
         $m->assigns["main_service_url"] = $this->globals->my_host;
         $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
         $m->send();
     } else {
         if ($_REQUEST["state"] == 2) {
             $msg = "D.CAMP 멤버십 가입신청이 반려되었습니다.";
             if ($_REQUEST["state_des"]) {
                 $msg = $msg . " 반려사유는 '" . $_REQUEST["state_des"] . "' 입니다.";
             }
             $arr2["com_type"] = 1;
             $arr2["com_id"] = $user["id"];
             $arr2["act_type"] = 1;
             $arr2["act_id"] = $user["id"];
             $arr2["msg"] = $msg;
             $this->Activity->add($arr2);
             $m = new TF_mailer($this->settings);
             $m->mailto = $user["email"];
             $m->subject = "[D.CAMP] 멤버십 반려 메일입니다.";
             $m->tpl_name = "membership";
             $m->assigns["status"] = 1;
             $m->assigns["des"] = $_REQUEST["state_des"];
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
         }
     }
     echo json_encode($result = NULL);
 }
Exemple #18
0
 public function examiner_confirm()
 {
     $this->tpl_name = "";
     if ($_REQUEST["competition_id"] && $_REQUEST["users"]) {
         $this->Competitions_examiner->confirm($_REQUEST["competition_id"], $_REQUEST["users"]);
         $this->Competitions->set_ex_confirm($_REQUEST["competition_id"]);
         $res = $this->Competitions->get($_REQUEST["competition_id"]);
         $ex = $this->Competitions_examiner->get_by_comp_outer($res["id"], 1, 100, "ce.status = 1");
         for ($i = 0; $i < sizeof($ex); $i++) {
             //mailing
             $e = $ex[$i]["memail"];
             if (!$e) {
                 $e = $ex[$i]["email"];
             }
             $us = $this->Members->get($res["user_id"]);
             $m = new TF_mailer($this->settings);
             $m->mailto = $e;
             if ($ex[$i]["name"]) {
                 $m->subject = "[D.CAMP] " . $ex[$i]["name"] . "님이 경진대회 심사위원으로 최종 선정되었습니다.";
             } else {
                 $m->subject = "[D.CAMP] 경진대회 심사위원으로 최종 선정되었습니다.";
             }
             $m->tpl_name = "competition_invite_fix";
             $m->assigns["res"] = $res;
             $m->assigns["user"] = $ex[$i]["name"];
             $m->assigns["main_service_url"] = $this->globals->my_host;
             $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
             $m->send();
         }
     }
 }
Exemple #19
0
 public function login()
 {
     if ($_SESSION["s"]) {
         header("Location: /member/" . $_SESSION["s"]["ids"]);
     }
     if ($_REQUEST["ids"]) {
         $check = $this->Members->login($_REQUEST);
         //            print_r($check); exit(1);
         if ($check == "error_9") {
             $this->assigns["ids"] = $_REQUEST["ids"];
             $this->assigns_layout["msg"] = "비밀번호를 확인해주세요.";
         } else {
             if ($check == "error_404") {
                 $this->assigns_layout["msg"] = "아이디를 확인해주세요.";
             } else {
                 if ($check == "error_300") {
                     $this->assigns_layout["msg"] = "회원 인증이 완료되지 않았습니다.<br />인증메일을 확인해주세요.";
                 } else {
                     if ($check == "error_200") {
                         $u = $this->Members->get_by_ids($_REQUEST["ids"]);
                         $new_pw = make_code();
                         $this->Members->edit_pwd_by_mail($u["id"], $new_pw);
                         $m = new TF_mailer($this->settings);
                         $m->mailto = $u["email"];
                         $m->subject = "[D.CAMP] 비밀번호 찾기 메일입니다.";
                         $m->tpl_name = "pw_renew";
                         $m->assigns["userid"] = $u["ids"];
                         $m->assigns["new_pw"] = $new_pw;
                         $m->assigns["main_service_url"] = $this->globals->my_host;
                         $m->assigns["main_service_domain"] = $_SERVER['SERVER_NAME'];
                         $m->send();
                         $this->assigns_layout["msg"] = "안녕하세요. D.CAMP입니다.<br />D.CAMP의 새로운 홈페이지에 오신 것을 환영합니다.<br />홈페이지 이전과 함께 기존 가입자의 경우 등록하신 메일(" . $u["email"] . ")로 새로운 임시 비밀번호를 발송해드렸습니다.<br />메일을 확인하시고 임시 비밀번호로 로그인해주세요. (멤버십 등 기존에 이용하시던 데이터는 이전 후에도 계속 유지됩니다)";
                     } else {
                         $_SESSION["s"] = $this->Members->get($check);
                         if (!$_SESSION["s"]["picture"]) {
                             $_SESSION["s"]["picture"] = '/img/default-img-member.png';
                         }
                         $_SESSION["s"]["acnt"] = $this->Activity->get_a_cnt(1, $_SESSION["s"]["id"], '0');
                         $_SESSION["s"]["fb"] = $this->Member_ext->get_by_user_id_type($_SESSION["s"]["id"], 1);
                         $_SESSION["s"]["tw"] = $this->Member_ext->get_by_user_id_type($_SESSION["s"]["id"], 2);
                         // auto_login
                         if (array_key_exists("auto_login", $_REQUEST) && $_REQUEST["auto_login"] == "1") {
                             $auto_login = $_REQUEST['auto_login'];
                             $auto_login = remove_tags($auto_login);
                             //자동로그인 업데이트
                             $this->Members->update_by_key('auto_login', 1, $_SESSION["s"]["id"]);
                             $akey = $this->Member_auto->add($_SESSION["s"]['id'], $_SESSION["s"]['ids']);
                             $_SESSION["s"]["auto_login"] = 1;
                             setcookie("dcamp_id_save", $_SESSION["s"]['id'], time() + 1209600, "/");
                             setcookie("dcamp_akey", $akey, time() + 1209600, "/");
                             $_SESSION["msg"] = "현재 &#039;로그인 유지&#039; 기능을 이용중입니다. 다른 이용자들과 함께 사용하는 PC인 경우 이용 후 반드시 로그아웃을 해 주세요!";
                         }
                         $con = $this->Content_category->get_cat_by_user($_SESSION["s"]["id"], 'cc.hidden = 0');
                         if (sizeof($con) > 0) {
                             $_SESSION["s"]["con"] = $con;
                         }
                         $mt = $this->Office_mento->cnt("user_id = " . $_SESSION["s"]["id"]);
                         if ($mt > 0) {
                             $_SESSION["s"]["mento"] = true;
                         }
                         $_SESSION["s"]["rep1"] = $this->Code->check('rep1', $_SESSION["s"]["id"]);
                         $_SESSION["s"]["rep2"] = $this->Code->check('rep2', $_SESSION["s"]["id"]);
                         $return_url = remove_tags($_REQUEST['returl_url']);
                         if ($return_url) {
                             header("Location: " . $return_url);
                         } else {
                             header("Location: /");
                         }
                     }
                 }
             }
         }
     }
     if (array_key_exists('url_next', $_GET)) {
         $next = $_GET['url_next'];
         $next = remove_tags($next);
     }
     if ($next) {
         $this->assigns['returl_url'] = $next;
     } else {
         $this->assigns['returl_url'] = get_return_url($_SERVER['HTTP_REFERER'], remove_tags($_REQUEST['returl_url']));
     }
     if ($_REQUEST["next"]) {
         $this->assigns["next"] = $_REQUEST["next"];
     }
     if ($_SESSION["error"]) {
         if ($_SESSION["error"] == "no_fb") {
             unset($_SESSION["error"]);
             $this->assigns_layout["msg"] = "연동된 페이스북 계정이 없습니다.";
         }
     }
 }