<?php

include "Framework/ViewHelpers/FormViewHelper.php";
include "Framework/ViewHelpers/Elements/Element.php";
include "Framework/ViewHelpers/Elements/TextField.php";
include "Framework/ViewHelpers/Elements/PasswordField.php";
include "Framework/ViewHelpers/Elements/Submit.php";
?>

<h1>Edit Existing User</h1>

<?php 
if ($this->user) {
    ?>
    <section class="bg-3">
        <div class="row">
            <div class="col-lg-6 col-lg-offset-3">
                <?php 
    echo \Framework\ViewHelpers\FormViewHelper::init()->setAction("/users/edit/" . $this->user['Id'])->setMethod("post")->initTextField()->setName("userName")->setAttribute("value", htmlspecialchars($this->user['Username']))->create()->initTextField()->setName("password")->setAttribute("value", htmlspecialchars($this->user['Password']))->create()->initTextField()->setName("balance")->setAttribute("value", htmlspecialchars($this->user['Balance']))->create()->initTextField()->setName("is_admin")->setAttribute("value", htmlspecialchars($this->user['is_admin']))->create()->initTextField()->setName("is_editor")->setAttribute("value", htmlspecialchars($this->user['is_editor']))->create()->initTextField()->setName("is_ban")->setAttribute("value", htmlspecialchars($this->user['is_ban']))->create()->initSubmit()->setValue("Edit")->create()->render();
    ?>
                <a href="/users">Cancel</a>
            </div>
        </div>
    </section>
    <br/>
<?php 
}
<div class="main">
    <div class="content">
        <div class="login_panel">
            <h3>Existing Customers</h3>
            <p>Sign in with the form below.</p>
            <?php 
echo \Framework\ViewHelpers\FormViewHelper::init()->setAttribute("id", "member")->setMethod("post")->setAction('/users/loginpost')->initTextField()->setName("Username")->setAttribute("placeholder", "Username")->setClasses("field")->create()->initPasswordField()->setName("Password")->setAttribute("placeholder", "Password")->setClasses("field")->create()->initSubmit()->setClasses("grey")->setValue("Sign in")->create()->render();
?>
        </div>
        <div class="clear"></div>
    </div>
</div>
<h1>Create New Category</h1>

<?php 
/** @var Models\ViewModels\UserViewModel */
include "Framework/ViewHelpers/FormViewHelper.php";
include "Framework/ViewHelpers/Elements/Element.php";
include "Framework/ViewHelpers/Elements/TextField.php";
include "Framework/ViewHelpers/Elements/PasswordField.php";
include "Framework/ViewHelpers/Elements/Submit.php";
?>

<section class="bg-3">
    <div class="row">
        <div class="col-lg-6 col-lg-offset-3">
            <?php 
echo \Framework\ViewHelpers\FormViewHelper::init()->setAction("/categories/create")->setMethod("post")->initTextField()->setName("CategoryName")->setAttribute("placeholder", "Category Name")->create()->initSubmit()->setValue("Create")->create()->render();
?>
            <a href="/categories">Cancel</a>
        </div>
    </div>
</section>
<br/>

예제 #4
0
<?php

/** @var Models\ViewModels\UserViewModel */
include "Framework/ViewHelpers/FormViewHelper.php";
include "Framework/ViewHelpers/Elements/Element.php";
include "Framework/ViewHelpers/Elements/TextField.php";
include "Framework/ViewHelpers/Elements/PasswordField.php";
include "Framework/ViewHelpers/Elements/Submit.php";
?>

<h1>Create New Product</h1>
<section class="bg-3">
    <div class="row">
        <div class="col-lg-6 col-lg-offset-3">
            <?php 
echo \Framework\ViewHelpers\FormViewHelper::init()->setAction("/products/create")->setMethod("post")->initTextField()->setName("productName")->setAttribute("placeholder", "Product Name")->create()->initTextField()->setName("quantity")->setAttribute("placeholder", "Quantity")->create()->initTextField()->setName("price")->setAttribute("placeholder", "Price")->create()->initTextField()->setName("categoryId")->setAttribute("placeholder", "Category Id")->create()->initSubmit()->setValue("Create")->create()->render();
?>
            <a href="/products">Cancel</a>
        </div>
    </div>
</section>
<br/>

예제 #5
0
<?php

