Added Order Form
This commit is contained in:
27
application/Order/OrderController.php
Normal file
27
application/Order/OrderController.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class OrderController extends mfBaseController {
|
||||
|
||||
protected function init() {
|
||||
$this->needlogin=true;
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me",$me);
|
||||
|
||||
if(!$me->isAdmin()) {
|
||||
$this->redirect("Dashboard");
|
||||
}
|
||||
}
|
||||
|
||||
protected function indexAction() {
|
||||
$this->layout()->setTemplate("Order/Index");
|
||||
$this->layout()->set("orders", OrderModel::getAll());
|
||||
|
||||
}
|
||||
|
||||
protected function addAction() {
|
||||
$this->layout()->setTemplate("Order/Form");
|
||||
$this->layout()->set("addresses", AddressModel::search(['parents_only' => 1]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user