Bernd Wurst commited on 2018-01-24 10:34:58
Zeige 3 geänderte Dateien mit 42 Einfügungen und 7 Löschungen.
... | ... |
@@ -21,20 +21,56 @@ require_once('session/start.php'); |
21 | 21 |
|
22 | 22 |
|
23 | 23 |
require_role(array(ROLE_CUSTOMER)); |
24 |
+$section = 'contacts_list'; |
|
24 | 25 |
|
25 | 26 |
$new = False; |
26 |
-if ($_REQUEST['action'] == 'new') { |
|
27 |
+if ($_REQUEST['id'] == 'new') { |
|
27 | 28 |
title("Adresse anlegen"); |
28 | 29 |
$new = True; |
29 | 30 |
} else { |
30 | 31 |
title("Adresse bearbeiten"); |
31 | 32 |
} |
32 | 33 |
|
33 |
-$contact = new_contact(); |
|
34 |
+$c = new_contact(); |
|
34 | 35 |
if (! $new) { |
35 |
- $contact = get_contact($_REQUEST['id']); |
|
36 |
+ $c = get_contact($_REQUEST['id']); |
|
36 | 37 |
} |
37 | 38 |
|
39 |
+$readonly = ''; |
|
40 |
+// Wenn das Handle beim NIC angemeldet ist, kann man Name und Land nicht mehr ändern |
|
41 |
+if ($c['nic_handle'] != NULL) { |
|
42 |
+ $readonly = ' disabled="disabled" '; |
|
43 |
+ output('<p>Da diese Adresse als möglicher Domaininhaber bei der Domain-Regristry angemeldet ist, können Name/Firmenname und Land nicht mehr geändert werden. Legen Sie ggf. eine neue Adresse an und ändern Sie den Domain-Inhaber entsprechend.</p>'); |
|
44 |
+} |
|
45 |
+$odd = false; |
|
46 |
+$html = '<table>'; |
|
47 |
+$html .= ' <tr class="'.($odd == true ? 'odd' : 'even').'"><td>Firmenname:</td><td><input type="text" name="firma" id="firma" value="'.$c['company'].'" '.$readonly.' /></td></tr>'; |
|
48 |
+$odd = !$odd; |
|
49 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td>'.($c['company'] ? 'Ansprechpartner' : 'Name').':</td><td><input type="text" name="name" id="name" value="'.$c['name'].'" '.$readonly.' /></td></tr>'; |
|
50 |
+$odd = !$odd; |
|
51 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="adresse">Adresse:</label></td><td><textarea rows="3" name="adresse" id="adresse">'.$c['address'].'</textarea></td></tr>'; |
|
52 |
+$odd = !$odd; |
|
53 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="plz">Land / PLZ:</label></td><td><input size="2" type="text" name="land" id="land" value="'.$c['country'].'" '.$readonly.' />-</strong><input type="text" name="plz" id="plz" value="'.$c['zip'].'"></td></tr>'; |
|
54 |
+$odd = !$odd; |
|
55 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="ort">Ort:</label></td><td><input type="text" name="ort" id="ort" value="'.$c['city'].'"></td></tr>'; |
|
56 |
+$odd = !$odd; |
|
57 |
+ |
|
58 |
+ |
|
59 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="email">E-Mail-Adresse:</label></td><td><input type="text" name="email" id="email" value="'.$c['email'].'"></td></tr>'; |
|
60 |
+$odd = !$odd; |
|
61 |
+ |
|
62 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="telefon">Telefonnummer:</label></td><td><input type="text" name="telefon" id="telefon" value="'.$c['phone'].'"></td></tr>'; |
|
63 |
+$odd = !$odd; |
|
64 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="telefon">Mobil:</label></td><td><input type="text" name="mobile" id="mobile" value="'.$c['mobile'].'"></td></tr>'; |
|
65 |
+$odd = !$odd; |
|
66 |
+$html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="telefon">Telefax:</label></td><td><input type="text" name="telefax" id="telefax" value="'.$c['fax'].'"></td></tr>'; |
|
67 |
+$odd = !$odd; |
|
68 |
+ |
|
69 |
+$html .= '<tr class="even"><td> </td><td><input type="submit" value="Speichern" /></td></tr>'; |
|
70 |
+$html .= '</table>'; |
|
71 |
+ |
|
38 | 72 |
|
73 |
+output(html_form('chdetails_all', 'chdetails_save', '', $html)); |
|
39 | 74 |
|
40 | 75 |
|
76 |
+?> |
... | ... |
@@ -61,8 +61,7 @@ function get_contact($id) |
61 | 61 |
if ($result->rowCount() == 0) { |
62 | 62 |
system_failure("Kontakt nicht gefunden oder gehört nicht diesem Kunden"); |
63 | 63 |
} |
64 |
- $res = $result->fetch() |
|
65 |
- $contact = $res[0]; |
|
64 |
+ $contact = $result->fetch(); |
|
66 | 65 |
return $contact; |
67 | 66 |
} |
68 | 67 |
|
... | ... |
@@ -53,11 +53,11 @@ foreach ($contacts as $id => $contact) { |
53 | 53 |
if ($new_email) { |
54 | 54 |
$email = "<strike>$email</strike><br/>".$new_email.footnote('Die E-Mail-Adresse wurde noch nicht bestätigt'); |
55 | 55 |
} |
56 |
- output("<tr><td>{$contact['id']}</td><td><strong>{$contact['name']}</strong></td><td>$adresse</td><td>$email</td><td>$usage</td><td>...</td></tr>"); |
|
56 |
+ output("<tr><td>{$contact['id']}</td><td><strong>".internal_link('edit', $contact['name'], 'id='.$contact['id'])."</strong></td><td>$adresse</td><td>$email</td><td>$usage</td><td>...</td></tr>"); |
|
57 | 57 |
} |
58 | 58 |
output('</table>'); |
59 | 59 |
output("<br />"); |
60 |
-addnew('edit', 'Neuen Kontakt erstellen', 'action=new'); |
|
60 |
+addnew('edit', 'Neuen Kontakt erstellen', 'id=new'); |
|
61 | 61 |
|
62 | 62 |
|
63 | 63 |
?> |
64 | 64 |