예제 #1
0
 public function executeLoadPublicHangoutReviews(sfWebRequest $request)
 {
     $userId = $request->getParameter('userId');
     $requester = Postings::getHangoutByReview($userId, true);
     $hangoutReviews = array();
     foreach ($requester as $v) {
         if (!isset($hangoutReviews[$v['rg_id']])) {
             $hangoutReviews[$v['rg_id']] = array('posting_title' => $v['posting_title'], 'ratee' => $v['ratee'], 'counter_done' => $v['counter_done'], 'rater_path' => $v['rater_path'], 'rater_username' => $v['rater_username'], 'rater_city' => $v['rater_city'], 'rater_state' => $v['rater_state'], 'rater_profile_id' => $v['rater_profile_id'], 'ratee_path' => $v['ratee_path'], 'ratee_username' => $v['ratee_username'], 'ratee_city' => $v['ratee_city'], 'ratee_state' => $v['ratee_state'], 'ratee_profile_id' => $v['ratee_profile_id'], 'posting_id' => $v['posting_id']);
         }
         $hangoutReviews[$v['rg_id']]['comments'][$v['comment_id']] = array('comments' => $v['comments'], 'sc_member_id' => $v['sc_member_id'], 'sc_nick_name' => $v['sc_nick_name']);
         $hangoutReviews[$v['rg_id']]['friendship'][$v['status']][] = $v['friend_id'];
     }
     $html = '<div id="review-container">';
     $counter = 1;
     foreach ($hangoutReviews as $rater_group_id => $v) {
         $comments = array();
         foreach ($v['comments'] as $comment) {
             $comments[] = $comment['comments'];
         }
         $html .= '<div id="review-subcontainer" style="width:100%;float:left;">';
         $html .= '  <div> <h6> <span style="font-weight:normal;">' . $v['posting_title'] . '</span> </h6> ';
         if ($userId == $v['ratee']) {
             $hngt_path = $v['rater_path'];
             $hngt_username = $v['rater_username'];
             $hngt_city = $v['rater_city'];
             $hngt_state = $v['rater_state'];
             $hngt_profile_id = $v['rater_profile_id'];
         } else {
             $hngt_path = $v['ratee_path'];
             $hngt_username = $v['ratee_username'];
             $hngt_city = $v['ratee_city'];
             $hngt_state = $v['ratee_state'];
             $hngt_profile_id = $v['ratee_profile_id'];
             $counter++;
         }
         $path = $v['gender'] == 'f' ? '/images/female.png' : '/images/male.png';
         $path = !empty($hngt_path) ? '/' . $hngt_path : $path;
         $comment_1 = '
                 <span style="font-size:12px;float:right;color:black!important;font-weight:normal!important;">
                     <blockquote>' . $comments[0] . '</blockquote>
                 </span>';
         $comment_2 = $comments[1];
         $comment_3 = $comments[2];
         $html .= '<div style="padding:5px;font-family:tahoma;height:92px;width:100%;">';
         $html .= '  <div style="float:left;padding-left:5px;font-weight:bold;width: 98%;">
                 <img src="' . $path . '" style="width:80px;height:80px;float:left;padding-right:5px;"/>' . $hngt_username . $comment_1;
         $html .= '      <div style="font-size:12px;font-weight:normal;">' . $hngt_city . ',' . $hngt_state . '<span style="font-size:12px;font-weight:normal;float:right;">
                     <blockquote> ' . $comment_2 . ' </blockquote>  
                 </span>
                         </div>';
         $html .= '      <div style="font-size:12px;font-weight:normal;">
                 <a href="/index.php/home/profile?id=' . $hngt_profile_id . '">View Public Profile</a>
                 <span style="font-size:12px;font-weight:normal;float:right;"><blockquote>' . $comment_3 . '</blockquote></a>
                         </div>';
         $html .= '  </div> <br/>';
         $survey_results = SurveyResults::getRatingsPerRaterGroup($rater_group_id);
         $html .= '<div id="pop-up_' . $rater_group_id . '"  class="pop-up">';
         $html .= '<table>';
         foreach ($survey_results as $sr) {
             $html .= "<tr> <td> {$sr['questions']} </td> <td> {$sr['result']}% </td> </tr>";
         }
         $html .= '</table>';
         $html .= '</div>';
         $html .= '<div class="clear"></div>';
         $html .= '</div>';
         $html .= '</div>';
     }
     $html .= '</div>';
     //        $html .= '<div style="width:100%;float:left;"> [ <a href="#" id="myPublicHangoutReviews" > Refresh </a> ] ';
     //        $html .= '<div class="hr-pattern"></div></div>';
     die($html);
 }
예제 #2
0
 public function executeGetListOfPostings(sfWebRequest $request)
 {
     $postings = new Postings();
     $posts = $postings->getAllPostings($_SESSION['userId']);
     $html = "<ul>";
     foreach ($posts as $v) {
         $html .= '<li>
                 <span style="font-size:12px;">
                     ' . $v->getPostingTitle() . '
                     <blockquote>' . $v->getPostingDesc() . '</blockqoute>
                 </span>
                 <br/>
                 <span style="font-weight:bold;">
                     <a href="/index.php/postings/edit?id=' . $v->getId() . '">Edit</a> | <a id="del-post" name="' . $v->getId() . '" href="#">Delete</a>
                     <span style="color:#FB9601;display:none;" id="del-post-conf-' . $v->getId() . '">Are you sure want to delete the selected post? ( <a id="opt-yes" name="opt-yes-' . $v->getId() . '" href="#">Yes</a> | <a id="opt-no" name="opt-no-' . $v->getId() . '" href="#">No</a> )</span>
                     <br/><span style="color:#FB9601;display:block;" id="resp-msg-' . $v->getId() . '"></span>
                 </span>
                 </li>';
     }
     $html .= "</ul>";
     die($html);
 }