<html> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </head> <body> <h1>Index View</h1> <div><?php echo $this->_viewBag->getData(); ?> </div> <?php \Framework\FormViewHelper::init()->initTextBox()->setAttribute('class', 'some')->setName('username')->setAttribute('value', 'pesho')->setAttribute('class1', 'some2')->create()->initTextArea()->create()->initUploadFile()->create()->initRadioBox()->setChecked()->create()->initRadioBox()->create()->initUploadFile()->create()->initCheckBox()->setChecked()->create()->initBoostrapDropDown('drop down')->setDropDownLi('#', '1')->setDropDownLi('#', '2')->create()->render(); ?> </body> </html>
?> </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) { \Framework\FormViewHelper::init()->initDiv()->setValue("*{$param}")->create()->render(); } ?> </div> <?php } ?> </div> <hr/> <?php } ?> </div> </body> </html>
?> <span class="label label-success">Moderator</span> <?php } ?> </div> <?php if (\Framework\App::getInstance()->isAdmin() || \Framework\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 \Framework\FormViewHelper::init()->initForm($this->getPath() . 'review/' . $review->getId() . '/delete', ['style' => 'display: inline;'], 'delete')->initSubmit()->setAttribute('value', 'Delete')->setAttribute('class', 'btn btn-sm btn-default')->create()->render(true); ?> </div> <?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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>
<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 \Framework\FormViewHelper::init()->initForm($this->getPath() . '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>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo \Framework\App::getInstance()->getUsername(); ?> <span class="caret"></span></a> <ul class="dropdown-menu"> <li> <?php \Framework\FormViewHelper::init()->initLink()->setAttribute('href', $this->getPath() . "user/" . \Framework\App::getInstance()->getUsername() . "/profile")->setValue('Profile')->create()->render(); ?> </li> <li> <?php \Framework\FormViewHelper::init()->initLink()->setAttribute('href', $this->getPath() . "users/all/0/10")->setValue('All users')->create()->render(); ?> </li> <?php if (\Framework\App::getInstance()->isAdmin()) { ?> <li><a href="<?php echo $this->getPath(); ?> admin">Admin</a></li> <?php } ?> <?php if (\Framework\App::getInstance()->isAdmin() || \Framework\App::getInstance()->isEditor()) { ?>
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">'; $confError = isset($this->_config->errors[$error]) && $this->_config->errors[$error] != null; FormViewHelper::init()->initLink()->setValue('Go back')->setAttribute('href', $this->_config->app['default_path'])->create()->render(); echo '<h1>Oooops, something went wrong . Error ' . $error . '</h1>'; if ($confError) { if ($confError == 'message') { echo '<h1>' . $message . '</h1>'; } else { echo "<h1> {$confError} </h1>"; } } echo '<img class="decoded shrinkToFit" src="http://www.decision-making-solutions.com/images/learning-from-mistakes-error-sign-iStock_000014363681XSmall.jpg" />'; echo '</div>'; exit; }
public function displayError(int $error, string $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('Go back')->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 '</div>'; exit; }
<div class="row row-eq-height"> <div class="panel panel-primary col-sm-5"> <h1 class="text-center">Sign in</h1> <img id="profile-img" class="profile-img-card" src="//ssl.gstatic.com/accounts/ui/avatar_2x.png" /> <?php \Framework\FormViewHelper::init()->initForm('/user/login', ['class' => 'form-group margin-bottom10'], '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', 'Sign in')->setAttribute('class', 'btn btn-lg btn-primary btn-block btn-signin margin-top25')->create()->render(); ?> </div> <div class="panel panel-primary col-sm-5 col-sm-offset-2"> <h1 class="text-center">Register</h1> <?php \Framework\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("Email")->setAttribute('for', 'email')->create()->initTextBox()->setName('email')->setAttribute('id', 'email')->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-lg btn-primary btn-block btn-signin margin-top10')->create()->render(true); ?> </div> </div>
?> <li><?php \Framework\FormViewHelper::init()->initLink()->setAttribute('href', '/PhoneNumber')->setValue('Phone Numbers')->create()->render(); ?> </li> <?php } ?> </ul> <?php if (\Framework\App::getInstance()->isLogged()) { ?> <ul class="nav navbar-nav navbar-right"> <li> <?php \Framework\FormViewHelper::init()->initForm('/PhoneNumber/search', ['class' => 'form-group'], 'post')->initTextBox()->setName('search')->setAttribute('id', 'search')->setAttribute('class', 'form-control input-md')->create()->initSubmit()->setAttribute('value', 'Search')->setAttribute('class', 'glyphicon glyphicon-search')->create()->render(); ?> </li> <li> <?php Framework\FormViewHelper::init()->initLink()->setAttribute('href', '/user/logout')->setValue('Logout')->create()->render(); ?> </li> </ul> <?php } ?> </div> <!-- /.navbar-collapse --> </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(\Framework\App::getInstance()->getUsername())) { ?> <div class="panel panel-heading">Your balance: <?php echo $this->_viewBag['body']->getBalance(); ?> lv</div> <?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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 class="panel panel-primary col-sm-6 col-sm-offset-3"> <h1 class="text-center">Sell your product here:</h1> <?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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>
<?php if ($_SESSION['error'] !== null) { \Framework\FormViewHelper::init()->initDiv()->setValue($_SESSION['error'])->setAttribute('class', 'panel panel-danger text-center')->create()->render(); $_SESSION['error'] = null; } $_SESSION['error'] = null; ?> <div class="panel panel-primary col-sm-6 col-sm-offset-3"> <h1 class="text-center">Add a PhoneNumber:</h1> <?php \Framework\FormViewHelper::init()->initForm('/PhoneNumber/add', ['class' => 'form-group'], 'post')->initLabel()->setValue("Name")->setAttribute('for', 'name')->create()->initTextBox()->setName('name')->setAttribute('id', 'name')->setAttribute('class', 'form-control input-md')->create()->initLabel()->setValue("Number")->setAttribute('for', 'number')->create()->initTextBox()->setName('number')->setAttribute('id', 'number')->setAttribute('class', 'form-control input-md')->create()->initDiv()->setAttribute('class', 'margin-top row')->create()->initSubmit()->setAttribute('value', 'Add')->setAttribute('class', 'btn btn-primary btn-lg col-sm-4 col-sm-offset-4')->create()->render(); ?> </div>
<?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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-default')->create()->render(); \Framework\FormViewHelper::init()->initForm($this->getPath() . '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-default')->create()->render(true);
<?php } ?> <?php foreach ($this->_viewBag['body']->getProducts() as $product) { ?> <div class="panel col-sm-3"> <h3 class="panel-primary"><a href="<?php echo $this->getPath() . 'product/' . $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(); ?> $</div> <!--panel panel-primary btn btn-default col-sm-6--> <?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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 }
<div class="panel"> <h1 class="text-center">Editor panel</h1> <div class="row"> <h2 class="col-sm-offset-1">Categories edit</h2> <?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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(); \Framework\FormViewHelper::init()->initForm($this->getPath() . '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); \Framework\FormViewHelper::init()->initForm($this->getPath() . '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 \Framework\FormViewHelper::init()->initForm($this->getPath() . '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); \Framework\FormViewHelper::init()->initForm($this->getPath() . '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); \Framework\FormViewHelper::init()->initForm($this->getPath() . '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>
<div class="panel panel-primary"> <div class="panel-body"> <?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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>
<div class="panel panel-primary col-sm-6 col-sm-offset-3"> <h1 class="text-center">Are you sure you want to remove this PhoneNumber?</h1> <?php \Framework\FormViewHelper::init()->initForm('/PhoneNumber/deletePhoneNumber', ['class' => 'form-group'], 'post')->initSubmit()->setAttribute('value', 'Remove Phone Number')->setAttribute('class', 'btn btn-primary btn-lg col-md-6 col-md-offset-3')->create()->render(); ?> </div>
<div class="panel"> <h1 class="text-center">Admin Edit</h1> <div class="row"> <?php \Framework\FormViewHelper::init()->initForm($this->getPath() . '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(); \Framework\FormViewHelper::init()->initForm($this->getPath() . '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>