Welcome Guest, Not a member yet? Register   Sign In
problem with passing data from model to view

the below is the _front_content_box.php which is the file from where i have given an anchor tag to show all coupons.

            <p id="coupon_list_header">Exclusiv f&uuml;r Sie</p>
             &lt;?php foreach($coupons as $coupon): ?&gt;
                <div class="coupon_container">
                    <h3 id="coupon_text_&lt;?=$coupon['coupon_id'];?&gt;" class="coupon_content">&lt;?=$coupon['name'];?&gt;
                    <br />&lt;?=$coupon['text'];?&gt;
                    <p class="coupon_valid_text">G&uuml;ltig vom  &lt;?=$coupon['from'];?&gt; bis &lt;?=$coupon['to'];?&gt;
                    <p>&lt;?=anchor('coupons/showCouponDetail/'.$coupon['coupon_id'], 'zu den Details', array('class' => 'coupon_link'));?&gt;</p>
              &lt;?php endforeach;?&gt;
              <p>&lt;?=anchor('coupons/showallcoupons','alle coupons',array('class' => 'colum_bottom_text'));?&gt;      </p>

the one below is the coupons/showallcoupons this is the controller file

function showallcoupons()
        $this-> content['title'] = "all coupons";
        $brands = $this->m_brands->selectAllOrderBy('name','ASC');
        $products = $this->m_products->selectAllOrderBy('name','ASC');
        $entries = $this->m_entries->selectAllOrderBy('name','ASC');
        $coupons = $this ->m_coupons->selectAllOrderBy('name','ASC');
        $this->content['content'] = $this->_renderFrontendOutput('home/_front_image_box.php',array('error' =>''));
        $this->content['content'] .= $this->_renderFrontendOutput('home/_front_entries_search_box.php', array('entries'=>$entries,'brands'=>$brands,'products'=>$products));
        $this->content['content'] .= $this->_renderFrontendOutput('coupons/_show_coupon_list.php',array('coupons' =>$coupons) );      

here is the model
class m_coupons extends WC_Model
    function __construct()
        $this->table = 'coupons';

this is the view file
<div id="coupons_detail_container">
     <p id="coupon_description">&lt;?=$coupons['text']?&gt;</p>
     <p id="coupon_description">&lt;?=$coupons['from']?&gt;</p>
     <p id="coupon_description">&lt;?=$coupons['to']?&gt;</p>

where text 'from' and 'to' are supposed to be database fields which i want to display. But i get an error for those feilds as undefined

i really cant understand y i am facing the problem its a simple database select code.

[eluser]Bart Mebane[/eluser]
Please post the rest of your m_coupons model code, and post the exact error message you are seeing.

i fixed that can u tell me why i get a "authorisation error" from codeigniter website when i register from my other pc?


[eluser]Bart Mebane[/eluser]
Do you have cookies disabled on your other pc?

no.. i register on other sites!! that works fine!

[eluser]Bart Mebane[/eluser]
I don't know anything about how the forum authorization works. My only guess is that you can only be logged in from one pc at one time, and you are already logged in on another computer.

Theme © iAndrew 2016 - Forum software by © MyBB