コード例 #1
0
function run()
{
    $htmlData = array();
    $htmlData["txtEmpresa"] = "";
    $htmlData["txtContacto"] = "";
    $htmlData["txtTel"] = "";
    $htmlData["txtCel"] = "";
    $htmlData["txtCorreo"] = "";
    $htmlData["txtProduc"] = "";
    $htmlData["txtCanti"] = "";
    $htmlData["txtEspecif"] = "";
    if (isset($_POST["btnEnviar"])) {
        $htmlData["txtEmpresa"] = $_POST["txtEmpresa"];
        $htmlData["txtContacto"] = $_POST["txtContacto"];
        $htmlData["txtTel"] = $_POST["txtTel"];
        $htmlData["txtCel"] = $_POST["txtCel"];
        $htmlData["txtCorreo"] = $_POST["txtCorreo"];
        $htmlData["txtProduc"] = $_POST["txtProduc"];
        $htmlData["txtCanti"] = $_POST["txtCanti"];
        $htmlData["txtEspecif"] = $_POST["txtEspecif"];
        $Empresa = $htmlData["txtEmpresa"];
        $Contacto = $htmlData["txtContacto"];
        $Tel = $htmlData["txtTel"];
        $Cel = $htmlData["txtCel"];
        $Correo = $htmlData["txtCorreo"];
        $Produc = $htmlData["txtProduc"];
        $Canti = $htmlData["txtCanti"];
        $Especif = $htmlData["txtEspecif"];
        if (!valorVacio($htmlData["txtContacto"]) && !valorVacio($htmlData["txtCel"]) && !valorVacio($htmlData["txtCorreo"])) {
            if (esNumero($htmlData["txtTel"]) && esNumero($htmlData["txtCel"]) || (esNumero($htmlData["txtTel"]) || esNumero($htmlData["txtCel"]))) {
                if ($htmlData["txtCel"] == '' || $htmlData["txtCorreo"] == '' || $htmlData["txtContacto"] == '') {
                    echo "<script>alert('Los campos marcados con * son obligatorios');location.href ='javascript:history.back()';</script>";
                } else {
                    require "archivosformulario/class.phpmailer.php";
                    $mail = new PHPMailer();
                    $mail->From = $htmlData["txtCorreo"];
                    $mail->FromName = $htmlData["txtContacto"];
                    $mail->AddAddress("*****@*****.**");
                    // Dirección a la que llegaran los mensajes.
                    // Aquí van los datos que apareceran en el correo que reciba
                    //adjuntamos un archivo
                    //adjuntamos un archivo
                    $mail->WordWrap = 50;
                    $mail->IsHTML(true);
                    $mail->Subject = "Contacto";
                    $mail->Body = "Empresa : {$Empresa} \n<br \\>" . "contacto : {$Contacto} \n<br \\>" . "telefono : {$Tel} \n<br \\>" . "celular : {$Cel} \n<br \\>" . "correo : {$Correo} \n<br \\>" . "producto : {$Produc} \n<br \\>" . "cantidad : {$Canti} \n<br \\>" . "especificacion : {$Especif}  \n<br \\>";
                    insertCotizacion($htmlData["txtEmpresa"], $htmlData["txtContacto"], $htmlData["txtTel"], $htmlData["txtCel"], $htmlData["txtCorreo"], $htmlData["txtProduc"], $htmlData["txtCanti"], $htmlData["txtEspecif"]);
                    // Datos del servidor SMTP
                    $mail->IsSMTP();
                    $mail->Host = "ssl://smtp.gmail.com:465";
                    // Servidor de Salida.
                    $mail->SMTPAuth = true;
                    $mail->Username = "******";
                    // Correo Electrónico
                    $mail->Password = "******";
                    // Contraseña
                    if ($mail->Send()) {
                        echo "<script>alert('Formulario enviado exitosamente, le responderemos lo más pronto posible.');location.href ='index.php?page=productos';</script>";
                    } else {
                        echo "<script>alert('Error al enviar el formulario');location.href ='index.php?page=productos';</script>";
                    }
                }
            }
        }
    }
    renderizar("cotizar", $htmlData);
}
コード例 #2
0
}
if ($cincomil != NULL) {
    $sumaCincomil = $COTPAPEL5000 + $COTPMX15000 + $COTUVP5000 + $COTANILLADODOBLEO5000 + $COTEND5000 + $COTPLANCHAS5000 + $COTPMX25000 + $COTSCRATCH5000 + $COTANILLADOPLASTICO5000 + $COTCOLAMINADO5000 + $COTPELICULAS5000 + $COTPBX15000 + $COTNUMERADO5000 + $COTREPUJE5000 + $COTBOLSAPLASTICA5000 + $COTCTP5000 + $COTPBX25000 + $COTTROQUEL5000 + $COTREPUJADO5000 + $COTOTROS5000 + $COTPRUEBADIGITAL5000 + $COTUVTX15000 + $COTTROQUELADO5000 + $COTPLEGADO5000 + $COTDISENO5000 + $COTTIRAJE5000 + $COTUVTX25000 + $COTHOTMELT5000 + $COTGRAFA5000 + $COTCAJAS5000;
    //echo "sumaCincomil: ". $sumaCincomil;
    $utilidad5000 = $sumaCincomil * $porcentajeUtilidad;
    //echo "utilidad5000". $utilidad5000;
    $comision5000 = $sumaCincomil * $porcetajeComision;
    //echo "comision". $porcetajeComision;
    $totalFinal5000 = $sumaCincomil + $utilidad5000 + $comision5000;
    //echo "Total ". $totalFinal5000;
    $valorUnitarioCincomil = $totalFinal5000 / $cincomil;
    $valorUnitarioCincomil = round($valorUnitarioCincomil);
}
$fechaEntrega = $anoEntrega . "/" . $mesEntrega . "/" . $diaEntrega;
//echo $fechaEntrega;
insertCotizacion($vendedor, $cliente, $att, $fax, $referencia, $mil, $dosmil, $tresmil, $cuatromil, $cincomil, $afiche, $calendario, $cajas, $folleto, $volantes, $hablador, $libretas, $libro, $bolsas, $papeleria, $revista, $plegable, $sticker, $carpeta, $sobres, $tarjetas, $tarjeton, $otro, $papel, $caratula, $interiores, $tamanoAbiertoPapel, $tamanoCerradoPapel, $tintasPapel, $pantonePapel, $tamanoAbiertoCaratula, $tamanoCerradoCaratula, $tintasCaratula, $pantoneCaratula, $tamanoAbiertoInteriores, $tamanoCerradoInteriores, $tintasInteriores, $pantoneInteriores, $paginasInteriores, $peliculasnegativas, $peliculaspositivas, $peliculasarchivo, $peliculasOriginales, $acabadosmate1caras, $acabadosmate2caras, $plastmateInteriores1cara, $plastmateInteriores2cara, $brillolitografico, $repujado, $plastbrillante1cara, $plastbrillante2cara, $plastbrillanteInteriores1cara, $plastbrillanteInteriores2cara, $grafado, $estampado, $acabadosuvtotal1caras, $acabadosuvtotal2caras, $acabadosuvtotalInteriores1caras, $acabadosuvtotalInteriores2caras, $perforado, $troquelado, $acabadosuvparcial1caras, $acabadosuvparcial2caras, $acabadosuvparcialInteriores1caras, $acabadosuvparcialInteriores2caras, $numerado, $numeradodel, $numeradohasta, $plegado, $centro, $cuerpos2, $cuerpos3, $cuerpos4, $otroEncuadernacion, $encolado, $caballete, $pegado, $hotmelt, $cintadoblefaz, $ensanduchado, $anilladocolor, $anilladodobleo, $anilladoplastico, $anilladoOtro, $empaquepapelkraft, $empaquecajasdecarton, $empaquebolsaplastica, $empaqueexportacion, $fechaEntrega, $observaciones, $COTPAPEL1000, $COTPAPEL2000, $COTPAPEL3000, $COTPAPEL4000, $COTPAPEL5000, $COTPMX11000, $COTPMX12000, $COTPMX13000, $COTPMX14000, $COTPMX15000, $COTUVP1000, $COTUVP2000, $COTUVP3000, $COTUVP4000, $COTUVP5000, $COTANILLADODOBLEO1000, $COTANILLADODOBLEO2000, $COTANILLADODOBLEO3000, $COTANILLADODOBLEO4000, $COTANILLADODOBLEO5000, $COTEND1000, $COTEND2000, $COTEND3000, $COTEND4000, $COTEND5000, $COTPLANCHAS1000, $COTPLANCHAS2000, $COTPLANCHAS3000, $COTPLANCHAS4000, $COTPLANCHAS5000, $COTPMX21000, $COTPMX22000, $COTPMX23000, $COTPMX24000, $COTPMX25000, $COTSCRATCH1000, $COTSCRATCH2000, $COTSCRATCH3000, $COTSCRATCH4000, $COTSCRATCH5000, $COTANILLADOPLASTICO1000, $COTANILLADOPLASTICO2000, $COTANILLADOPLASTICO3000, $COTANILLADOPLASTICO4000, $COTANILLADOPLASTICO5000, $COTCOLAMINADO1000, $COTCOLAMINADO2000, $COTCOLAMINADO3000, $COTCOLAMINADO4000, $COTCOLAMINADO5000, $COTPELICULAS1000, $COTPELICULAS2000, $COTPELICULAS3000, $COTPELICULAS4000, $COTPELICULAS5000, $COTPBX11000, $COTPBX12000, $COTPBX13000, $COTPBX14000, $COTPBX15000, $COTNUMERADO1000, $COTNUMERADO2000, $COTNUMERADO3000, $COTNUMERADO4000, $COTNUMERADO5000, $COTREPUJE1000, $COTREPUJE2000, $COTREPUJE3000, $COTREPUJE4000, $COTREPUJE5000, $COTBOLSAPLASTICA1000, $COTBOLSAPLASTICA2000, $COTBOLSAPLASTICA3000, $COTBOLSAPLASTICA4000, $COTBOLSAPLASTICA5000, $COTCTP1000, $COTCTP2000, $COTCTP3000, $COTCTP4000, $COTCTP5000, $COTPBX21000, $COTPBX22000, $COTPBX23000, $COTPBX24000, $COTPBX25000, $COTTROQUEL1000, $COTTROQUEL2000, $COTTROQUEL3000, $COTTROQUEL4000, $COTTROQUEL5000, $COTREPUJADO1000, $COTREPUJADO2000, $COTREPUJADO3000, $COTREPUJADO4000, $COTREPUJADO5000, $COTOTROS1000, $COTOTROS2000, $COTOTROS3000, $COTOTROS4000, $COTOTROS5000, $COTPRUEBADIGITAL1000, $COTPRUEBADIGITAL2000, $COTPRUEBADIGITAL3000, $COTPRUEBADIGITAL4000, $COTPRUEBADIGITAL5000, $COTUVTX11000, $COTUVTX12000, $COTUVTX13000, $COTUVTX14000, $COTUVTX15000, $COTTROQUELADO1000, $COTTROQUELADO2000, $COTTROQUELADO3000, $COTTROQUELADO4000, $COTTROQUELADO5000, $COTPLEGADO1000, $COTPLEGADO2000, $COTPLEGADO3000, $COTPLEGADO4000, $COTPLEGADO5000, $COTDISENO1000, $COTDISENO2000, $COTDISENO3000, $COTDISENO4000, $COTDISENO5000, $COTTIRAJE1000, $COTTIRAJE2000, $COTTIRAJE3000, $COTTIRAJE4000, $COTTIRAJE5000, $COTUVTX21000, $COTUVTX22000, $COTUVTX23000, $COTUVTX24000, $COTUVTX25000, $COTHOTMELT1000, $COTHOTMELT2000, $COTHOTMELT3000, $COTHOTMELT4000, $COTHOTMELT5000, $COTGRAFA1000, $COTGRAFA2000, $COTGRAFA3000, $COTGRAFA4000, $COTGRAFA5000, $COTCAJAS1000, $COTCAJAS2000, $COTCAJAS3000, $COTCAJAS4000, $COTCAJAS5000, $comisionMil, $utilidadMil, $sumaMil, $totalFinalMil, $comision2000, $utilidad2000, $sumaDosmil, $totalFinal2000, $comision3000, $utilidad3000, $sumaTresmil, $totalFinal3000, $comision4000, $utilidad4000, $sumaCuatromil, $totalFinal4000, $comision5000, $utilidad5000, $sumaCincomil, $totalFinal5000, $valorUnitarioMil, $valorUnitarioDosmil, $valorUnitarioTresmil, $valorUnitarioCuatromil, $valorUnitarioCincomil, $comision, $utilidad, $db);
//Sacamos el máximo Id para dar el numero de orden de cotizacion
//Esta funcion se encuentra en /consultas/funcionesSQL.php
$maxId = maxIdCotizacion($db);
foreach ($maxId as $row) {
    $id = $row['max(ID)'];
    echo "--" . $id;
}
$valoresCotizacion = seleccionarCotizacion($id, $db);
foreach ($valoresCotizacion as $myrows) {
    $fecha_alta = $myrows['FECHA_DE_ALTA'];
    $cliente = $myrows['CLIENTE'];
    $att = $myrows['ATT'];
    $fax = $myrows['FAX'];
    $referencia = $myrows['REFERENCIA'];
    $mil = $myrows['CANTIDAD1000'];