$product = POS::getProductbyId($product_id, $customer_id); echo json_encode($product); } } elseif ($action == 'getProductFk') { if (isset($data['data'])) { $product_id = intval($data['data']['product']); $customer_id = intval($data['data']['customer']); $product = POS::getProductbyIdFk($product_id, $customer_id); echo json_encode($product); } } elseif ($action == 'getProductFkUsado') { if (isset($data['data'])) { $product_id = intval($data['data']['product']); $customer_id = intval($data['data']['customer']); $ticket_id = intval($data['data']['ticket']); $product = POS::getProductbyIdFkUsado($product_id, $customer_id, $ticket_id); echo json_encode($product); } } elseif ($action == 'getTicket') { if (sizeof($data)) { $ticketId = $data['data']; $ticket = POS::getTicket($ticketId); echo json_encode($ticket); } } elseif ($action == 'getFacture') { if (sizeof($data)) { $ticketId = $data['data']; $ticket = POS::getFacture($ticketId); echo json_encode($ticket); } } elseif ($action == 'getHistory') {