Beispiel #1
0
<?php

/**
 * 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>
Beispiel #2
0
    }
    if (empty($_POST["userphone"])) {
        $userphone_error = "Address required";
    } else {
        $phone = test_input($_POST["userphone"]);
    }
    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>