Beispiel #1
0
<?php

require_once '../contact_model.php';
require_once '../validator.php';
$contact = new Contact_model();
$contact->table = 'contacts';
$validator = new Validator();
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    $con_id = $validator->cleanData($_GET['con_id']);
    $sql = "SELECT * FROM contacts WHERE id={$con_id}";
    $result = $contact->select($sql);
}
if (!empty($result)) {
    $result = $result[0];
}
echo json_encode($result);
Beispiel #2
0
<?php

require_once '../contact_model.php';
$contact = new Contact_model();
$contact->table = 'contacts';
$contacts = $contact->select();
?>

<!doctype html>
<html>
	<head>
		<title>Index page</title>
		<meta charset="utf-8">
		<link href="../../css/main.css" rel="stylesheet">
		<script type="text/javascript">
			function deleteContact(){}
			function editContact(){}
		</script>
	</head>
	<body>
		<div id="wrapper">
			<h1>Редкатировать контакты</h1>
			<table class="bordered">
			<thead>
				<tr>
					<th>Имя пользователя</th>
					<th>Номер телефона</th>
					<th>Email адресс</th>
					<th>URL</th>
					<th>Редкатировать</th>
				</tr>