Пример #1
0
 function generateSendAdvanceResultTemplateALL($explore, $list)
 {
     $msg = "<html>\n <head>\n  <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\n  <title>UCEazy - Advance Explore - Your Result</title>\n  <meta name='viewport' content='width=device-width, initial-scale=1.0'/>\n</head>\n<body style='margin: 0; padding: 0; background:#fafafa;'>\n <table align='center' border='0' cellpadding='0' cellspacing='0' width='800' style='border-collapse: collapse; '>\n\t <tr>\n\t  <td align='center' style='padding:20px;'>\n\t   \t<img src='" . Constants::SITE_BASE_URL . "/img/logo-uceazy.png' class='img-responsive' width='169' height='90'>\n\t  </td>\n\t </tr>\n\t <tr>\n\t  <td style='background:#c4211a; '>\n\t   \t<h3 style='font-family: Arial, Helvitica, sans-serif; color:#fff;' align='center'>Advanced Explore - Result</h3>\n\t  </td>\n\t </tr>\n\t <tr>\n\t  \t<td>\n\t\t \t<table align='center' border='0' cellpadding='0' cellspacing='0' width='100%' style='padding:20px; background:#fff; font-family: Arial, Helvitica, sans-serif; font-size:14px;'>\n\t\t \t\t<tr>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'> Current State:</td>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'>" . Convertors::getStateDescription($explore->getState()) . "</td>\n\t\t \t\t</tr>\n\t\t \t\t<tr>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'> California County:</td>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getCounty() . "</td>\n\t\t \t\t</tr>\n\t\t \t\t\t\t\t<tr>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'> Weighted GPA:</td>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getGpa() . "</td></tr>\n\t\t \t\t<tr>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'> Standardized Test:</td>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'>" . strtoupper($explore->getExam()) . "</td>\n\t\t \t\t</tr>\n\t\t \t\t";
     if ($explore->getExam() == 'act') {
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>ACT Composite</td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getAct() . "</td>\n\t\t\t  </tr>";
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>ACT English Writing</td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getActew() . "</td>\n\t\t\t  </tr>";
     } elseif ($explore->getExam() == 'sat') {
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Critical Reading </td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getsatread() . "</td>\n\t\t\t  </tr>";
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Math</td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getsatmath() . "</td>\n\t\t\t  </tr>";
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Writing</td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getsatwrite() . "</td>\n\t\t\t  </tr>";
     } elseif ($explore->getExam() == 'psat') {
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Critical Reading </td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getpsatread() . "</td>\n\t\t\t  </tr>";
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Math</td>\n\t\t\t <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getpsatmath() . "</td>\n\t\t\t  </tr>";
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Writing</td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getpsatwrite() . "</td>\n\t\t\t  </tr>";
     }
     $msg .= "<tr>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'> Applying to:</td>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'>" . Convertors::getUS($explore->getus()) . "</td>\n\t\t \t\t</tr>";
     if ($explore->getMajor() == "-1") {
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Major</td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Undeclared</td>\n\t\t\t  </tr>";
     } else {
         $msg .= "<tr>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>Major</td>\n\t\t\t  <td style='padding:5px; border-bottom:1px solid #eee;'>" . $explore->getMajor() . "</td>\n\t\t\t  </tr>";
     }
     $msg .= "\n\t\t \t\t<tr>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'> Campus Size:</td>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'>" . Convertors::getCSize($explore->getcsize()) . "</td>\n\t\t \t\t</tr>\n\t\t \t\t<tr>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'> Campus Preference:</td>\n\t\t \t\t\t<td style='padding:5px; border-bottom:1px solid #eee;'>" . Convertors::getCPref($explore->getcpref()) . "</td>\n\t\t \t\t</tr>\n\t\t \t</table>\n\t  \t</td>\n\t </tr>\n\t <tr>\n\t \t<td>\n\t \t\t<table align='center' border='0' cellpadding='0' cellspacing='0' width='100%' style='padding:0px 20px 20px 20px; background:#fff; font-family: Arial, Helvitica, sans-serif; font-size:14px;'>\n\t\t \t\t<tr>\n\t\t \t\t\t<td width='10%' style='color:#c4211a; padding-bottom:10px;'><h3>My List :</h3></td>\n\t\t \t\t\t<td width='26%'  style='color:#000; padding-bottom:10px;'><strong> </strong></td>\n\t\t \t\t\t<td width='10%' align='left' style='color:#c4211a; padding-bottom:10px; font-size:20px;'>  </td>\n\t\t \t\t\t<td width='11%' style='color:000; padding-bottom:10px;'><strong></strong> </td>\n\t\t \t\t\t<td width='43%' style='color:#c4211a; padding-bottom:10px; font-size:20px;'>  </td>\n\t\t \t\t</tr>";
     $safety = $explore->getSafety();
     $reach = $explore->getReach();
     $target = $explore->getTarget();
     if (in_array("reach", $list)) {
         $msg .= "<tr bgcolor='#fafafa'>\n\t\t \t\t\t<td colspan='5' align='center' valign='top' style='border:1px solid #eee;'>\n\t\t \t\t\t\t<table align='center' border='0' cellpadding='0' cellspacing='0' width='100%' style='font-family: Arial, Helvitica, sans-serif;'>\n\t\t \t\t\t\t\t<tr>\n\t\t \t\t\t\t\t\t<td align='left' colspan='6' style='padding:5px; background:#9adcfd; border-bottom:1px solid #efefef;'><strong>Reach</strong></td>\n\t\t \t\t\t\t\t</tr>\n\t\t \t\t\t\t\t<tr bgcolor='#ddd'>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>College</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Cost - Living with Parent/Guardian (\$)</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Cost - Living on Campus (\$)</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Size</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>University System</strong></td>\n\t\t \t\t\t\t\t\t<td align='ce' valign='middle' style='padding:5px; color:#222;'><strong>Environment</strong></td>\n\t\t \t\t\t\t\t</tr>";
         if (count($reach) > 0) {
             foreach ($reach as $val) {
                 $msg .= "<tr bgcolor='#fff'>\n\t\t\t\t\t\t\t<td align='center' valign='middle' style='padding:5px; '> " . $val['name'] . "</td>\n\t\t\t\t\t\t\t<td align='center' valign='middle' style='padding:5px; '>\$ " . number_format(intval($val['relativeCOA']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='center' valign='middle' style='padding:5px; '>\$ " . number_format(intval($val['onCampusCOA']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='center' valign='middle' style='padding:5px; '>" . number_format(intval($val['size']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='center' valign='middle' style='padding:5px; '>" . $val['universitySystem'] . "</td>\n\t\t\t\t\t\t\t<td align='center' valign='middle' style='padding:5px; '>" . $val['environment'] . "</td>\n\t\t\t\t\t</tr>";
             }
         } else {
             $msg .= "<tr bgcolor='#fff'><td colspan=6 >No College found</td></tr>";
         }
         $msg .= "</table>\n\t\t \t\t\t</td>\n\t\t \t\t</tr>\n\t\t \t\t<tr><td height='20'></td></tr>";
     }
     if (in_array("target", $list)) {
         $msg .= "<tr bgcolor='#fafafa'>\n\t\t \t\t\t<td colspan='5' align='center' valign='top' style='border:1px solid #eee;'>\n\t\t \t\t\t\t<table align='center' border='0' cellpadding='0' cellspacing='0' width='100%' style='font-family: Arial, Helvitica, sans-serif;'>\n\t\t \t\t\t\t\t<tr>\n\t\t \t\t\t\t\t\t<td align='left' colspan='6' style='padding:5px; background:#FFA500; border-bottom:1px solid #FFA500;'><strong>Target</strong></td>\n\t\t \t\t\t\t\t</tr>\n\t\t \t\t\t\t\t<tr bgcolor='#ddd'>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>College</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Cost - Living with Parent/Guardian (\$)</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Cost - Living on Campus (\$)</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Size</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>University System</strong></td>\n\t\t \t\t\t\t\t\t<td align='ce' valign='middle' style='padding:5px; color:#222;'><strong>Environment</strong></td>\n\t\t \t\t\t\t\t</tr>";
         if (count($target) > 0) {
             foreach ($target as $val) {
                 $msg .= "<tr bgcolor='#fff'>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . $val['name'] . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>\$ " . number_format(intval($val['relativeCOA']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>\$ " . number_format(intval($val['onCampusCOA']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . number_format(intval($val['size']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . $val['universitySystem'] . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . $val['environment'] . "</td>\n\t\t\t\t\t</tr>";
             }
         } else {
             $msg .= "<tr bgcolor='#fff'><td align='left' colspan=6 valign='middle' style='padding:5px ; '>No College found</td></tr>";
         }
         $msg .= "</table>\n\t\t \t\t\t</td>\n\t\t \t\t</tr>\n\t\t \t\t<tr><td height='20'></td></tr>";
     }
     if (in_array("safety", $list)) {
         $msg .= "<tr bgcolor='#fafafa'>\n\t\t \t\t\t<td colspan='5' align='center' valign='top' style='border:1px solid #eee;'>\n\t\t \t\t\t\t<table align='center' border='0' cellpadding='0' cellspacing='0' width='100%' style='font-family: Arial, Helvitica, sans-serif;'>\n\t\t \t\t\t\t\t<tr>\n\t\t \t\t\t\t\t\t<td align='left' colspan='6' style='padding:5px; background:#00ff00; border-bottom:1px solid #00ff00;'><strong>Safety</strong></td>\n\t\t \t\t\t\t\t</tr>\n\t\t \t\t\t\t\t<tr bgcolor='#ddd'>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>College</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Cost - Living with Parent/Guardian (\$)</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Cost - Living on Campus (\$)</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>Size</strong></td>\n\t\t \t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px; color:#222;'><strong>University System</strong></td>\n\t\t \t\t\t\t\t\t<td align='ce' valign='middle' style='padding:5px; color:#222;'><strong>Environment</strong></td>\n\t\t \t\t\t\t\t</tr>";
         if (count($safety) > 0) {
             foreach ($safety as $val) {
                 $msg .= "<tr bgcolor='#fff'>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . $val['name'] . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>\$ " . number_format(intval($val['relativeCOA']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>\$ " . number_format(intval($val['onCampusCOA']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . number_format(intval($val['size']), 0, '.', ',') . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . $val['universitySystem'] . "</td>\n\t\t\t\t\t\t\t<td align='left' valign='middle' style='padding:5px ; '>" . $val['environment'] . "</td>\n\t\t\t\t\t</tr>";
             }
         } else {
             $msg .= "<tr bgcolor='#fff'><td align='left' valign='middle' colspan=6 style='padding:5px ; '>No College found</td></tr>";
         }
         $msg .= "</table>\n\t\t \t\t\t</td>\n\t\t \t\t</tr>\n\t\t \t</table>\n\t \t</td>\n\t </tr>";
     }
     $msg .= "<tr>\n\t\t<td style='padding:10px; text-align:center;'><a href='#'>www.uceazy.com</a>\t</td>\n\t</tr>\n</table>\n</body>\n</html>";
     return $msg;
 }
Пример #2
0
 function myprofileJSONAction()
 {
     if (!isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
         return $this->redirect()->toUrl('/');
     }
     $this->layout("layout/user");
     $jsonRequest = array();
     $jsonRequest['error'] = null;
     $jsonRequest['errorCode'] = 0;
     $jsonRequest['errorLevel'] = 0;
     $mode = $this->params()->fromPost('mode');
     $session = new Container('user');
     $username = $session->username;
     $uid = $session->userid;
     $uid = $this->params()->fromPost('uid');
     $jsonRequest['notes'] = array($this->params()->fromPost('note'));
     $jsonRequest['uid'] = $this->params()->fromPost('uid');
     $jsonRequest['parentGuardian'][0] = array("PGFirstName" => $this->params()->fromPost('pgfname1'), "PGMiddleName" => $this->params()->fromPost('pgmname1'), "PGLastName" => $this->params()->fromPost('pglname1'), "PGStreetAddress" => $this->params()->fromPost('pgaddress1'), "PGCity" => $this->params()->fromPost('pgcity1'), "PGState" => $this->params()->fromPost('pgstate1'), "PGZipcode" => $this->params()->fromPost('pgzip1'), "PGCounty" => $this->params()->fromPost('pgcounty1'), "PGPhone" => $this->params()->fromPost('pgtelephone1'), "PGMobilePhone" => $this->params()->fromPost('pgcell1'), "PGEmail" => $this->params()->fromPost('pgemail1'), "PGEmailUcEazy" => $this->params()->fromPost('isemailuceazy1'), "PGEmailUCCSU" => $this->params()->fromPost('isemailucsu1'));
     $jsonRequest['parentGuardian'][1] = array("PGFirstName" => $this->params()->fromPost('pgfname2'), "PGMiddleName" => $this->params()->fromPost('pgmname2'), "PGLastName" => $this->params()->fromPost('pglname2'), "PGStreetAddress" => $this->params()->fromPost('pgaddress2'), "PGCity" => $this->params()->fromPost('pgcity2'), "PGState" => $this->params()->fromPost('pgstate2'), "PGZipcode" => $this->params()->fromPost('pgzip2'), "PGCounty" => $this->params()->fromPost('pgcounty2'), "PGPhone" => $this->params()->fromPost('pgtelephone2'), "PGMobilePhone" => $this->params()->fromPost('pgcell2'), "PGEmail" => $this->params()->fromPost('pgemail2'), "PGEmailUcEazy" => $this->params()->fromPost('isemailuceazy2'), "PGEmailUCCSU" => $this->params()->fromPost('isemailucsu2'));
     $jsonRequest['state'] = $this->params()->fromPost('state');
     $jsonRequest['suffix'] = $this->params()->fromPost('suffix');
     $jsonRequest['email'] = $this->params()->fromPost('email');
     $jsonRequest['city'] = $this->params()->fromPost('city');
     $jsonRequest['firstName'] = $this->params()->fromPost('fname');
     $jsonRequest['middleName'] = $this->params()->fromPost('mname');
     $jsonRequest['lastName'] = $this->params()->fromPost('lname');
     $jsonRequest['streetAddress'] = $this->params()->fromPost('street');
     $jsonRequest['zipcode'] = $this->params()->fromPost('zipcode');
     $jsonRequest['county'] = $this->params()->fromPost('county');
     $jsonRequest['phone'] = $this->params()->fromPost('telephone');
     $jsonRequest['mobilePhone'] = $this->params()->fromPost('cell');
     $jsonRequest['birthday'] = $this->params()->fromPost('birthdate');
     $jsonRequest['sex'] = $this->params()->fromPost('gendar');
     $jsonRequest['ethnicity'] = $this->params()->fromPost('ethnicity');
     if ($this->params()->fromPost('ethnicityname') == "999") {
         $jsonRequest['ethnicityOthers'] = $this->params()->fromPost('ethnicitynameothers');
     } else {
         $jsonRequest['ethnicityOthers'] = Convertors::getEthnicityVal($this->params()->fromPost('ethnicityname'));
     }
     $starCount = 0;
     if ($this->params()->fromPost('email') != '' && $this->params()->fromPost('fname') != '' && $this->params()->fromPost('mname') != '' && $this->params()->fromPost('lname') != '' && $this->params()->fromPost('cell') != '') {
         $starCount++;
     }
     if ($this->params()->fromPost('pgfname1') != '' && $this->params()->fromPost('pgmname1') != '' && $this->params()->fromPost('pglname1') != '' && $this->params()->fromPost('pgcell1') != '' && $this->params()->fromPost('pgemail1') != '') {
         $starCount++;
     }
     $jsonRequest['starCount'] = $starCount;
     $jsonRequest['race'] = $this->params()->fromPost('race');
     $jsonRequest['raceCategory'] = $this->params()->fromPost('racecategory');
     $planjson = new RESTJSONManager();
     $url = "";
     $jsonResponse = "";
     if ($mode == "update") {
         $url = Constants::PLAN_PROFILE_BASE_URL;
         $url = str_replace("<UID>", $uid, $url);
         $this->LogMessage(json_encode($jsonRequest));
         $jsonResponse = $planjson->PlanJSONManager('PUT', $url, json_encode($jsonRequest), $uid);
         $this->LogMessage($jsonResponse);
     } elseif ($mode == "save") {
         $this->getPlanTable()->updateMyProfile($uid);
         $url = Constants::PLAN_PROFILE_BASE_URL;
         $url = str_replace("<UID>", $uid, $url);
         $jsonResponse = $planjson->PlanJSONManager('POST', $url, json_encode($jsonRequest), $uid);
     }
     $error = "";
     $ecode = "";
     $response = "";
     if ($jsonResponse->getStatusCode() == '200' || $jsonResponse->getStatusCode() == '201') {
         $response = json_decode($jsonResponse->getBody(), true);
         $ecode = $response['errorCode'];
         $error = $response['error'];
     } else {
         $ecode = "999";
         $error = "Backend API Error";
     }
     $resultret = new JsonModel(array('response' => json_decode($jsonResponse->getBody(), true), 'error' => $error, 'ecode' => $ecode, 'request' => json_encode($jsonRequest)));
     return $resultret;
 }
Пример #3
0
 static function traverseArray(&$array, $keys)
 {
     foreach ($array as $key => &$value) {
         if (is_array($value)) {
             Convertors::traverseArray($value, $keys);
         } else {
             if (in_array($key, $keys)) {
                 unset($array[$key]);
             }
         }
     }
 }