Пример #1
0
 public function carga_solicitud($id_contrato)
 {
     $consulta = "SELECT c.id_contrato AS contrato, s.importe AS importe ,s.importeCheque AS ImporteDeCheque,t.nombre AS nombre ,c.entrega_cheque AS FechaDeCheque, s.descuento AS descuento\n\t\t\t\t\t,(SELECT sindicato FROM catsindicatos WHERE cve_sindicato = t.sindicato) AS Sindicato,plazo as plazo,saldo_anterior as saldo_anterior,entrega_real as entrega_real\n\t\t\t\t\t,(SELECT COUNT(*) AS movimientos FROM movimientos WHERE id_tipo_movto = 2 and id_contrato = c.id_contrato) AS AbonosRealizados\n\t\t\t\t\t,(SELECT COUNT(*) AS movimientos FROM movimientos WHERE id_contrato = c.id_contrato) AS MovimientosRealizados\n\t\t\t\t\t,(SELECT (SUM(cargo) - SUM(abono) ) AS saldo FROM movimientos WHERE  id_contrato = c.id_contrato) AS SaldoActual\n\t\t\t\t\t,s.descuento as descuento\n\t\t\t\t\tFROM contrato AS c\n\t\t\t\t\tLEFT JOIN solicitud AS s\tON c.id_solicitud = s.id_solicitud\n\t\t\t\t\tLEFT JOIN sujetos  AS t ON t.numero = s.titular\t\n\t\t\t\t\tWHERE c.id_contrato = :id_contrato ";
     $comando = $this->dbConexion->createCommand($consulta);
     $comando->bindValue(":id_contrato", $id_contrato);
     $result = $comando->query()->readAll();
     if (count($result) > 0) {
         // ----------------------------,(SELECT (SUM(cargo) - SUM(abono) ) AS saldo FROM movimientos WHERE  id_contrato = c.id_contrato) AS SaldoActual-----------------------------------------------------------------------------------------------------------
         $plazo = $result[0]["plazo"];
         $seguro = 0.0;
         $saldoAnterior = $result[0]["saldo_anterior"];
         $this->txtContrato2->Text = $result[0]["contrato"];
         $this->txtNombre3->Text = $result[0]["nombre"];
         $this->txtSindicato4->Text = $result[0]["Sindicato"];
         $this->txtPrestamo2->Text = $result[0]["importe"];
         $intereses = THttpUtility::htmlEncode(round($this->txtPrestamo2->Text * $plazo * (1.0 / 100)));
         $this->txtImporteDeCheque3->Text = $result[0]["ImporteDeCheque"];
         $this->txtDescuentoQuincenal4->Text = $result[0]["descuento"];
         $this->txtInteres2->Text = $intereses;
         $cheque = $this->txtPrestamo2->Text - ($intereses + $saldoAnterior + $seguro);
         $this->txtImporteDeCheque3->Text = $cheque;
         $this->txtFechaDeCheque3->Text = $result[0]["entrega_real"];
         $this->txtAbonosRealizados4->Text = $result[0]["AbonosRealizados"];
         $this->txtSaldo4->Text = $result[0]["SaldoActual"];
     }
     $consulta = "SELECT SUM(cargo) AS cargo,  SUM(abono) AS abono  FROM movimientos WHERE id_contrato = :id_contrato";
     $comando = $this->dbConexion->createCommand($consulta);
     $comando->bindValue(":id_contrato", $id_contrato);
     $result = $comando->query()->readAll();
     if (count($result) > 0) {
         $this->txtTotalDeMovimiento2->Text = $result[0]["cargo"];
         $this->txtTotalDeMovimiento3->Text = $result[0]["abono"];
     }
 }
