Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Allowed memory size of ...
#3

[eluser]paynterc[/eluser]
From the controller:
if(isset($_POST['form'])){

$data_qry['query'] = $this->db_model->getSearchResults($_POST['form']);
}else{
$data_qry['query'] = null;

}



$data_exp['headerexport'] = "Content-Disposition: attachment; filename=\"Shipments_".time().".xls\"";
$this->load->view("exportheader",$data_exp);
$this->load->view($_SESSION['shipsearch']['r_view'],$data_qry);


From model:

<?php
class DB_model extends Model {

function DB_model()
{
parent::Model();

}

function getSearchResults ($criteria)
{


$sumt="summary_table";



$this->db->select('*');



if($criteria['startdate']!='' && $criteria['enddate']!=''){
$datecrit=array($sumt . '.billingdate >=' => date("Y-m-d",strtotime($criteria['startdate'])), $sumt.'.billingdate <=' => date("Y-m-d",strtotime($criteria['enddate'])));
$this->db->where($datecrit);
}elseif($criteria['startdate']!=''){
$datecrit=array($sumt . '.billingdate >=' => date("Y-m-d",strtotime($criteria['startdate'])));
$this->db->where($datecrit);
}

if($criteria['org']!=''){
$orgcrit=array('org'=>$criteria['org']);
$this->db->where($salesorgcrit);
}





$query = $this->db->get($sumt);
$str = $this->db->last_query();
//echo "<br>" . $str . "<p>";
if ($query->num_rows() > 0) {
return $query;
} else {
return null;
}


}

}


?&gt;



From the view:
<center>
<table border="0" class="bigger_table">
<tr>
<td class="gray_dark_bgcolor center">

<table border="0" width="100%">

<tr class="blue_dark_bgcolor">
<td align="left" width=100><font size="-2">Cust#</font></td>
<td align="left"><font size="-2">Cust Name</font></td>
<td align="left"><font size="-2">PO#</font></td>
<td align="left"><font size="-2">ORG#</font></td>

</tr>


&lt;?php
if($query){
$i=1;
foreach($query->result() as $myrow1b){
($i % 2) ? $tableclass = "gray_lite_bgcolor_row" : $tableclass = "blue_med_bgcolor_row";
?&gt;
<tr class="&lt;?= $tableclass ?&gt;">
<td align="left">&lt;?= $myrow1b->custnumber ?&gt;</td>
<td align="left">&lt;?= $myrow1b->custname ?&gt;</td>
<td align="left">&lt;?= $myrow1b->ponumber ?&gt;</td>
<td align="left">&lt;?= $myrow1b->org ?&gt;</td>
</tr>
&lt;?php
$i++;
}
}
?&gt;
</table>
</td>
</tr>
</table>
</center>


Messages In This Thread
Fatal error: Allowed memory size of ... - by El Forum - 03-25-2008, 12:57 PM
Fatal error: Allowed memory size of ... - by El Forum - 03-25-2008, 01:10 PM
Fatal error: Allowed memory size of ... - by El Forum - 03-25-2008, 02:09 PM
Fatal error: Allowed memory size of ... - by El Forum - 03-25-2008, 02:33 PM
Fatal error: Allowed memory size of ... - by El Forum - 03-26-2008, 09:54 AM
Fatal error: Allowed memory size of ... - by El Forum - 03-26-2008, 10:00 AM
Fatal error: Allowed memory size of ... - by El Forum - 03-26-2008, 12:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB