Init
This commit is contained in:
40
simpla/OrdersLabelAdmin.php
Normal file
40
simpla/OrdersLabelAdmin.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?PHP
|
||||
require_once('api/Simpla.php');
|
||||
|
||||
class OrdersLabelAdmin extends Simpla
|
||||
{
|
||||
public function fetch()
|
||||
{
|
||||
$label->color = 'ffffff';
|
||||
if($this->request->method('POST'))
|
||||
{
|
||||
$label->id = $this->request->post('id', 'integer');
|
||||
$label->name = $this->request->post('name');
|
||||
$label->color = $this->request->post('color');
|
||||
if(empty($label->id))
|
||||
{
|
||||
$label->id = $this->orders->add_label($label);
|
||||
$label = $this->orders->get_label($label->id);
|
||||
$this->design->assign('message_success', 'added');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->orders->update_label($label->id, $label);
|
||||
$label = $this->orders->get_label($label->id);
|
||||
$this->design->assign('message_success', 'updated');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $this->request->get('id', 'integer');
|
||||
if(!empty($id))
|
||||
$label = $this->orders->get_label(intval($id));
|
||||
}
|
||||
|
||||
$this->design->assign('label', $label);
|
||||
|
||||
return $this->design->fetch('orders_label.tpl');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user