Пример #2
0
 public function callback2_Requested($sender, $param)
 {
     $parameters = $param->CallbackParameter;
     $this->labelParam1->Text = THttpUtility::htmlEncode($parameters->Param1);
     $this->labelParam2->Text = THttpUtility::htmlEncode($parameters->Param2);
     $this->labelParam3->Text = THttpUtility::htmlEncode($parameters->Param3);
 }
 public function onLoad($param)
 {
     parent::onLoad($param);
     $this->dbConexion = Conexion::getConexion($this->Application, "dbpr");
     Conexion::createConfiguracion();
     $idcontrato = $_REQUEST['id'];
     $consulta = "SELECT c.id_contrato AS contrato, s.importe AS importe ,s.importeCheque AS ImporteDeCheque,t.nombre AS nombre ,c.entrega_cheque AS FechaDeCheque, s.descuento AS descuento\n\t\t\t\t\t,(SELECT sindicato FROM catsindicatos WHERE cve_sindicato = t.sindicato) AS Sindicato,plazo as plazo,saldo_anterior as saldo_anterior,entrega_real as entrega_real\n\t\t\t\t\t,(SELECT COUNT(*) AS movimientos FROM movimientos WHERE id_tipo_movto = 2 and id_contrato = c.id_contrato) AS AbonosRealizados\n\t\t\t\t\t,(SELECT COUNT(*) AS movimientos FROM movimientos WHERE id_contrato = c.id_contrato) AS MovimientosRealizados\n\t\t\t\t\t,(SELECT (SUM(cargo) - SUM(abono) ) AS saldo FROM movimientos WHERE  id_contrato = c.id_contrato) AS SaldoActual\n\t\t\t\t\t,s.descuento as descuento\n\t\t\t\t\tFROM contrato AS c\n\t\t\t\t\tLEFT JOIN solicitud AS s\tON c.id_solicitud = s.id_solicitud\n\t\t\t\t\tLEFT JOIN sujetos  AS t ON t.numero = s.titular\t\n\t\t\t\t\tWHERE c.id_contrato = :idcontrato";
     $comando = $this->dbConexion->createCommand($consulta);
     $comando->bindValue(":idcontrato", $idcontrato);
     $result = $comando->query()->readAll();
     if (count($result) > 0) {
         $plazo = $result[0]["plazo"];
         $seguro = 0.0;
         $saldoAnterior = $result[0]["saldo_anterior"];
         $this->lblContrato2->Text = $result[0]["contrato"];
         $this->lblNombre3->Text = $result[0]["nombre"];
         $this->lblSindicato4->Text = $result[0]["Sindicato"];
         $this->lblPrestamo2->Text = $result[0]["importe"];
         $intereses = THttpUtility::htmlEncode(round($this->lblPrestamo2->Text * $plazo * (1.0 / 100)));
         $this->lblImporteDeCheque3->Text = $result[0]["ImporteDeCheque"];
         $this->lblDescuentoQuincenal4->Text = $result[0]["descuento"];
         $this->lblInteres2->Text = $intereses;
         $cheque = $this->lblPrestamo2->Text - ($intereses + $saldoAnterior + $seguro);
         $this->lblImporteDeCheque3->Text = $cheque;
         $this->lblFechaDeCheque3->Text = $result[0]["entrega_real"];
         $this->lblAbonosRealizados4->Text = $result[0]["AbonosRealizados"];
         $this->mostrarDatosGrid();
     }
 }
Пример #4
0
 /**
  * Renders the body content of the hyperlink.
  * @param THtmlWriter the writer for rendering
  */
 public function renderContents($writer)
 {
     if (($imageUrl = $this->getImageUrl()) === '') {
         if (($text = $this->getText()) !== '') {
             $writer->write(THttpUtility::htmlEncode($text));
         } else {
             if ($this->getHasControls()) {
                 parent::renderContents($writer);
             } else {
                 $writer->write(THttpUtility::htmlEncode($this->getNavigateUrl()));
             }
         }
     } else {
         $this->createImage($imageUrl)->renderControl($writer);
     }
 }
Пример #5
0
 public function render($writer)
 {
     $writer->renderBeginTag("li");
     if (null !== ($path = $this->getPath())) {
         $writer->addAttribute('href', $this->Service->constructUrl($path));
         if ($path == $this->Page->getPagePath()) {
             $writer->addAttribute('class', 'active');
         }
     } elseif (null !== ($url = $this->getUrl())) {
         $writer->addAttribute('href', $url);
     }
     if ($this->getTarget() !== null) {
         $writer->addAttribute('target', $this->getTarget());
     }
     $writer->renderBeginTag("a");
     $writer->write(THttpUtility::htmlEncode($this->getText()));
     $writer->renderEndTag();
     $writer->renderEndTag();
 }
Пример #6
0
 protected function renderLinkButtonItem($writer, $item, $index)
 {
     if (!$this->_isEnabled || !$item->getEnabled()) {
         $writer->addAttribute('disabled', 'disabled');
     } else {
         $this->_currentRenderItemIndex = $index;
         $writer->addAttribute('id', $this->getClientID() . $index);
         $writer->addAttribute('href', "javascript:;//" . $this->getClientID() . $index);
         $cs = $this->getPage()->getClientScript();
         $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions());
     }
     if (($accesskey = $this->getAccessKey()) !== '') {
         $writer->addAttribute('accesskey', $accesskey);
     }
     $writer->renderBeginTag('a');
     $writer->write(THttpUtility::htmlEncode($item->getText()));
     $writer->renderEndTag();
 }
