Exemplo n.º 1
0
$time = $ticket->created_at;
$time = date_create($time);
date_add($time, date_interval_create_from_date_string($SlaPlan->grace_period));
echo date_format($time, 'd/m/Y H:i:s');
?>
 >
                        <td><input type="checkbox" class="icheckbox_flat-blue" name="select_all[]" value="{{$ticket->id}}"/></td>
                        <?php 
//  collaborators
$collaborators = App\Model\helpdesk\Ticket\Ticket_Collaborator::where('ticket_id', '=', $ticket->id)->get();
$collab = count($collaborators);
//  title
$title = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
$string = strip_tags($title->title);
// check atatchments
$attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $title->id)->first();
$attach = count($attachments);
if (strlen($string) > 40) {
    $stringCut = substr($string, 0, 40);
    $string = substr($stringCut, 0, strrpos($stringCut, ' ')) . ' ...';
}
$TicketData = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
$TicketDatarow = App\Model\helpdesk\Ticket\Ticket_Thread::where('id', '=', $TicketData)->first();
$LastResponse = App\User::where('id', '=', $TicketDatarow->user_id)->first();
if ($LastResponse->role == "user") {
    $rep = "#F39C12";
    $username = $LastResponse->user_name;
} else {
    $rep = "#000";
    $username = $LastResponse->first_name . " " . $LastResponse->last_name;
    if ($LastResponse->first_name == null || $LastResponse->last_name == null) {
                                                         <td>{!! $ticket_form_data->content !!}</td>
                                                     </tr>
                                                 @endforeach
                                                 </tbody></table>
                                             </div>
                                 @endif
                             @endif
                             <br/><br/>
                             <div class="timeline-footer" style="margin-bottom:-5px">
                             @if(!$conversation->is_internal)
                             <?php 
 Event::fire(new App\Events\Timeline($conversation, $role, $user));
 ?>
                             @endif
                                 <?php 
 $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id', '=', $conversation->id)->get();
 $i = 0;
 foreach ($attachments as $attachment) {
     if ($attachment->poster == 'ATTACHMENT') {
         $i++;
     }
 }
 if ($i > 0) {
     echo "<hr style='border-top: 1px dotted #FFFFFF;margin-top:0px;margin-bottom:0px;background-color:#8B8C90;'><h4 class='box-title'><b>" . $i . " </b> Attachments</h4>";
 }
 ?>
                                 <ul class='mailbox-attachments clearfix'>
                                 <?php 
 foreach ($attachments as $attachment) {
     $size = $attachment->size;
     $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');