die("Error: Invalid wiki id."); } $range = isset($options['range']) ? intval($options['range']) : 1000; $fromUserId = isset($options['from_userid']) ? intval($options['from_userid']) : 0; $toUserId = isset($options['to_userid']) ? intval($options['to_userid']) : 0; $cleanupCondition = "date(user_registration) < curdate() - interval 30 day"; $reminderCondition = "date(user_registration) = curdate() - interval 7 day"; // remove old temp user if (isset($options['cleanup'])) { removeOldTempUser($fromUserId, $toUserId, $range, $cleanupCondition); } // send reminder for all wikis if (isset($options['reminder'])) { // get list of wikis $wikis = getWikis($reminderCondition); // send reminder for each wiki foreach ($wikis as $wikiId) { $cmd = "SERVER_ID={$wikiId} php {$IP}/extensions/wikia/UserLogin/maintenance.php --conf={$wgWikiaLocalSettingsPath} --wiki_reminder"; $result = wfShellExec($cmd, $retval); if ($retval) { echo "Error code {$retval}: {$result} \n"; } else { echo "{$result} \n"; } } echo "Reminder emails sent for " . count($wikis) . " wikis.\n"; } // send reminder for current wiki if (isset($options['wiki_reminder'])) { sendReminder($fromUserId, $toUserId, $range, $reminderCondition); }
$this_message['dueDate'] = isset($_POST['dueDate']) ? $_POST['dueDate'] : ''; // -------------------------------------------------------------------------------------------------------------------------- // --- check for the post, if it is valid, commit to the database, close this window and run opener.Handeler if (!empty($sendTo) and isset($_POST['dueDate']) and preg_match('/\\d{4}[-]\\d{2}[-]\\d{2}/', $_POST['dueDate']) and isset($_POST['priority']) and intval($_POST['priority']) <= 3 and isset($_POST['message']) and strlen($_POST['message']) <= 144 and strlen($_POST['message']) > 0 and isset($_POST['PatientID']) and is_numeric($_POST['PatientID'])) { $dueDate = $_POST['dueDate']; $priority = intval($_POST['priority']); $message = $_POST['message']; $fromID = $_SESSION['authId']; $patID = $_POST['PatientID']; if (isset($_POST['sendSeperately']) and $_POST['sendSeperately']) { foreach ($sendTo as $st) { $ReminderSent = sendReminder(array($st), $fromID, $message, $dueDate, $patID, $priority); } } else { // -------- Send the reminder $ReminderSent = sendReminder($sendTo, $fromID, $message, $dueDate, $patID, $priority); } // -------------------------------------------------------------------------------------------------------------------------- if (!$ReminderSent) { $output .= '<div style="text-size:2em; text-align:center; color:red">* ' . xlt('Please select a valid recipient') . '</div> '; } else { // --------- echo javascript echo '<html><body><script language="JavaScript">'; // ------------ 1) refresh parent window this updates if sent to self echo ' if (opener && !opener.closed && opener.updateme) opener.updateme("new");'; // ------------ 2) communicate with user echo ' alert("' . addslashes(xl('Message Sent')) . '");'; // ------------ 3) close this window echo ' window.close();'; echo '</script></body></html>'; // --------- stop script from executing further
if ($group != "all") { $queryG = " AND Field=" . $dbClass->quote($group); } else { $queryG = ""; } if ($author) { $queryA = " AND Authors LIKE '" . $dbClass->quote("%" . $author . "%") . "'"; } else { $queryA = ""; } $dbClass->query("SELECT * FROM publications WHERE " . ($selectPP ? "RowId = '" . $selectPP . "'" : "Status='ok' AND Year>='" . $yFirst . "' AND Year<='" . $yLast . "' " . $queryG . " " . $queryA) . " ORDER BY Year,Report DESC"); while ($pr = $dbClass->next_record()) { prtRow($pr, $t); } $t->close("</div>"); sendReminder(); endPage(); // ========================================================================== /// @fn void s ( void ) /// /// ... /// /// @global /// @parameter ... /// @return ... /// @gobals[out] - none /// @sideeffect - none /// /// @calledby ... // ========================================================================== function s($k, $def, $v)
$nda_row = $ndas[0]->fetch_assoc(); } } //pull everyone from the db who hasn't completed survey $sql = "call getSurveyNotDoneTest();"; $surveys = execute_query($mysqli, $sql); //for ea if time since intial sign up > 2 days && < 3 days || time > 5 days < 6 days send reminder email if ($surveys) { $sur_row = $surveys[0]->fetch_assoc(); while ($sur_row) { $interval = time_diff($sur_row["time"], $now); $int_val = intval($interval->format('%a')); if ($int_val == 2 || $int_val == 5) { echo 'missing survey: ' . $sur_row['key'] . ', ' . $sur_row['email'] . ', ' . $sur_row['time'] . ", diff = " . $interval->format('%R%a days') . '<br>'; //send email sendReminder(getSocksMailer(), $sur_row['email'], 'survey', $key); } $sur_row = $surveys[0]->fetch_assoc(); } } function sendReminder($mail, $address, $type, $key) { $mail->AddAddress($address); if ($type == 'survey') { //add survey body } else { if ($type == 'nda') { //add nda body } } //$mail->SendMail();