-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathusers-edit.php
112 lines (106 loc) · 4 KB
/
users-edit.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
@include_once 'commons.php';
$nc = new NewsletterControls();
if (isset($_GET['id'])) {
$nc->load($wpdb->prefix . 'newsletter', $_GET['id']);
if (empty($nc->data['id'])) {
$nc->data['status'] = 'C';
$nc->data['token'] = md5(rand());
}
}
else {
if ($nc->is_action('save')) {
for($i=1; $i<=NEWSLETTER_LIST_MAX; $i++) {
if (!isset($nc->data['list_' . $i])) $nc->data['list_' . $i] = 0;
}
$nc->save($wpdb->prefix . 'newsletter');
}
}
$nc->errors($errors);
$nc->messages($messages);
$options_profile = get_option('newsletter_profile');
?>
<div class="wrap">
<h2>Newsletter Subscriber Editing</h2>
<p><a href="admin.php?page=newsletter/users.php">Back to the list</a></p>
<form method="post" action="admin.php?page=newsletter/users-edit.php">
<?php $nc->init(); ?>
<?php $nc->hidden('id'); ?>
<?php $nc->hidden('token'); ?>
<table class="form-table">
<tr valign="top">
<th> </th>
<td>
id: <?php $nc->value('id'); ?>
created: <?php $nc->value('created'); ?>
ip: <?php $nc->value('ip'); ?>
token: <?php $nc->value('token'); ?>
</td>
</tr>
<tr valign="top">
<th>Name and email</th>
<td>
first name: <?php $nc->text('name', 30); ?> last name: <?php $nc->text('surname', 30); ?>
email: <?php $nc->text('email', 40); ?> sex: <?php $nc->select('sex', array('n'=>'Not specified', 'f'=>'female', 'm'=>'male')); ?>
</td>
</tr>
<tr valign="top">
<th>Status</th>
<td>
<?php $nc->select('status', array('C'=>'Confirmed', 'S'=>'Not confirmed', 'U'=>'Unsubscribed')); ?>
</td>
</tr>
<tr valign="top">
<th>Test subscriber?</th>
<td>
<?php $nc->yesno('test'); ?>
<div class="hints">
A test subscriber is a normal subscriber that is used when sending test are made, too.
</div>
</td>
</tr>
<tr valign="top">
<th>Lists</th>
<td>
<table>
<tr>
<td valign="top">
<?php
for ($i=1; $i<=5; $i++) {
$nc->checkbox('list_' . $i, '(' . $i . ') ' . htmlspecialchars($options_profile['list_' . $i]) . '<br />');
}
?>
</td>
<td valign="top">
<?php
for ($i=6; $i<=40; $i++) {
$nc->checkbox('list_' . $i, '(' . $i . ') ' . htmlspecialchars($options_profile['list_' . $i]) . '<br />');
}
?>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<th>Profiles</th>
<td>
<table>
<?php
for ($i=1; $i<20; $i++) {
echo '<tr><td>(' . $i . ') ';
echo $options_profile['profile_' . $i];
echo '</td><td>';
$nc->text('profile_' . $i, 50);
echo '</td></tr>';
}
?>
</table>
</td>
</tr>
</table>
<p class="submit">
<?php $nc->button('save', 'Save'); ?>
</p>
</form>
</div>