<?php
	// Start session.
	session_start();
	
	// Set a key, checked in mailer, prevents against spammers trying to hijack the mailer.
	$security_token = $_SESSION['security_token'] = uniqid(rand());
	
	if ( ! isset($_SESSION['formMessage'])) {
		$_SESSION['formMessage'] = 'Por favor cont&aacute;ctenos por <b><a href="https://wa.me/18459037580" style="text-decoration: none;">WhatsApp</a></b>  para enviarle todos los Datos Bancarios y pueda anexar la imagen de la transferencia bancaria requerida.';
	}
	
	if ( ! isset($_SESSION['formFooter'])) {
		$_SESSION['formFooter'] = ' ';
	}
	
	if ( ! isset($_SESSION['form'])) {
		$_SESSION['form'] = array();
	}
	
	function check($field, $type = '', $value = '') {
		$string = "";
		if (isset($_SESSION['form'][$field])) {
			switch($type) {
				case 'checkbox':
					$string = 'checked="checked"';
					break;
				case 'radio':
					if($_SESSION['form'][$field] === $value) {
						$string = 'checked="checked"';
					}
					break;
				case 'select':
					if($_SESSION['form'][$field] === $value) {
						$string = 'selected="selected"';
					}
					break;
				default:
					$string = $_SESSION['form'][$field];
			}
		}
		return $string;
	}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="es">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="autor" content="Combito">
    <meta name="description" content="Tu Negocio Digital Inteligente Para WhatsApp y WhatsApp Business...">
    <meta name="keywords" content="whatsbusiness, whatsapp, whatsapp business, negocio, digital, tienda, online, web, virtual, restaurant, menu, madrid, españa, buenos aires, argentina, santiago, chile, bogotá, colombia, quito, ecuador, lima, peru, montevideo, uruguay, onplace, delivery, pickup">
    <title>WhatsBusiness - Registro</title>
    <link rel="apple-touch-icon" sizes="180x180" href="resources/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="resources/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="resources/favicon-16x16.png">
    <link rel="stylesheet" href="css/ux.css">
    <link rel="stylesheet" href="css/style.css">

    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/scroll.js"></script>

    <meta property="og:title" content=">WhatsBusiness - Registro">
    <meta property="og:description" content="Tu Negocio Digital Para WhatsApp y WhatsApp Business...">
    <meta property="og:image" content="https://whatsbusiness.app/resources/whatsbusiness.png">

    <script>
        $(function() {
            $.scrollIt({
                upKey: 38,
                downKey: 40,
                easing: 'linear',
                scrollTime: 1000,
                activeClass: 'active',
                onPageChange: null,
                topOffset: 0
            });
        });
    </script>

    <style>
        .w3-input {
            padding: 8px;
            display: block;
            border: none;
            border-bottom: 1px solid #ccc;
            width: 100%
        }

        .custom-textarea {
            resize: none
        }

        input:focus {
            outline: none;
            border: 2px solid #000000;
            border-color: #000000;
            box-shadow: 0 0 3px #ffffff;
        }

        textarea:focus {
            outline: none;
            border: 2px solid #000000;
            border-color: #000000;
            box-shadow: 0 0 3px #ffffff;
        }
    </style>

</head>

