123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- <?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
- {
-
- // ------------------------------------------------------------------------
-
- public function __construct()
- {
- parent::__construct();
- }
-
- // ------------------------------------------------------------------------
-
- // ------------------------------------------------------------------------
- public function getLicitaciones($having = "")
- {
- $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,
- PROJ.NAME as name,
- 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
- maestro_datos_iniciales_licitacion LI
- JOIN import_licitaciones_temp temp ON LI.id_licitacion = temp.id_licitacion
- LEFT JOIN maestro_contract_folder CF ON CF.id_ajena_licitacion = LI.id_licitacion
- LEFT JOIN maestro_located_contracting_party LP ON LP.id_ajena_licitacion = LI.id_licitacion
- LEFT JOIN maestro_party MP ON MP.id_ajena_licitacion = LI.id_licitacion
- LEFT JOIN maestro_procurement_project PROJ ON PROJ.id_ajena_licitacion = LI.id_licitacion
- LEFT JOIN maestro_procurement_project_itemclass PROJI ON PROJI.id_ajena_licitacion = LI.id_licitacion
- LEFT JOIN maestro_tendering_process TP ON TP.id_ajena_licitacion = LI.id_licitacion
- LEFT JOIN maestro_tendering_terms TT ON TT.id_ajena_licitacion = LI.id_licitacion
- LEFT JOIN relacionada_contract_status RCF ON RCF.CODE = CF.contractFolderStatusCode
- LEFT JOIN relacionada_located_contracting_party RLP ON RLP.CODE = LP.contractingPartyTypeCode
- LEFT JOIN relacionada_tipo_contrato TPC ON TPC.CODE = PROJ.typeCode
- LEFT JOIN relacionada_tender_process RTP ON RTP.CODE = TP.procedureCode
- LEFT JOIN relacionada_tender_process_contracting_code RTPC ON RTPC.CODE = TP.contractingSystemCode
- LEFT JOIN relacionada_tender_process_submission RTPS ON RTPS.CODE = TP.submissionMethodCode
- LEFT JOIN relacionada_tender_process_urgency_code RTPU ON RTPU.CODE = TP.urgencyCode /*WHERE
- LI.id < 17174 */
-
- GROUP BY
- id_licitacion
- $having
- ORDER BY
- CF.id";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getDatosByTablaAndLicitacion($tabla, $licitacionID)
- {
- $sql = "SELECT *
- FROM
- $tabla
- WHERE id_ajena_licitacion = $licitacionID";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos['datos'];
- }
- public function getTablaWithoutLicitacion($tabla)
- {
- $sql = "SELECT
- *
- FROM
- $tabla t1";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getDatosRelacionadosByTablaAndLicitacion($tabla, $tablaAjena, $idRelacionada, $idAjenaLicitacion)
- {
- $sql = "SELECT
- *
- FROM
- $tabla
- JOIN $tablaAjena TBAJ ON TBAJ.code = " . $tabla . "." . $idRelacionada . "
- WHERE id_ajena_licitacion = $idAjenaLicitacion";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos['datos'];
- }
-
- public function getDatosRelacionadasTablaWithoutLicitacion($tablaRelacion, $tabla, $txtIdAjena, $id = "t1.id")
- {
- $sql = "SELECT
- *
- FROM
- $tabla t1
- JOIN
- $tablaRelacion t2 ON t2." . $txtIdAjena . " = t1.id";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTenderProcessRelacion()
- {
- $sql = "SELECT
- t2.nombre as procedureCode, t3.nombre as contractingSystemCode, t4.nombre as submissionMethodCode, t5.nombre as urgencyCode,
- t1.id_ajena_licitacion, t1.partPresentationCode, t1.maximumLotPresentationQuantity, t1.maximumTendererAwardedLotsQuantity, t1.lotsCombinationContractingAuthorityRights,
- t1.deadLineEndDate, t1.deadLineEndTime, t1.deadLineDescription, t1.auctionTerms, t1.documentAvailablePeriod_EndDate, t1.documentAvailablePeriod_EndTime
- FROM
- maestro_tendering_process t1
- JOIN relacionada_tender_process t2 ON t2.code = t1.procedureCode
- JOIN relacionada_tender_process_contracting_code t3 ON t3.code = t1.contractingSystemCode
- JOIN relacionada_tender_process_submission t4 ON t4.code = t1.submissionMethodCode
- JOIN relacionada_tender_process_urgency_code t5 ON t5.code = t1.urgencyCode";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getValidNoticeInfoRelacion()
- {
- $sql = "SELECT
- t2.nombre as noticeTypeCode, t1.id_ajena_licitacion, t1.publicationMediaName
- FROM
- maestro_valid_notice_info t1
- JOIN relacionada_valid_notice_info t2 ON t2.code = t1.noticeTypeCode";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTenderResult()
- {
- $sql = "SELECT
- t2.nombre as resultCode, t1.id_ajena_licitacion, t1.description, t1.awardDate, t1.receivedTenderQuantity, t1.lowerTenderAmount , t1.higherTenderAmount, t1.startDate,
- t1.smeawardedIndicator, t1.contract_id, t1.contract_issueDate, t1.partyIdentification, t1.partyName, t1.TaxExclusiveAmount, t1.PayableAmount
- FROM
- maestro_tender_result t1
- JOIN relacionada_tender_result t2 ON t2.code = t1.resultCode";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTenderingTermsGarantia()
- {
- $sql = "SELECT
- t1.id_ajena_licitacion, t2.nombre as guaranteeTypeCode, t1.requiredCurriculaIndicator, t1.variantConstraintIndicator, t1.fundingProgramCode, t1.requiredFinancialGuarantee_Amount,
- t1.language, t1.allowedSubcontractTerms, t1.description, t1.personalSituation, t1.procurementLegislationDocumentReference
- FROM
- maestro_tendering_terms t1
- JOIN relacionada_codigo_tipo_garantia t2 ON t2.code = t1.guaranteeTypeCode";
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTenderingTermsCriteriosFinanciacion()
- {
- $sql = "SELECT
- t2.id_ajena_licitacion,
- t3.nombre AS evaluationCriteriaTypeCode,
- t1.description
- FROM
- maestro_tendering_terms_financial_evaluation t1
- JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
- JOIN relacionada_tendering_terms_financial t3 ON t3.CODE = t1.evaluationCriteriaTypeCode";
-
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTenderingTermsCriteriosTecnicos()
- {
- $sql = "SELECT
- t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
- FROM
- maestro_tendering_terms_qualification_request t1
- JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
- JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
-
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getTenderingTermsRequisitos()
- {
- $sql = "SELECT
- t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
- FROM
- maestro_tendering_terms_qualification_request t1
- JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
- JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
-
- $result = $this->db->query($sql);
- $datos['datos'] = $result->result_array();
- $datos['num_rows'] = $result->num_rows();
- return $datos;
- }
-
- public function getProjectLotActivityByProjectLot($projectLotId)
- {
- $sql = "SELECT
- *
- FROM
- maestro_procurement_project_lot_item
- WHERE id_ajena_ppl = $projectLotId";
- $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 */
|