1
I have a code that to generate a PDF it checks what is marked in the checkbox. But if I don’t mark anything, it still opens the PDF, only with the blank sheet. It has how to make a if
that if nothing has been marked, show an alert on the screen to the user. My code is written in Codeigniter, and in view report has the following code:
if (in_array("foto", $itens)) {
//código para mostrar a foto se está marcada a opção no checkbox
}
On my controller is:
$itens = $this->input->post('itens');
if (!empty($itens)) {
$data['itens'] = $itens;
} else {
$data['itens'] = array(null);
}
$this->load->view('ViewDoRelatorio', $data);
try to give a
die();
orexit();
before generating the code, and after the exception.– Ivan Ferrer
@Ivanferrer I put but there appeared nothing different
– Ketlin
@Ivanferrer I put your response code and it really worked, it fixed another mistake I had. I think I misexpressed myself, not exactly the mistake I was talking about. Thank you so much in the same way, with the code you sent me corrected another error that there was.
– Ketlin