\FTS\FormViewHelper::init()->initForm('/cart/checkout')->initSubmit()->setAttribute('value', 'Checkout')->setAttribute('class', 'btn btn-default col-sm-2 col-sm-offset-1')->create()->render();
    ?>
    </h1>
<?php 
}
foreach ($this->_viewBag['body']->getProducts() as $product) {
    ?>
    <div class="panel col-sm-3">
        <h3 class="panel-primary"><a href="/product/<?php 
    echo $product->getId();
    ?>
/show"><?php 
    echo $product->getName();
    ?>
</a>
        </h3>

        <div class="panel-body">
            <div class="row">
                <div class="col-sm-6 text">Price: <?php 
    echo $product->getPrice();
    ?>
 lv.</div>
                <?php 
    \FTS\FormViewHelper::init()->initForm('/cart/remove/' . $product->getId(), array(), 'delete')->initSubmit()->setAttribute('value', 'Remove')->setAttribute('class', 'panel panel-primary btn btn-default col-sm-6')->create()->render(true);
    ?>
            </div>
        </div>
    </div>
<?php 
}
示例#2
0
<div class="panel">
    <h1 class="text-center">Admin Edit</h1>
    <div class="row">
        <?php 
\FTS\FormViewHelper::init()->initForm('/admin/index/add', ['class' => 'form-group col-sm-4 col-sm-offset-1'], 'post')->initLabel()->setValue("Username")->setAttribute('for', 'username')->create()->initTextBox()->setName('username')->setAttribute('id', 'username')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Right name")->setAttribute('for', 'rightName')->create()->initTextBox()->setName('rightName')->setAttribute('id', 'rightName')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Give right')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render();
\FTS\FormViewHelper::init()->initForm('/admin/index/remove', ['class' => 'form-group col-sm-4 col-sm-offset-2'], 'delete')->initLabel()->setValue("Username")->setAttribute('for', 'username')->create()->initTextBox()->setName('username')->setAttribute('id', 'username')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Right name")->setAttribute('for', 'rightName')->create()->initTextBox()->setName('rightName')->setAttribute('id', 'rightName')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Remove right')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render(true);
?>
    </div>
</div>
            <span class="label label-danger">Admin</span>
        <?php 
}
?>
        <?php 
if ($this->_viewBag['body']->getIsEditor()) {
    ?>
            <span class="label label-info">Editor</span>
        <?php 
}
?>
        <?php 
if ($this->_viewBag['body']->getIsModerator()) {
    ?>
            <span class="label label-success">Moderator</span>
        <?php 
}
?>
    </h2>
    <?php 
if (strtolower($this->_viewBag['body']->getUsername()) === strtolower(\FTS\App::getInstance()->getUsername())) {
    ?>
        <div class="panel panel-heading">Your balance: <?php 
    echo $this->_viewBag['body']->getBalance();
    ?>
lv</div>
        <?php 
    \FTS\FormViewHelper::init()->initForm('/user/changePass', ['class' => 'form-group'], 'put')->initLabel()->setValue("Old Password")->setAttribute('for', 'oldPassword')->create()->initPasswordBox()->setAttribute('id', 'oldPassword')->setName('oldPassword')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("New Password")->setAttribute('for', 'newPassword')->create()->initPasswordBox()->setAttribute('id', 'newPassword')->setName('newPassword')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Confirm Password")->setAttribute('for', 'conPassword')->create()->initPasswordBox()->setAttribute('id', 'conPassword')->setName('confirm')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Change password')->setAttribute('class', 'btn btn-default')->create()->render();
}
?>
</div>
<div class="row row-eq-height">
    <div class="panel panel-primary  col-sm-5">
        <h1 class="text-center">Login</h1>
        <?php 
\FTS\FormViewHelper::init()->initForm('/user/login', ['class' => 'form-group'], 'post')->initLabel()->setValue("Username")->setAttribute('for', 'username')->create()->initTextBox()->setName('username')->setAttribute('id', 'username')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Password")->setAttribute('for', 'password')->create()->initPasswordBox()->setName('password')->setAttribute('id', 'password')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Login')->setAttribute('class', 'btn btn-primary btn-lg col-sm-4 col-sm-offset-4')->create()->render();
?>
    </div>
    <div class="panel panel-primary col-sm-5 col-sm-offset-2">
        <h1 class="text-center">Register</h1>
        <?php 
