Exemplo n.º 1
0
    public static function editOrderProp()
    {
        DB::escapePost();
        //die(print_r($_POST,true));
        $id = $_POST['id'];
        $sum = self::calcOrderSum($id);
        $notififications = isset($_POST['send_notification']) ? 1 : 0;
        $sql = 'UPDATE {{dealers_orders}}
			SET
				status=\'' . $_POST['status'] . '\',
				delivery=\'' . $_POST['delivery'] . '\',
				cons=\'' . $_POST['cons'] . '\',
				delivery_price=\'' . $_POST['delivery_price'] . '\',
				tracking=\'' . $_POST['tracking'] . '\',
				add_sale=\'' . $_POST['add_sale'] . '\',
				add_sale_text=\'' . $_POST['add_sale_text'] . '\',
				comment=\'' . $_POST['comment'] . '\',
				send_notification=\'' . $notififications . '\',
				sale_type=\'' . $_POST['sale_type'] . '\',
				sum=' . $sum . '
			WHERE id = \'' . $id . '\'';
        //dealer=\''.$_POST['dealer'].'\',
        DB::exec($sql);
        self::addHistory($id, $_POST['old_status'], $_POST['status']);
        self::setTotalOrdersSum($_POST['dealer']);
        if ($notififications > 0 && $_POST['old_status'] != $_POST['status']) {
            DealersEmail::order_status($id);
        }
    }