-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditCustomerForm.php
More file actions
34 lines (28 loc) · 1.39 KB
/
Copy patheditCustomerForm.php
File metadata and controls
34 lines (28 loc) · 1.39 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
<?php
include 'header.php';
echo '<div id="conteudo">
<div class="texto">';
if ($_SESSION['permission'] == "reader")
{
echo 'Precisa de ter permissões de writer para editar clientes!';
exit();
}
$db = new PDO('sqlite:database/documents.db');
$customers = $db->query('SELECT * FROM Customer WHERE CustomerID = ?');
$customers->execute(array($_GET['CustomerID']));
$customer = $customers->fetch();
echo '<form action="editCustomer.php" method="POST">
<h2>Editar Cliente:</h2><br>
Código: <br><input type="number" name="CustomerID" value='. $customer['CustomerID'] .' readonly><br><br>
Número Contribuinte: <br><input type="number" name="CustomerTaxID" value="' . $customer['CustomerTaxID'] .'"><br><br>
Nome da Empresa: <br><input type="text" name="CompanyName" value="' . $customer['CompanyName'] .'"><br><br>
Morada: <br><input type="text" name="AdressDetail" value="' . $customer['AdressDetail'] .'"><br><br>
Cidade: <br><input type="text" name="City" value="' . $customer['City'] .'"><br><br>
Código Postal: <br><input type="number" name="PostalCode" value="' . $customer['PostalCode'] .'"><br><br>
Código País: <br><input type="number" name="Country" value="' . $customer['Country'] .'"><br><br>
Email: <br><input type="text" name="Email" value="' . $customer['Email'] .'"><br><br>
<input type="submit" value="Editar Cliente">
</form>';
?>
</div>
</div>