Пример #7
0
 /**
  * Renders body content of the list control.
  * This method renders items contained in the list control as the body content.
  * @param THtmlWriter writer
  */
 public function renderContents($writer)
 {
     $this->renderPrompt($writer);
     if ($this->_items) {
         $writer->writeLine();
         $previousGroup = null;
         foreach ($this->_items as $item) {
             if ($item->getEnabled()) {
                 if ($item->getHasAttributes()) {
                     $group = $item->getAttributes()->remove('Group');
                     if ($group !== $previousGroup) {
                         if ($previousGroup !== null) {
                             $writer->renderEndTag();
                             $writer->writeLine();
                             $previousGroup = null;
                         }
                         if ($group !== null) {
                             $writer->addAttribute('label', $group);
                             $writer->renderBeginTag('optgroup');
                             $writer->writeLine();
                             $previousGroup = $group;
                         }
                     }
                     foreach ($item->getAttributes() as $name => $value) {
                         $writer->addAttribute($name, $value);
                     }
                 } else {
                     if ($previousGroup !== null) {
                         $writer->renderEndTag();
                         $writer->writeLine();
                         $previousGroup = null;
                     }
                 }
                 if ($item->getSelected()) {
                     $writer->addAttribute('selected', 'selected');
                 }
                 $writer->addAttribute('value', $item->getValue());
                 $writer->renderBeginTag('option');
                 $writer->write(THttpUtility::htmlEncode($item->getText()));
                 $writer->renderEndTag();
                 $writer->writeLine();
             }
         }
         if ($previousGroup !== null) {
             $writer->renderEndTag();
             $writer->writeLine();
         }
     }
 }
Пример #8
0
 public function testHtmlDecode()
 {
     $html = THttpUtility::htmlDecode('<tag key="value">');
     self::assertEquals('<tag key="value">', $html);
 }
Пример #9
0
 /**
  * Renders the literal control.
  * @param THtmlWriter the writer used for the rendering purpose
  */
 public function render($writer)
 {
     if (($text = $this->getText()) !== '') {
         if ($this->getEncode()) {
             $writer->write(THttpUtility::htmlEncode($text));
         } else {
             $writer->write($text);
         }
     } else {
         parent::render($writer);
     }
 }
Пример #10
0
 public function textChanged($sender, $param)
 {
     $this->label2->Text = THttpUtility::htmlEncode($this->txt2->Text);
 }
Пример #11
0
 /**
  * Renders the head control.
  * @param THtmlWriter the writer for rendering purpose.
  */
 public function render($writer)
 {
     $page = $this->getPage();
     $title = $this->getTitle();
     $writer->write("<head>\n<title>" . THttpUtility::htmlEncode($title) . "</title>\n");
     if (($baseUrl = $this->getBaseUrl()) !== '') {
         $writer->write('<base href="' . $baseUrl . "\" />\n");
     }
     if (($icon = $this->getShortcutIcon()) !== '') {
         $writer->write('<link rel="shortcut icon" href="' . $icon . "\" />\n");
     }
     if (($metaTags = $this->getMetaTags()) !== null) {
         foreach ($metaTags as $metaTag) {
             $metaTag->render($writer);
             $writer->writeLine();
         }
     }
     $cs = $page->getClientScript();
     $cs->renderStyleSheetFiles($writer);
     $cs->renderStyleSheets($writer);
     if ($page->getClientSupportsJavaScript()) {
         $cs->renderHeadScriptFiles($writer);
         $cs->renderHeadScripts($writer);
     }
     parent::render($writer);
     $writer->write("</head>\n");
 }
Пример #12
0
 /**
  * @param THtmlWriter writer for the rendering purpose
  */
 public function renderHiddenFields($writer)
 {
     $str = '';
     foreach ($this->_hiddenFields as $name => $value) {
         $id = strtr($name, ':', '_');
         if (is_array($value)) {
             foreach ($value as $v) {
                 $str .= '<input type="hidden" name="' . $name . '[]" id="' . $id . '" value="' . THttpUtility::htmlEncode($value) . "\" />\n";
             }
         } else {
             $str .= '<input type="hidden" name="' . $name . '" id="' . $id . '" value="' . THttpUtility::htmlEncode($value) . "\" />\n";
         }
     }
     if ($str !== '') {
         $writer->write("<div style=\"visibility:hidden;\">\n" . $str . "</div>\n");
     }
 }
