forked from itflow-org/itflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcampaign_add_modal.php
152 lines (126 loc) · 6.16 KB
/
campaign_add_modal.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<div class="modal" id="campaignAddModal" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-envelope"></i> New Campaign</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>×</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<div class="modal-body bg-white">
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#pills-campaign">Campaign</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-content">Content</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#pills-recipients">Recipients</a>
</li>
</ul>
<hr>
<div class="tab-content">
<div class="tab-pane fade show active" id="pills-campaign">
<div class="form-group">
<label>Campaign Name <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-paper-plane"></i></span>
</div>
<input type="text" class="form-control" name="name" placeholder="Campaign Name" required autofocus>
</div>
</div>
<div class="form-group">
<label>Email Subject <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-smile-wink"></i></span>
</div>
<input type="text" class="form-control" name="subject" placeholder="Email Subject" required>
</div>
</div>
<div class="form-group">
<label>From Name <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
</div>
<input type="text" class="form-control" name="from_name" placeholder="From Name" required>
</div>
</div>
<div class="form-group">
<label>From Email <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-envelope"></i></span>
</div>
<input type="text" class="form-control" name="from_email" placeholder="From Email" required>
</div>
</div>
<hr>
<div class="form-group">
<label>Schedule <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-clock"></i></span>
</div>
<input type="datetime-local" class="form-control" name="scheduled_at" placeholder="Schedule Date and Time">
</div>
</div>
<div class="form-group">
<label>Set Status <strong class="text-danger">*</strong></label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-smile-wink"></i></span>
</div>
<select class="form-control" name="status">
<option>Draft</option>
<option>Queued</option>
</select>
</div>
</div>
</div>
<div class="tab-pane fade" id="pills-content">
<div class="form-group">
<textarea class="form-control summernote" name="content"></textarea>
</div>
</div>
<div class="tab-pane fade" id="pills-recipients">
<label>Select Tags <strong class="text-danger">*</strong></label>
<ul class="list-group mb-3">
<?php
$sql_tags_select = mysqli_query($mysqli,"SELECT * FROM tags WHERE tag_type = 1 AND company_id = $session_company_id ORDER BY tag_name ASC");
while($row = mysqli_fetch_array($sql_tags_select)){
$tag_id_select = $row['tag_id'];
$tag_name_select = $row['tag_name'];
//Get Contact Count
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT(*) AS client_count FROM clients, client_tags
WHERE clients.client_id = client_tags.client_id
AND tag_id = $tag_id_select
AND company_id = $session_company_id
"));
$client_count = $row['client_count'];
?>
<li class="list-group-item">
<div class="form-check">
<input type="checkbox" class="form-check-input" name="tags[]" value="<?php echo $tag_id_select; ?>">
<label class="form-check-label ml-2"><?php echo $tag_name_select; ?> (<?php echo $client_count; ?> subscribers)</label>
</div>
</li>
<?php
}
?>
</ul>
</div>
</div>
</div>
<div class="modal-footer bg-white">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" name="add_campaign" class="btn btn-primary">Save</button>
</div>
</form>
</div>
</div>
</div>