Example #1
0
 function reset($_oh, $_aid)
 {
     $c = new Query();
     $c->value("apply_id", "");
     $c->where_eq("oh_id", $_oh);
     $c->where_eq("apply_id", $_aid);
     $this->update($c);
 }
Example #2
0
 function del_by_user($_cid, $_uid)
 {
     $this->debug();
     $c = new Query();
     $c->where_eq("user_id", $_uid);
     $c->where_eq("id", $_cid);
     $this->delete_cond($c);
 }
 function get_by_form($_aid, $_eid)
 {
     // $this->debug();
     $c = new Query();
     $c->where_eq("apply_id", $_aid);
     $c->where_eq("form_id", $_eid);
     $res = $this->fetch_one("*", $c);
     return $res;
 }
Example #4
0
 function get_follower($_type = '', $_id = '')
 {
     //        $this->debug();
     $c = new Query();
     $c->where_eq("follower", $_id);
     if ($_type) {
         $c->where_eq("type", $_type);
     }
     $res = $this->fetch("*", $c);
     return $res;
 }
Example #5
0
 function edit_by_fb($_arr)
 {
     $c = new Query();
     $c->value("ids", $_arr["ids"]);
     $c->value("secret", $_arr["secret"]);
     $c->value("date_created", "now()", 1);
     if ($_arr["public"]) {
         $c->value("public", $_arr["public"]);
     }
     $c->where_eq("user_id", $_arr["user_id"]);
     $c->where_eq("type", $_arr["type"]);
     $this->update($c);
 }
Example #6
0
 function cnt_by_opt($_tid, $_cid, $_where = '')
 {
     // $this->debug();
     $c = new Query();
     $c->from = "recruit r, recruit_opt ro";
     $c->where("ro.recruit_id = r.id");
     $c->where_eq("code_type", $_tid);
     $c->where_eq("code_id", $_cid);
     if ($_where) {
         $c->where($_where);
     }
     $res = $this->counts($c);
     return $res;
 }
Example #7
0
 function check($_type)
 {
     $c = new Query();
     $c->where_eq("name", $_type);
     $res = $this->fetch_one("id", $c);
     return $res;
 }
Example #8
0
 function edit($_id, $_state)
 {
     $c = new Query();
     $c->value("visible", $_state);
     $c->where_eq("id", $_id);
     $this->update($c);
 }
Example #9
0
 function del_form_res($_aid)
 {
     $c = new Query();
     $c->from = "competitions_form_res";
     $c->where_eq("apply_id", $_aid);
     $this->delete_cond($c);
 }
Example #10
0
 function add($_arr)
 {
     // $this->debug();
     $c = new Query();
     $c->value("dates", $_arr["dates"]);
     $c->value("times", $_arr["times"]);
     $c->value("url", $_arr["url"]);
     $c->value("img", $_arr["img"]);
     $c->value("title", str_replace('\'', '\'', $_arr["title"]));
     $c->value("subtitle", str_replace('\'', '\'', $_arr["subtitle"]));
     $c->value("author", str_replace('\'', '\'', $_arr["author"]));
     $c->value("publisher", str_replace('\'', '\'', $_arr["publisher"]));
     $c->value("c_date", $_arr["c_date"]);
     $c->value("tags", str_replace('\'', '\'', $_arr["tags"]));
     $c->value("mento_img", $_arr["mento_img"]);
     $c->value("mento_name", str_replace('\'', '\'', $_arr["mento_name"]));
     $c->value("mento_endor", str_replace('\'', '\'', $_arr["mento_endor"]));
     if ($_arr["id"]) {
         $c->where_eq("id", $_arr["id"]);
         $this->update($c);
         $id = $_REQUEST["id"];
     } else {
         $this->insert($c);
         $id = $this->last_id();
     }
     return $id;
 }
Example #11
0
 function add_error($_id)
 {
     $c = new Query();
     $c->where_eq('id', $_id);
     $c->value('error_cnt', 'error_cnt+1', true);
     $this->update($c);
 }
Example #12
0
 function get_by_mento($_id)
 {
     // $this->debug();
     $c = new Query();
     $c->where_eq("mento_id", $_id);
     $res = $this->fetch("*", $c);
     return $res;
 }
