Welcome Guest, Not a member yet? Register   Sign In
"Undefined property: CI_Validation::$variable_name" ERROR
#11

[eluser]buddyram[/eluser]
Code:
....
....
//PRINTS THE TABLE HEADER PART
<?php if ($vendor) {?>
<?php if (!isset($page_navi)) $page_navi='';?>
&lt;?php if(uri_assoc('get_print',4)) if(isset($total_pendings)) echo '<br/><span>'.$this->lang->line('total_pending_payment').' : '.display_currency($total_pendings).'</span>';?&gt;
<table  class="table_style" width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
  &lt;?php if (isset($sort_links) AND $sort_links == TRUE) {?&gt;
    &lt;?php if (!isset($hide_links)) {?&gt;    <th>&lt;?php echo $this->lang->line('slno');?&gt;</th>&lt;?php }?&gt;
   <th>&lt;?php echo anchor("vendor/index/order_by/vendor_id".$page_navi, $this->lang->line('v_id'));?&gt;</th>
   <th>&lt;?php echo anchor("vendor/index/order_by/vendor_name".$page_navi, $this->lang->line('v_name'));?&gt;</th>
   <th>&lt;?php echo anchor("vendor/index/order_by/phone_no".$page_navi, $this->lang->line('phone_number'));?&gt;</th>
   <th>&lt;?php echo anchor("vendor/index/order_by/fax_no".$page_navi, $this->lang->line('fax_number'));?&gt;</th>
   <th>&lt;?php echo anchor("vendor/index/order_by/email".$page_navi, $this->lang->line('email_address'));?&gt;</th>
   <th>&lt;?php echo anchor("vendor/index/order_by/web_address".$page_navi, $this->lang->line('web_address'));?&gt;</th>
  
  
   &lt;!-- Marked out for vendor--&gt;
   &lt;!--<th class="col_balance"><php echo anchor('invoices/index/order_by/balance'.$page_navi, $this->lang->line('balance'));?&gt;</th>--&gt;
  &lt;?php } else {?&gt;
    &lt;?php if (!isset($hide_links)) {?&gt;   <th>&lt;?php echo $this->lang->line('slno');?&gt;</th>&lt;?php }?&gt;
   <th>&lt;?php echo $this->lang->line('s_date');?&gt;</th>
   <th>&lt;?php echo $this->lang->line('v_name');?&gt;</th>
   <th class="col_amount">&lt;?php echo $this->lang->line('v_id');?&gt;</th>
   &lt;!-- Marked out for vendor--&gt;
   &lt;!--<th class="col_balance"><php echo $this->lang->line('balance');?&gt;</th>--&gt;
  &lt;?php }?&gt;
       &lt;?php if (!isset($hide_links)) {?&gt;      
        <th>Payment</th>
  <th>&lt;?php echo $this->lang->line('pdf');?&gt;</th>
  <th>&lt;?php echo $this->lang->line('html');?&gt;</th>  
        &lt;?php /*?&gt;  <th align="center">&lt;?php echo $this->lang->line('view');?&gt;</th>&lt;?php */?&gt;
         <th>&lt;?php echo $this->lang->line('email');?&gt;</th>
  <th>&lt;?php echo $this->lang->line('edit');?&gt;</th>
  <th>&lt;?php echo $this->lang->line('delete');?&gt;</th>
        <th>&lt;?php echo $this->lang->line('print');?&gt;</th>
        &lt;?php }?&gt;
    </tr>

//PRINTS THE TABLE DETAILS HERE IN THE FOREACH LOOP

&lt;?php  $i=1;if(uri_assoc('page'))if(uri_assoc('page')>1)$i=((uri_assoc('page')-1)*200)+1; foreach ($vendor as $vendor1) {?&gt;
  <tr>
    &lt;?php if (!isset($hide_links)) {?&gt;    <td class="center">&lt;?php echo $i++;?&gt;</td>&lt;?php }?&gt;
   &lt;!--<td><php echo $invoice->supplied_date;?&gt;</td> //format_date($invoice->supplied_date);--&gt;
   <td>&lt;?php echo $vendor1->vendor_id;?&gt;</td> &lt;!--//format_date($invoice->supplied_date);--&gt;
   <td>&lt;?php echo $vendor1->vendor_name;?&gt;</td> &lt;!--//format_date($invoice->supplied_date);--&gt;
   <td>&lt;?php echo $vendor1->phone_no;?&gt;</td> &lt;!--//format_date($invoice->supplied_date);--&gt;
   <td>&lt;?php echo $vendor1->fax_no;?&gt;</td> &lt;!--//format_date($invoice->supplied_date);--&gt;
   <td>&lt;?php echo $vendor1->email;?&gt;</td> &lt;!--//format_date($invoice->supplied_date);--&gt;
   <td>&lt;?php echo $vendor1->web_address;?&gt;</td> &lt;!--//format_date($invoice->supplied_date);--&gt;
   &lt;!--<td><php echo anchor('clients/details/client_id/' . $invoice->client_id, $invoice->to_client_name);?&gt;</td>--&gt;
   &lt;!--<td class="col_amount"><php echo display_currency($invoice->amount_invoice);?&gt;</td>--&gt;
   &lt;!-- Marked out for vendor--&gt;
   &lt;!--<td class="col_balance"><php echo display_currency($invoice->amount_balance);?&gt;</td>--&gt;
          
            &lt;?php if (!isset($hide_links)) {?&gt;
            <td align="center">&lt;?php echo anchor('payments/form/invoice_id/' . $vendor1->vendor_id,'&nbsp;',array('class'=>"add"));?&gt;</td>
  
            <td>&lt;?php echo anchor('invoices/generate_pdf/invoice_id/' . $vendor1->vendor_id,'&nbsp;',array('class'=>"pdf",'target'=>"_blonk"));?&gt;</td>
   <td>&lt;?php echo anchor('invoices/generate_html/invoice_id/' . $vendor1->vendor_id, '&nbsp;',array('class'=>"html",'target'=>"_blonk"));?&gt;</td>

         &lt;?php /*?&gt;<td>&lt;?php echo anchor('invoices/generate_pdf/invoice_id/' . $invoice->invoice_id,'pdf','target=_blonk');?&gt; / &lt;?php echo anchor('invoices/generate_html/invoice_id/' . $invoice->invoice_id, 'html','target=_blonk');?&gt;</td>&lt;?php */?&gt;
          
   <td>&lt;?php echo anchor('invoices/send_email/form/invoice_id/' . $vendor1->vendor_id,'&nbsp;',array('class'=>"email",'target'=>"_blonk"));?&gt;</td>
   <td>&lt;?php echo anchor('vendor/form/vendor_id/' . $vendor1->vendor_id,'&nbsp;', array('class'=>'edit'));?&gt;</td>
  
   &lt;!--<td><php echo anchor('vendor/edit/vendor_id/' . $vendor1->vendor_id,'&nbsp;',array('class'=>"edit"));?&gt;</td>--&gt;
   <td>&lt;?php echo anchor('vendor/delete/vendor_id/' . $vendor1->vendor_id,'&nbsp;', array('class'=>"delete",'onclick'=>"[removed]if(!confirm('" . $this->lang->line('confirm_delete') . "')) return false"));?&gt;</td>
            
            <td>&lt;?php echo anchor('invoices/generate_print/invoice_id/' . $vendor1->vendor_id,'&nbsp;',array('class'=>"print",'onclick'=>"[removed]return get_print($vendor1->vendor_id)"));?&gt;</td>
            
             &lt;?php }?&gt;
  </tr>
&lt;?php }?&gt;

</table>
#12

[eluser]meigwilym[/eluser]
Right at the top of your view, add the following code:
Code:
&lt;?php
echo '<pre s_tyle="background:#fff;padding:12px;font-family:monospace;margin:12px;border:1px solid red;">code>';
    var_dump($vendor1);
    echo '</code></pre>';
?&gt;

This will print out what the $vendor1 object contains. Feel free to post it here if you still aren't any better off.

Mei

PS remember to remove the underscore in the style attribute of the <pre> element.
#13

[eluser]InsiteFX[/eluser]
This is not telling me anything, were are you getting this $vendor1 information from?

If it is in a model show the model were you are getting the vendor infromation!
#14

[eluser]buddyram[/eluser]
My Doubt is why it not pulling the details to vendor_edit page but working fine in the vendor_display file!


Code:
//Controller file: vendor.php

function index.php()
{
        $this->_post_handler();
        $page_navi='';
        $this->redir->set_last_index();

$vendor = $this->mdl_vendor->get(array('limit'=>200,'paginate'=>TRUE, 'page'=>uri_assoc('page'),  
  'where'=>array('vendor_id'=>uri_assoc('vendor_id')), 'order_by'=>$order_by));  
//This statement is included in many if...else  but only instance of this stmt is mentioned here

$data    =    array(
            'vendor'        =>    $vendor,
            'page_links'    =>    TRUE,
            'sort_links'    =>    TRUE,
            'page_navi'        =>    $page_navi
        );

        $this->load->view('index',    $data);  //Loading the view
}

//Models file: mdl_vendor.php

function get($params=NULL)
{
  $this->_prep_params($params);
  $this->_prep_joins();
  $query = $this->db->get($this->table_name);
  $this->_prep_pagination($params);
  if (isset($params['where'][$this->primary_key])) {
$result = $query->row();
  if ($result) {
$result->vendor = $this->get_items(array('vendor_id'=>$result->vendor_id));
  }
return $result;
}

  else {
return $query->result();
  }
}

//get_items file
function get_items($params = NULL) {
$this->db->select('*, qty * unit_price AS line_price', FALSE);
if (isset($params['vendor_id'])) {
  $this->db->where('vendor_id', $params['vendor_id']);
  }
  if (!isset($params['order_by'])) {
  $this->db->order_by('vendor_id');
  }
  $query = $this->db->get('din_vendor');
  if (isset($params['vendor_id'])) {
  return $query->row();
  }
  else {
  return $query->result();
  }
}
#15

[eluser]InsiteFX[/eluser]
Step through them one by one then remark them out!
Code:
//Models file: mdl_vendor.php

function get($params=NULL)
{
  $this->_prep_params($params);
  $this->_prep_joins();
  $query = $this->db->get($this->table_name);
  $this->_prep_pagination($params);
  if (isset($params['where'][$this->primary_key])) {
$result = $query->row();
  if ($result) {
$result->vendor = $this->get_items(array('vendor_id'=>$result->vendor_id));
  }
// add to check for values
  print_r($result);
  exit();

return $result;
}
  else {
// add to check for values
  print_r($query->result());
  exit();

return $query->result();
  }
}

//get_items file
function get_items($params = NULL) {
$this->db->select('*, qty * unit_price AS line_price', FALSE);
if (isset($params['vendor_id'])) {
  $this->db->where('vendor_id', $params['vendor_id']);
  }
  if (!isset($params['order_by'])) {
  $this->db->order_by('vendor_id');
  }
  $query = $this->db->get('din_vendor');
  if (isset($params['vendor_id'])) {
// add to check for values
  print_r($query->row());
  exit();

  return $query->row();
  }
  else {
// add to check for values
  print_r($query->row());
  exit();

  return $query->result();
  }
}
#16

[eluser]buddyram[/eluser]
thanx for your incessant support, actually i had to initialize the variables in the mdl_vendor constructor function, but i hadn't. Now am a able to pass the value for editing.

Thanx Again!!


Kindly recommend me any good book on codeignitor please




Theme © iAndrew 2016 - Forum software by © MyBB