\FTS\FormViewHelper::init()->initForm('/user/register', ['class' => 'form-group'], 'post')->initLabel()->setValue("Username")->setAttribute('for', 'username')->create()->initTextBox()->setName('username')->setAttribute('id', 'username')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Password")->setAttribute('for', 'password')->create()->initPasswordBox()->setName('password')->setAttribute('id', 'password')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Confirm Password")->setAttribute('for', 'confPassword')->create()->initPasswordBox()->setName('confirm')->setAttribute('id', 'confPassword')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Register')->setAttribute('class', 'btn btn-primary btn-lg col-sm-4 col-sm-offset-4')->create()->render(true);
?>
    </div>
</div>
            <?php 
    if (\FTS\App::getInstance()->isAdmin() || \FTS\App::getInstance()->isEditor()) {
        ?>
                <a href="/product/<?php 
        echo $product->getId();
        ?>
/edit" class="panel panel-primary btn btn-default">Edit</a>
                <?php 
        \FTS\FormViewHelper::init()->initForm('/product/' . $product->getId() . '/delete', ['style' => 'display: inline;'], 'delete')->initSubmit()->setAttribute('value', 'Delete')->setAttribute('class', 'panel panel-primary btn btn-default')->create()->render(true);
        ?>
            <?php 
    }
    ?>
            <?php 
    if (\FTS\App::getInstance()->isLogged()) {
        \FTS\FormViewHelper::init()->initForm('/review/add/' . $product->getId(), ['class' => 'form-group', 'style' => 'display: none', 'id' => $product->getId()])->initLabel()->setAttribute('for', 'message')->setValue('Message')->create()->initTextArea()->setAttribute('name', 'message')->setAttribute('class', 'form-control input-md')->setAttribute('id', 'message')->create()->initSubmit()->setAttribute('value', 'Send')->setAttribute('class', 'btn btn-primary btn-sm col-sm-1 col-sm-offset-5')->create()->render(true);
    }
    ?>
        </div>
    </div>
<?php 
}
?>

<ul class="pager">
    <li><a href="/products/<?php 
$start = $this->_viewBag['body']->getStart();
if ($start - 3 >= 0) {
    echo $start -= 3;
} else {
    echo 0;
    echo $route;
    ?>
</div>
            <?php 
    if ($bindingModel) {
        ?>
                <button onclick="enableReviewForm(<?php 
        echo $id;
        ?>
)" class="btn btn-primary btn-xs">Show binding model</button>
                <div id="<?php 
        echo $id++;
        ?>
" style="display: none">
                    <?php 
        foreach ($bindingModel as $param) {
            \FTS\FormViewHelper::init()->initDiv()->setValue("*{$param}")->create()->render();
        }
        ?>
                </div>
            <?php 
    }
    ?>
        </div>
        <hr/>
    <?php 
}
?>
</div>
</body>
</html>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                               aria-haspopup="true"
                               aria-expanded="false"><?php 
    echo \FTS\App::getInstance()->getUsername();
    ?>
<span
                                    class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><?php 
    \FTS\FormViewHelper::init()->initLink()->setAttribute('href', "/user/" . \FTS\App::getInstance()->getUsername() . "/profile")->setValue('Profile')->create()->render();
    ?>
</li>
                                <li><?php 
    \FTS\FormViewHelper::init()->initLink()->setAttribute('href', "/users/all/0/10")->setValue('All users')->create()->render();
    ?>
