Repository navigation
Expand file tree
/
Copy pathclient_new.php
More file actions
executable file
·84 lines (78 loc) · 3.06 KB
/
Copy pathclient_new.php
File metadata and controls
executable file
·84 lines (78 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/*
* Factux le facturier libre
* Copyright (C) 2003-2005 Guy Hendrickx, 2017~ Thomas Ingles
*
* Licensed under the terms of the GNU General Public License:
* http://opensource.org/licenses/GPL-3.0
*
* For further information visit:
* http://factux.free.fr
*
* File Name: fckconfig.js
* Editor configuration settings.
*
* * * * Version: 8.0.0
* * * * Modified: 07/06/2025
*
* File Authors:
* Guy Hendrickx
*.
*/
require_once(__DIR__ . "/include/verif.php");
include_once(__DIR__ . "/include/config/common.php");
include_once(__DIR__ . "/include/config/var.php");
include_once(__DIR__ . sprintf('/include/language/%s.php', $lang));
include_once(__DIR__ . "/include/utils.php");
$mail_admin = $mail;
$nom=isset($_POST['nom'])?$_POST['nom']:"";
$nom_sup=isset($_POST['nom_sup'])?$_POST['nom_sup']:"";
$rue=isset($_POST['rue'])?$_POST['rue']:"";
$ville=isset($_POST['ville'])?$_POST['ville']:"";
$code_post=isset($_POST['code_post'])?$_POST['code_post']:"";
$num_tva=isset($_POST['num_tva'])?$_POST['num_tva']:"";
$login=isset($_POST['login'])?$_POST['login']:"";
$pass=isset($_POST['pass'])?$_POST['pass']:"";
$mail_cli=isset($_POST['mail'])?$_POST['mail']:"";
$pass2=isset($_POST['pass2'])?$_POST['pass2']:"";
$civ=isset($_POST['civ'])?$_POST['civ']:"";
$tel=isset($_POST['tel'])?$_POST['tel']:"";
$fax=isset($_POST['fax'])?$_POST['fax']:"";
if($pass != $pass2){
$message = sprintf('<h1>%s</h1>', $lang_mot_pa);
include(__DIR__ . '/form_client.php');
exit;
}
$pass = md5($pass);
if($nom=='' || $rue=='' || $ville=='' || $code_post=='' || $num_tva==''){
$message= sprintf('<h1>%s</h1>', $lang_oubli_champ);
include(__DIR__ . '/form_client.php'); // On inclus le formulaire d'identification
exit;
}
if ($login !=''){
$sql = "SELECT * FROM " . $tblpref ."client WHERE login = '".$login."' OR mail = '".$mail_cli."'";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$test = mysql_num_rows($req);
if ($test > 0) {
$message = sprintf('<h1>%s</h1>', $lang_id_or_mail_exist);
include(__DIR__ . '/form_client.php');
exit;
}
}
$sql1 = "INSERT INTO " . $tblpref .sprintf("client(nom, nom2, rue, ville, cp, num_tva, login, pass, mail, civ, tel, fax) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $nom, $nom_sup, $rue, $ville, $code_post, $num_tva, $login, $pass, $mail_cli, $civ, $tel, $fax);
mysql_query($sql1) || die('Erreur SQL !<br>'.$sql1.'<br>'.mysql_error());
$message='';
if ($login != '' && $pass2 != '' && $mail_cli != ''){
$to = $mail_cli;
$from = $mail_admin ;
$subject = $lang_cre_mo_pa ;
$message = sprintf("%s %s <br>%s %s <br>%s <a href='mailto:", $lang_mai_cre, $login, $lang_mai_cr_pa, $pass2, $lang_mai_cre_enc).$mail_admin.sprintf("'>%s</a> %s", $lang_admini, $lang_pass_nou);
if (courriel($to,$subject,$message,$from,$logo)) {
#mail($to,$subject,$message,$header)
$message = sprintf('<h2>%s</h2>', $lang_noti_pa);
} else {
$message = sprintf('<h1>%s</h1>', $lang_notifi_cli_non);
}
}
$message = sprintf('<h2>%s</h2>', $lang_client_enr).$message;
include(__DIR__ . "/lister_clients.php");