PDF ka chakkar babu bhaiya

This commit is contained in:
Manish Verma
2021-03-15 12:59:25 +05:30
parent 9c1496ad46
commit eb11b11d37
2 changed files with 13 additions and 5 deletions

View File

@@ -498,8 +498,12 @@ class TicketController extends Controller
$ticket = Tickets::where('tickets.id', '=', $id)->first();
$html = view('themes.default1.agent.helpdesk.ticket.pdf', compact('id', 'ticket', 'tickets'))->render();
$html1 = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
return PDF::load($html1)->show();
/**
* This statement throws error with php7.1
* @see https://github.com/dompdf/dompdf/issues/1272
* For time bieng we are silencing the error using "@" operator in front of it
*/
return @PDF::load($html1)->show();
}
/**
@@ -2430,8 +2434,12 @@ class TicketController extends Controller
$ticket = Tickets::where('id', $thread->ticket_id)->first();
$html = view('themes.default1.agent.helpdesk.ticket.thread-pdf', compact('thread', 'system', 'company', 'ticket'))->render();
$html1 = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
return PDF::load($html1)->show();
/**
* This statement throws error with php7.1
* @see https://github.com/dompdf/dompdf/issues/1272
* For time bieng we are silencing the error using "@" operator in front of it
*/
return @PDF::load($html1)->show();
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}

View File

@@ -346,7 +346,7 @@ Route::group(['middleware' => ['web']], function () {
Route::patch('/internal/note/{id}', ['as' => 'Internal.note', 'uses' => 'Agent\helpdesk\TicketController@InternalNote']); /* Patch Internal Note */
Route::patch('/ticket/assign/{id}', ['as' => 'assign.ticket', 'uses' => 'Agent\helpdesk\TicketController@assign']); /* Patch Ticket assigned to whom */
Route::patch('/ticket/post/edit/{id}', ['as' => 'ticket.post.edit', 'uses' => 'Agent\helpdesk\TicketController@ticketEditPost']); /* Patchi Ticket Edit */
Route::post('/ticket/print/{id}', ['as' => 'ticket.print', 'uses' => 'Agent\helpdesk\TicketController@ticket_print']); /* Get Print Ticket */
Route::get('/ticket/print/{id}', ['as' => 'ticket.print', 'uses' => 'Agent\helpdesk\TicketController@ticket_print']); /* Get Print Ticket */
Route::post('/ticket/close/{id}', ['as' => 'ticket.close', 'uses' => 'Agent\helpdesk\TicketController@close']); /* Get Ticket Close */
Route::post('/ticket/resolve/{id}', ['as' => 'ticket.resolve', 'uses' => 'Agent\helpdesk\TicketController@resolve']); /* Get ticket Resolve */
Route::post('/ticket/open/{id}', ['as' => 'ticket.open', 'uses' => 'Agent\helpdesk\TicketController@open']); /* Get Ticket Open */