-
Notifications
You must be signed in to change notification settings - Fork 0
/
clients.php
76 lines (64 loc) · 2.28 KB
/
clients.php
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
<?php
require 'functions.php';
require 'mysqldatabase.class.php';
require 'template.class.php';
require 'clients.class.php';
require 'connectDB.php';
include('templates/header.php');
$db = new MySQLDatabase($HOST,$USERNAME,$PASSWORD,$DATABASE);
$db->connect();
if(isset($_REQUEST['op']))
$op = sanitize($_REQUEST['op']);
else
$op = "";
$client = new Clients;
switch($op) {
default:
echo '<br>';
if(isset($_GET['page']))
$page=sanitize($_GET['page']);
else
$page=1;
if(isPositiveValue($page))
$client->getClients($db,$page);
break; break;
case "searching":
echo '<br>';
if(isset($_POST['word'])&&$_POST['word']!=""){
$word=sanitize($_POST['word']);
$client->searchClients($db,$word);
}
break;
case "add":
$client->formAddClients();
break;
case "adding":
$client->formAddClients($db,sanitize($_POST['name']),sanitize($_POST['lastname']),sanitize($_POST['yearborn']),sanitize($_POST['sex']),sanitize($_POST['address']),sanitize($_POST['phone']),sanitize($_POST['email']),sanitize($_POST['coloreyes']),sanitize($_POST['colorhair']),sanitize($_POST['skintype']),sanitize($_POST['other']));
break;
case "edit":
$id=sanitize($_GET['cid']);
if(isPositiveValue($id))
$client->formEditClients($db,$id);
break;
case "editing":
$id=sanitize($_POST['cid']);
if(isPositiveValue($id))
$client->editClients($db,sanitize($_POST['name']),sanitize($_POST['lastname']),sanitize($_POST['yearborn']),sanitize($_POST['sex']),sanitize($_POST['address']),sanitize($_POST['phone']),sanitize($_POST['email']),sanitize($_POST['coloreyes']),sanitize($_POST['colorhair']),sanitize($_POST['skintype']),sanitize($_POST['other']),$id);
break;
case "uploading":
$client->uploadClients();
break;
case "remove":
$id=sanitize($_GET['cid']);
if(isPositiveValue($id))
$client->formRemoveClients($id,sanitize($_GET['name']),sanitize($_GET['lastname']));
break;
case "removing":
$cid=sanitize($_POST['cid']);
if(isPositiveValue($cid))
$client->removeClients($db,$cid);
break;
}
$db->close();
include('templates/footer.php');
?>