コード例 #1
0
ファイル: Helpers.php プロジェクト: centaurustech/bmradi
 public static function getAllConversationList()
 {
     $user_ID = Session::get("account_id");
     $conversations = "<div id='gridForm' class='gridContent' style='display:none'></div><div id='loadingAdd' style='display:none'></div>";
     $conversations .= '<div class="table-responsive">
                             <!-- THE MESSAGES -->
                             ' . Form::token() . '<table class="table table-mailbox" id="report" title="conversations">';
     $rs = Conversation::getConversationList($user_ID, true);
     $conversations .= "<tr title=''>\n                                <td colspan='5'>\n                                </td>\n                            </tr>";
     if (count($rs['records']) > 0) {
         foreach ($rs['records'] as $conv) {
             $conversations .= '<tr ' . (Conversation::getMsgStatus($conv->message_hash) == 0 ? 'class="unread"' : 'class="read"') . ' title="' . $conv->message_hash . '" >
                                     <td class="small-col"></td>
                                     <td>' . (Conversation::getMsgStatus($conv->message_hash) == 0 ? '<i class="fa fa-star"></i>' : '<i class="fa fa-star-o"></i>') . '</td>
                                     <td colspan="3"><b>' . $conv->recipient . '</b> (' . $conv->recipient_email . ') & <b>' . $conv->sender . '</b> (' . $conv->sender_email . ')</td>
                                     
                                 </tr>';
             $conversations .= "<tr title='" . $conv->message_hash . "'>\n                                <td colspan='5'>\n                                        <div id='loading" . $conv->message_hash . "' class='loadingview'></div>\n                                        <div id='ajaxcontent" . $conv->message_hash . "'>\n                                        </div>\n                                </td>\n                            </tr>";
         }
     } else {
         $conversations .= "<tr title='d'>\n                                <td colspan='5' style='text-align:center'>\n                                    No conversations \n                                </td>\n                            </tr>";
     }
     $pagination = Paginator::make($rs['records'], $rs['total_pages'], Session::get('rec_per_page'));
     $paginationString = $pagination->links();
     $conversations .= '</table>
                             <div class="box-footer clearfix">
                                 <div class="pull-right">
                                     ' . $paginationString . '
                                         </div>
                             </div><!-- box-footer -->
                         </div><!-- /.table-responsive -->';
     return $conversations;
 }