Пример #1
0
         $zone_id = 1;
     }
 }
 // ページの選択
 $page = isset($_POST["page"]) ? $_POST["page"] : 0;
 // 新規作成
 if (isset($_POST["submit_add"])) {
     $_POST["new_zone"] = $zone_id;
     $cols = array("zone", "id", "name", "nm", "category", "image", "walkspeed", "delay", "search", "follow", "link", "maxlevel", "minlevel", "repop", "maxpop", "skill", "dropitem", "soul", "steal", "note", "event");
     foreach ($cols as $col) {
         $values[] = isset($_POST["new_" . $col]) ? "'" . mysqli_real_escape_string($data->m_Con, $_POST["new_" . $col]) . "'" : 0;
     }
     $cols = implode(",", $cols);
     $values = implode(",", $values);
     $data->insert_data($table, $cols, $values);
     $data->timestamp($table, "zone=" . $_POST["new_zone"] . " AND id=" . $_POST["new_id"]);
 }
 // 変更
 if (isset($_POST["submit_upd"])) {
     $id = key($_POST["submit_upd"]);
     $target = "zone=" . $zone_id . " AND id=" . $id;
     $cols = array("name", "nm", "category", "image", "walkspeed", "delay", "search", "follow", "link", "maxlevel", "minlevel", "repop", "maxpop", "skill", "dropitem", "soul", "steal", "note", "event");
     foreach ($cols as $col) {
         $values[] = isset($_POST[$col][$id]) ? mysqli_real_escape_string($data->m_Con, preg_replace("/[\r][\n]/", "\n", $_POST[$col][$id])) : 0;
     }
     $data->update_data($table, $cols, $values, $target);
     $data->timestamp($table, $target);
 }
 // 登録件数
 if (isset($_SESSION["user"]) && isset($_SESSION["pass"])) {
     $data->select_column("id", $table, "zone", $zone_id);
Пример #2
0
if (isset($_SERVER["REQUEST_METHOD"]) == "POST" && !isset($login_err)) {
    // ログアウト
    if (isset($_POST["submit_logout"])) {
        session_destroy();
        selfpage();
    }
    // 新規作成
    if (isset($_POST["submit_add"])) {
        $cols = array("id", "name", "nameE", "nameS", "event");
        foreach ($cols as $col) {
            $values[] = isset($_POST["new_" . $col]) ? "'" . mysqli_real_escape_string($data->m_Con, $_POST["new_" . $col]) . "'" : 0;
        }
        $cols = implode(",", $cols);
        $values = implode(",", $values);
        $data->insert_data($table, $cols, $values);
        $data->timestamp($table, "id=" . $_POST["new_id"]);
    }
    // 変更
    if (isset($_POST["submit_upd"])) {
        $id = key($_POST["submit_upd"]);
        $target = "id=" . $id;
        $cols = array("name", "nameE", "nameS", "event");
        foreach ($cols as $col) {
            $values[] = isset($_POST[$col][$id]) ? mysqli_real_escape_string($data->m_Con, preg_replace("/[\r][\n]/", "\n", $_POST[$col][$id])) : 0;
        }
        $data->update_data($table, $cols, $values, $target);
        $data->timestamp($table, $target);
    }
}
?>
<html>
Пример #3
0
if (isset($_SERVER["REQUEST_METHOD"]) == "POST" && !isset($login_err)) {
    // ログアウト
    if (isset($_POST["submit_logout"])) {
        session_destroy();
        selfpage();
    }
    // 新規作成
    if (isset($_POST["submit_add"])) {
        $cols = array("lv", "hp", "sp", "str", "vit", "dex", "agi", "wis", "wil");
        foreach ($cols as $col) {
            $values[] = isset($_POST["new_" . $col]) ? "'" . $_POST["new_" . $col] . "'" : 0;
        }
        $cols = implode(",", $cols);
        $values = implode(",", $values);
        $data->insert_data($table, $cols, $values);
        $data->timestamp("class", "nameS='{$table}'");
    }
    // 範囲指定新規作成
    if (isset($_POST["submit_addmulti"])) {
        for ($lv = $_POST["start"]; $lv <= $_POST["end"]; $lv++) {
            $data->insert_data($table, "lv", $lv);
        }
        $data->timestamp("class", "nameS='{$table}'");
    }
    // 変更
    if (isset($_POST["submit_upd"])) {
        $lv = key($_POST["submit_upd"]);
        $target = "lv=" . $lv;
        $cols = array("hp", "sp", "str", "vit", "dex", "agi", "wis", "wil");
        foreach ($cols as $col) {
            $values[] = isset($_POST[$col][$lv]) ? preg_replace("/[\r][\n]/", "\n", $_POST[$col][$lv]) : 0;