Esempio n. 1
0
/**
 * REGRESA EL HTML CON LOS INGREDIENTES DEL PRODUCTO
 */
function ajax_html_ingredientes_producto()
{
    extract($_POST);
    if (is_user_logged_in()) {
        global $current_user;
        $opCliente = getCliente($current_user->ID);
        $canasta = getIdCanastaClube($opCliente->clubId, $producto);
        $ingredientes = getIngredientesCanasta($canasta);
    } else {
        $canasta = '1' . $producto;
        $ingredientes = getIngredientesCanasta($canasta);
    }
    $html = getHtmlIngredientes($ingredientes, $producto);
    wp_send_json($html);
}
Esempio n. 2
0
function consultarCliente($objCliente)
{
    return getCliente($objCliente);
}
    $cliente["direccion"] = $_POST["direccion"];
    $cliente["email"] = $_POST["email"];
    if ($_POST["idUsuario"] != "Seleccionar") {
        $cliente["idUsuario"] = $_POST["idUsuario"];
    } else {
        $cliente["idUsuario"] = "";
    }
    if ($id = registrarNuevoCliente($cliente)) {
        header("Location: ../View/Mantenimiento/Cliente/ListaCliente.php?rpta=correcto&mensaje=nuevo&id=" . $id);
    } else {
        header("Location: ../View/Mantenimiento/Cliente/ListaCliente.php?rpta=incorrecto&mensaje=nuevo");
    }
}
if ($submit == "editar") {
    $idCliente = $_GET["idCliente"];
    $cliente = getCliente($idCliente);
}
if ($submit == "Modificar") {
    $cliente["idCliente"] = $_POST["idCliente"];
    $cliente["nombres"] = $_POST["nombres"];
    $cliente["apellidoPaterno"] = $_POST["apellidoPaterno"];
    $cliente["apellidoMaterno"] = $_POST["apellidoMaterno"];
    $cliente["telefono"] = $_POST["telefono"];
    $cliente["direccion"] = $_POST["direccion"];
    $cliente["email"] = $_POST["email"];
    if ($_POST["idUsuario"] != "Seleccionar") {
        $cliente["idUsuario"] = $_POST["idUsuario"];
    } else {
        $cliente["idUsuario"] = "";
    }
    $id = $cliente["idCliente"];
Esempio n. 4
0
<?php

require_once '../bootstrap.php';
$config = (require '../config.php');
$config = $config[$config['running']];
$servicePath = $config['servicePath'];
$authenticationPath = $config['authenticationPath'];
$session = new NashEarlySession($authenticationPath, $servicePath);
$service = new ClienteService($session);
$empresaService = new EmpresaService($session);
$session->login($config);
//var_dump($session);
$empresas = $empresaService->getEmpresasSelecionaveis(1, 0);
$empresaService->selecionaEmpresa($empresas[0]->getId());
$cliente = getCliente($session);
$result = $service->create($cliente);
print_r($result->getStatus());
print_r($result->getModel());
function getMunicipio($session1)
{
    $service1 = new MunicipioService($session1);
    $result1 = $service1->retrieve(1, 0);
    $municipio = $result1->getModel()->Data[0];
    return $municipio;
}
function getCliente($session2)
{
    $cliente = new Cliente();
    $cliente->setNomeFantasia("Nome do Cliente");
    $cliente->setRazaoSocial("Nome do Cliente");
    $cliente->setCPFCNPJ("00000000000000");
Esempio n. 5
0
function checkStatusCliente()
{
    global $current_user;
    global $opCliente;
    $opCliente = getCliente($current_user->ID);
}
if (isset($_POST["name"])) {
    $name = $_POST["name"];
} else {
    $name = "";
}
if (isset($_POST["email"])) {
    $email = $_POST["email"];
} else {
    $email = "";
}
if (isset($_POST["password"])) {
    $password = $_POST["password"];
} else {
    $password = "";
}
$user = getCliente($email);
if (!$user) {
    setCliente($name, $email, $password);
} else {
    echo "<script>window.location.href = 'register_error.html'</script>";
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Helpycar</title>
</head>
<body>
	<script type="text/javascript">
            //$rubro = $aux[0]->nombre;
            //Optimizar
            $aux = getComuna($local->comuna);
            $comuna = $aux[0]->nombre;
            $aux = getCliente($local->usuario);
            $cliente = $aux[0]->nombre;
            $acciones = "<a href='#'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a>";
            $html_locales .= "<tr><td>" . ++$contador . "</td><td>" . utf8_encode($local->nombre) . "</td><td>" . utf8_encode($local->direccion) . "</td><td>" . utf8_encode($comuna) . "</td><td>" . $local->telefono . "</td><td>" . $local->horario . "</td><td>" . $local->mail . "</td><td>" . utf8_encode($local->descripcion) . "</td><td>" . utf8_encode($cliente) . "</td><td>" . $acciones . "</td></tr>";
        }
        $html = str_replace("{LOCALES_ACTIVOS}", $html_locales, $html);
        $inactivos = getLocales(0);
        $html_locales = "";
        $contador = 0;
        foreach ($inactivos as $local) {
            //$aux = getRubro($local->tipo);
            //$rubro = $aux[0]->nombre;
            //Optimizar
            $aux = getComuna($local->comuna);
            $comuna = $aux[0]->nombre;
            $aux = getCliente($local->usuario);
            $cliente = $aux[0]->nombre;
            $acciones = "<a href='validate-shop.php?local=" . $local->id . "'><span class='glyphicon glyphicon-ok' aria-hidden='true'></span></a>&nbsp;" . "<a href='#'><span class='glyphicon glyphicon-remove' aria-hidden='true'></span></a>";
            $html_locales .= "<tr><td>" . ++$contador . "</td><td>" . utf8_encode($local->nombre) . "</td><td>" . utf8_encode($local->direccion) . "</td><td>" . utf8_encode($comuna) . "</td><td>" . $local->telefono . "</td><td>" . $local->horario . "</td><td>" . $local->mail . "</td><td>" . utf8_encode($local->descripcion) . "</td><td>" . utf8_encode($cliente) . "</td><td>" . $acciones . "</td></tr>";
        }
        $html = str_replace("{LOCALES_INACTIVOS}", $html_locales, $html);
    }
}
echo $html;
?>

