function displayTLCUsers($which, $display_type = '') { $users = getTLCUsers($which); if ($display_type == 'admin') { $template_name = 'admin/list_tlc_users_admin.tpl'; } else { $template_name = 'admin/list_tlc_users.tpl'; } $tpl = new PSU\Template(); $tpl->assign('users', $users); return $tpl->fetch($template_name); }
public static function mail($id) { $tpl = new PSU\Template(); $f = PSU::db('myplymouth')->GetRow("SELECT * FROM anejf WHERE id_ = ?", array($id)); $form = new AnejfApply($f, true); $form->readonly(true); $tpl->assign('form', $form); $message = $tpl->fetch('email.tpl'); $to = '*****@*****.**'; if (PSU::isdev()) { $to = '*****@*****.**'; } $subject = sprintf("[ANEJF %d] Application for %s %s", $GLOBALS['ANEJF']['YEAR'], $form->first_name->value(), $form->last_name->value()); PSU::mail($to, $subject, $message, 'Content-Type: text/html'); }
respond(function ($request, $response, $app) { PSU::session_start(); $GLOBALS['BASE_URL'] = '/app/festivals/music-career-day'; $app->event_year = 2012; $GLOBALS['TITLE'] = "{$app->event_year} Music Technology and Education Career Day"; $GLOBALS['TEMPLATES'] = PSU_BASE_DIR . '/app/festivals/music-career-day/templates'; if (!isset($_SESSION['mtecd'])) { $_SESSION['mtecd'] = array(); } $app->mail = function ($id) { $tpl = new PSU\Template(); $f = PSU::db('myplymouth')->GetRow("SELECT * FROM mte_career_day WHERE id_ = ?", array($id)); $form = new PSU\Festivals\MusicCareerDay\Model($f, true); $form->readonly(true); $tpl->assign('form', $form); $message = $tpl->fetch('email.tpl'); $to = array('*****@*****.**'); if (PSU::isdev()) { $to[0] = '*****@*****.**'; } $subject = sprintf("[MTECD {$app->event_year}] Application for %s %s", $form->first_name->value(), $form->last_name->value()); PSU::mail($to, $subject, $message, 'Content-Type: text/html'); }; $app->tpl = new PSU\Template(); $app->tpl->assign('event_year', $app->event_year); }); respond('/apply', function ($request, $response, $app) { $f = isset($_SESSION['mtecd']['f']) ? $_SESSION['mtecd']['f'] : array(); $form = new PSU\Festivals\MusicCareerDay\Model($f); $app->tpl->assign('form', $form); $app->tpl->display('apply.tpl');
require dirname(__DIR__) . '/webapp/calllog/includes/functions/open_call_functions.php'; // needed to fetch open calls $GLOBALS['db'] = PSU::db('calllog'); $GLOBALS['BANNER'] = PSU::db('banner'); $GLOBALS['BannerGeneral'] = new BannerGeneral($GLOBALS['BANNER']); $GLOBALS['user'] = new User(PSU::db('calllog')); $HOST = 'https://www.plymouth.edu'; $GLOBALS['BASE_URL'] = $HOST . '/webapp/calllog'; $GLOBALS['BASE_DIR'] = dirname(__FILE__); $GLOBALS['TEMPLATES'] = dirname(__DIR__) . '/webapp/calllog/templates'; $GLOBALS['CALLLOG_WEB'] = $GLOBALS['BASE_URL'] . '/calls/my/'; $tpl = new PSU\Template(); $users = getTLCUsers('active'); foreach ($users as $person) { $reminder = $GLOBALS['user']->getReminderSetting($person['user_name']); if ($reminder == 'yes') { $options = array('which' => 'my', 'who' => $person['user_name']); $calls = getOpenCalls($options); if (count($calls) > 0) { $tpl->assign('calls', $calls); $tpl->assign('user', $person); $html = $tpl->fetch('email.calls.tpl'); $text = 'This email is optimized for HTML. View your open calls here: ' . $GLOBALS['CALLLOG_WEB']; $p = new PSUPerson($person['user_name']); PSU::mail($p->email['CA'][0], '[CallLog] Daily Open Call Report', array($text, $html)); } // end if } // end if } // end foreach