FaveoHELPDESK
	
        
        {{$thread->title}}
source)->first();
        $ticket_source = $ticket_source->value;
        
        
        $user = App\User::where('id', '=', $tickets->user_id)->first(); ?>
        id)->get(); ?>
        @foreach($response as $last)
        created_at; ?>
        @endforeach
        status)->first(); ?>
        priority_id)->first(); ?>
        help_topic_id)->first(); ?>
        help_topic_id)->first(); ?>
department)->first();   ?>
            
            |  |  | 
|---|
            | Status: | {{$status->state}} | 
            | Priority: | {{$priority->priority}} | 
            | Department: | {{$dept->name}} | 
 
            | Email: | {{$user->email}} | 
            | Phone: | {{$user->mobile}} | 
            | Source: | {{$ticket_source}} | 
            | Help Topic: | {{$help_topic->topic}} | 
        
        id)->get(); ?>
        @foreach($conversations as $conversation)
        
        
                                user_id)->first();
    ?>
                                is_internal) { ?>
                                
                                    role == 'agent' || $role->role == 'admin') { ?>
                                    
                                role == 'user') {  ?>
                                    
                                
                                    
    id)->first();
    if($attachment == null ) {
        $body = $conversation->body;
    }
    else {
        // dd($attachment->file);
        // print $attachment->file;
        // header("Content-type: image/jpeg");
        // echo ".") ";
        $body = $conversation->body;
        $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$conversation->id)->orderBy('id', 'DESC')->get();
        // $i = 0;
                    foreach($attachments as $attachment)
                    {
                        // $i++;
                        if($attachment->type == 'pdf')
                        {
                            // echo "hello";
                        }elseif($attachment->type == 'docx')
                        {
                            // echo "hello";
                        }
                        else
                        {
                        $image = @imagecreatefromstring($attachment->file); 
                        ob_start();
                        imagejpeg($image, null, 80);
                        $data = ob_get_contents();
                        ob_end_clean();
                        $var  =  '
 ";
        $body = $conversation->body;
        $attachments = App\Model\helpdesk\Ticket\Ticket_attachments::where('thread_id','=',$conversation->id)->orderBy('id', 'DESC')->get();
        // $i = 0;
                    foreach($attachments as $attachment)
                    {
                        // $i++;
                        if($attachment->type == 'pdf')
                        {
                            // echo "hello";
                        }elseif($attachment->type == 'docx')
                        {
                            // echo "hello";
                        }
                        else
                        {
                        $image = @imagecreatefromstring($attachment->file); 
                        ob_start();
                        imagejpeg($image, null, 80);
                        $data = ob_get_contents();
                        ob_end_clean();
                        $var  =  '  . ') ';
                        // echo $var;
                        // echo $attachment->name;
                        // $body = explode($attachment->name, $body);
                        $body = str_replace($attachment->name, "data:image/jpg;base64," .  base64_encode($data), $body);
                            $string = $body;                        
                            $start = "";
                            $end = "";
                            if(strpos($string,$start) == false || strpos($string,$start) == false)
                            {
                            }
                            else
                            {
                            $ini = strpos($string,$start);
                            $ini += strlen($start);
                            $len = strpos($string,$end,$ini) - $ini;
                            $parsed = substr($string,$ini,$len);
                            $body2 = $parsed;
                            $body = str_replace($body2 ," " ,$body);
                            }
                        }
                    }
                    // echo $body;
        // $body = explode($attachment->file, $body);
        // $body = $body[0];
    }
    ?>
    ";
                            $end = "";                            
                            if(strpos($string,$start) == false || strpos($string,$start) == false)
                            {
                            }
                            else
                            {
                            $ini = strpos($string,$start);
                            $ini += strlen($start);
                            $len = strpos($string,$end,$ini) - $ini;
                            $parsed = substr($string,$ini,$len);
                            $body2 = $parsed;
                            $body = str_replace($body2 ," " ,$body);
                            }
    ?>
';
                        // echo $var;
                        // echo $attachment->name;
                        // $body = explode($attachment->name, $body);
                        $body = str_replace($attachment->name, "data:image/jpg;base64," .  base64_encode($data), $body);
                            $string = $body;                        
                            $start = "";
                            $end = "";
                            if(strpos($string,$start) == false || strpos($string,$start) == false)
                            {
                            }
                            else
                            {
                            $ini = strpos($string,$start);
                            $ini += strlen($start);
                            $len = strpos($string,$end,$ini) - $ini;
                            $parsed = substr($string,$ini,$len);
                            $body2 = $parsed;
                            $body = str_replace($body2 ," " ,$body);
                            }
                        }
                    }
                    // echo $body;
        // $body = explode($attachment->file, $body);
        // $body = $body[0];
    }
    ?>
    ";
                            $end = "";                            
                            if(strpos($string,$start) == false || strpos($string,$start) == false)
                            {
                            }
                            else
                            {
                            $ini = strpos($string,$start);
                            $ini += strlen($start);
                            $len = strpos($string,$end,$ini) - $ini;
                            $parsed = substr($string,$ini,$len);
                            $body2 = $parsed;
                            $body = str_replace($body2 ," " ,$body);
                            }
    ?>
                                
                                      {{date_format($conversation->created_at, 'd/m/Y H:i:s')}}
                                    
                                    
                                            {!! $body !!}
                                    
                                    
                                 
        @endforeach