123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <?php
- defined('BASEPATH') or exit('No direct script access allowed');
-
- /**
- *
- * Model Xlsexport_model_model
- *
- * This Model for ...
- *
- * @package CodeIgniter
- * @category Model
- * @author Setiawan Jodi <jodisetiawan@fisip-untirta.ac.id>
- * @link https://github.com/setdjod/myci-extension/
- * @param ...
- * @return ...
- *
- */
-
- class Xlsexport_model extends CI_Model
- {
-
- protected $fechaLog = "2022-02-28 12:23:38";
-
- public function __construct()
- {
- parent::__construct();
- }
-
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- public function getLicitaciones($idUltimaImportacion)
- {
- $sql = " SELECT
- CF.id,
- LI.id_licitacion,
- GROUP_CONCAT( PROJI.itemClassification_value ) AS itemClassification_attr,
- LI.link_uri,
- LI.updated,
- CF.contractFolderID,
- CF.contractFolderStatusCode,
- LP.buyerProfileURIID,
- LP.contractingPartyTypeCode,
- MP.partyName,
- MP.codpostal,
- MP.websiteURI,
- MP.city,
- MP.direccion,
- MP.contact_name,
- MP.contact_email,
- MPI.idPartyIdent AS partyItem,
- MPI.attr as tipoIdParty,
- PROJ.NAME as nameProject,
- PROJ.estimatedOverallContractAmount,
- PROJ.taxExclusiveAmount,
- PROJ.totalAmount,
- PROJ.countrySubentityCode,
- PROJ.countrySubentity,
- PROJ.durationMesure,
- PROJ.medida,
- PROJ.duracion_inicio,
- PROJ.duracion_fin,
- PROJ.contractExtension,
- TT.procurementLegislationDocumentReference,
- TT.allowedSubcontractTerms,
- RCF.descripcion AS contrato_status,
- RLP.nombre AS tipo_administracion,
- TPC.descripcion AS tipo_contrato,
- RTP.nombre AS tipoTender,
- RTPC.nombre AS contrato_sistema,
- RTPS.nombre AS submision,
- RTPU.nombre AS urgency,
- LI.fecha_creacion_log
- FROM
- global_datos_iniciales_licitacion LI
- JOIN global_contract_folder CF ON CF.id_ajena_licitacion = LI.id_licitacion
- JOIN global_located_contracting_party LP ON LP.id_ajena_licitacion = LI.id_licitacion
- JOIN global_party MP ON MP.id_ajena_licitacion = LI.id_licitacion
- JOIN global_party_party_idenfitication MPI on MPI.id_ajena_licitacion = LI.id_licitacion AND MPI.attr = 'DIR3'
- JOIN global_procurement_project PROJ ON PROJ.id_ajena_licitacion = LI.id_licitacion
- JOIN global_procurement_project_itemclass PROJI ON PROJI.id_ajena_licitacion = LI.id_licitacion
- JOIN global_tendering_process TP ON TP.id_ajena_licitacion = LI.id_licitacion
- JOIN global_tendering_terms TT ON TT.id_ajena_licitacion = LI.id_licitacion
- JOIN codice_contract_status RCF ON RCF.CODE = CF.contractFolderStatusCode
- JOIN codice_located_contracting_party RLP ON RLP.CODE = LP.contractingPartyTypeCode
- JOIN codice_tipo_contrato TPC ON TPC.CODE = PROJ.typeCode
- JOIN codice_tender_process RTP ON RTP.CODE = TP.procedureCode
- JOIN codice_tender_process_contracting_code RTPC ON RTPC.CODE = TP.contractingSystemCode
- JOIN codice_tender_process_submission RTPS ON RTPS.CODE = TP.submissionMethodCode
- JOIN codice_tender_process_urgency_code RTPU ON RTPU.CODE = TP.urgencyCode
- WHERE LI.id_importacion = $idUltimaImportacion
- GROUP BY
- id_licitacion";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getFullDatosUltimasInsertadas()
- {
- $sql = "SELECT *
- FROM
- vista_datos_licitacion";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTablaByFechaLog($tabla)
- {
- $sql = "SELECT * FROM $tabla
- WHERE fecha_creacion_log = '$this->fechaLog'";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getProjectLotItem()
- {
- $sql = "SELECT
- MP.idProcurementLot,
- MP.countrySubentity,
- MP.countrySubentityCode,
- MP.totalAmount,
- MP.taxExclusiveAmount,
- MP.`name`,
- MP.id_ajena_licitacion,
- GROUP_CONCAT( MPI.idItem ) AS itemClassification_attr
-
- FROM
- global_procurement_project_lot MP
- JOIN global_procurement_project_lot_item MPI ON MP.id_compuesta = MPI.id_compuesta_padre
- WHERE
- MPI.fecha_creacion_log = '$this->fechaLog'
- GROUP BY
- MP.id_compuesta";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getFechasPublicadas($idLicitacion)
- {
- $sql = "SELECT MIN(fechas) as fecha
- FROM
- global_valid_notice_info_fecha WHERE id_ajena_licitacion = '$idLicitacion'";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->row();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTenderingTermsCodes()
- {
- $sql = "SELECT
- TP.*,
- RTP.nombre AS tipoTender, /*procedureCode*/
- RTPC.nombre AS contrato_sistema, /*urgencyCode*/
- RTPS.nombre AS submision, /*contractingSistemCode*/
- RTPU.nombre AS urgency /*urgencyCode*/
- FROM
- global_tendering_process TP
- JOIN codice_tender_process RTP ON RTP.CODE = TP.procedureCode
- JOIN codice_tender_process_contracting_code RTPC ON RTPC.CODE = TP.contractingSystemCode
- JOIN codice_tender_process_submission RTPS ON RTPS.CODE = TP.submissionMethodCode
- JOIN codice_tender_process_urgency_code RTPU ON RTPU.CODE = TP.urgencyCode
-
- WHERE
- TP.fecha_creacion_log = '$this->fechaLog'";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getDatosRelacionadasTablaWithoutLicitacion($tabla, $tablaRelacion, $txtIdAjena, $id = "t1.id")
- {
- $sql = "SELECT
- *,
- t2.nombre as code_desc
- FROM
- $tabla t1
- JOIN
- $tablaRelacion t2 ON t2." . $txtIdAjena . " = t1." . $id . "
- WHERE t1.fecha_creacion_log = '$this->fechaLog'";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- }
-
- /* End of file Xlsexport_model_model.php */
- /* Location: ./application/models/Xlsexport_model_model.php */
|