Ejemplo n.º 1
0
<h2>Searching <?php 
echo ucfirst(str_replace("_", " ", $_GET["param_0"]));
?>
</h2>
<br />

<?php 
// SQL Form
$FormGen = new FormGen();
$FormGen->AddElement(array("name" => "Fields", "value" => $_POST["Fields"]), array("title" => "Fields"));
$FormGen->AddElement(array("name" => "Where", "value" => $_POST["Where"], "placeholder" => "key=value"), array("title" => "Where", "postHTML" => "test"));
$FormGen->AddElement(array("name" => "Order", "value" => $_POST["Order"]), array("title" => "Order"));
$FormGen->AddElement(array("name" => "Limit", "value" => $_POST["Limit"]), array("title" => "Limit"));
$FormGen->AddElement(array("type" => "submit", "value" => "Run query"));
echo $FormGen->Build(array("ColNum" => 5));
?>

<?php 
// Checks
foreach (array("Fields", "Where", "Order") as $Key) {
    if ($Key == "Fields" && strlen($_POST["Fields"]) == 0) {
        $Error = "Fields is empty, try *";
    } else {
        foreach (array(";", "FROM", "DROP", "UNION", "DELETE", "REMOVE", "CREATE", "SHOW", "UPDATE", "FLUSH", "INSERT", "ALTER", "DESCRIBE", "LIMIT") as $BannedWord) {
            if (strstr(strtolower($_POST[$Key]), strtolower($BannedWord)) != false) {
                $Error = "Cannot use '" . $BannedWord . "' in MySQL statement";
            }
        }
    }
}
Ejemplo n.º 2
0
            }
        }
        $FormGen->AddElement(array("type" => $Type, "name" => $Item["column_name"], "value" => $Item["column_default"], "class" => $Class), array("title" => $Title, "data" => $Options));
    } elseif ($Type == "checkbox") {
        $Options = array();
        if (isset($ColumnCommands[$Item["column_name"]]["confignlgroup"])) {
            $ConfigNLGroups = $DB->SelectSingle("*", "config", array(array("_key", "=", $ColumnCommands[$Item["column_name"]]["confignlgroup"][0])));
            foreach (explode("\r\n\r\n", $ConfigNLGroups["_value"]) as $Temp1) {
                $Temp1 = explode("\r\n", $Temp1);
                if ($Temp1[0] == $ColumnCommands[$Item["column_name"]]["confignlgroup"][1]) {
                    unset($Temp1[0]);
                    foreach ($Temp1 as $Temp2) {
                        $Options[$Temp2] = $Temp2;
                    }
                }
            }
        }
        $FormGen->AddElement(array("type" => $Type, "name" => $Item["column_name"], "class" => $Class), array("title" => $Title, "data" => $Options));
    } elseif ($Type == "timestamp") {
        $FormGen->AddElement(array("type" => "text", "name" => $Item["column_name"], "value" => date("Y/m/d G:i"), "class" => "datetimepicker " . $Class), array("title" => $Title));
    } elseif ($Item["column_name"] == "image") {
        $PreHTML = "<table style='width: 100%;'><tr><td style='width: 12%;'><img src='" . $PHPZevelop->Path->GetImage("components/no-image-icon.jpg", true) . "' class='PreviewImage' /></td><td>";
        $PostHTML = "</td></tr></table>";
        $FormGen->AddElement(array("type" => "file", "name" => $Item["column_name"], "class" => "ImageSelector " . $Class), array("title" => $Title, "prehtml" => $PreHTML, "posthtml" => $PostHTML));
    } else {
        $FormGen->AddElement(array("type" => $Type, "name" => $Item["column_name"], "value" => $Item["column_default"], "class" => $Class), array("title" => $Title));
    }
}
$FormGen->AddElement(array("type" => "submit"));
echo $FormGen->Build();
Ejemplo n.º 3
0
<?php

/* Page setup
	------------------------------*/
$PHPZevelop->OverrideObjectData("CFG", array("PageTitle" => "Edit"));
?>

<h2>Generate a password for the user system</h2>
<p>This will produce a hashed password and salt based on the origional visible password.<br /><br /></p>

<?php 
$FormGen = new FormGen();
$FormGen->AddElement(array("type" => "text", "name" => "password", "placeholder" => "Password"), array("title" => "Password"));
$FormGen->AddElement(array("type" => "submit", "value" => "Submit"));
echo $FormGen->Build(array("ColNum" => 3, "data" => $_POST));
?>

<?php 
if (count($_POST) > 0) {
    $TempUser = new User();
    $TempUser->SetPassword($_POST["password"]);
    echo "<p>Origional password: <b>" . $_POST["password"] . "</b></p>";
    echo "<p>Hashed password: <b>" . $TempUser->Data["password"] . "</b></p>";
    echo "<p>Generated salt: <b>" . $TempUser->Data["salt"] . "</b></p>";
    unset($TempUser);
}
Ejemplo n.º 4
0
// File manager
if (ArrGet($TableOptions, $_GET["param_0"], "FileManager") == "true") {
    if (!isset($TableOptions[$_GET["param_0"]]["FileManagerDefaultLocation"])) {
        $TableOptions[$_GET["param_0"]]["FileManagerDefaultLocation"] = "";
    }
    ?>
	<iframe src="<?php 
    $PHPZevelop->Path->GetPage("file-manager-full/" . $TableOptions[$_GET["param_0"]]["FileManagerDefaultLocation"]);
    ?>
"
		style="width: 99.5%; height: 90px; border: none; margin: auto; background: none;"></iframe>
	<?php 
}
?>

<?php 
if (isset($TableOptions[$_GET["param_0"]]["EditLink"])) {
    $Parts = explode("|", $TableOptions[$_GET["param_0"]]["EditLink"]);
    $Parts[0] = str_replace("[id]", $_GET["param_1"], $Parts[0]);
    echo "<a href='" . $Parts[0] . "' target='_blank'>" . $Parts[1] . "</a><br />";
}
?>

<?php 
foreach ($ColumnNames as $Item) {
    if (isset($ColumnCommands[$Item]["type"][0]) && $ColumnCommands[$Item]["type"][0] == "timestamp") {
        $Data[$Item] = date("Y/m/d G:i", $Data[$Item]);
    }
}
echo $FormGen->Build(array("data" => $Data));
Ejemplo n.º 5
0
<style type="text/css">
	#loginForm {width: 50%; margin: auto; background: #EEEEEE; border: 1px solid #009ACD; box-sizing: border-box; padding-bottom: 15px;}
	#loginForm h2 {margin: 0px; padding: 15px;}
	#loginForm h3 {margin: 0px; padding: 9px 13px;}
	#loginForm table.FormGen {width: 95%; margin: auto;}

	@media screen and (max-width: 900px){
		#loginForm {width: 100%;}
	}
</style>

<br />
<div id="loginForm">
	<h2>Login</h2>

	<?php 
if (isset($MSG)) {
    echo $MSG;
}
?>

	<?php 
$FormGen = new FormGen();
$FormGen->AddElement(array("type" => "text", "name" => "username", "autofocus" => "autofocus", "required" => "required"), array("title" => "Username"));
$FormGen->AddElement(array("type" => "password", "name" => "password", "required" => "required"), array("title" => "Password"));
$FormGen->AddElement(array("type" => "submit", "value" => "Login"));
unset($_POST["password"]);
echo $FormGen->Build(array("data" => $_POST));
?>
</div>