</li>
                                <?php 
    if (\FTS\App::getInstance()->isAdmin()) {
        ?>
                                    <li><a href="/admin">Admin</a></li>
                                <?php 
    }
    ?>
                                <?php 
    if (\FTS\App::getInstance()->isAdmin() || \FTS\App::getInstance()->isEditor()) {
        ?>
                                    <li><a href="/editor">Editor</a></li>
                                <?php 
    }
                            <span class="label label-success">Moderator</span>
                        <?php 
    }
    ?>
                    </div>
                    <?php 
    if (\FTS\App::getInstance()->isAdmin() || \FTS\App::getInstance()->isModerator()) {
        ?>
                        <div class="col-sm-2 text-right">
                            <button class="btn btn-sm btn-default" onclick="enableReviewForm('<?php 
        echo $review->getId() . 'r';
        ?>
')">Edit</button>
                            <?php 
        \FTS\FormViewHelper::init()->initForm('/review/' . $review->getId() . '/delete', ['style' => 'display: inline;'], 'delete')->initSubmit()->setAttribute('value', 'Delete')->setAttribute('class', 'btn btn-sm btn-default')->create()->render(true);
        ?>
                        </div>
                        <?php 
        \FTS\FormViewHelper::init()->initForm('/review/' . $review->getId() . '/edit', ['class' => 'form-group', 'style' => 'display: none', 'id' => $review->getId() . 'r'], 'put')->initLabel()->setAttribute('for', 'message')->setValue('Edit Message')->create()->initTextArea($review->getMessage())->setAttribute('name', 'message')->setAttribute('class', 'form-control input-md')->setAttribute('id', 'message')->create()->initSubmit()->setAttribute('value', 'Edit')->setAttribute('class', 'btn btn-primary btn-sm col-sm-1 col-sm-offset-5')->create()->render(true);
        ?>
                    <?php 
    }
    ?>
                </div>
            </div>
        <?php 
}
?>
    </div>
</div>
示例#9
0
<div class="panel panel-primary  col-sm-6 col-sm-offset-3">
    <h1 class="text-center">Sell your product here!</h1>
    <?php 
\FTS\FormViewHelper::init()->initForm('/product/add', ['class' => 'form-group'], 'post')->initLabel()->setValue("Product name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Description")->setAttribute('for', 'description')->create()->initTextBox()->setName('description')->setAttribute('id', 'description')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Price")->setAttribute('for', 'price')->create()->initTextBox()->setName('price')->setAttribute('id', 'price')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Category")->setAttribute('for', 'category')->create()->initTextBox()->setName('category')->setAttribute('id', 'category')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Sell')->setAttribute('class', 'btn btn-primary btn-lg col-sm-4 col-sm-offset-4')->create()->render();
?>
</div>
示例#10
0
<div class="panel panel-primary">
    <div class="panel-body">
        <?php 