Example #13
0
 function edit($_id, $_type, $_cid)
 {
     $c = new Query();
     $c->value("type", $_type);
     $c->value("cid", $_cid);
     $c->where_eq("id", $_id);
     $this->update($c);
 }
Example #14
0
 function get_by_mento($_id)
 {
     $c = new Query();
     $c->where_eq("mento_id", $_id);
     $c->order = "id ASC";
     $res = $this->fetch("*", $c);
     return $res;
 }
Example #15
0
 function get_by_apply($_id)
 {
     $c = new Query();
     $c->where_eq("apply_id", $_id);
     $c->order = "id ASC";
     $res = $this->fetch("file", $c);
     return $res;
 }
Example #16
0
 function get_by_comp($_id)
 {
     //        $this->debug();
     $c = new Query();
     $c->where_eq("competition_id", $_id);
     $c->order = "id ASC";
     $res = $this->fetch("*", $c);
     return $res;
 }
Example #17
0
 function add($_label)
 {
     // $this->debug();
     $c = new Query();
     $c->where_eq("label", $_label);
     $res = $this->fetch_one("id", $c);
     $id = $res["id"];
     if (!$res) {
         $d = new Query();
         $d->value("label", $_label);
         $this->insert($d);
         $id = $this->last_id();
     }
     return $id;
 }
Example #18
0
 function add($_arr)
 {
     $c = new Query();
     $c->value("type", $_arr["type"]);
     $c->value("name", $_arr["name"]);
     $c->value("opt", $_arr["opt"]);
     $c->value("start", $_arr["start"]);
     $c->value("end", $_arr["end"]);
     $c->value("days", $_arr["days"]);
     $c->value("visible", $_arr["visible"]);
     if ($_REQUEST["id"]) {
         $c->where_eq("id", $_REQUEST["id"]);
         $this->update($c);
     } else {
         $c->value("date_created", "now()", 1);
         $this->insert($c);
     }
 }
Example #19
0
 function signout($_id)
 {
     $c = new Query();
     $c->from = "office_hours h, office_mento m";
     $c->where("m.id = h.mento_id");
     $c->where_eq("m.user_id", $_id);
     $this->delete_cond($c);
 }
Example #20
0
 function get_one($_id)
 {
     $c = new Query();
     $c->where_eq("type", $_id);
     return $this->fetch_one("*", $c);
 }
Example #21
0
 function signout($_id)
 {
     $c = new Query();
     $c->where_eq("user_id", $_id);
     $this->delete_cond($c);
 }
Example #22
0
 function check_cat_u($_id, $_cat = '')
 {
     // $this->debug();
     $c = new Query();
     $c->from = "faq_category";
     $c->where_eq("user_id", $_id);
     if ($_cat) {
         $c->where_eq("id", $_cat);
     }
     $res = $this->fetch_one("id", $c);
     return $res["id"];
 }
Example #23
0
 function add_login($_id)
 {
     $c = new Query();
     $c->value("last_login", "now()", 1);
     $c->where_eq("id", $_id);
     $this->update($c);
 }
Example #24
0
 function del_cont($_id)
 {
     // $this->debug();
     $c = new Query();
     $c->from = "newsletter_cont";
     $c->where_eq("newsl_id", $_id);
     $this->delete_cond($c);
 }
Example #25
0
 function check_first($_uid)
 {
     $this->debug();
     $c = new Query();
     $c->where_eq("is_mailed", 1);
     $c->where_eq("user_id", $_uid);
     $res = $this->fetch_one("id", $c);
     return $res["id"];
 }
Example #26
0
 function delete_by_id_user($id_user)
 {
     $c = new Query();
     $c->where_eq('user_id', $id_user);
     return $this->delete($c);
 }
Example #27
0
 function del($_user)
 {
     $c = new Query();
     $c->where_eq("startup_id", $_user);
     $this->delete_cond($c);
 }
Example #28
0
 function del_file($_cid)
 {
     $c = new Query();
     $c->where_eq("competition_id", $_cid);
     $this->delete_cond($c);
 }
Example #29
0
 function del_article($_id)
 {
     $c = new Query();
     $c->from = "startup_service_article";
     $c->where_eq("service_id", $_id);
     $this->delete_cond($c);
 }
Example #30
0
 function del_file_res($_cid)
 {
     $c = new Query();
     $c->from = "program_file_res";
     $c->where_eq("apply_id", $_cid);
     $this->delete_cond($c);
 }