Parserdatabaselimpio.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. defined('BASEPATH') or exit('No direct script access allowed');
  3. class Parserdatabaselimpio
  4. {
  5. protected $CI;
  6. public function __construct()
  7. {
  8. $this->CI = &get_instance();
  9. $this->CI->load->model("Parser_model");
  10. $this->CI->load->model("Xlsexport_model");
  11. }
  12. public function index($fechaInicioParser, $filename)
  13. {
  14. $tablasInsert = $this->CI->Parser_model->getMapaTablas();
  15. $totalInserted = array();
  16. if ($tablasInsert['num_rows'] > 0) {
  17. //$licitacionDeleteCascada = $this->CI->Parser_model->getLicitacionesNuevasBruto();
  18. //if ($licitacionDeleteCascada['num_rows'] > 0) {
  19. $this->CI->Parser_model->deleteCascadaNuevasLicitaciones();
  20. foreach ($tablasInsert['datos'] as $row) {
  21. $datosTablaToInsert = $this->CI->Parser_model->getDatosBrutos($row->tabla_sucia);
  22. if ($datosTablaToInsert['num_rows'] > 0) {
  23. guardar_log("inToGlobal_" . $fechaInicioParser, "ARCHIVO--" . $row->tabla_maestra . "_" . $fechaInicioParser . " - " . $filename);
  24. $totalInserted[$row->tabla_maestra] = insertBucle($datosTablaToInsert['datos'], $row->tabla_maestra, "inToGlobal_" . $fechaInicioParser);
  25. }
  26. }
  27. //}
  28. return $totalInserted;
  29. }
  30. }
  31. }
  32. /* End of file Parserdatabaselimpio.php */
  33. /* Location: ./application/libraries/Parserdatabaselimpio.php */