Jump to content

Order Status


Guest Ian MacMillan

Recommended Posts

Guest Ian MacMillan

I'm trying to add a "Pre Order" status to my orders.php

I added;

$la_order_preorder

$la_nav_preorder

to my English file but they will not display in my orders.php properly. When you view an order it gives you an option of "$la_order_preorder" instead of "Pre Order" and when you select it orders.php displays a status of "5" in the table instead of "Pre Order"

I believe orders.php was edited properly I just can't find my error....

Any ideas?

<?php

/***************************************************************************

*   File Info: admin/orders.php

*   Purpose:   Display Orders

*   Updated:   31/07/2003

****************************************************************************

*   Developer: Alistar Brookbanks (Brooky.com)

*   Copyright: (C)2003 http://www.brooky.com

*	Copyright: (C)2003 http://www.cubecart.com

*   This program is not "free" software and restrictions apply!

*   Further Info: http://www.cubecart.com/license.php

*   Contact [email protected] if any conditions are not clear.

*

*   Licensees holding valid "CubeCart Licence Number" may edit

*   the (powered by CubeCart) from browser title and "Powered by CubeCart"

*   and "(c) Brooky.com" from the web page footer.

*

*   This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING

*   THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR

*   PURPOSE. This and all others in the download package can only be

*	redistributed with written permission from Alistair Brookbanks!

*

*   The "CubeCart License" is available to purchase at

*   https://secure.cubecart.com/

*   For pricing please contact us via e-mail at [email protected]

***************************************************************************/

session_start();

if (!session_is_registered("admin"))

  {

    header("Location: login.php");

  }

