function run() { SFS_bin_Utils_auth(); require_once '../SFS/Utils/Conference.php'; // send reminder email for all SFS_Utils_Conference::sendReminderEmail(7, 7); }
function run() { SFS_bin_Utils_auth(); $config =& CRM_Core_Config::singleton(); require_once '../drupal/sfschool/sfschool.module'; sfschool_civicrm_config($config); require_once 'SFS/Utils/ExtendedCare.php'; SFS_Utils_ExtendedCare::sendBalanceInvoiceEmail(SFS_BALANCE_OVERDUE); }
function run() { SFS_bin_Utils_auth(); require_once '../SFS/Utils/Conference.php'; // send reminder email for all $startDate = '2009-12-01'; $endDate = '2009-12-10'; require_once 'SFS/Utils/ExtendedCare.php'; SFS_Utils_ExtendedCare::sendNotSignedOutEmail($startDate, $endDate); }
function run() { SFS_bin_Utils_auth(); require_once '../SFS/Utils/Conference.php'; // first cache all the contacts who have created a login $sql = "\nSELECT c.id\nFROM civicrm_contact c,\n civicrm_uf_match uf,\n drupal_sfs.users u\nWHERE uf.contact_id = c.id\nAND uf.uf_id = u.uid\nAND u.created != u.access\n"; $dao = CRM_Core_DAO::executeQuery($sql); $accountsCreted = array(); while ($dao->fetch()) { $accountsCreated[$dao->id] = 1; } // now fetch all the student parent information $sql = "\nSELECT c.id as c_id, c.display_name as c_name, s.grade_sis as c_grade, p.id as p_id, p.display_name as p_name, ep.email as p_email\nFROM civicrm_contact c\nINNER JOIN civicrm_value_school_information s ON s.entity_id = c.id\nINNER JOIN civicrm_relationship r ON r.contact_id_a = c.id\nINNER JOIN civicrm_contact p ON r.contact_id_b = p.id\nLEFT JOIN civicrm_email ep ON ep.contact_id = p.id\nWHERE s.subtype = 'Student'\nAND s.grade_sis >= 1\nAND r.relationship_type_id = 1\nORDER BY p_id\n"; $parentsDoNotHaveLogin = array(); $parentsDoHaveLogin = array(); $dao = CRM_Core_DAO::executeQuery($sql); while ($dao->fetch()) { if (array_key_exists($dao->p_id, $accountsCreated)) { unset($parentsDoNotHaveLogin[$dao->c_id]); if (!array_key_exists($dao->c_id, $parentsDoHaveLogin)) { $parentsDoHaveLogin[$dao->c_id] = array(); } $parentsDoHaveLogin[$dao->c_id][] = array($dao->c_name, $dao->c_grade, $dao->p_id, $dao->p_name, $dao->p_email); } else { if (array_key_exists($dao->c_id, $parentsDoHaveLogin)) { unset($parentsDoNotHaveLogin[$dao->c_id]); $parentsDoHaveLogin[$dao->c_id][] = array($dao->c_name, $dao->c_grade, $dao->p_id, $dao->p_name, $dao->p_email); } else { if (!array_key_exists($dao->c_id, $parentsDoNotHaveLogin)) { $parentsDoNotHaveLogin[$dao->c_id] = array(); } $parentsDoNotHaveLogin[$dao->c_id][] = array($dao->c_name, $dao->c_grade, $dao->p_id, $dao->p_name, $dao->p_email); } } } $families = array(); $emailAddress = array(); foreach ($parentsDoNotHaveLogin as $cid => $pValues) { $familyKey = $familyValue = array(); foreach ($pValues as $pValue) { $familyKey[] = $pValue[2]; if (!empty($pValue[4])) { $familyValue[] = "{$pValue[3]} <{$pValue[4]}>"; $emailAddress[$pValue[4]] = "{$pValue[3]} <{$pValue[4]}>"; } else { $familyValue[] = $pValue[3]; } } $families[implode('_', $familyKey)] = implode(', ', $familyValue); } CRM_Core_Error::debug(count($emailAddress), implode(', ', $emailAddress)); CRM_Core_Error::debug(count($families), $families); $familiesLoggedIn = array(); foreach ($parentsDoHaveLogin as $cid => $pValues) { $familyKey = $familyValue = array(); foreach ($pValues as $pValue) { $familyKey[] = $pValue[2]; $familyValue[] = "{$pValue[3]} <{$pValue[4]}>"; } $familiesLoggedIn[implode('_', $familyKey)] = implode(', ', $familyValue); } CRM_Core_Error::debug(count($familiesLoggedIn), $familiesLoggedIn); }
function run() { SFS_bin_Utils_auth(); require_once '../SFS/Utils/Conference.php'; SFS_Utils_Conference::createConferenceSchedule(); }
function run() { SFS_bin_Utils_auth(); $results = matchAllStaffContacts(); echo $results['matched'] . " matched; " . $results['unmatched'] . " unmatached"; }