stage #2
@@ -190,7 +190,9 @@
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="frequency" required>
|
||||
<option>Three Days</option>
|
||||
<option>Weekly</option>
|
||||
<option>Biweekly</option>
|
||||
<option>Monthly</option>
|
||||
<option>Quarterly</option>
|
||||
<option>Biannually</option>
|
||||
|
||||
@@ -212,7 +212,9 @@ ob_start();
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="frequency">
|
||||
<option <?php if ($recurring_ticket_frequency == "Three Days") { echo "selected"; } ?>>Three Days</option>
|
||||
<option <?php if ($recurring_ticket_frequency == "Weekly") { echo "selected"; } ?>>Weekly</option>
|
||||
<option <?php if ($recurring_ticket_frequency == "Biweekly") { echo "selected"; } ?>>Biweekly</option>
|
||||
<option <?php if ($recurring_ticket_frequency == "Monthly") { echo "selected"; } ?>>Monthly</option>
|
||||
<option <?php if ($recurring_ticket_frequency == "Quarterly") { echo "selected"; } ?>>Quarterly</option>
|
||||
<option <?php if ($recurring_ticket_frequency == "Biannually") { echo "selected"; } ?>>Biannually</option>
|
||||
|
||||
@@ -406,10 +406,15 @@ if (mysqli_num_rows($sql_recurring_tickets) > 0) {
|
||||
addToMailQueue($data);
|
||||
|
||||
// Set the next run date
|
||||
if ($frequency == "weekly") {
|
||||
// Note: We seemingly have to initialize a new datetime for each loop to avoid stacking the dates
|
||||
if ($frequency == "three days") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('3 days'));
|
||||
} elseif ($frequency == "weekly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('1 week'));
|
||||
} elseif ($frequency == "biweekly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('2 weeks'));
|
||||
} elseif ($frequency == "monthly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('1 month'));
|
||||
|
||||
@@ -406,10 +406,15 @@ if (mysqli_num_rows($sql_recurring_tickets) > 0) {
|
||||
addToMailQueue($data);
|
||||
|
||||
// Set the next run date
|
||||
if ($frequency == "weekly") {
|
||||
// Note: We seemingly have to initialize a new datetime for each loop to avoid stacking the dates
|
||||
if ($frequency == "three days") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('3 days'));
|
||||
} elseif ($frequency == "weekly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('1 week'));
|
||||
} elseif ($frequency == "biweekly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('2 weeks'));
|
||||
} elseif ($frequency == "monthly") {
|
||||
$now = new DateTime();
|
||||
$next_run = date_add($now, date_interval_create_from_date_string('1 month'));
|
||||
|
||||
Reference in New Issue
Block a user