if(session_is_registered("admin")){

include ("config.php");

include( "settings.inc.php");

$url="index";

include_once ("header.inc.php");

echo"<a href=\"print_distributororder.php\">PRINT Distributor Order</a>";

if($del==1){



$del = mysql_query("delete from ".$prefix."store_order_sum where cart_order_id  = '$order_id'");

$del = mysql_query("delete from ".$prefix."store_order_inv where cart_order_id  = '$order_id'");

echo"<br><br><p align=\"center\">$la_ord_deleted</p><br>";

}

//Wen clicked cancel order

//we re-add the quantity of stock

//order status set to 'declined'

//'cancel order' button disappears for this order

// let's go...

if($can==1){

$sql_select = mysql_query( "select * from ".$prefix."store_order_inv where cart_order_id='$order_id'");

$totalrows = mysql_num_rows($sql_select);

        while ($row = mysql_fetch_array($sql_select)){

        $product=$row["product"];

        $quantity=$row["quantity"];

$select_prod = mysql_query( "SELECT * FROM ".$prefix."store_inventory WHERE product='$product'");

$totalrows = mysql_num_rows($select_prod);

        while ($row = mysql_fetch_array($select_prod))

        $instock = $row["instock"];

        $new_ins = $instock + $quantity;

        $sql_update = "update ".$prefix."store_inventory set instock='$new_ins' where product='$product'";

        $result = mysql_query ($sql_update);

        $sql_update2 = "update ".$prefix."store_order_sum set status='4',cancel='1' where cart_order_id='$order_id'";

        $result = mysql_query ($sql_update2);

}//end while

}//end cancel order function



if ($type==1){$txtstatus="$la_order_pending";}

if ($type==2){$txtstatus="$la_order_await_ship";}

if ($type==3){$txtstatus="$la_order_shipped";}

if ($type==4){$txtstatus="$la_order_declined";}

if ($type==5){$txtstatus="$la_order_preorder";}

else{

	$all = 1;

	$txtstatus="$la_all";

	}



echo"<h2>$la_orders_title - ($txtstatus)</h2>";

if($updated==Y){

echo"<p align=\"center\">$la_ord_updated</p>";}

if($task=="order"){

	echo"<p align=\"center\"><a href=\"javascript:history.back()\">$la_ord_return_no_save</a></p>";



if($save)

	{

	mysql_query("update ".$prefix."store_order_sum set comments='$comments', tracking_no='$tracking_no', status='$status', ship_service='$ship_service', ship_date='$ship_date' where cart_order_id='$order_id'");

	echo "<p align=\"center\">$la_ord_updated</p>";



	if ($status==1){$txtstatus="$la_order_pending";}

	if ($status==2){$txtstatus="$la_order_await_ship";}

	if ($status==3){$txtstatus="$la_order_shipped";}

	if ($status==4){$txtstatus="$la_order_declined";}

	if ($status==5){$txtstatus="$la_order_preorder";}

	if ($ship_service==1){$txtshipservice="$la_service_1";}

	if ($ship_service==2){$txtshipservice="$la_service_2";}

	if ($ship_service==3){$txtshipservice="$la_service_3";}

if ($ship_service==4){$txtshipservice="$la_service_4";}



	// send email about status change to customer

	$subject = "$la_ord_status_tit - $order_id";

	$message = "$la_ord_status_email '$txtstatus'$la_ord_status_email2\r\n\n";

	if ($status==3){$message .="$la_shipped_txta $txtshipservice.  $la_shipped_txtb $tracking_no";}



	if(!empty($staff_comments)){

	$message .= "$la_staff_comments_mail\n";

	$message .= "~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n$staff_comments\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";}

	$message .= "\n\n$la_account_ending\n\n\n$site_business\n$site_url";

	if($inform_customer=="Y"){

	mail($email, $subject, $message, "From: $site_email");}





	}



// view order content

// find all order records from database

$sql_select = mysql_query( "select * from ".$prefix."store_order_sum where cart_order_id='$order_id'");

$totalrows = mysql_num_rows($sql_select);



if(empty($order_id)){echo"<br><br><p align=\"center\">$la_orders_acident</p>";}



if($totalrows==0){echo"<br><br><p align=\"center\">$la_order_no_exist</p>";}

if($totalrows!==0){

	while ($row = mysql_fetch_array($sql_select)){



 	 $order_id=$row["cart_order_id"];

 	 $status=$row["status"];

 	 $time=$row["time"];

           $year=substr($row["date"],0,2);

            $month=substr($row["date"],2,2);

            $day=substr($row["date"],4,2);

            $prod_total=$row["prod_total"];

 	 $name_d=$row["name_d"];

 	 $add_1_d=$row["add_1_d"];

 	 $add_2_d=$row["add_2_d"];

 	 $town_d=$row["town_d"];

 	 $county_d=$row["county_d"];

 	 $postcode_d=$row["postcode_d"];

 	 $country_d=$row["country_d"];

 	 $name=$row["name"];

 	 $email=$row["email"];

 	 $add_1=$row["add_1"];

 	 $add_2=$row["add_2"];

 	 $town=$row["town"];

 	 $county=$row["county"];

 	 $postcode=$row["postcode"];

 	 $country=$row["country"];

 	 $phone=$row["phone"];

 	 $total_tax=$row["total_tax"];

 	 $total_ship=$row["total_ship"];

 	 $prod_total=$row["prod_total"];

 	 $subtotal=$row["subtotal"];

 	 $ip=$row["ip"];

 	 $sec_order_id=$row["sec_order_id"];

 	 $ship_date=$row["ship_date"];

 	 $comments=$row["comments"];

 	 $gateway=$row["gateway"];

 	 $ship_service=$row["ship_service"];

$tracking_no=$row["tracking_no"];

 	 $customer_comments=$row["customer_comments"];

            $customer_comments = stripslashes($customer_comments);

 	 if(empty($customer_comments)){

 	 $customer_comments = $la_cust_no_coms;}





            }// end while

 	 if($date_style=="0")

    {

 	 $date="$month/$day/$year";}

 	 // EU date format

 	 if($date_style=="1")

    {

 	 $date="$day/$month/$year";}





 	 if ($status==1){$txtstatus="$la_order_pending";$pay_status="$la_order_wait_conf";}

 	 if ($status==2){$txtstatus="$la_order_await_ship";$pay_status="$la_order_confirmed";}

 	 if ($status==3){$txtstatus="$la_order_shipped";$pay_status="$la_order_confirmed";}

 	 if ($status==4){$txtstatus="$la_order_declined";$pay_status="$la_order_notrecieved";}

 	 if ($status==5){$txtstatus="$la_order_preorder";$pay_status="$la_order_preorder";}



 	 echo"<br><br><table align=\"center\" bgcolor=\"$colour_1\" valign=\"top\" width=\"90%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

   	 <tr bgcolor=\"$colour_2\"><td>

   	 <table cellpadding=\"2\" cellspacing=\"1\" valign=\"top\" width=\"100%\" align=\"center\">

      <tr bgcolor=\"$colour_1\" height=\"20\">

     	 <td background=\"../images/bevel_bg.gif\" colspan=\"2\"><b>$la_your_orders_no - $order_id</b></td>";



 	 echo"<tr bgcolor=\"$colour_1\">

            <td valign=\"top\" width=\"33%\" align=\"left\"><b>$la_dispatch_add</b><br>$name_d<br>$add_1_d<br>";if(!empty($add_2_d)){echo"$add_2_d<br>";}echo"$town_d<br>$county_d<br>$postcode_d<br>$country_d<br><br><b>$la_status</b><br>$txtstatus<br><br><b>$la_order_recieved</b><br>$date $la_at $time<br><br><b>$la_order_ip</b><br>";

 	 if($ip!==$la_search_na) // makes sure theres no n/a as ip if english

    {

    echo"<a href=\"http://www.nic.com/cgi-bin/whois.cgi?query=$ip\" target=\"_blank\">$ip</a>";

    }

    if($ip==$la_search_na) // makes sure theres no n/a as ip if english

    {

    echo"$ip";

    }

    echo"</td>

            <td valign=\"top\" align=\"left\">";



 	 echo"<table width=\"100%\" bgcolor=\"$colour_1\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

   	 <tr>

      <td valign=\"top\" align=\"left\"><b>$la_items_ordered</b><br><br></td>

         <td valign=\"top\" width=\"100\" align=\"left\"><b>$la_store_price</b><br><br></td>

   	 </tr>";

        // select order items

   	 $sql_select = mysql_query( "select * from ".$prefix."store_order_inv where cart_order_id='$order_id'");

                    $totalrows = mysql_num_rows($sql_select);



   	 while ($row = mysql_fetch_array($sql_select)){



   	 $title=$row["title"];

   	 $quantity=$row["quantity"];

   	 $price=$row["price"];

   	 $product=$row["product"];



   	 $totalprice=$price*$quantity;

   	 $product_options=$row["product_options"];

   	 $title = stripslashes($title);

   	 $totalprice = number_format($totalprice, 2);

   	 $price = number_format($price, 2);

   	 echo"<tr>

      <td valign=\"top\" align=\"left\"><li><a href=\"../view_product.php?product=$product\" target=\"_self\">$title</a> ($la_quantity $quantity) [$la_inv_prod_id = $product]</li><br>";

      if(!empty($product_options)){

      $product_options = nl2br($product_options);

      $product_options = stripslashes($product_options);

      echo"<ol>$product_options</ol>";}

      echo"<br><br></td>

      <td valign=\"top\" align=\"right\">

      <table align=\"right\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

    <tr>

   	 <td align=\"left\" width=\"100\">$currency$totalprice</td>

    </tr>

    </table></td>

   	 </tr>";

   	 }// end while





 	 echo"</table></td></tr>";



	echo"</table></tr></td></table>";



	//payment info



	echo"<br><br><table align=\"center\" bgcolor=\"$colour_1\" valign=\"top\" width=\"90%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

   	 <tr bgcolor=\"$colour_2\"><td>

   	 <table cellpadding=\"2\" cellspacing=\"1\" valign=\"top\" width=\"100%\" align=\"center\">

      <tr bgcolor=\"$colour_1\" height=\"20\">

     	 <td background=\"../images/bevel_bg.gif\" colspan=\"2\"><b>$la_payment_info</b></td>";



 	 echo"<tr bgcolor=\"$colour_1\">

            <td valign=\"top\" width=\"33%\" align=\"left\"><b>$la_order_inv_add</b><br>$name<br>$add_1<br>";if(!empty($add_2)){echo"$add_2<br>";}echo"$town<br>$county<br>$postcode<br>$country<br>$la_cust_phone: $phone<br><br><b>$la_pay_method</b><br>$gateway<b><br><br>$la_view_orders_payment</b><br> $pay_status</td>

            <td valign=\"top\" align=\"right\">

 	 <table align=\"right\" bgcolor=\"$colour_1\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

    <tr>

   	 <td><b>$la_view_orders_items_sub</b></td>

   	 <td width=\"100\">$currency$subtotal</td>

    </tr>

    <tr>

      <td><b>$la_order_bask_pap&nbsp;&nbsp;</b></td>

      <td width=\"100\">$currency$total_ship</td>

    </tr>

    <tr>

       <td><b>$la_order_bask_tax ($site_tax%):</b></td>

       <td width=\"100\">$currency$total_tax</td>

     </tr>

     <tr>

       <td></td>

       <td width=\"100\">---------------</td>

     </tr>

     <tr>

       <td><b>$la_view_orders_grand_tot</b></td>

      <td width=\"100\"><b>$currency$prod_total</b></td>

   	 <tr>

       <td></td>

       <td width=\"100\">---------------</td>

     </tr>

     </tr>

    </table><br>



    </td></tr>

    <tr><td bgcolor=\"$colour_1\" colspan=\"2\" align=\"left\" valign=\"top\"><b>$la_view_cust_comms</b><br><br>\"$customer_comments\"</td></tr>";



	echo"</table></tr></td></table><br><br>";



    echo"<form method=\"post\" name=\"orders\" action=\"orders.php?task=order&order_id=$order_id&save=yes&email=$email\">

    <table width=\"60%\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

    <tr>

      <td valign=\"top\"><b>$la_shipping_date</b><br>";

	if($date_style=="0")

    {

 	 echo"(MM/DD/YYYY)";}

 	 // EU date format

 	 if($date_style=="1")

    {

 	 echo"(DD/MM/YYYY)";}

	echo"</td>

      <td><input type=\"text\" name=\"ship_date\" class=\"textbox\" value=\"$ship_date\"><input type=\"checkbox\" name=\"shippedtoday\" value=\"Y\" onClick=\"javascript:setToToday();\">$la_ship_today<br><br></td>

    </tr>

	<tr>

      <td><b>$la_ord_mod_status</b></td>

      <td><select name=\"status\" >

        <option value=\"1\"";if($status==1){echo "selected";}echo">$la_ord_await_pay_conf</option>

  <option value=\"2\"";if($status==2){echo "selected";}echo">$la_ord_pay_conf</option>

  <option value=\"3\"";if($status==3){echo "selected";}echo">$la_ord_shipped</option>

  <option value=\"4\"";if($status==4){echo "selected";}echo">$la_ord_decl</option>

  <option value=\"5\"";if($status==5){echo "selected";}echo">$la_ord_preorder</option>

  </select><br><br></td>

    </tr>

    <tr>

      <td><b>$la_postal_service:</b></td>

      <td><select name=\"ship_service\" >

      <option value=\"1\"";if($ship_service==1){echo "selected";}echo">$la_service_1</option>

	<option value=\"2\"";if($ship_service==2){echo "selected";}echo">$la_service_2</option>

	<option value=\"3\"";if($ship_service==3){echo "selected";}echo">$la_service_3</option>

	<option value=\"4\"";if($ship_service==4){echo "selected";}echo">$la_service_4</option>

	</select><br><br></td>

     </tr>

	<tr>

      <td><b>$la_tracking_number:</b></td>

      <td><input type=\"text\" name=\"tracking_no\" class=\"textbox\" value=\"$tracking_no\"><br><br></td>

    </tr>

    <tr>

      <td valign=\"top\">$la_ord_comments</td>

      <td><textarea name=\"comments\" cols=\"50\" rows=\"4\" value=\"$comments\">$comments</textarea><br><br></td>

    </tr>

	<tr>

      <td valign=\"top\">$la_inform_customer</td>

      <td><input name=\"inform_customer\" type=\"checkbox\" id=\"inform_customer\" value=\"Y\" checked><br><br></td>

    </tr>

	<tr>

      <td valign=\"top\">$la_staff_comments</td>

      <td><textarea name=\"staff_comments\" cols=\"50\" rows=\"4\" value=\"$comments\"></textarea><br><br></td>

    </tr>

    <tr>

      <td>&nbsp;</td>

      <td>

   <input type=\"submit\" class=\"submit\" value=\"$la_save\"><input type=\"button\" class=\"submit\" name=\"note\" value=\"$la_ord_save_print\" onClick=\"MM_openBrWindow('print_order.php?order_id=$order_id','image','width=600,height=400,scrollbars=yes,resizable=yes')\"></td>

    </tr>

  </table>

";



}//end if no rows

echo"<br><p align=\"center\"><a href=\"javascript:history.back()\">$la_ord_return_no_save</a></p><br><br>";

}// end order content



// default page content

if($task!=="order"){

if($all !==1){$where ="where status='$type'";}

$sql_count = "select * from ".$prefix."store_order_sum $where";

$result_count = mysql_query ($sql_count);

$total = mysql_num_rows($result_count);



if ($total==0){

	echo "<p align=\"center\">$la_curr_no_ords - ($txtstatus)</p>";



	include ("footer.inc.php");

	exit;}

if (empty($ddlimit)){$ddlimit=25;}

echo "<p>$la_ord_total_orders $total</p>";

echo"<form action=\"orders.php?type=$type\" method=\"post\"><table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr align=\"right\"><input type=\"hidden\" value=\"$searchStr\" name=\"searchStr\">

    <td align=\"right\">$la_cust_view <select name=\"ddlimit\" >

	<option value=\"5\" ";if($ddlimit==5){echo "selected";}echo">5</option>

	<option value=\"10\" ";if($ddlimit==10){echo "selected";}echo">10</option>

	<option value=\"25\" ";if($ddlimit==25){echo "selected";}echo">25</option>

	<option value=\"50\" ";if($ddlimit==50){echo "selected";}echo">50</option>

	<option value=\"100\" ";if($ddlimit==100){echo "selected";}echo">100</option>

</select> $la_cust_res_per_page <input type=\"submit\" class=\"submit\" value=\"$la_go\"></div></form></td>

</form><form action=\"orders.php?search=yes&ddlimit=$ddlimit&type=$type\" method=\"post\"><tr><td align=\"right\">$la_ord_order_id <input type=\"text\" class=\"textbox\" name=\"searchStr\">&nbsp;<input type=\"submit\" class=\"submit\" value=\"$la_search_ex\"></td>

</tr></table></form>";

// set limit value for number of records to be shown per page

// query database to find total number of records to display

$limit = $ddlimit;

$searchStr = str_replace(" ", "",$searchStr);



if(!empty($type)){

$query_count = " SELECT * FROM ".$prefix."store_order_sum where status=$type and (cart_order_id like '%$searchStr%')";}



else{

$query_count = " SELECT * FROM ".$prefix."store_order_sum where(cart_order_id like '%$searchStr%')";}



$result_count = mysql_query($query_count);

$totalrows = mysql_num_rows($result_count);

if(empty($page))

$page = 1;

$limitvalue = $page * $limit - ($limit);



if(!empty($type)){

if($search!=="yes"){

$query = "SELECT * FROM ".$prefix."store_order_sum where status=$type order by date desc LIMIT $limitvalue, $limit";}

if($search=="yes"){

$query = "SELECT * FROM ".$prefix."store_order_sum where status=$type and (cart_order_id like '%$searchStr%') order by date desc LIMIT $limitvalue, $limit";}}



else{

if($search!=="yes"){

$query = "SELECT * FROM ".$prefix."store_order_sum order by date desc LIMIT $limitvalue, $limit";}

if($search=="yes"){

$query = "SELECT * FROM ".$prefix."store_order_sum where (cart_order_id like '%$searchStr%') order by date desc LIMIT $limitvalue, $limit";}}



$result = mysql_query($query) or die("Error: " . mysql_error());

$count_result = mysql_num_rows($result);



if((mysql_num_rows($result) == 0)){

if($search!=="yes"){

echo("<p align=\"center\"><br>$la_ord_no_orders_ap</p><br>"); }

if($search=="yes"){

echo("<p align=\"center\"><br>$la_no_ord_match \"<b>$searchStr</b>\"!<br><br><a href=\"orders.php?type=$type\" target=\"_self\">$la_cust_reset</a></p>"); }}



if((mysql_num_rows($result) > 0)){



if($search=="yes"){

echo("<p align=\"center\"><br>$la_orders_match \"<b>$searchStr</b>\"!</p><br>"); }}



// Display links at the bottom to indicate current page and number of pages displayed

$numofpages = ceil($totalrows / $limit);

$from=$limit*$page-$limit+1;

$to=$from + $count_result-1;

echo "<table align=\"center\" width=\"90%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

            <tr><td width=\"50%\" bgcolor=\"$bg_colour\" align=\"left\">";if($numofpages>1){echo"$la_store_showing $from - $to</td><td width=\"50%\" bgcolor=\"$bg_colour\" align=\"right\"><b>$la_store_go_to_page</b> ($numofpages) ";}



$upper_limit = $page + 3;

$lower_limit = $page - 2;



if($page != 1){

$pageprev = $page - 1;

echo("<a href=\"$PHP_SELF?page=1&ddlimit=$ddlimit&searchStr=$searchStr&type=$type\">$la_store_prev</a>&nbsp;");

}



$lower_dots = $page - $lowerlimit;



if($lower_dots > 3){

echo("...");}



for($i = 1; $i <= $numofpages; $i++){

if($numofpages>1){



if($i == $page){

echo("&nbsp;<b>[".$i."]</b>&nbsp;");}

if(($i != $page)&&($i < $upper_limit)&&($i >= $lower_limit)){

echo("&nbsp;<a href=\"$PHP_SELF?page=$i&ddlimit=$ddlimit&searchStr=$searchStr&type=$type\">$i</a>&nbsp;");}

}}



$upper_dots = $numofpages - 2;



if($page < $upper_dots){

echo("...&nbsp;");}



if(($totalrows - ($limit * $page)) > 0){

$pagenext = $page + 1;

echo("&nbsp;<a href=\"$PHP_SELF?page=$pagenext&ddlimit=$ddlimit&searchStr=$searchStr&type=$type\">$la_store_next</a>");

}



echo"</tr></td></table><br>";

if($count_result>0){

echo"<table align=\"center\" bgcolor=\"$colour_1\" width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

            <tr><td bgcolor=\"$colour_2\">

<table cellpadding=\"2\" cellspacing=\"1\" width=\"100%\" align=\"center\">

   <tr bgcolor=\"$colour_1\" align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\">

   <td align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\" nowrap><b>$la_your_orders_no</b></td>

   <td align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\" nowrap><b>$la_your_orders_status</b></td>

   <td align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\" nowrap><b>$la_your_orders_time</b></td>

   <td align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\" nowrap><b>$la_customer_sing</b></td>

   <td align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\" nowrap><b>$la_ord_ip_cus</b></td>

   <td align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\" nowrap><b>$la_order_total</b></td>

   <td align=\"center\" height=\"20\" background=\"../images/bevel_bg.gif\" nowrap><b>$la_doc_action</b></td>

   </tr>";}

$bgcolour=$colour_3;

while($row = mysql_fetch_array($result)){



 	 $order_id=$row["cart_order_id"];

 	 $status=$row["status"];

 	 $email=$row["email"];

 	 $time=$row["time"];

           $year=substr($row["date"],0,2);

            $month=substr($row["date"],2,2);

            $day=substr($row["date"],4,2);

            $prod_total=$row["prod_total"];

            $tracking_no=$row["tracking_no"];

$ship_service=$row["ship_service"];

 	 $gateway=$row["gateway"];

 	 $ip=$row["ip"];

 	 // US date format



 	 if($date_style=="1")

    {

 	 $date="$month/$day/$year";}

 	 // EU date format

 	 if($date_style=="0")

    {

 	 $date="$day/$month/$year";}



 	 if ($bgcolour ==$colour_3){

    $bgcolour =$colour_4;}

  elseif ($bgcolour ==$colour_4){

    $bgcolour =$colour_3;}



      if ($status==1){$status="$la_ord_qed";}

 	 if ($status==2){$status="$la_ord_incom";}

 	 if ($status==3){$status="$la_ord_comp";}

 	 if ($status==4){$status="$la_ord_dec";}

 	 if ($status==5){$status="$la_ord_pre";}



  $query = mysql_query ("select name from ".$prefix."store_customer where email='$email'");

  while ($row = mysql_fetch_array($query))

      {

  $name=$row["name"];

   }

   /////////start sec_order_id check///////////////



   $sql_select = mysql_query( "select * from ".$prefix."store_order_sum where cart_order_id='$order_id'");

   $totalrows = mysql_num_rows($sql_select);

   while ($row = mysql_fetch_array($sql_select)){

           $order_id=$row["cart_order_id"];

           $sec_order_id=$row["sec_order_id"];}

   if ($sec_order_id==""){$gateway="<font color=red><b>$la_order_incomplete</b></font>";}



/////// end sec_order_id check/////////////////

  echo"

 	 <tr bgcolor=\"$bgcolour\">

    <td align=\"center\"><a href=\"orders.php?task=order&order_id=$order_id&type=$type\" target=\"_self\">$order_id</a><br>$gateway</td>

    <td align=\"center\">$status</td>

    <td align=\"center\">$date $time</td>

    <td align=\"center\">$name<br><a href=\"mailto:$email\">$email</a></td>

    <td align=\"center\">";

    if($ip!==$la_search_na) // makes sure theres no n/a as ip if english

    {

    echo"<a href=\"http://www.nic.com/cgi-bin/whois.cgi?query=$ip\" target=\"_blank\">$ip</a>";

    }

    if($ip==$la_search_na) // makes sure theres no n/a as ip if english

    {

    echo"$ip";

    }

    echo"</td>

    <td align=\"center\">$currency$prod_total</td>

    <td align=\"center\"><a href=\"javascript:decision('$la_ord_deleted_conf',

    'orders.php?order_id=$order_id&del=1')\">$la_inv_del</a>/<a href=\"orders.php?task=order&order_id=$order_id&type=$type\" target=\"_self\">$la_cust_view</a>/<a href=\"edit_orders.php?task=order&order_id=$order_id\" target=\"_self\">EDIT</a>";



    $sql_select = mysql_query( "select * from ".$prefix."store_order_sum where cart_order_id='$order_id'");

    $totalrows = mysql_num_rows($sql_select);

    while ($row = mysql_fetch_array($sql_select)){

    $order_id=$row["cart_order_id"];

    $cancel=$row["cancel"];}

    if($cancel==0){

    echo"<a href=\"javascript:decision('$la_ord_cancel_conf',

    'orders.php?order_id=$order_id&can=1')\">/$la_order_cancelled</a>";}

    echo"</td></tr>";

/////// end cancel orders button

}

echo"</table></td></tr></table><br>";

// Display links at the bottom to indicate current page and number of pages displayed

echo "<table align=\"center\" width=\"90%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">

            <tr><td width=\"50%\" bgcolor=\"$bg_colour\" align=\"left\">";if($numofpages>1){echo"$la_store_showing $from - $to</td><td width=\"50%\" bgcolor=\"$bg_colour\" align=\"right\"><b>$la_store_go_to_page</b> ($numofpages) ";}



$upper_limit = $page + 3;

$lower_limit = $page - 2;



if($page != 1){

$pageprev = $page - 1;

echo("<a href=\"$PHP_SELF?page=1&ddlimit=$ddlimit&searchStr=$searchStr&type=$type\">$la_store_prev</a>&nbsp;");

}



$lower_dots = $page - $lowerlimit;



if($lower_dots > 3){

echo("...");}



for($i = 1; $i <= $numofpages; $i++){

if($numofpages>1){



if($i == $page){

echo("&nbsp;<b>[".$i."]</b>&nbsp;");}

if(($i != $page)&&($i < $upper_limit)&&($i >= $lower_limit)){

echo("&nbsp;<a href=\"$PHP_SELF?page=$i&ddlimit=$ddlimit&searchStr=$searchStr&type=$type\">$i</a>&nbsp;");}

}}



$upper_dots = $numofpages - 2;



if($page < $upper_dots){

echo("...&nbsp;");}



if(($totalrows - ($limit * $page)) > 0){

$pagenext = $page + 1;

echo("&nbsp;<a href=\"$PHP_SELF?page=$pagenext&ddlimit=$ddlimit&searchStr=$searchStr&type=$type\">$la_store_next</a>");

}



mysql_free_result($result);

echo"<br><br></tr></td></table>";





}// end if task !==order

include_once ("footer.inc.php");

} // end if session is registered

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...