Esempio n. 1
0
    }
    if (empty($_POST["useraddress"])) {
        $useraddress_error = "Address required";
    } else {
        $useraddress = test_input($_POST["useraddress"]);
    }
    if ($userfirstname_error == "" and $userlastname_error == "" and $useraddress_error == "") {
        $response = $user_manage->editUser($userfirstname, $userlastname, $useraddress);
    }
}
$users_array = $user_manage->getAllUsers();
if (isset($_GET["delete"])) {
    $response = $user_manage->deleteUsers($_GET["delete"]);
}
if (isset($_GET["update"])) {
    $response = $user_manage->updateUsers($_GET['first_name'], $_GET['last_name'], $_GET['address'], $_GET['user_id']);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    $users_array = $user_manage->getAllUsers($keyword);
} else {
    $users_array = $user_manage->getAllUsers();
}
?>
	<html>
	
				<form method="POST" action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>
">
Esempio n. 2
0
/**
 * Created by PhpStorm.
 * User: JaanMartin
 * Date: 12.01.2016
 * Time: 18:13
 */
require_once __DIR__ . '/../functions.php';
require_once __DIR__ . '/../user_manage_class.php';
$user_manage = new user_manage($connection);
$users_array = $user_manage->getAllUsers();
if (isset($_GET["delete"])) {
    $response = $user_manage->deleteUsers($_GET["delete"]);
}
if (isset($_GET["update"])) {
    $response = $user_manage->updateUsers($_GET['first_name'], $_GET['last_name'], $_GET['phone'], $_GET['user_id'], $_GET['badge']);
}
$keyword = "";
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    $users_array = $user_manage->getAllUsers($keyword);
} else {
    $users_array = $user_manage->getAllUsers();
}
require_once __DIR__ . '/header.php';
?>

<body>
<table class="table table-hover">
    <tr>
        <th>id</th>
Esempio n. 3
0
    if (empty($_POST["tag"])) {
        $tag_error = "tag required";
    } else {
        $usertag = test_input($_POST["tag"]);
    }
    if ($userfirstname_error == "" and $userlastname_error == "" and $userphone_error == "" and $tag_error == "") {
        $response = $user_manage->addcontact($first_name, $last_name, $phone, $usertag);
    }
}
$users_array = $user_manage->getAllUsers();
$tags_array = $user_manage->get_unique_tag();
if (isset($_GET["delete"])) {
    $response = $user_manage->deleteUsers($_GET["delete"]);
}
if (isset($_GET["update"])) {
    $response = $user_manage->updateUsers($_GET['first_name'], $_GET['last_name'], $_GET['phone'], $_GET['tag'], $_GET['list_id']);
}
if (isset($_GET["keyword"])) {
    $keyword = $_GET["keyword"];
    $users_array = $user_manage->get_all_phonebook($keyword);
} else {
    $users_array = $user_manage->get_all_phonebook();
}
?>
	<html>
	
				<form method="POST" action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>
">
						<?php