}
 } elseif ($action == 'getHistory') {
     $searchValue = '';
     if (sizeof($data)) {
         $searchValue = $data['data']['search'];
         $stat = $data['data']['stat'];
     }
     $history = POS::getHistoric($searchValue, $stat);
     echo json_encode($history);
 } elseif ($action == 'getHistoryFac') {
     $searchValue = '';
     if (sizeof($data)) {
         $searchValue = $data['data']['search'];
         $stat = $data['data']['stat'];
     }
     $history = POS::getHistoricFac($searchValue, $stat);
     echo json_encode($history);
 } elseif ($action == 'countHistory') {
     $history = POS::countHistoric();
     echo json_encode($history);
 } elseif ($action == 'countHistoryFac') {
     $history = POS::countHistoricFac();
     echo json_encode($history);
 } elseif ($action == 'getParking') {
     $history = POS::getHistoric();
     echo json_encode($history);
 } elseif ($action == 'saveTicket') {
     $result = POS::SetTicket($data);
     echo json_encode($result);
 } elseif ($action == 'searchProducts') {
     if (sizeof($data)) {