\FTS\FormViewHelper::init()->initForm('/product/change/' . $this->_viewBag['body']->getId(), ['class' => 'form-group'], 'put')->initLabel()->setValue("Product name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->setAttribute('value', $this->_viewBag['body']->getName())->create()->initLabel()->setValue("Description")->setAttribute('for', 'description')->create()->initTextBox()->setName('description')->setAttribute('id', 'description')->setAttribute('class', 'form-control
        input-md')->setAttribute('value', $this->_viewBag['body']->getDescription())->create()->initLabel()->setValue("Price")->setAttribute('for', 'price')->create()->initTextBox()->setName('price')->setAttribute('id', 'price')->setAttribute('class', 'form-control input-md')->setAttribute('value', $this->_viewBag['body']->getPrice())->create()->initLabel()->setValue("Quantity")->setAttribute('for', 'quantity')->create()->initTextBox()->setName('quantity')->setAttribute('id', 'quantity')->setAttribute('class', 'form-control
        input-md')->setAttribute('value', $this->_viewBag['body']->getQuantity())->create()->initLabel()->setValue("Category")->setAttribute('for', 'category')->create()->initTextBox()->setName('category')->setAttribute('id', 'category')->setAttribute('class', 'form-control
        input-md')->setAttribute('value', $this->_viewBag['body']->getCategory())->create()->initSubmit()->setAttribute('value', 'Change')->setAttribute('class', 'btn btn-primary btn-lg col-sm-4
        col-sm-offset-4')->create()->render();
?>
    </div>
</div>
示例#11
0
 public function displayError($error, $message)
 {
     echo '<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">';
     echo '<div class="text-center">';
     FormViewHelper::init()->initLink()->setValue('Home')->setAttribute('href', '/')->create()->render();
     $confError = $this->_config->errors[$error];
     if ($confError) {
         if ($confError == 'message') {
             echo '<h1>' . $message . '</h1>';
         } else {
             echo "<h1> {$confError} </h1>";
         }
     } else {
         echo '<h1>Oooops, something went wrong ;(. Error  ' . $error . '</h1>';
         echo '<img class="decoded shrinkToFit" alt="http://media.topito.com/wp-content/uploads/2011/09/lama_bizarre012.jpg" src="http://media.topito.com/wp-content/uploads/2011/09/lama_bizarre012.jpg" height="340" width="453">';
     }
     echo '</div>';
     exit;
 }
示例#12
0
<div class="panel">
    <h1 class="text-center">Editor panel</h1>
    <br/>
    <div class="row">
        <h2 class="text-center">Categories edit</h2>
        <?php 
\FTS\FormViewHelper::init()->initForm('/editor/category/add', ['class' => 'form-group col-sm-4'], 'post')->initLabel()->setValue("Category name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Add category')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render();
\FTS\FormViewHelper::init()->initForm('/editor/category/remove', ['class' => 'form-group col-sm-4'], 'delete')->initLabel()->setValue("Category name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Remove category')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render(true);
\FTS\FormViewHelper::init()->initForm('/editor/category/rename', ['class' => 'form-group col-sm-4'], 'put')->initLabel()->setValue("Old category name")->setAttribute('for', 'oldName')->create()->initTextBox()->setName('oldName')->setAttribute('id', 'oldName')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("New category name")->setAttribute('for', 'newName')->create()->initTextBox()->setName('newName')->setAttribute('id', 'newName')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Rename category')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render(true);
?>
    </div>
    <hr/>
    <div class="row">
        <h2 class="col-sm-4 col-sm-offset-1">Products edit</h2>
        <h2 class="col-sm-6 col-sm-offset-1">Promotions edit <a href="/editor/promotions/all" class="btn btn-default col-sm-offset-1">All Promotions</a></h2>
    </div>
    <div class="row">
        <?php 
\FTS\FormViewHelper::init()->initForm('/products/find', ['class' => 'form-group col-sm-4'], 'post')->initLabel()->setValue("Product name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Edit product')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render(true);
\FTS\FormViewHelper::init()->initForm('/editor/promotion/add', ['class' => 'form-group col-sm-4'], 'post')->initLabel()->setValue("Promotion name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Product name")->setAttribute('for', 'product')->create()->initTextBox()->setName('product')->setAttribute('id', 'product')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Percentage")->setAttribute('for', 'percentage')->create()->initTextBox()->setName('percentage')->setAttribute('id', 'percentage')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("End date")->setAttribute('for', 'date')->create()->initTextBox()->setName('date')->setAttribute('id', 'date')->setAttribute('placeholder', 'mm/dd/yyyy')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Add promotion')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render(true);
\FTS\FormViewHelper::init()->initForm('/editor/promotion/remove', ['class' => 'form-group col-sm-4'], 'delete')->initLabel()->setValue("Promotion name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Remove promotion')->setAttribute('class', 'btn btn-primary col-sm-4 col-sm-offset-4')->create()->render(true);
?>
    </div>
</div>
示例#13
0
<div class="panel">
    <?php 
foreach ($this->_viewBag['body']->getPromotions() as $promotion) {
    ?>
        <div class="panel panel-primary">
            <div class="panel panel-heading">Promotion name: <?php 
    echo $promotion->getName();
    ?>
 </div>
            <div class="panel panel-body">
                <?php 
    \FTS\FormViewHelper::init()->initForm('/editor/promotion/remove', ['class' => 'form-group col-sm-4'], 'delete')->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('style', 'display: none')->setAttribute('value', $promotion->getName())->create()->initSubmit()->setAttribute('value', 'Remove promotion')->setAttribute('class', 'btn btn-default')->create()->render(true);
    ?>
                <div>Product name: <?php 
    echo $promotion->getProduct();
    ?>
</div>
                <div>Percentage: <?php 
    echo $promotion->getPercentage();
    ?>
%</div>
                <div>End date: <?php 
    echo $promotion->getDate();
    ?>
</div>
            </div>
        </div>
    <?php 
}
?>
</div>