Parserdatabaselimpio.php 1.3KB

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