Пример #1
0
            $Image = new upload($_FILES[$Column]);
            if ($Image->uploaded) {
                foreach (array_keys($ColumnCommands[$Column]) as $Item) {
                    if (substr($Item, 0, 3) == "io_") {
                        $ImgOptionKey = substr($Item, 3);
                        $Val = $ColumnCommands[$Column]["io_" . $ImgOptionKey][0];
                        $Val = str_replace("[id]", $LastInsertId, $Val);
                        $Val = str_replace("[timestamp]", time(), $Val);
                        $Image->{$ImgOptionKey} = $Val;
                    }
                }
                $Image->process($FrontEndImageLocationRoot . "/" . (string) $ColumnCommands[$Column]["filelocation"][0]);
                if ($Image->processed) {
                    $Array = array();
                    $Array[$Column] = $Image->file_dst_name_body . "." . $Image->file_dst_name_ext;
                    UpdateQueryFromArray($_GET["param_0"], $Array, "WHERE id=:id", $LastInsertId);
                } else {
                    die($Image->error . "<br /><br />" . $FrontEndImageLocationRoot . "/" . (string) $ColumnCommands[$Column]["filelocation"][0]);
                }
            }
        }
    }
    //IMAGE
    $PHPZevelop->Location("edit/" . $_GET["param_0"] . "/" . $LastInsertId);
}
?>

<h2>Adding to table <?php 
echo ucfirst(str_replace("_", " ", $_GET["param_0"]));
?>
</h2>
Пример #2
0
                        $Val = str_replace("[id]", $_GET["param_1"], $Val);
                        $Val = str_replace("[timestamp]", time(), $Val);
                        $Image->{$ImgOptionKey} = $Val;
                    }
                }
                $Image->process($FrontEndImageLocationRoot . "/" . (string) $ColumnCommands[$Column]["filelocation"][0]);
                if ($Image->processed) {
                    $_POST[$Column] = $Image->file_dst_name_body . "." . $Image->file_dst_name_ext;
                } else {
                    die($Image->error . "<br /><br />" . $FrontEndImageLocationRoot . "/" . (string) $ColumnCommands[$Column]["filelocation"][0]);
                }
            }
        }
    }
    //IMAGE
    UpdateQueryFromArray($_GET["param_0"], $_POST, "WHERE id=:id", $_GET["param_1"]);
    AppendLog("Edited item #" . $_GET["param_1"] . " in " . $_GET["param_0"]);
    $Data = $DB->QuerySingle("SELECT * FROM " . $_GET["param_0"] . " WHERE id=:id", array("id" => $_GET["param_1"]));
}
$FormGen = new FormGen();
foreach ($Columns as $Item) {
    if (strtolower($Item["column_name"]) == "id") {
        continue;
    }
    $Title = ucfirst(ltrim(str_replace("_", " ", $Item["column_name"]), " "));
    $Type = isset($ColumnCommands[$Item["column_name"]]["type"][0]) ? $ColumnCommands[$Item["column_name"]]["type"][0] : "text";
    $Class = isset($ColumnCommands[$Item["column_name"]]["class"][0]) ? $ColumnCommands[$Item["column_name"]]["class"][0] : "";
    if ($Type == "select") {
        $Options = array("0" => " - none -");
        if (isset($ColumnCommands[$Item["column_name"]]["join"])) {
            foreach ($DB->Query("SELECT id," . $ColumnCommands[$Item["column_name"]]["join"][1] . " FROM " . $ColumnCommands[$Item["column_name"]]["join"][0]) as $Option) {