Esempio n. 8
0
$app->get('/getCliente', function () {
    //Importa el archivo que contiene el método
    require_once 'Servicios/getCliente.php';
    $app = new \Slim\Slim();
    require_once 'Servicios/Auth.php';
    $deviceId = $app->request->headers->get('deviceID');
    $hash = $app->request->headers->get('hash');
    $respuesta = auth($deviceId, $hash);
    if ($respuesta != "Auth_OK") {
        echo $respuesta;
        return;
    }
    //Obtiene los parametros del header http
    $idCliente = $app->request->headers->get('idCliente');
    //LLama el método que lee de la base de datos y obtiene la respuesta
    $respuesta = getCliente($idCliente);
    //Muestra la respuesta al cliente
    echo $respuesta;
});
//--------------------------------------------------------------------------------------------------
$app->put('/editCliente', function () {
    //Importa el archivo que contiene el método
    require_once 'Servicios/editCliente.php';
    $app = new \Slim\Slim();
    require_once 'Servicios/Auth.php';
    $deviceId = $app->request->headers->get('deviceID');
    $hash = $app->request->headers->get('hash');
    $respuesta = auth($deviceId, $hash);
    if ($respuesta != "Auth_OK") {
        echo $respuesta;
        return;
<?php

require_once "config.php";
require_once "dist/class/class.connect.php";
require_once "dist/functions/data.access.php";
$c_host = $databaselocation;
$c_user = $databaseuser;
$c_pass = $databasepass;
$c_db = $databasename;
$email = $_POST["email"];
$password = $_POST["password"];
if (!validateCliente($email, $password)) {
    $html = file_get_contents("login_error.html");
} else {
    $html = file_get_contents("user/index.html");
    $user = getCliente($_POST["email"]);
    session_start();
    $_SESSION["username"] = $user[0]->nombre;
    $_SESSION["userid"] = $user[0]->id;
    $_SESSION["premium"] = $user[0]->premium;
    $_SESSION["loged"] = 1;
}
echo $html;
Esempio n. 10
0
<?php 
include "conexion.php";
echo getCliente();
function getCliente()
{
    $sql = 'SELECT * FROM vista_customer';
    return getJSON($sql);
}