<body data-scroll-index="0">

    <header>
        <div class="w3-bar w3-black w3-xlarge w3-card">
            <a href="./" class="w3-bar-item w3-xlarge" style="text-decoration: none;">WHATSBUSINESS</a>
            <a onclick="openNavWhatsApp()" class="w3-bar-item w3-button w3-xlarge w3-right w3-hide-small">WHATSAPP</a>
            <a href="registro.php" class="w3-bar-item w3-button w3-right w3-xlarge w3-hide-small">REGISTRO</a>
            <!-- <a onclick="openNavLlamar()" class="w3-bar-item w3-button w3-right w3-xlarge w3-hide-small">LLAMAR</a> -->
            <a onclick="openNavDemo()" class="w3-bar-item w3-button w3-right w3-xlarge w3-hide-small">DEMO</a>
            <div class="menuicon w3-right w3-hide-large w3-hide-medium"
                onclick="MenuIconChange(this); NavbarCollapse();">
                <div class="bar1"></div>
                <div class="bar2"></div>
                <div class="bar3"></div>
            </div>
        </div>

        <div id="MobileMenu" class="w3-bar-block w3-black w3-hide w3-hide-large w3-card" style="z-index: 9999;">
            <a onclick="openNavDemo()" class="w3-bar-item w3-button w3-large">DEMO</a>
            <!-- <a onclick="openNavLlamar()" class="w3-bar-item w3-button w3-large">LLAMAR</a> -->
            <a href="registro.php" class="w3-bar-item w3-button w3-large">REGISTRO</a>
            <a onclick="openNavWhatsApp()" class="w3-bar-item w3-button w3-large">WHATSAPP</a>
        </div>
    </header>


    <div class="w3-container w3-margin">

        <div class="w3-center">
            <h2>IMPORTANTE</h2>
            <div class="message-text"><?php echo $_SESSION['formMessage']; unset($_SESSION['formMessage']); ?></div><br />
        </div>

        <form class="rw-contact-form" action="./files/mailer.php" method="post" enctype="multipart/form-data">
            <div class="w3-row-padding">
                <div class="w3-third w3-margin-top">

                    <label>Nombre y Apellido</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="32" placeholder="Pedro Perez" value="<?php echo check('element0'); ?>" name="form[element0]" size="40" />
                    <br>

                    <label>Teléfono / WhatsApp</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="16" placeholder="+34123456789" value="<?php echo check('element1'); ?>" name="form[element1]" size="40" />
                    <br>

                    <label>Gmail</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="32" placeholder="pedroperez@gmail.com" value="<?php echo check('element2'); ?>" name="form[element2]" size="40" />
                    <br>

                    <label>Nombre del Negocio</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="32" placeholder="Pedro´s Café" value="<?php echo check('element3'); ?>" name="form[element3]" size="40" /><br>

                    <label>Tipo de Negocio</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="32" placeholder="Cafetería" value="<?php echo check('element4'); ?>" name="form[element4]" size="40" />
                    <br>

                    <label>Teléfono / WhatsApp del Negocio</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="16" placeholder="+34987654321" value="<?php echo check('element5'); ?>" name="form[element5]" size="40" />
                    <br>

                    <label>Instagram</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="32" placeholder="@pedroscafe" value="<?php echo check('element6'); ?>" name="form[element6]" size="40" />
                    <br>

                </div>

                <div class="w3-third w3-margin-top">

                    <label>Número de Categorías (Exacto)</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="2" size="2" placeholder="10" value="<?php echo check('element7'); ?>" name="form[element7]" size="40" />
                    <br>

                    <label>Número de Productos (Exacto)</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="3" placeholder="100" value="<?php echo check('element8'); ?>" name="form[element8]" size="40" />
                    <br>

                    <label>Ciudad y País</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" minlength="0" maxlength="32" placeholder="Madrid, España" value="<?php echo check('element9'); ?>" name="form[element9]" size="40" />
                    <br>

                    <label>Dirección, Horario y Teléfono</label> *<br />
                    <textarea class="form-input-field w3-input w3-border w3-hover-border-black custom-textarea" minlength="0" maxlength="128" placeholder="Calle Pedro 10, 28040 Madrid - España. Teléfono / WhatsApp +34987654321" name="form[element10]" rows="8" cols="38"><?php echo check('element10'); ?></textarea>
                    <br>

                    <label>Mapa de Google</label> *<br />
                    <input class="form-input-field w3-input w3-border w3-hover-border-black" type="text" maxlenght="256" placeholder="https://www.google.com/maps/place/Madrid,+Espa%C3%B1a/@40.4374862,-4.0091807,10z/data=!3m1!4b1!4m6!3m5!1s0xd422997800a3c81:0xc436dec1618c2269!8m2!3d40.4167279!4d-3.7032905!16zL20vMDU2X3k?entry=ttu&g_ep=EgoyMDI0MTAwOC4wIKXMDSoASAFQAw%3D%3D" value="<?php echo check('element11'); ?>" name="form[element11]" size="40" />
                    <br>

                </div>

                <div class="w3-third w3-margin-top">

                    <label>Imagen de Transferencia Bancaria</label> *<br />
                    <input type="file" name="element12" accept=".jpg, .jpeg, .png" />
                    <br>
                    <br>

                    <label>Logotipo del Negocio</label> *<br />
                    <input type="file" name="element13" accept=".jpg, .jpeg, .png" />
                    <br>
                    <br>

                    <label>Catálogo o Menú en Formato Pdf</label> *<br />
                    <input type="file" name="element14" accept=".pdf" />
                    <br>
                    <br>

                    <div style="display: none;">
                        <label>Spam Protection: Please don't fill this in:</label>
                        <textarea name="comment" rows="1" cols="1"></textarea>
                    </div>
                    <input type="hidden" name="form_token" value="<?php echo $security_token; ?>" />
                    <input class="w3-button w3-black w3-padding-large w3-hover-green w3-ripple w3-block w3-round-large" type="submit" name="submitButton" value="Enviar Información" />
                    <br>
                    <input class="w3-button w3-black w3-padding-large w3-hover-red w3-ripple w3-block w3-round-large" type="reset" name="resetButton" value="Borrar" />

                </div>

            </div>
        </form>

    </div>

    <div class="form-footer"><?php echo $_SESSION['formFooter']; unset($_SESSION['formFooter']); ?></div><br />
    <?php unset($_SESSION['form']); ?>
    </div>

    <div class="w3-center">
        <h2>IMPORTANTE</h2>
        <p>
            Tan pronto recibamos y verifiquemos la información, nos pondremos en contacto para notificar su Registro y dar las respectivas indicaciones para el correcto funcionamiento.
        </p>
    </div>

    <br>

    </div>
    </div>

    <div id="mySidenavDemo" class="sidenav" style="z-index: 9999;">
        <a href="javascript:void(0)" class="closebtn" onclick="closeNavDemo()">&times;</a>
        <a href="cs/ar/pedroscafe/">Argentina - Restaurante</a>
        <a href="cs/ar/pedrospets/">Argentina - Tienda</a>
        <a href="cs/cl/pedroscafe/">Chile - Restaurante</a>
        <a href="cs/cl/pedrospets/">Chile - Tienda</a>
        <a href="cs/cl/pedroscafe/">Colombia - Restaurante</a>
        <a href="cs/cl/pedrospets/">Colombia - Tienda</a>
        <a href="cs/cr/pedroscafe/">Costa Rica - Restaurante</a>
        <a href="cs/cr/pedrospets/">Costa Rica - Tienda</a>
        <a href="cs/ec/pedroscafe/">Ecuador - Restaurante</a>
        <a href="cs/ec/pedrospets/">Ecuador - Tienda</a>
        <a href="cs/es/pedroscafe/">España - Restaurante</a>
        <a href="cs/es/pedrospets/">España - Tienda</a>
        <a href="cs/mx/pedroscafe/">México - Restaurante</a>
        <a href="cs/mx/pedrospets/">México - Tienda</a>
        <a href="cs/pa/pedroscafe/">Panamá - Restaurante</a>
        <a href="cs/pa/pedrospets/">Panamá - Tienda</a>
        <a href="cs/pe/pedroscafe/">Perú - Restaurante</a>
        <a href="cs/pe/pedrospets/">Perú - Tienda</a>
        <a href="cs/py/pedroscafe/">Paraguay - Restaurante</a>
        <a href="cs/py/pedrospets/">Paraguay - Tienda</a>
        <a href="cs/uy/pedroscafe/">Uruguay - Restaurante</a>
        <a href="cs/uy/pedrospets/">Uruguay - Tienda</a>
    </div>

    <!-- <div id="mySidenavLlamar" class="sidenav">
        <a href="javascript:void(0)" class="closebtn" onclick="closeNavLlamar()">&times;</a>
        <a href="tel:+18459037580">España</a>
    </div> -->

    <div id="mySidenavWhatsApp" class="sidenav" style="z-index: 9999;">
        <a href="javascript:void(0)" class="closebtn" onclick="closeNavWhatsApp()">&times;</a>
        <a href="https://wa.me/18459037580">Argentina</a>
        <a href="https://wa.me/18459037580">Chile</a>
        <a href="https://wa.me/18459037580">Colombia</a>
        <a href="https://wa.me/18459037580">Costa Rica</a>
        <a href="https://wa.me/18459037580">Ecuador</a>
        <a href="https://wa.me/18459037580">España</a>
        <a href="https://wa.me/18459037580">México</a>
        <a href="https://wa.me/18459037580">Panamá</a>
        <a href="https://wa.me/18459037580">Perú</a>
        <a href="https://wa.me/18459037580">Paraguay</a>
        <a href="https://wa.me/18459037580">Uruguay</a>
    </div>

    <a id="TopBtn" class="w3-btn w3-light-grey w3-text-dark-gray w3-card" data-scroll-goto="0"><b>TOP</b></a>


    <script>
        function MenuIconChange(x) {
            x.classList.toggle("change");
        }
    </script>


    <script>
        function NavbarCollapse() {
            var x = document.getElementById("MobileMenu");
            if (x.className.indexOf("w3-show") == -1) {
                x.className += " w3-show";
            } else {
                x.className = x.className.replace(" w3-show", "");
            }
        }
    </script>


    <script>
        var slideIndex = 1;
        showDivs(slideIndex);

        function plusDivs(n) {
            showDivs(slideIndex += n);
        }

        function showDivs(n) {
            var i;
            var x = document.getElementsByClassName("mySlides");
            if (n > x.length) {
                slideIndex = 1
            }
            if (n < 1) {
                slideIndex = x.length
            }
            for (i = 0; i < x.length; i++) {
                x[i].style.display = "none";
            }
            x[slideIndex - 1].style.display = "block";
        }
    </script>


    <script>
        var myIndex = 0;
        carousel();

        function carousel() {
            var i;
            var x = document.getElementsByClassName("mySlides");
            for (i = 0; i < x.length; i++) {
                x[i].style.display = "none";
            }
            myIndex++;
            if (myIndex > x.length) {
                myIndex = 1
            }
            x[myIndex - 1].style.display = "block";
            setTimeout(carousel, 2500);
        }
    </script>


    <script>
        let mybutton = document.getElementById("TopBtn");

        window.onscroll = function() {
            scrollFunction()
        };

        function scrollFunction() {
            if (document.body.scrollTop > 640 || document.documentElement.scrollTop > 640) {
                mybutton.style.display = "block";
            } else {
                mybutton.style.display = "none";
            }
        }

        function topFunction() {
            document.body.scrollTop = 0;
            document.documentElement.scrollTop = 0;
        }
    </script>


    <script>
        function openNavDemo() {
            document.getElementById("mySidenavDemo").style.width = "100%";
        }

        function closeNavDemo() {
            document.getElementById("mySidenavDemo").style.width = "0";
        }
    </script>

    <script>
        function openNavLlamar() {
            document.getElementById("mySidenavLlamar").style.width = "100%";
        }

        function closeNavLlamar() {
            document.getElementById("mySidenavLlamar").style.width = "0";
        }
    </script>

    <script>
        function openNavWhatsApp() {
            document.getElementById("mySidenavWhatsApp").style.width = "100%";
        }

        function closeNavWhatsApp() {
            document.getElementById("mySidenavWhatsApp").style.width = "0";
        }
    </script>

</body>

</html>