function modify_exercise() { global $data; global $TABLE; $exseq = $this->get_post("exseq"); $page = $this->get_post("page"); try { $this->dbop->update($TABLE['exercise'], array("Name" => $this->post("exname", ""), "Type" => $this->post("extype", "1"), "KCal" => $this->post("kcal", "0"), "ExCode" => $this->post("excode", ""), "DateModified" => now()), array("Seq" => $exseq)); if ($this->post("ischnimg", "0") == "1") { $loc = upload_center("logophoto"); $locurl = ""; if (!is_null($loc)) { $locurl = '/www/upload/center/' . $loc['file_name']; $this->dbop->update($TABLE['exercise'], array("Logo" => $locurl), array("Seq" => $exseq)); } } gopage("admin/common/exercise?page=" . $page); } catch (Exception $e) { } }
function modify_center() { global $data; global $TABLE; $seq = $this->get_post("seq", -1); // Set validation rules $this->form_validation->set_rules('centercode', 'Center Code', 'required'); $this->form_validation->set_rules('centername', 'Center Name', 'required'); $this->form_validation->set_rules('workout', 'workout', 'required'); // If validation is failed if ($this->form_validation->run() == FALSE) { $this->load->admin_view("center_register", $data); } else { try { $this->dbop->update($TABLE['center'], array("CenterCode" => $this->post("centercode", ""), "CenterNm" => $this->post("centername", ""), "Adress" => $this->post("addr", ""), "WebSite" => $this->post("website", ""), "WorkoutSeq" => $this->post("workout", ""), "OpenDT" => now(), "UserID" => $this->post("userid", ""), "UserPW" => $this->post("userpwd", "")), array("Seq" => $seq)); $this->dbop->update($TABLE['admin'], array("AdminID" => $this->post("userid", ""), "AdminPW" => $this->post("userpwd", ""), "Permission" => "1", "CenterCode" => $this->post("centercode", "")), array("AdminSeq" => $seq, "Permission" => "1")); if ($this->post("ischnimg", "0") == "1") { $loc = upload_center("logophoto"); $locurl = ""; if (!is_null($loc)) { $locurl = '/www/upload/center/' . $loc['file_name']; $this->dbop->update($TABLE['center'], array("Logo" => $locurl), array("Seq" => $seq)); } } gopage("admin/ccenter/lists?page=" . $this->post("page", 0)); } catch (Exception $e) { } } }