I'am having problem on how and where i would put my codes in codeigniter. I was new in Php/CI and I was having a hard time with mvc form. I want to put my data's (vaccination record brand) in cookies so that i could store it temporary. I have tried to set my cookies and i got blank result but the data's were inserting in my database. I think i have problem with my controller's code.
my controller's code :
function vaccs($id) {
$data['title'] = $this->main_title.' | Vaccination';
$data['jslibraries'] = $this->inc_files->data_tables_scripts();
$data['uid'] = $id;
$data['employee'] = $this->vaccination_model->get_employee($id);
$data['vaccine'] = $this->vaccination_model->get_vaccinationrecord($id,0);
$data['vaccine1'] = $this->vaccination_model->get_vaccinationrecord($id,1);
$this->load->view('vaccs',$data);
}
my view's code:
<?php
if (isset($_COOKIE['vaccine'])) {
setcookie('vaccine',$vaccine);
foreach ($_COOKIE[$vaccine] as $vaccine){ ?>
<div class="control-group">
<label class="control-label">
<?php echo ' '.'<a href="javascript:void(0);" rel="tooltip"
title="Delete" onclick="delete_vaccination('.$vaccine->vaccination_record_id.');"><i class="icon-minus-sign"></i></a>'.'';?><?php echo $vaccine->vaccination_record_brand;?>
</label>
</div>
Thank you for any help.