echo json_encode($categories); } elseif ($action == 'newTicket') { //$html.= POS::CreateTicket(); //$jorge = $html; } elseif ($action == 'getProduct') { if (isset($data['data'])) { $product_id = intval($data['data']['product']); $customer_id = intval($data['data']['customer']); $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 == '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') {