function cotizacion($cotizacion, $idmodelo, $cuotainicial) { if ($idmodelo) { $sql = "SELECT * FROM motoriente_moto, motoriente_interes WHERE Motoriente_Moto_id = {$idmodelo}"; $result = mysql_query($sql); $row = mysql_fetch_array($result); } ?> <div id='cotizacion'> <div id='titulocotizacion'> <h3>Cotizacion <?php print $cotizacion; ?> :</h3> </div> <div id='cuerpocotizacion'> <div id = "cotizacionmodelo"> <label>Modelo: <select name='modelo<?php print $cotizacion; ?> ' id='modelo<?php print $cotizacion; ?> '> <option value="0">---</option> <?php $sql = 'SELECT Motoriente_Moto_id, Motoriente_Moto_modelo FROM motoriente_moto ORDER BY Motoriente_Moto_modelo'; $result = mysql_query($sql); while ($rowm = mysql_fetch_array($result)) { $idmoto = $rowm['Motoriente_Moto_id']; $modelo = $rowm['Motoriente_Moto_modelo']; $seleccionada = ""; if ($idmodelo) { if ($idmoto == $idmodelo) { $seleccionada = "selected='selected'"; } } ?> <option value='<?php print $idmoto; ?> '<?php print $seleccionada; ?> ><?php print $modelo; ?> </option> <?php } ?> </select> </label> <label>Valor: <input name='valorMoto<?php print $cotizacion; ?> ' type='text' id='valorMoto<?php print $cotizacion; ?> ' size='12' value='$<?php print number_format($row['Motoriente_Moto_valor']); ?> '/> </label> <label>Papeles: <input name='papeles<?php print $cotizacion; ?> ' type='text' id='papeles<?php print $cotizacion; ?> ' size='12' value='$<?php print number_format($row['Motoriente_Moto_papeles']); ?> '/> </label> <label>Cuota Inicial: <input name='cuotaInicial<?php print $cotizacion; ?> ' type='text' id='cuotaInicial<?php print $cotizacion; ?> ' size='12' maxlength='15' value='<?php print (int) $cuotainicial; ?> '/> </label> <?php if (!isset($_GET['id'])) { ?> <input type='submit' name='cargarMoto<?php print $cotizacion; ?> ' id='cargarMoto<?php print $cotizacion; ?> ' value='Cargar Información' /> <?php } ?> </div> <div id='label_price'> Con Matricula + Soat </div> <div id='input_prices'> <label>12:<input name='valorConDocs<?php print $cotizacion; ?> 12' type='text' readonly='readonly' id='valorConDocs<?php print $cotizacion; ?> 12' size='12' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_12'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> '/> </label> <label>24:<input name='valorConDocs<?php print $cotizacion; ?> 24' type='text' readonly='readonly' id='valorConDocs<?php print $cotizacion; ?> 2' size='12' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_24'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> '/> </label> <label>36:<input name='valorConDocs<?php print $cotizacion; ?> 36' type='text' readonly='readonly' id='valorConDocs<?php print $cotizacion; ?> 36' size='12' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_36'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> '/> </label> <label>48:<input name='valorConDocs<?php print $cotizacion; ?> 48' type='text' id='valorConDocs<?php print $cotizacion; ?> 48' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_48'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>60:<input name='valorConDocs<?php print $cotizacion; ?> ' type='text' id='valorConDocs<?php print $cotizacion; ?> ' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_60'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> </div> <div id='label_price'> Con Matricula sin Soat </div> <div id='input_prices'> <label>12:<input name='valorsinDocs<?php print $cotizacion; ?> 12' type='text' id='valorsinDocs<?php print $cotizacion; ?> 12' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_12'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>24:<input name='valorsinDocs<?php print $cotizacion; ?> 24' type='text' id='valorConDocs<?php print $cotizacion; ?> 24' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_24'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>36:<input name='valorsinDocs<?php print $cotizacion; ?> 36' type='text' id='valorConDocs<?php print $cotizacion; ?> 36' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_36'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>48:<input name='valorsinDocs<?php print $cotizacion; ?> 48' type='text' id='valorsinDocs<?php print $cotizacion; ?> 48' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_48'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>60:<input name='valorConDocs<?php print $cotizacion; ?> 60' type='text' id='valorConDocs<?php print $cotizacion; ?> 60'value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_60'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> </div> <div id='label_price'> Cheques + Papeles </div> <div id='input_prices'> <label> 3 : <input name='chequeconDocs<?php print $cotizacion; ?> 3' type='text' id='chequeconDocs<?php print $cotizacion; ?> 3' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_3'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>6 : <input name='chequeConDocs<?php print $cotizacion; ?> 6' type='text' id='chequeConDocs<?php print $cotizacion; ?> 6' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_6'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>8 : <input name='chequeConDocs<?php print $cotizacion; ?> 8' type='text' id='chequeConDocs<?php print $cotizacion; ?> 8' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_8'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>10:<input name='chequeconDocs<?php print $cotizacion; ?> 10' type='text' id='chequeconDocs<?php print $cotizacion; ?> 10' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_10'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> ' size='12' readonly="readonly"]/> </label> <label>12:<input name='chequeConDocs<?php print $cotizacion; ?> 12' type='text' id='chequeConDocs<?php print $cotizacion; ?> 12' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_12'], $row['Motoriente_Moto_papeles'], $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> </div> <div id='label_price'> Cheques sin Papeles </div> <div id='input_prices'> <label> 3 : <input name='chequesinDocs<?php print $cotizacion; ?> 3' type='text' id='chequesinDocs<?php print $cotizacion; ?> 3' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_3'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>6 : <input name='chequesinDocs<?php print $cotizacion; ?> 6' type='text' id='chequesinDocs<?php print $cotizacion; ?> 6' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_6'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>8 : <input name='chequesinDocs<?php print $cotizacion; ?> 8' type='text' id='chequesinDocs<?php print $cotizacion; ?> 8' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_8'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>10:<input name='chequesinDocs<?php print $cotizacion; ?> 10' type='text' id='chequesinDocs<?php print $cotizacion; ?> 10' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_10'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> </label> <label>12:<input name='chequesinDocs<?php print $cotizacion; ?> 12' type='text' id='chequesinDocs<?php print $cotizacion; ?> 12' value='$<?php print calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_12'], 0, $cuotainicial); ?> ' size='12' readonly="readonly"/> <br /> </label> <strong>Seguro Robo:</strong> <label>Prima Anual: <input name='segAnual<?php print $cotizacion; ?> ' type='text' id='segAnual$cotizacion' value='$<?php print number_format($row['Motoriente_Moto_prima_anual']); ?> ' size='12' readonly="readonly"/> </label> <label>10 Cuotas Mensuales: <input name='seg10<?php print $cotizacion; ?> ' type='text' id='seg10$cotizacion' value='$<?php print number_format($row['Motoriente_Moto_prima_10_cuotas']); ?> ' size='12' readonly="readonly"/> </label> <label>Valor Todo Riesgo: <input name='SegTodoRiesgo<?php print $cotizacion; ?> ' type='text' id='SegTodoRiesgo$cotizacion' value='$<?php print number_format($row['Motoriente_Moto_todo_riesgo']); ?> ' size='12' readonly="readonly"/> </label> </div> <hr /> </div> </div> <?php }
function Cotizacion($cotizacion, $idmoto, $cuotainicial) { $this->SetFont('Arial', 'B', 8); $this->Cell(22, 4, 'COTIZACION ' . $cotizacion, 1); $this->SetX(5); $this->Cell(0, 26, '', 1); $this->SetX(37); if (!isset($idmoto)) { $idmoto = 0; } if (!isset($cuotainicial)) { $cuotainicial = 0; } $sql = "SELECT * FROM motoriente_moto, motoriente_interes WHERE Motoriente_Moto_id = {$idmoto}"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $this->Cell(34, 6, $row['Motoriente_Moto_modelo']); $this->SetFont('Arial', '', 8); $this->Cell(32, 6, 'Valor: $' . number_format($row['Motoriente_Moto_valor'])); $this->Cell(31, 6, 'Papeles: $' . number_format($row['Motoriente_Moto_papeles'])); $this->Cell(0, 6, 'C. Inicial: $' . number_format($cuotainicial)); $this->Ln(5); $this->Cell(55, 4, 'Financiacion con Matricula y Soat (Meses)'); $this->Cell(26, 4, '12: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_12'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '24: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_24'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '36: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_36'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '48: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_48'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '60: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_60'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Ln(4); $this->Cell(55, 4, 'Financiacion sin Matricula y Soat (Meses)'); $this->Cell(26, 4, '12: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_12'], 0, $cuotainicial)); $this->Cell(26, 4, '24: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_24'], 0, $cuotainicial)); $this->Cell(26, 4, '36: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_36'], 0, $cuotainicial)); $this->Cell(26, 4, '48: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_48'], 0, $cuotainicial)); $this->Cell(26, 4, '60: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_60'], 0, $cuotainicial)); $this->Ln(4); $this->Cell(55, 4, 'No. Cheques con Matricula y Soat'); $this->Cell(26, 4, '3: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_3'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '6: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_6'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '8: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_8'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '10: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_10'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Cell(26, 4, '12: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_12'], $row['Motoriente_Moto_papeles'], $cuotainicial)); $this->Ln(4); $this->Cell(55, 4, 'No. Cheques sin Matricula y Soat'); $this->Cell(26, 4, '3: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_3'], 0, $cuotainicial)); $this->Cell(26, 4, '6: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_6'], 0, $cuotainicial)); $this->Cell(26, 4, '8: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_8'], 0, $cuotainicial)); $this->Cell(26, 4, '10: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_10'], 0, $cuotainicial)); $this->Cell(26, 4, '12: $' . calcularCuota($row['Motoriente_Moto_valor'], $row['Motoriente_Interes_Cheques_12'], 0, $cuotainicial)); $this->Ln(4); $this->Cell(40, 4, 'Seguro contra Robo'); $this->Cell(45, 4, 'Prima Anual: $' . number_format($row['Motoriente_Moto_prima_anual'])); $this->Cell(55, 4, '10 Cuotas Mensuales: $' . number_format($row['Motoriente_Moto_prima_10_cuotas'])); $this->Cell(0, 4, 'Valor Todo Riesgo: $' . number_format($row['Motoriente_Moto_todo_riesgo'])); $this->Ln(5); }