Пример #1
0
<?php

/**
 * Created by PhpStorm.
 * User: ferry francois
 * Date: 17/11/2015
 * Time: 09:05
 */
session_start();
include '../contr/controller.php';
$add = get_ip();
$err = "";
if (isset($_POST['art1'])) {
    if ($_POST['art1'] != 'Sélectionner le client') {
        $lui = check_num_compte($_POST['art1']);
        $_SESSION['proforma'] = $_POST['num'];
        $_SESSION['id_client_proforma'] = $lui['id_client'];
        $_SESSION['nom'] = $lui['nom'];
        $_SESSION['adresse'] = $lui['adresse'];
        $_SESSION['email'] = $lui['email'];
        $_SESSION['ville'] = $lui['cp'];
        $_SESSION['pays'] = $lui['pays'];
        $_SESSION['telephone'] = $lui['telephone'];
        $_SESSION['heure'] = date('h') . date('i') . date('s') . $add;
        header('Location:../installateur/elements/proformat.index.php');
    } else {
        header('Location:../installateur/ui.php');
    }
} else {
    header('Location:../installateur/ui.php');
}
Пример #2
0
/**
 * Created by PhpStorm.
 * User: ferry francois
 * Date: 29/11/2015
 * Time: 16:27
 */
session_start();
include '../contr/controller.php';
$err = "";
$num_compte = "";
$i = 4;
$un = cutString(htmlspecialchars($_POST['nom']), $i);
$creat = check_id($_COOKIE['technicien']);
$check = check_mail($_POST['email']);
$num_compte .= '411' . $un;
$check1 = check_num_compte($num_compte);
if ($num_compte == $check1['num_compte']) {
    $i = $i + 1;
    $num_compte = "";
    $num_compte .= '411' . cutString(htmlspecialchars($_POST['nom']), $i);
}
if ($check['email'] == $_POST['email']) {
    $err .= "<li class='btn btn-warning'>Votre client exite deja</li>";
    header('Location:../technicien/cree_client.php?code_retour=' . $err);
} else {
    if (cree_client($num_compte, htmlspecialchars($_POST['nom']), $un, htmlspecialchars($_POST['qualite']), htmlspecialchars($_POST['adres']), htmlspecialchars($_POST['compl']), htmlspecialchars($_POST['cpv']), htmlspecialchars($_POST['pays']), htmlspecialchars($_POST['id']), htmlspecialchars($_POST['tel']), htmlspecialchars($_POST['email']), htmlspecialchars($_POST['site']), $creat['id'])) {
        $err .= "<li class='btn btn-success'>Votre client est bien crée</li>";
        header('Location:../technicien/cree_client.php?code_retour=' . $err);
    } else {
        header('Location:../technicien/cree_client.php?code_retour=' . $err);
    }