Hello guys i am making search form with voucher code.
I have done about the search with this code :
controller :
function voucher(){
$voucher = $this->input->GET('voucher');
$data['search'] = $this->Voucher_m->check_voucher($voucher);
$this->load->view('/VENDOR/'.country_code.'/Voucher',$data);
}
and this is the model :
function check_voucher($voucher){
$this->db->join("uhd_restaurant" , "uhd_voucher.restaurant_id = uhd_restaurant.restaurant_id");
$this->db->where('voucher_code',$voucher);
$query = $this->db->get('uhd_voucher');
return $query->result();
}
this is my simple view for my search code :
<?php
if($search!=NULL){
echo "voucher dapat di gunakan";
}else{
echo "vocher tidak dapat di gunakan";
} ?>
There is no problem on search form, and i can view it. The problem is, when i search the code voucher, but if the expiry date of the voucher has expired, the search form will echo "Sorry, your voucher has expired"
The expiry date of the voucher, i have set it on my database. guys can u help me how to set the expire code?
thank you