1 Public functionget_kefu_reply_list () {2 $wid=$this->_post (' order_id ');3 if(!$wid){4 Echo(' Ticket information acquisition failed! '));5 Exit;6 }7 $where=NULL;8 $where[' A.wid ']=$wid;9 $list=m (' kefu_reply ')->alias ("A")Join(' Z_user_common as B on A.uid=b.id ')Tenwhere$where)->field (' A.*,b.realname,b.account ')->order (' A.do_time desc ')Select (); One foreach($list as $key=$value) { A if(Mb_strlen ($value[' content ']) >15){ - $list[$key[' Content_new ']=mb_substr ($value[' Content '],0,6, ' utf-8 '); -}Else{ the $list[$key[' Content_new ']=$value[' Content ']; - } - $list[$key[' Dotime ']=Date("Y-m-d h:i:s",$value[' Do_time ']); - } + if($list){ - $str=""; + $str. = "<table align= ' center ' border= ' 1 ' width= ' + ' cellpadding= ' 1 ' cellspacing= ' 1 ' >"; A $str. = "<tr>"; at $str. = "<td align= ' center ' > follow-up person name </td>"; - $str. = "<td align= ' center ' > follow-up person account </td>"; - $str. = "<td align= ' center ' > Follow-up content </td>"; - $str. = "<td align= ' center ' > Follow-up time </td>"; - $str. = "</tr>"; - foreach($list as $k=$v){ in $str. = "<tr>"; - $str. = "<td align= ' center ' >$v[realname]</td> "; to $str. = "<td align= ' center ' >$v[account]</td> "; + $str. = "<td align= ' center ' >"; - $str. = "<a href= ' javascript:void (0); ' a= '$v[content] ' onclick= ' get_detail_contents (this); ' style= ' color:blue; ' >$v[content_new]...</a> "; the $str. = "</td>"; * $str. = "<td align= ' center ' >$v[dotime]</td> "; $ $str. = "</tr>"; Panax Notoginseng } - $str. = ' </table> '; the Echo $str; +}Else{ A Echo0;//No data currently the } +}
PHP background template HTML stitching notation