Welcome Guest, Not a member yet? Register   Sign In
A page displays ok on local server, and blank on live server - Please help
#1

[eluser]Cgull[/eluser]
Hello,

I have a web site where a page I am calling displays ok on my local server but on the live server I get a blank page.
View page source shows me the digit 1 on top and that's it.

Please, can someone help?

The url:
Code:
www.highlandcoffeeroastery.co.za/order/orderonline/viewUserOrders

The routes file:
Code:
$route['orderonline/([a-z]+)'] = 'order/orderonline/$1';
$route['orderonline'] = 'order/orderonline';

The function I am calling on the controller:
Code:
function viewUserOrders()
{
  if($this->tank_auth->is_logged_in()):
   $userId = $this->session->userdata('user_id');
   $this->load->model('order/orderonline_model');
   $data['orders'] = $this->orderonline_model->getUserOrders($userId);
   $data['title'] = 'My Orders';
   $data['view'] = 'order/userorders';
   $this->load->view('index_view', $data);
  else:
   $this->load->helper('form');
   redirect('auth/login');
  endif;
}

The view file:
Code:
&lt;!--<h1 class="pageTitle">My Orders</h1>--&gt;
<div>
&lt;?php
  if($orders):
?&gt;
   <table cellpadding="0" cellspacing="0" border="0" class="cart_table">
       <thead>
       <tr>
         <th>Order No</th>
          <th>Order Date</th>
          <th>Invoice No</th>
          <th>Paid</th>
          <th>Tracking No</th>
          <th></th>
        </tr>
        </thead>
   &lt;?php
   foreach($orders as $key):
    $orderId = $key['orderId'];
    $date = $key['date'];
    $invoiceNo = $key['invoice'];
    $paid = $key['paid'];
    if($paid == 1) $paid = 'Paid'; else $paid = 'Awaiting Payment';
    $trackingNo = $key['tracking'];
    
    echo "
       <tbody>
        <tr>
         <td colspan=\"6\">
          <table class=\"cart_table innerTable\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" 650px;\">
               <thead>
               <tr class=\"cart_item\" id=\"cartItem$orderId\" pointer;\">
             <td 60px;\"><div class=\"dArrow\"></div>$orderId</td>\n
             <td 90px;\">$date</td>\n
             <td 90px;\">$invoiceNo</td>\n
             <td 150px;\">$paid</td>\n
             <td 100px;\"><a >$trackingNo</a></td>\n
             <td>";
        if($paid == 'Awaiting Payment'): ?&gt;
                <a href="&lt;?php echo base_url(); ?&gt;order/orderonline/cancelOrder" class="cancel" id="&lt;?php echo $orderId; ?&gt;">Cancel Order</a>
                &lt;?php else: ?&gt;
                &nbsp;
        &lt;?php
        endif;
        echo "</td>\n
       </tr>\n
       <tr class=\"cart_spacer\"><td colspan=\"6\"></td></tr>
           </thead>
           <tbody none;\">
           <tr class=\"subHeader\">\n
            <td>Quantity</td>\n
            <td colspan=\"2\">Product</td>\n
            <td>Weight</td>\n
            <td>Grind</td>\n
            <td>Roast</td>\n
           </tr>\n";
           foreach($key['dets'] as $k):
            $product = $k['product'];
            $weight = $k['weight'];
            $grind = $k['grind'];
            $roast = $k['roast'];
            $qty = $k['qty'];
            
            echo
            "
            <tr class=\"tblContent\">\n
             <td>$qty</td>\n
             <td colspan=\"2\">$product</td>\n
             <td>$weight</td>\n
             <td>$grind</td>\n
             <td>$roast</td>\n

            </tr>\n
            ";
           endforeach;
          
       echo "  
            </tbody>
           </table>
         </td>
        </tr>
       </tbody>";
   endforeach;
   echo '</table>';
  else:
   echo "You have no orders.";
  endif;
?&gt;
</div>
<div id="dialog" title="Confirm Order Cancel">
  Are you sure you want to cancel this order?
</div>

[removed]
$("#dialog").dialog({
      modal: true,
      width: 400,
      height: 150,
      autoOpen: false
});

$(".cancel").click(function(e) {
e.preventDefault();
  var theHREF = $(this).attr("href");
var orderId = $(this).attr('id');

  $("#dialog").dialog('option', 'buttons', {
   "Confirm" : function() {
  $.ajax({
      type: 'POST',
      url: '&lt;?php echo base_url(); ?&gt;order/orderonline/cancelOrder',
      data: {orderId: orderId},
      success: function(data) { console.log(data);
      $('#'+orderId).hide();
      $('#cartItem' + orderId).css({'text-decoration':'line-through',"color":"red"});
      $('#cartItem' + orderId).children().css('color', 'grey');
      }
     });
  $(this).dialog("close");
      },
    "Cancel" : function() { $(this).dialog("close"); }
  });

  $("#dialog").dialog("open");

});

var a = $("table.innerTable:first").find("tr:first");
a.parents('table.innerTable') .children('tbody') .toggle();
a.closest("td").find("div").toggleClass("uArrow");

$('table.innerTable tr') .click(
function() {
  $(this) .parents('table.innerTable') .children('tbody') .toggle();
  $(this).closest("td").find("div").toggleClass("uArrow");
}
);
[removed]
#2

[eluser]Krasser[/eluser]
Did you have using gzip? try disable it.
#3

[eluser]Cgull[/eluser]
I'm sorry, what do you mean? Using gzip where?
#4

[eluser]Krasser[/eluser]
In application/config/config.php, $config['compress_output'] set to FALSE
#5

[eluser]Cgull[/eluser]
Yes, it is set to FALSE
#6

[eluser]vitoco[/eluser]
sometimes this happens when some "fatal error" occurs ( library/class/function missing, syntax problem, file not completely uploaded, etc ) and doesn't show errors. Add this code to index.php to debug.

Code:
error_reporting( E_ALL ^ E_NOTICE ) ; //

Saludos
#7

[eluser]Cgull[/eluser]
Thank you vitoco !!!!

That helped !!!

If anybody wants to know, I have added a function to the date_helper file and the model could not find it.

So I've created my own helper and that solved everything.

Halleluiah.





Theme © iAndrew 2016 - Forum software by © MyBB