alert('投稿タイトルが入力されていません');"); } else if (($act == "add") && ((filter_input(INPUT_POST, "regist_lat") == null) || (filter_input(INPUT_POST, "regist_lng") == null))) { $status = 1; print(""); } } else { $status = 1; } if ($status == 0) { $up_image = new UploadImage(); $regist_db = new Regist_DB(); $regist_db->setRegist_tableName("m_regist"); $regist_db->setText_tableName("t_registdata"); if ($act == "add") { $r_id = $regist_db->getNextId(); } else { $r_id = filter_input(INPUT_POST, "regist_id"); } $text_data = filter_input(INPUT_POST, "text_data"); $line_id = filter_input(INPUT_POST, "line_id"); $regist_data->setRegist_id($r_id); $regist_data->setRegist_name(filter_input(INPUT_POST, "regist_name")); $regist_data->setRegist_lat(filter_input(INPUT_POST, "regist_lat")); $regist_data->setRegist_lng(filter_input(INPUT_POST, "regist_lng")); $regist_data->setCategory_id(filter_input(INPUT_POST, "category_id")); $text = new TextArrangement($text_data, $line_id); $text->createSentenceArray(); if ($_FILES["image_file"]["tmp_name"] != null) { $up_image->setTmpUpLoadFile($_FILES["image_file"]["tmp_name"]); $up_image->setUpLoadFile($_FILES["image_file"]["name"]); $up_image->checkExt(); if (($up_image->getExt() == "jpg") || ($up_image->getExt() == "JPG") || ($up_image->getExt() == "jpeg") || ($up_image->getExt() == "png")) { $up_image->setFileName($r_id . "." . $up_image->getExt()); $up_image->UpLoad(); if($up_image->ResizeImage("./image_thumb/", 150) && $up_image->ResizeImage("./image/", 500)){ $regist_data->setFile_name($up_image->getFileName()); }else{ print(""); $regist_data->setFile_name("toshinaga.jpg"); } } else { print(""); $regist_data->setFile_name("toshinaga.jpg"); } } else { $regist_data->setFile_name("toshinaga.jpg"); } if ($act == "add") { if ($regist_db->regist_data($regist_data) < 1) { print(""); } if ($regist_db->regist_text_data($r_id, $text->getSentenceArray(), $text->getRow()) < 1) { print(""); } } else if ($act == "up") { if ($regist_db->update_data($regist_data) < 1) { print(""); } if ($regist_db->update_text_data($r_id, $text->getSentenceArray(), $text->getRow()) < 1) { print(""); } } else if ($act == "del") { if ($regist_db->delete_data($r_id) < 1) { print(""); } } } /* ------------------▲データ登録関係▲-------------------- */ /* ------------------▼データ取得関係▼-------------------- */ $select_category = $_POST['category']; $regist_get = new Regist_get(); $regist_get->setRegist_tableName("m_regist"); $regist_get->setText_tableName("t_registdata"); $regist_get->setCategory_tableName("m_category"); $category_list = $regist_get->get_categroy(); if ($select_category != null) { $regist_list = $regist_get->getRefine_list($select_category); } else { $regist_list = $regist_get->getRegist_list(); } if ($regist_list != null) { foreach ($regist_list as $i => $data) { $regist_id_list_tmp[$i] = $data->getRegist_id(); $regist_name_list_tmp[$i] = $data->getRegist_name(); $regist_lat_list_tmp[$i] = $data->getRegist_lat(); $regist_lng_list_tmp[$i] = $data->getRegist_lng(); $regist_category_list_tmp[$i] = $data->getCategory_id(); $regist_file_list_tmp[$i] = $data->getFile_name(); } $regist_id_list = join(",", $regist_id_list_tmp); $regist_name_list = join(",", $regist_name_list_tmp); $regist_lat_list = join(",", $regist_lat_list_tmp); $regist_lng_list = join(",", $regist_lng_list_tmp); $regist_category_list = join(",", $regist_category_list_tmp); $regist_file_list = join(",", $regist_file_list_tmp); unset($regist_list); } if ($regist_data->getRegist_lat() != null) { $lat = $regist_data->getRegist_lat(); } else { $lat = 36.745987; } if ($regist_data->getRegist_lng() != null) { $lng = $regist_data->getRegist_lng(); } else { $lng = 137.012046; } if (filter_input(INPUT_POST, "d_zoom") != null) { $zoom = filter_input(INPUT_POST, "d_zoom"); } else { $zoom = 16; } /* ------------------▲データ取得関係▲-------------------- */ ?>