Пример #13
0
 /**
  * Removes the named stylesheet attribute from rendering
  * @param string name of the stylesheet attribute to be removed
  */
 public function removeStyleAttribute($name)
 {
     unset($this->_styles[THttpUtility::htmlStrip($name)]);
 }
Пример #14
0
 /**
  * Databinds a cell in the column.
  * This method is invoked when datagrid performs databinding.
  * It populates the content of the cell with the relevant data from data source.
  */
 public function dataBindColumn($sender, $param)
 {
     $item = $sender->getNamingContainer();
     $data = $item->getData();
     $formatString = $this->getDataFormatString();
     if (($field = $this->getDataField()) !== '') {
         $value = $this->formatDataValue($formatString, $this->getDataFieldValue($data, $field));
     } else {
         $value = $this->formatDataValue($formatString, $data);
     }
     if ($sender instanceof TTableCell) {
         if ($this->getEncode()) {
             $value = THttpUtility::htmlEncode($value);
         }
         $sender->setText($value);
     }
 }
Пример #15
0
 public function testAddStyleAttribute()
 {
     $writer = new THtmlWriter(self::$output);
     $writer->addStyleAttribute('font-size', '1em');
     $writer->addStyleAttribute('background-image', 'url(image.gif)');
     $result = self::readAttribute($writer, '_styles');
     self::assertEquals('1em', $result['font-size']);
     self::assertEquals(THttpUtility::htmlEncode('url(image.gif)'), $result['background-image']);
 }
Пример #16
0
    protected function renderMessage($log, $info)
    {
        $string = '';
        $total = sprintf('%0.6f', $info['total']);
        $delta = sprintf('%0.6f', $info['delta']);
        $msg = preg_replace('/\\(line[^\\)]+\\)$/', '', $log[0]);
        //remove line number info
        $msg = THttpUtility::htmlEncode($msg);
        if ($this->getCssClass()) {
            $colorCssClass = $log[1];
            $messageCssClass = $info['even'] ? 'even' : 'odd';
            $string = <<<EOD
\t<tr class="message level{$colorCssClass} {$messageCssClass}">
\t\t<td class="code">&nbsp;</td>
\t\t<td class="category">{$log[2]}</td>
\t\t<td class="message">{$msg}</td>
\t\t<td class="time">{$delta}</td>
\t\t<td class="cumulatedtime">{$total}</td>
\t</tr>
EOD;
        } else {
            $bgcolor = $info['even'] ? "#fff" : "#eee";
            $color = $this->getColorLevel($log[1]);
            $string = <<<EOD
\t<tr style="background-color: {$bgcolor}; color:#000">
\t\t<td style="border:1px solid silver;background-color: {$color};">&nbsp;</td>
\t\t<td>{$log[2]}</td>
\t\t<td>{$msg}</td>
\t\t<td style="text-align:center">{$delta}</td>
\t\t<td style="text-align:center">{$total}</td>
\t</tr>
EOD;
        }
        return $string;
    }
Пример #17
0
 /**
  * Renders a javascript file
  * @param string URL to the javascript file
  * @return string rendering result
  */
 public static function renderScriptFile($file)
 {
     return '<script type="text/javascript" src="' . THttpUtility::htmlEncode($file) . "\"></script>\n";
 }
Пример #18
0
 public function buttonClicked2($sender, $param)
 {
     $this->label2->Text = THttpUtility::htmlEncode($this->txt2->Text);
 }
Пример #19
0
 /**
  * Renders the body content of the textbox when it is in MultiLine text mode.
  * @param THtmlWriter the writer for rendering
  */
 public function renderContents($writer)
 {
     if ($this->getTextMode() === 'MultiLine') {
         $writer->write(THttpUtility::htmlEncode($this->getText()));
     }
 }
Пример #20
0
 /**
  * Adds a stylesheet attribute to be rendered
  * @param string stylesheet attribute name
  * @param string stylesheet attribute value
  */
 public function addStyleAttribute($name, $value)
 {
     $this->_styles[$name] = isset(self::$_styleEncode[$name]) ? THttpUtility::htmlEncode($value) : $value;
 }