/** @var Models\ViewModels\UserViewModel */
include "Framework/ViewHelpers/FormViewHelper.php";
include "Framework/ViewHelpers/Elements/Element.php";
include "Framework/ViewHelpers/Elements/TextField.php";
include "Framework/ViewHelpers/Elements/PasswordField.php";
include "Framework/ViewHelpers/Elements/Submit.php";
?>

<h1>Edit Existing Product</h1>
<section class="bg-3">
    <div class="row">
        <div class="col-lg-6 col-lg-offset-3">
            <?php 
echo \Framework\ViewHelpers\FormViewHelper::init()->setAction("/products/edit/" . $this->product['Id'])->setMethod("post")->initTextField()->setName("productName")->setAttribute("value", htmlspecialchars($this->product['ProductName']))->create()->initTextField()->setName("quantity")->setAttribute("value", htmlspecialchars($this->product['Quantity']))->create()->initTextField()->setName("price")->setAttribute("value", htmlspecialchars($this->product['Price']))->create()->initTextField()->setName("categoryId")->setAttribute("value", htmlspecialchars($this->product['Category_Id']))->create()->initSubmit()->setValue("Edit")->create()->render();
?>
            <a href="/products">Cancel</a>
        </div>
    </div>
</section>
<br/>

<?php

/** @var Models\ViewModels\UserViewModel */
include "Framework/ViewHelpers/FormViewHelper.php";
include "Framework/ViewHelpers/Elements/Element.php";
include "Framework/ViewHelpers/Elements/TextField.php";
include "Framework/ViewHelpers/Elements/PasswordField.php";
include "Framework/ViewHelpers/Elements/Submit.php";
?>

<h1>Login Form</h1>
<br/>
<section class="bg-3">
    <div class="row">
        <div class="col-lg-6 col-lg-offset-3">
            <?php 
echo \Framework\ViewHelpers\FormViewHelper::init()->setAction("")->setMethod("post")->initTextField()->setName("username")->setAttribute("placeholder", "Username")->create()->initPasswordField()->setName("password")->setAttribute("placeholder", "Password")->create()->initSubmit()->setValue("Login")->create()->render();
?>
        </div>
    </div>
</section>
<br/>


<?php

include "Framework/ViewHelpers/FormViewHelper.php";
include "Framework/ViewHelpers/Elements/Element.php";
include "Framework/ViewHelpers/Elements/TextField.php";
include "Framework/ViewHelpers/Elements/PasswordField.php";
include "Framework/ViewHelpers/Elements/Submit.php";
?>
<h1>Edit Existing Category</h1>

<?php 
if ($this->category) {
    ?>
    <section class="bg-3">
        <div class="row">
            <div class="col-lg-6 col-lg-offset-3">
                <?php 
    echo \Framework\ViewHelpers\FormViewHelper::init()->setAction("/categories/edit/" . $this->category['Id'])->setMethod("post")->initTextField()->setName("categoryName")->setAttribute("value", htmlspecialchars($this->category['CategoryName']))->create()->initSubmit()->setValue("Edit")->create()->render();
    ?>
                <a href="/categories">Cancel</a>
            </div>
        </div>
    </section>
    <br/>
<?php 
}
echo $this->data->getUsername(true);
?>
</p>
        <p style="font-size: 25px;">Cash:  <?php 
echo $this->data->getCash();
?>
$</p>
        <p style="font-size: 25px;">Role: <?php 
echo $this->data->getRole();
?>
</p>

        <div class="login_panel" style="float: right; margin-top: -88px;">
            <h3>Change cash</h3>
            <?php 
echo \Framework\ViewHelpers\FormViewHelper::init()->setAttribute("id", "member")->setMethod("post")->setAction("/users/editcash")->initTextField()->setName("Cash")->setAttribute("placeholder", "Cash")->setClasses("field")->create()->initTextField()->setName("Confirm")->setAttribute("placeholder", "Confirm  Cash")->setClasses("field")->create()->initSubmit()->setClasses("grey")->setValue("Change cash")->create()->initHiddenField()->setName("CsrfToken")->setValue($this->data->getCsrfToken())->create()->render();
?>
        </div>

        <div class="clear"></div>
        <p style="font-size: 25px;">Products: <?php 
echo count($this->data->getProducts()) === 0 ? 'You have no products yet' : '';
?>
 </p>

        <?php 
foreach ($this->data->getProducts() as $product) {
    ?>
            <p>Name: <?php 
    echo htmlspecialchars($product['name']);
    ?>