con = $con; } /* P1.TOTAL AS TOTAL_SIN_DESCUENTO_FINANCIADO, P1.BASE AS BASE_FINANCIADO, P1.DTOIMP AS DTOIMP_FINANCIADO, P1.DTOPRC AS DTOPOR_FINANCIADO, P1.TOTALCOB AS TOTALCOB_FINANCIADO, P1.LIMITE AS LIMITE_FINANCIADO, P2.TOTAL AS TOTAL_SIN_DESCUENTO_PRO, P2.BASE AS BASE_PRO, P2.DTOIMP AS DTOIMP_PRO, P2.DTOPRC AS DTOPOR_PRO, P2.TOTALCOB AS TOTALCOB_PRO, P2.LIMITE AS LIMITE_PRO */ public function getCarData($lg, $codigo) { $uno = 1; $dos = 2; $tipo = 'VO'; $sql = "SELECT DISTINCT V.CODIGO AS CODIGO_COCHE, V.IDCAR AS ID_CAR, V.MARCA AS M, V.MODELO AS VEHMOD, V.*, P1.TOTAL AS TOTAL_FINANCIADO, P1.TOTALSINDTO AS TOTAL_SIN_DTO_FINANCIADO, P1.BASE AS BASE_FINANCIADO, P1.DTOIMP AS DTOIMP_FINANCIADO, P1.DTOPRC AS DTOPOR_FINANCIADO, P1.LIMITE AS LIMITE_FINANCIADO, P2.TOTAL AS TOTAL_PRO, P2.TOTALSINDTO AS TOTAL_SIN_DTO_PRO, P2.BASE AS BASE_PRO, P2.DTOIMP AS DTOIMP_PRO, P2.DTOPRC AS DTOPOR_PRO, P2.LIMITE AS LIMITE_PRO, L5.EXTRA1, M.DESCRIPCION AS MARCAS, MO.DESCRIPCION AS MODELOS, L1.DESCRIPCION_$lg AS DESCRIPCION_LG1, L2.DESCRIPCION_$lg AS DESCRIPCION_LG2, L3.DESCRIPCION_$lg AS DESCRIPCION_LG3, L5.DESCRIPCION_$lg AS DESCRIPCION_LG5, L8.DESCRIPCION_$lg AS DESCRIPCION_LG8 FROM (((((((((VEHICULOS V LEFT JOIN VEHICULOS_MARCAS M ON M.CODIGO = V.MARCA) LEFT JOIN VEHICULOS_MODELOS MO ON MO.CODIGO = V.MODELO) LEFT JOIN VEHICULOS_LITERALES L1 ON L1.CODIGO = V.COMBUSTIBLE AND L1.TIPO = 'TIP_COM') LEFT JOIN VEHICULOS_LITERALES L2 ON L2.CODIGO = V.CAJACAMBIOS AND L2.TIPO = 'TIP_CAJ') LEFT JOIN VEHICULOS_LITERALES L3 ON L3.CODIGO = V.CARROCERIA AND L3.TIPO = 'TIP_CAR') LEFT JOIN VEHICULOS_LITERALES L5 ON L5.CODIGO = V.COLOR_PRINCIPAL AND L5.TIPO = 'COL_PRI') LEFT JOIN VEHICULOS_LITERALES L8 ON L8.CODIGO = V.DISTINTIVO_AMB AND L8.TIPO = 'DIS_AMB') LEFT JOIN VEHICULOS_PRECIOSEXTRAS P1 ON V.CODIGO = P1.CODIGO AND P1.TIPO = ?) LEFT JOIN VEHICULOS_PRECIOSEXTRAS P2 ON V.CODIGO = P2.CODIGO AND P2.TIPO = ?) WHERE V.ACTIVO = ? AND V.TIPO = ? AND V.CODIGO = ?"; $stmt = $this->con->prepare($sql); $stmt->bind_param('iiisi', $uno, $dos, $uno, $tipo, $codigo); $stmt->execute(); $res = $stmt->get_result(); if($res->num_rows) { $row = $res->fetch_array(); return $row; } else { return FALSE; } } //$style = col, margin etc //$label & $Label_2 == ture => icon & label public function marca_modelo($style = FALSE, $label = FALSE, $label_2 = FALSE) { global $elige_la_marca_lg; global $elige_el_modelo_lg; global $marca_lg; global $modelo_lg; $style = !$style ? 'col-md-3 col-12 mb-3' : $style; $label = $label ? '' : ''; $label_2 = $label_2 ? '' : ''; $html = '
'; $html .= $label; $html .= ''; $html .= '
'; $html .= '
'; $html .= $label_2; $html .= ''; $html .= '
'; return $html; } public function sliderCar($esquema, $grupoe, $idCAR, $class = FALSE, $controllers = FALSE, $control_icon_style = FALSE) { $html = ''; $select = new Schema($this->con); $html .= ''; $html .= ''; $html .= ''; $html .= 'Previous'; $html .= ''; $html .= ''; $html .= ''; $html .= 'Next'; $html .= ''; return $html; } public function listadoVehiculoFicha($titulo1, $icono1 = NULL, $info1, $titulo2 = NULL, $icono2 = NULL, $info2 = NULL) { $iconoFirst = !empty($icono1) ? '' : ''; $html = '
  • '; $html .= '
    '; $html .= '
    ' . $titulo1 .'
    '; $html .= '
    ' . $iconoFirst . $info1 . '
    '; $html .= '
    '; if($titulo2) { $html .= '
    '; $html .= '
    ' . $titulo2 .'
    '; $html .= '
    ' . $info2 . '
    '; $html .= '
    '; } $html .= '
  • '; echo $html; } public function listado_vehiculo_lista_horizontal($titulo_categoria, $info_categoria, $style = FALSE) { $style = $style ? $style : 'bg-white'; $html = '
  • '; $html .= '
    ' . $titulo_categoria . '
    '; $html .= '' . $info_categoria . ''; $html .= '
  • '; echo $html; } public function calcularBeneficios ($venta, $compra, $gastos, $gasto_1, $gasto_2, $gasto_3, $gasto_4) { $desperdiciacion = $venta * $gastos / 100; $publicidad = $compra * ($gasto_1/100); $reacondi = $compra * ($gasto_2/100); $comercializacion = $compra * ($gasto_3/100); $saneamiento = $compra * ($gasto_4/100); $tota_gastos = $desperdiciacion + $publicidad + $reacondi + $comercializacion + $saneamiento; return number_format($venta - $compra - $gastos ,'0','',',') . " €"; } public function car_price ($venta_total, $total_sindto, $tag = FALSE) { $html = ''; if($venta_total == 0) { $venta_total = $total_sindto; } elseif($venta_total != $total_sindto) { $html .= '' . number_format($total_sindto, '2', '.', ',') . ''; } if ($tag) { $tag = explode('#', $tag); $tag1 = $tag[0] . ' ' . $tag[1]; $tag2 = $tag[0]; } else { $tag1 = $tag2 = 'span'; } $html .= '<' . $tag1 . '>' . number_format($venta_total,'2','.',',') . ''; return $html; } } ?>