public static function calcSale($orderId) { $order = DealersOrders::getOrderProp($orderId); $sql = ' SELECT {{dealers}},*, {{dealers_status}}.sale as statussale FROM {{dealers}} LEFT JOIN ((dealers_status)) ON {{dealers}}.status = {{dealers_status}}.id WHERE {{dealers}}.id=' . $order['dealer'] . ' '; $dealer = DB::getRow($dealerId); $sale_status = $dealer['statussale']; $sale_one = self::calc($order['sum'], 'sale_one'); $sale_year = self::calc($order['sum'], 'sale_year'); $sale_total = $sale_status + max($sale_year, $sale) + $order['add_sale']; return $sale_total; }
public function editorder() { $id = $_GET['id']; $data = DealersOrders::getOrderProp($id); $data['formpath'] = 'acteditorder'; View::plugin('orders/edit', $data); }