Parserdatabaselimpio.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. if ($tablasInsert['num_rows'] > 0) {
  16. //$licitacionDeleteCascada = $this->CI->Parser_model->getLicitacionesNuevasBruto();
  17. //if ($licitacionDeleteCascada['num_rows'] > 0) {
  18. $this->CI->Parser_model->deleteCascadaNuevasLicitaciones();
  19. foreach ($tablasInsert['datos'] as $row) {
  20. $datosTablaToInsert = $this->CI->Parser_model->getDatosBrutos($row->tabla_sucia);
  21. if ($datosTablaToInsert['num_rows'] > 0) {
  22. guardar_log("brutoToMaestro_" . $fechaInicioParser, "ARCHIVO--" . $row->tabla_maestra . "_" . $fechaInicioParser . " - " . $filename);
  23. insertBucle($datosTablaToInsert['datos'], $row->tabla_maestra, "brutoToMaestro_" . $fechaInicioParser);
  24. }
  25. }
  26. //}
  27. }
  28. }
  29. }
  30. /* End of file Parserdatabaselimpio.php */
  31. /* Location: ./application/libraries/Parserdatabaselimpio.php */