Пример #21
0
 protected function renderHiddenFieldsInt($writer, $initial)
 {
     if ($initial) {
         $this->_renderedHiddenFields = array();
     }
     $str = '';
     foreach ($this->_hiddenFields as $name => $value) {
         if (in_array($name, $this->_renderedHiddenFields)) {
             continue;
         }
         $id = strtr($name, ':', '_');
         if (is_array($value)) {
             foreach ($value as $v) {
                 $str .= '<input type="hidden" name="' . $name . '[]" id="' . $id . '" value="' . THttpUtility::htmlEncode($value) . "\" />\n";
             }
         } else {
             $str .= '<input type="hidden" name="' . $name . '" id="' . $id . '" value="' . THttpUtility::htmlEncode($value) . "\" />\n";
         }
         $this->_renderedHiddenFields[] = $name;
     }
     if ($str !== '') {
         $writer->write("<div style=\"visibility:hidden;\">\n" . $str . "</div>\n");
     }
 }
Пример #22
0
 public function calculo($campos = null)
 {
     if ($this->txtTipoTit->Text == "JUBILADO") {
         $importeT = $this->txtImporte->Text;
     } else {
         $importeT = $this->txtImporte1->Text;
     }
     $this->lblNotaValCamposVacios->visible = "false";
     $intereses = THttpUtility::htmlEncode(round($importeT * $this->txtPlazo1->Text * (1.0 / 100)));
     $importe = $importeT;
     $saldoAnterior = $this->lblSaldoAnterior->text;
     $seguro = $this->lblSeguro->text = 0.0;
     $descuento = $this->txtPlazo1->Text * 2;
     $LItemp = $importe / $descuento;
     $LItemp = $LItemp * 100;
     $importeDescuento = $LItemp / 100;
     $importeADescontar = $descuento * $importeDescuento;
     $DescQuincena = $importe / $descuento;
     $Redondeo = $importe - $importeADescontar;
     $this->lblIntereses1->Text = number_format($intereses, 2);
     $this->lblDescuentos->text = number_format($descuento, 2);
     $this->lblImpDescuentos->text = number_format($importeDescuento, 2);
     $this->lblImpPrestamos->text = number_format($importeADescontar, 2);
     $this->lblDiferencia->text = number_format($Redondeo, 2);
     $cheque = $importe - ($intereses + $saldoAnterior + $seguro);
     $this->lblImpCheque->text = number_format($cheque, 2);
     $this->lblImpChequeResp->text = $cheque;
     if ($cheque < 0) {
         $this->lblValImpSanAnterior->Text = "El importe: \$" . number_format($importeT, 2) . '<br/>' . "es menor al saldo anterior: \$" . number_format($saldoAnterior, 2);
         //.'\n\n'.
     } else {
         $this->lblValImpSanAnterior->visible = "false";
     }
     if ($this->lblSolicitadasTit->Text > 0 or $this->lblSolicitadasAval1->Text > 0 or $this->lblAutorizadasAval1->Text > 0 or $this->lblSolicitadasAval2->Text > 0 or $this->lblAutorizadasAval2->Text > 0) {
         $this->btnGuardar->visible = "false";
     } else {
         $this->btnGuardar->visible = "true";
     }
     if ($this->txtTipoTit->Text == "JUBILADO") {
         if ($importeT > 0) {
             $this->lblNotaVal->visible = "false";
             $this->btnImprimir->visible = "true";
             $this->btnGuardar->visible = "true";
         } else {
             $this->btnImprimir->visible = "false";
             $this->lblNotaVal->visible = "true";
             $this->lblNotaVal->Text = 'El importe tiene que ser mayor a:' . $importeTt;
         }
     } else {
         $MesesTrabajo = $this->txtAntiguedadNumTit->Text;
         switch ($MesesTrabajo) {
             case $MesesTrabajo >= 0.61 and $MesesTrabajo < 15.0:
                 if ($importeT >= 7000.0 and $importeT <= 50000.0) {
                     $this->lblNotaVal->visible = "false";
                 } else {
                     $this->btnImprimir->visible = "false";
                     $this->lblNotaVal->visible = "true";
                     $this->lblNotaVal->Text = 'No cumple con la Antigüedad para el préstamo de 50000: $' . $importeT;
                 }
                 break;
             case $MesesTrabajo >= 15.0:
                 if ($importeT >= 7000.0 and $importeT <= 100000.0) {
                     $this->lblNotaVal->visible = "false";
                     $this->btnImprimir->visible = "true";
                 } else {
                     $this->btnImprimir->visible = "false";
                     $this->btnGuardar->visible = "false";
                     $this->lblNotaVal->visible = "true";
                     $this->lblNotaVal->Text = 'No cumple con la Antigüedad para el préstamo de 100000: $' . $importeT;
                 }
                 break;
         }
     }
 }