# PHP-Nuke



## oldcelt (Jan 28, 2008)

The website seems to work but I've tried to join the forum - never got a confirmation. Tried to contact the originator, again with no result. Does anybody know if this project has been abandoned? I wanted to use it in conjunction with PHP-Multishop but that also seems to be defunct!


----------



## NegativeKelvin (Apr 12, 2012)

Perhaps it got to your Spam folder? Try a different email provider, I've had experiences with certain email providers not letting certain emails through.


----------



## oldcelt (Jan 28, 2008)

britishcommando2 said:


> Perhaps it got to your Spam folder? Try a different email provider, I've had experiences with certain email providers not letting certain emails through.


not that simple I'm afraid; wish it were. thanks for the suggestion anyway.


----------



## JiminSA (Dec 15, 2011)

I see that upon registration (which I have just done) they say they will send a confirmation email within the next 24 hours.
I'll let you know what transpires ...


----------



## JiminSA (Dec 15, 2011)

I had no problem registering an subsequently confirming. I definitely don't see that this project is not active - I just downloaded it. I would try registering again, suspecting that there may have been a comms glitch.


----------



## oldcelt (Jan 28, 2008)

Thanks; Il give it another go.


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> I had no problem registering an subsequently confirming. I definitely don't see that this project is not active - I just downloaded it. I would try registering again, suspecting that there may have been a comms glitch.


Weird. I never received the email for confirmation but now I find I can log in using the name and password I chose! 

However, I can now try to find some answers. Thanks for the help.


----------



## oldcelt (Jan 28, 2008)

OK, I've been able to log in but every forum is locked and it's impossible to post any messages!


----------



## JiminSA (Dec 15, 2011)

.. I never found the link to any forums on my visit, just a community page - which continent did you select?


----------



## oldcelt (Jan 28, 2008)

JiminSA said:


> .. I never found the link to any forums on my visit, just a community page - which continent did you select?


Are we looking at the same forum I wonder?
Chris Karakas is the originator of PHP-Nuke and it's his forum I've been trying to access at:-
http://www.karakas-online.de/forum/phpnuke.html
I see that there is a community forum for the application so I'll try that at http://phpnuke-ie.net/
There's no UK option unfortunately and Eire seems to be the only English language version.


----------



## JiminSA (Dec 15, 2011)

I visited the above link and see that the forum has been locked. So unless it unlocks on registration, it's not active. But as you say you might get some feedback from the Irish community link in the nuke site ...
Can I suggest that if you have php questions arising from your use of the nuke scripts, you ask them on this forum - we have plenty of experienced advisers on board ...


----------



## oldcelt (Jan 28, 2008)

Thanks. I suspect that the originator of PHP-Nuke has retired and I wonder whether it's worth pursuing the project which is the combination of PHP-Multishop and Nuke. It's a combination which enables a kind of on-line shopping mall where each individual store owner can manage the content and overall control is in the hands of the main administrator.


----------



## JiminSA (Dec 15, 2011)

I thought maybe you were going to use the site to facilitate a learning curve in php, not knowing your current level of understanding. In your position I would opt to make my own shopping cart (it's not rocket science and is fairly straight forward combining php with a little javascript).
I will happily post a cart that I have written to give you an idea of how it works


----------



## oldcelt (Jan 28, 2008)

I'm actually looking to create a 'mall', not just a single ecommerce store. I've used osCommerce as my core unit in the past but I've been looking for an add-on to extend it so I can administer the backend - i.e. control all financial aspects, control shop owners access, monitor sales, monitor shipping performance, etc. However, still enable individual shop owners to administer their products, prices, shipping charges, etc. but without access to the other shop owners' sites.

I really appreciate your offer and would be interested to see the code you've suggested anyway. Again, many thanks.


----------



## JiminSA (Dec 15, 2011)

What I've done has been for one "store" environments, but to extend it to "multiple" is no big deal. You can see one of the sites here
To facilitate the Content Management I have used one of our member's (thruska) free CMS facility which you can find here in conjunction with mySQL databases and of course php.
Below is the php page for the first link above, which should give you the gist of what is going on and below that is my index page for the CMS in the second link - have fun and post back any ensuing questions

```
<?php
session_start();
include "functions.php";
OpenDatabase();

if(isset($_GET['change']))
{
	$change = $_GET['change'];
}
else
{
// $_SESSION VARIABLES SET UP
	$_SESSION['cost1'] = "";
	$_SESSION['cost1k'] = "";
	$_SESSION['cost2'] = "";
	$_SESSION['cost2k'] = "";
	$_SESSION['cost3'] = "";
	$_SESSION['cost3k'] = "";
	$_SESSION['cost4'] = "";
	$_SESSION['cost4k'] = "";
	$_SESSION['postupto1'] = "";
	$_SESSION['postupto5'] = "";
	$_SESSION['postupto20'] = "";
	$_SESSION['CSupto4'] = "";
	$_SESSION['CSupto8'] = "";

	$SQL = "SELECT * FROM products ORDER BY pid ASC";

	$result = mysql_query($SQL);

	$i = 1;
	while ($row = mysql_fetch_array($result) ) 
	{
		$var = "cost" . $i;
		$vark = "cost" . $i . "k";
		if(strpos($row['unit'],"gms") == true) 
		{
			switch ($row['pid']) {
				case 1;
					$_SESSION['cost1'] = $row['cpu'];
					break;
				case 3;
					$_SESSION['cost2'] = $row['cpu'];
					break;
				case 5;
					$_SESSION['cost3'] = $row['cpu'];
					break;
				case 7;
					$_SESSION['cost4'] = $row['cpu'];
					break;
			}
		}
		if(strpos($row['unit'],"Kg") == true) 
		{
			switch ($row['pid']) {
				case 2;
					$_SESSION['cost1k'] = $row['cpu'];
					break;
				case 4;
					$_SESSION['cost2k'] = $row['cpu'];
					break;
				case 6;
					$_SESSION['cost3k'] = $row['cpu'];
					break;
				case 8;
					$_SESSION['cost4k'] = $row['cpu'];
					break;
				case 9;
					$_SESSION['cost5'] = $row['cpu'];
					break;
			}
			$i++;
		}
	}

	$SQL = "SELECT * FROM postage ORDER BY id ASC";

	$result = mysql_query($SQL);

	while ($row = mysql_fetch_array($result) ) 
	{
		if($row['unit_wt'] == 1000) $_SESSION['upto1k'] = $row['cost'];
		if($row['unit_wt'] == 5000) $_SESSION['upto5k'] = $row['cost'];
		if($row['unit_wt'] == 20000) $_SESSION['upto20k'] = $row['cost'];
		if($row['unit_wt'] == "b5000") $_SESSION['bupto5k'] = $row['cost'];
		if($row['unit_wt'] == "b20000") $_SESSION['bupto20k'] = $row['cost'];
		if($row['unit_wt'] == "s5000") $_SESSION['supto5k'] = $row['cost'];
		if($row['unit_wt'] == "s10000") $_SESSION['supto10k'] = $row['cost'];
		if($row['unit_wt'] == "sb5000") $_SESSION['sbupto5k'] = $row['cost'];
		if($row['unit_wt'] == "sb10000") $_SESSION['sbupto10k'] = $row['cost'];
	}

	$_SESSION["address"] = false;
	$_SESSION['confirmed'] = false;
	$_SESSION['qty1'] = 0;
	$_SESSION['qty1k'] = 0;
	$_SESSION['qty2'] = 0;
	$_SESSION['qty2k'] = 0;
	$_SESSION['qty3'] = 0;
	$_SESSION['qty3k'] = 0;
	$_SESSION['blevel'] = "";
	$_SESSION['qty4'] = 0;
	$_SESSION['qty4k'] = 0;
	$_SESSION['qty5'] = 0;
	$_SESSION['sum'] = 0;
	$_SESSION["Payment_Amount"] = 0;
	$_SESSION["ordno"] = 0;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Homepage - Pete's Biltong - Lincolnshire U.K. - Online Purveyors of Boerewors and Biltong - Buy our products using PayPal

	



		[CENTER]
		[URL=index.php][IMG]images/header.png[/IMG][/URL]
		[/CENTER]

			[URL=JavaScript:Popup('contact.html');]Contact Us[/URL]

				[CENTER][IMG alt="all about biltong!"]images/tab1.png[/IMG][/CENTER]

						[IMG]images/cartoon.png[/IMG]

[B][SIZE=15]Biltong - [I]Wikipedia Definition[/I][/SIZE][/B]
 - Biltong is a kind of cured meat that originated in South Africa. Many different types of meat are used to produce it, ranging from beef through game meats to fillets of ostrich from commercial farms. It is typically made from raw fillets of meat cut into strips following the grain of the muscle, or flat pieces sliced across the grain. It is similar to beef jerky in that they are both spiced, dried meats, but differ in their typical ingredients, taste and production processes; in particular the main difference from jerky is that biltong is usually thicker (from cuts up to 1" (25 mm) thick), while jerky is rarely more than 1/8" (3 mm) thick and biltong does not have a sweet taste.
The word biltong is from the Dutch bil ("rump") and tong ("strip" or "tongue").

[B][SIZE=15][I]Origins[/I][/SIZE][/B]

The Dutch settlers who arrived in southern Africa in the 17th century brought recipes for dried meat from Europe. Preparation involved applying vinegar, then rubbing the strips of meat with a mix of herbs, salts and spices. The need for preservation in the new colony was pressing. Building up herds of livestock took a long time. There was native game about but it could take hunters days to track and kill a large animal such as an eland and they were then faced with the problem of preserving a large mass of meat in a short time in a hot climate during a period of history before iceboxes had been invented. Desiccation solved the problem. Biltong as it is today evolved from the dried meat carried by the wagon-travelling Voortrekkers, who needed stocks of durable food as they migrated from the Cape Colony north-eastward (away from British rule) into the interior of Southern Africa during the Great Trek. The raw meat was preserved from decay and insects within a day or two and within a fortnight would be black and rock-hard, having been fully cured.

[B][SIZE=15][I]Meat[/I][/SIZE][/B]

							[IMG]images/biltong-sliced.png[/IMG]

Prior to the introduction of refrigeration, the curing process was used to preserve all kinds of meat in South Africa. However today biltong is most commonly made from beef, primarily due to its widespread availability and lower cost relative to game. For the finest cuts, fillet, sirloin or steaks cut from the hip such as topside or silverside. Other cuts can be used, but are not as high in quality.
							Biltong can also be made from:
							Chicken, simply referred to as 'chicken biltong'
							Fish in this case, known as bokkoms (shark biltong can also be found in South Africa).
							Game such as kudu and springbok
							Ostrich meat (bright red, often resembling game)
							Bokkoms should not be confused with other cured fish such as dried angelfish and dried snoek (snook).

[B][SIZE=15][I]Drying[/I][/SIZE][/B]

It is typically dried outside (rural settings), cardboard or wooden boxes (urban) or climate-controlled dry rooms (commercial).

							[IMG]images/BiltongStokkies.png[/IMG]

Biltong can also be made in colder climates by using an electric lamp to dry the meat, but care must be taken to ventilate, as mold can begin to form on the meat.
							A traditional slow dry will deliver a medium cure in about 4 days.
							An electric fan-assisted oven set to 40-70 °C (100-160 °F), with the door open a fraction to let out moist air, can dry the meat in approximately 4 hours. Although slow dried meat is considered by some to taste better, oven dried is ready to eat a day or two after preparation.

				[CENTER][IMG alt="all about boerewors!"]images/tab3.png[/IMG][/CENTER]

						[IMG]images/BoerieBraai.png[/IMG]

[B][SIZE=15]Boerewors - [I]Wikipedia Definition[/I][/SIZE][/B]
 - Boerewors is based on an older traditional Dutch sausage called the verse worst, though it differs somewhat in its ingredients. Boerewors is made from coarsely minced beef (sometimes combined with minced pork, lamb, or both) and spices (usually toasted coriander seed, black pepper, nutmeg, cloves and allspice). Like many other forms of sausage, boerewors contains a high proportion of fat, and is preserved with salt and vinegar, and packed in sausage casings. Traditional boerewors is usually formed into a continuous spiral. It is often served with pap (traditional South African porridge / polenta made from mielie-meal). Boerewors is also very common throughout South Africa, as well as with expatriate communities in countries such as Australia, the Netherlands, the United Kingdom, the United States, and Ireland.

				[CENTER][IMG alt="our products!"]images/tab2.png[/IMG][/CENTER]

				[URL][/URL]

[B][SIZE=15][I][U]Our Products and Pricing[/U][/I][/SIZE][/B]

						If you want to buy in bulk, please [URL=JavaScript:Popup('contact.html');][I]Contact Pete directly[/I][/URL]...
						If you are from Overseas and want to make an ad hoc payment on an existing Order please click [URL=adhoc.php][I]here[/I][/URL]
						If you have an existing Order you want to make a payment on please click [URL=existing.php][I]here[/I][/URL]
						Ordered so far ...

								[URL=javascript:void(0);][IMG]images/BB1.png[/IMG][/URL]
[B][SIZE=15][I]"Bites"[/I][/SIZE][/B]

£2.85 per 75gm pkt or £38.00 per 1Kg.

								

									[I]Order Quantity[/I]  
									" onclick="select()"/>  
									[I]Order Quantity(1Kg)[/I]  
									" onclick="select()"/>
									">
									">
									">
									">
									">
									">
									">
									">
									">

								

								[URL=javascript:void(0);][IMG]images/Biltong.png[/IMG][/URL]
[B][SIZE=15][I]"Stix"[/I][/SIZE][/B]

£3.40 per 100gm pkt or £32.00 per 1Kg.

								

									[I]Order Quantity(100gm)[/I]  
									" onclick="select()"/>
									[I]Order Quantity(1Kg)[/I]  
									" onclick="select()"/>
									">
									">
									">
									">
									">
									">
									">
									">
									">

								

								[URL=javascript:void(0);][IMG]images/cb1.png[/IMG][/URL]
[B][SIZE=15][I]"Chilli Stix"[/I][/SIZE][/B]

£2.85 per 75gm pkt or £38.00 per 1Kg.

								

									[I]Order Quantity(75gm)[/I]  
									" onclick="select()"/> 
									[I]Order Quantity(1Kg)[/I]  
									" onclick="select()"/>
									[I]Degree of Bite![/I]

<?php
echo "Blevel " . $_SESSION['blevel'];
if(isset($_SESSION['blevel']))
{
	$blevel = $_SESSION['blevel'];
}
else
{
	$blevel = "Hot or Mild?";
}
echo "Blevel " . $blevel;

?>
									Mild
										Hot
									 [I](default "Mild")[/I]
									">
									">
									">
									">
									">
									">
									">
									">
									">

								

								[URL=javascript:void(0);][IMG]images/Chicken.png[/IMG][/URL]
[B][SIZE=15][I]"Chicken Stix"[/I][/SIZE][/B]

£2.85 per 75gm pkt or £38.00 per 1Kg

								

									[I]Order Quantity(75gm)[/I]  
									" onclick="select()"/>
									[I]Order Quantity(1Kg)[/I]  
									" onclick="select()"/>
									">
									">
									">
									">
									">
									">
									">
									">
									">

								

 								[URL=javascript:void(0);][IMG]images/boerewors.png[/IMG][/URL]
[B][SIZE=15][I]"Country Style Boerewors"[/I][/SIZE][/B]

£8.75 per 1Kg

								

									[I]Order Quantity(1Kg)[/I]  
									" onclick="select()"/>
									">
									">
									">
									">
									">
									">
									">
									">
									">

								

					[CENTER]    [IMG]images/B_Roll.png[/IMG][/CENTER]
					[URL=billing_summary.php][IMG]images/checkout.png[/IMG][/URL]

[URL=clear.php]Reset[/URL]

		 

	[CENTER][URL=http://bespoke-webwork.com]
[B][SIZE=14]Design by Bespoke Webwork ©2013[/SIZE][/B]
[/URL][/CENTER]
```


```
<?php
	// Admin Pack.
	// (C) 2012 CubicleSoft.  All Rights Reserved.

	// This small package exists to make it easy to design quick-n-dirty administrative backends that look good.
	// This file is well-commented.  When republishing based on this work, copyrights must remain intact.

	require_once "support/str_basics.php";
	require_once "support/page_basics.php";

	ProcessAllInput();

	// $bb_randpage is used in combination with a user token to prevent hackers from sending malicious URLs.
	$bb_randpage = "8106a9fef96db74d6252c27fab510266ca715ef3acdbf104840f785a15c4";
	$bb_rootname = "Pete's Biltong | Content Management";
	date_default_timezone_set('GMT');

	require_once "base.php";

	$allowedpasswords = array(
		"pete",
		"jim"
	);
	// Login screen.
	session_start();
	// Login
	if (!isset($_SESSION["pwd"]) || !in_array($_SESSION["pwd"], $allowedpasswords))
	{
		if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "login")
		{
			if (!in_array($_REQUEST["pass"], $allowedpasswords))  BB_SetPageMessage("error", "Invalid password.");

			if (BB_GetPageMessageType() != "error")
			{
				$_SESSION["pwd"] = $_REQUEST["pass"];

				header("Location: " . BB_GetFullRequestURLBase());
				exit();
			}
		}

		$menuopts = array();
		$contentopts = array(
			"desc" => "You must login to continue.",
			"nonce" => "action",
			"hidden" => array(
				"action" => "login"
			),
			"fields" => array(
				array(
					"title" => "Your Password",
					"type" => "password",
					"name" => "pass",
					"width" => "200px",
					"value" => BB_GetValue("pass", "")
				),
			),
			"submit" => "Login",
			"focus" => true
		);

		BB_GeneratePage("Login", $menuopts, $contentopts);
		exit();
	}

	// Session security (sort of).
	$bb_usertoken = $secret . $_SESSION["pwd"];

	BB_ProcessPageToken("action");

	// Menu/Navigation options.
	$menuopts = array(
		"PETE's BILTONG" => array(
			"Manage Orders" => BB_GetRequestURLBase() . "?action=manage_orders&sec_t=" . BB_CreateSecurityToken("manage_orders"),
			"Pending Orders" => BB_GetRequestURLBase() . "?action=unpaid_orders&sec_t=" . BB_CreateSecurityToken("unpaid_orders"),
			"Orders Outside U.K." => BB_GetRequestURLBase() . "?action=outside_orders&sec_t=" . BB_CreateSecurityToken("outside_orders"),
			"Logout" => BB_GetRequestURLBase() . "?action=logout&sec_t=" . BB_CreateSecurityToken("logout"),
		)
	);

	// Example mobile switcher.
	if (isset($_COOKIE["bb_layout"]) && $_COOKIE["bb_layout"] == "mobile")
	{
		require_once "support/mobile_layout.php";
		$menuopts["Switch To"] = array(
			"Main Layout" => BB_GetRequestURLBase() . "?action=bb_setlayout&layout=&sec_t=" . BB_CreateSecurityToken("bb_setlayout")
		);
	}
	else
	{
		$menuopts["Switch To"] = array(
			"Mobile Layout" => BB_GetRequestURLBase() . "?action=bb_setlayout&layout=mobile&sec_t=" . BB_CreateSecurityToken("bb_setlayout")
		);
	}

//******* ORDERS

	if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "manage_orders")
	{

		$desc = "";

		$rows = array();

		OpenDatabase();

		$tbl_name="`orders`";		// table name

		$query = "SELECT * FROM $tbl_name ORDER BY id ASC";

		$result = mysql_query($query) or die(mysql_error());;

		$bucket = 0;

		$rows = array();

		while($row = mysql_fetch_array($result))
		{
			$format = ("D d M Y H:i");
			$timestamp = $row["date_time"];
			if (is_numeric($timestamp))
			{
				$date_time = date($format, $row["date_time"]);
			}
			else
			{
				$row["date_time"] = strtotime($timestamp);
				$date_time = date($format, $row["date_time"]);
			}

			$country = $row['country'];
			$outside = true;
			if($country == 'England') $outside = false;
			if($country == 'Ireland') $outside = false;
			if($country == 'Scotland') $outside = false;
			if($country == 'Wales') $outside = false;

			if($row['payment_made'] == "") $row['payment_made'] = "No";
			if($outside) if($row['ad_hoc_paid'] == "") $row['ad_hoc_paid'] = "No";
			$display_ov = str_pad($row['order_value'], 6, "____________", STR_PAD_LEFT);
			$display_dp = "";
			if(!$outside) $display_dp = str_pad($row['DPtot'], 5, "____________", STR_PAD_LEFT);
			$display_ah = "";
			if($outside) $display_ah = str_pad($row['ad_hoc'], 6, "____________", STR_PAD_LEFT);
			$rows[] = array( htmlspecialchars_decode($date_time, ENT_QUOTES), htmlspecialchars_decode($row["ordno"], ENT_QUOTES), htmlspecialchars_decode($row["rname"], ENT_QUOTES), htmlspecialchars_decode($row["country"], ENT_QUOTES), htmlspecialchars_decode($display_ov, ENT_QUOTES), htmlspecialchars_decode($display_dp, ENT_QUOTES), htmlspecialchars_decode($row["payment_made"], ENT_QUOTES), htmlspecialchars_decode($display_ah, ENT_QUOTES), htmlspecialchars_decode($row["ad_hoc_paid"], ENT_QUOTES), " [URL]EDIT <img src=\"spanner.jpg\" align=\"top\" title=\"Entry Edit/Print\">[/URL] | [URL] DELETE <img src=\"delete.jpg\" align=\"top\" title=\"Delete Entry\">[/URL]");
		}

		$contentopts = array(

			"desc" => "Maintain Order Records in the System.",
			"nonce" => "action",
			"hidden" => array(
				"action" => ""
			),
			"fields" => array(
				"startrow",
				array(
					"title" => "--------------------------------------------------------------------------------------------------- Delivery Outside the U.K.",
					"type" => "label",
					"name" => "desclabel",
				),
				"endrow",
				"startrow",
				array(
					"type" => "table",
					"cols" => array("Date", "Order No.", "Recipient", "Country", "Nett", "Del.", "Paid?", "Ad Hoc", "Del paid?", "Options"),
					"rows" => $rows
				),
				"endrow",
			),
		);

		BB_GeneratePage("Manage order Records", $menuopts, $contentopts);
		echo "

		";
	}

	else if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "delete_order_entry")

	{
		if (isset($_REQUEST["id"]))
		{
			$id = $_REQUEST["id"];

			OpenDatabase();

			Delete_Order_Rec($id);

			BB_RedirectPage("success", "Successfully deleted the orders entry.", array("action=manage_orders&sec_t=" . BB_CreateSecurityToken("manage_orders")));

		}

	}

	else if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "edit_order_entry")

	{
		if (isset($_REQUEST["id"]))
		{
			$id = $_REQUEST["id"];

			$row = array();

			OpenDatabase();

			GetOrderRec($id);

			$row = mysql_fetch_array($result) or die(mysql_error());;

			$display_nett = str_pad($row["order_value"], 7, "_", STR_PAD_LEFT);
			$display_dp = str_pad($row["DPtot"], 7, "_", STR_PAD_LEFT);
			$display_ah = str_pad($row["ad_hoc"], 7, "_", STR_PAD_LEFT);

			if (isset($_REQUEST["rname"]))
			{
				if ($_REQUEST["rname"] == "")  BB_SetPageMessage("error", "You left out the required field 'Recipient'");
				else if ($_REQUEST["email"] == "")  BB_SetPageMessage("error", "You left out the required field 'email Address'");
				else if ($_REQUEST["street1"] == "")  BB_SetPageMessage("error", "You left out the required field 'Address Line 1'");
				else if ($_REQUEST["street2"] == "")  BB_SetPageMessage("error", "You left out the required field 'Address Line 2'");
				else if ($_REQUEST["city_town"] == "")  BB_SetPageMessage("error", "You left out the required field 'City/Town'");
				else if ($_REQUEST["county"] == "")  BB_SetPageMessage("error", "You left out the required field 'County'");
				else if ($_REQUEST["postcode"] == "")  BB_SetPageMessage("error", "You left out the required field 'Postcode'");
				else if ($_REQUEST["country"] == "")  BB_SetPageMessage("error", "You left out the required field 'Country'");
				else if ($_REQUEST["city_town"] == "")  BB_SetPageMessage("error", "You left out the required field 'City/Town'");

				if (BB_GetPageMessageType() != "error")
				{
					OpenDatabase();
					$row['rname'] = $_REQUEST['rname'];
					$row['email'] = $_REQUEST['email'];
					$row['street1'] = $_REQUEST['street1'];
					$row['street2'] = $_REQUEST['street2'];
					$row['city_town'] = $_REQUEST['city_town'];
					$row['county'] = $_REQUEST['county'];
					$row['postcode'] = $_REQUEST['postcode'];
					$row['country'] = $_REQUEST['country'];
					$row['qty1'] = $_REQUEST['qty1'];
					$row['qty2'] = $_REQUEST['qty2'];
					$row['qty3'] = $_REQUEST['qty3'];
					$row['qty4'] = $_REQUEST['qty4'];
					$row['qty1k'] = $_REQUEST['qty1k'];
					$row['qty2k'] = $_REQUEST['qty2k'];
					$row['qty3k'] = $_REQUEST['qty3k'];
					$row['qty4k'] = $_REQUEST['qty4k'];
					$row['Blevel'] = $_REQUEST['Blevel'];
					$row['qty5'] = $_REQUEST['qty5'];
					$row['value1'] = $_REQUEST['value1'];
					$row['value1k'] = $_REQUEST['value1k'];
					$row['value2'] = $_REQUEST['value2'];
					$row['value2k'] = $_REQUEST['value2k'];
					$row['value3'] = $_REQUEST['value3'];
					$row['value3k'] = $_REQUEST['value3k'];
					$row['value4'] = $_REQUEST['value4'];
					$row['value4k'] = $_REQUEST['value4k'];
					$row['value5'] = $_REQUEST['value5'];

					$row['ad_hoc'] = number_format($_REQUEST['ad_hoc'], 2);

					UpdateSaveOrders($row, $id);

					BB_RedirectPage("success", "Successfully edited the Order entry.", array("action=manage_orders&sec_t=" . BB_CreateSecurityToken("manage_orders")));
				}
				else
				{
					BB_RedirectPage("error", "Order Entry Edit Unsuccessful! - ", array("action=manage_orders&sec_t=" . BB_CreateSecurityToken("manage_orders")));
				}
			}

			$format = ("D d M Y H:i");
			$timestamp = $row["date_time"];
			if (is_numeric($timestamp))
			{
				$date_time = date($format, $row["date_time"]);
			}
			else
			{
				$row["date_time"] = strtotime($timestamp);
				$date_time = date($format, $row["date_time"]);
			}

			$contentopts = array(
				"desc" => "Edit Order entry in the system.",
				"nonce" => "action",
				"hidden" => array(
					"action" => "edit_order_entry",
					"id" => $_REQUEST["id"]
				),
				"fields" => array(
					"startrow",
					array(
						"title" => "EDIT EXISTING TRANSACTION --------->",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "Order Date",
						"type" => "static",
						"name" => "date_time",
						"width" => "150px",
						"value" => BB_GetValue("date_time",  $date_time),
					),
					array(
						"title" => "Order. No.",
						"type" => "static",
						"name" => "ordno",
						"width" => "60px",
						"value" => BB_GetValue("ordno",  $row['ordno']),
					),
					array(
						"title" => "Nett. Value",
						"type" => "static",
						"name" => "order_value",
						"width" => "50px",
						"value" => BB_GetValue("order_value",  htmlspecialchars_decode($display_nett, ENT_QUOTES)),
						"desc" => "excl. Del."
					),
					array(
						"title" => "Paid?",
						"type" => "static",
						"name" => "payment_made",
						"width" => "25px",
						"value" => BB_GetValue("payment_made",  $row['payment_made']),
					),
					array(
						"title" => "Delivery",
						"type" => "static",
						"name" => "DPtot",
						"width" => "50px",
						"value" => BB_GetValue("DPtot",  htmlspecialchars_decode($display_dp, ENT_QUOTES)),
						"desc" => ""
					),
					array(
						"title" => "Country",
						"type" => "static",
						"name" => "country",
						"width" => "100px",
						"value" => BB_GetValue("country",  $row['country']),
					),
					array(
						"title" => "Ad Hoc Del.",
						"type" => "text",
						"name" => "ad_hoc",
						"width" => "50px",
						"value" => BB_GetValue("ad_hoc", htmlspecialchars_decode($display_ah, ENT_QUOTES)),
					),
					array(
						"title" => "Paid",
						"type" => "static",
						"name" => "ad_hoc_paid",
						"width" => "25px",
						"value" => BB_GetValue("ad_hoc_paid", $row['ad_hoc_paid']),
					),
					"endrow",
					"startrow",
					array(
						"title" => "SHIPPING DETAILS --------->",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "Recipent",
						"type" => "text",
						"name" => "rname",
						"width" => "120px",
						"value" => BB_GetValue("rname",  htmlspecialchars_decode($row['rname'], ENT_QUOTES)),
					),
					array(
						"title" => "email Address",
						"type" => "text",
						"name" => "email",
						"width" => "200px",
						"value" => BB_GetValue("email",  htmlspecialchars_decode($row['email'], ENT_QUOTES)),
					),
					array(
						"title" => "Phone No.",
						"type" => "text",
						"name" => "phone",
						"width" => "100px",
						"value" => BB_GetValue("phone",  htmlspecialchars_decode($row['phone'], ENT_QUOTES)),
						"desc" => "If obtained ...",
					),
					"endrow",
					"startrow",
					array(
						"title" => "Address Line 1",
						"type" => "text",
						"name" => "street1",
						"width" => "300px",
						"value" => BB_GetValue("street1",  htmlspecialchars_decode($row['street1'], ENT_QUOTES)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "Address Line 2",
						"type" => "text",
						"name" => "street2",
						"width" => "300px",
						"value" => BB_GetValue("street2",  htmlspecialchars_decode($row['street2'], ENT_QUOTES)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "City/Town",
						"type" => "text",
						"name" => "city_town",
						"width" => "300px",
						"value" => BB_GetValue("city_town",  htmlspecialchars_decode($row['city_town'], ENT_QUOTES)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "County",
						"type" => "text",
						"name" => "county",
						"width" => "300px",
						"value" => BB_GetValue("county",  htmlspecialchars_decode($row['county'], ENT_QUOTES)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "Postcode",
						"type" => "text",
						"name" => "postcode",
						"width" => "100px",
						"value" => BB_GetValue("postcode",  htmlspecialchars_decode($row['postcode'], ENT_QUOTES)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "Country",
						"type" => "text",
						"name" => "country",
						"width" => "300px",
						"value" => BB_GetValue("country",  htmlspecialchars_decode($row['country'], ENT_QUOTES)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "ORDER DETAILS --------->",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "Bites",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "75gms",
						"type" => "text",
						"name" => "qty1",
						"width" => "20px",
						"value" => BB_GetValue("qty1",  htmlspecialchars_decode($row['qty1'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value1",
						"width" => "50px",
						"value" => BB_GetValue("value1",  str_pad(htmlspecialchars_decode($row['value1'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					array(
						"title" => "1Kg",
						"type" => "text",
						"name" => "qty1k",
						"width" => "20px",
						"value" => BB_GetValue("qty1k",  htmlspecialchars_decode($row['qty1k'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value1k",
						"width" => "50px",
						"value" => BB_GetValue("value1k",  str_pad(htmlspecialchars_decode($row['value1k'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "Stix",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "100gm",
						"type" => "text",
						"name" => "qty2",
						"width" => "20px",
						"value" => BB_GetValue("qty2",  htmlspecialchars_decode($row['qty2'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value2",
						"width" => "50px",
						"value" => BB_GetValue("value2",  str_pad(htmlspecialchars_decode($row['value2'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					array(
						"title" => "1Kg",
						"type" => "text",
						"name" => "qty2k",
						"width" => "20px",
						"value" => BB_GetValue("qty2k",  htmlspecialchars_decode($row['qty2k'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value2k",
						"width" => "50px",
						"value" => BB_GetValue("value2k",  str_pad(htmlspecialchars_decode($row['value2k'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "Chilli Stix",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "75gms",
						"type" => "text",
						"name" => "qty3",
						"width" => "20px",
						"value" => BB_GetValue("qty3",  htmlspecialchars_decode($row['qty3'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value3",
						"width" => "50px",
						"value" => BB_GetValue("value3",  str_pad(htmlspecialchars_decode($row['value3'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					array(
						"title" => "1Kg",
						"type" => "text",
						"name" => "qty3k",
						"width" => "20px",
						"value" => BB_GetValue("qty3k",  htmlspecialchars_decode($row['qty3k'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value3k",
						"width" => "50px",
						"value" => BB_GetValue("value3k",  str_pad(htmlspecialchars_decode($row['value3k'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					array(
						"title" => "Bite Level",
						"type" => "select",
						"name" => "Blevel",
						"options" => array("Mild" => "Mild", "Hot" => "Hot", ),
						"width" => "60px",
						"select" => BB_GetValue("Blevel",  $row['Blevel']),
					),
					"endrow",
					"startrow",
					array(
						"title" => "Chicken Stix",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "75gm",
						"type" => "text",
						"name" => "qty4",
						"width" => "20px",
						"value" => BB_GetValue("qty4",  htmlspecialchars_decode($row['qty4'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value4",
						"width" => "50px",
						"value" => BB_GetValue("value4",  str_pad(htmlspecialchars_decode($row['value4'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					array(
						"title" => "1Kg",
						"type" => "text",
						"name" => "qty4k",
						"width" => "20px",
						"value" => BB_GetValue("qty4k",  htmlspecialchars_decode($row['qty4k'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value4k",
						"width" => "50px",
						"value" => BB_GetValue("value4k",  str_pad(htmlspecialchars_decode($row['value4k'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					"endrow",
					"startrow",
					array(
						"title" => "Country Style Boerewors",
						"type" => "label",
						"name" => "desclabel",
					),
					"endrow",
					"startrow",
					array(
						"title" => "1 Kilo",
						"type" => "text",
						"name" => "qty5",
						"width" => "20px",
						"value" => BB_GetValue("qty5",  htmlspecialchars_decode($row['qty5'], ENT_QUOTES)),
					),
					array(
						"title" => "Value",
						"type" => "text",
						"name" => "value5",
						"width" => "50px",
						"value" => BB_GetValue("value5",  str_pad(htmlspecialchars_decode($row['value5'], ENT_QUOTES), 7, "_", STR_PAD_LEFT)),
					),
					"endrow",
					"startrow",
				),
				"submit" => "Save Edit",
				"focus" => false
			);

			BB_GeneratePage("Edit Order Entry", $menuopts, $contentopts);

			echo "

			";
		}
	}

//******* Pending ORDERS

	else if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "unpaid_orders")

	{

		$desc = "";

		$rows = array();

		OpenDatabase();

		$tbl_name="`orders`";		// table name

		$query = "SELECT * FROM $tbl_name WHERE payment_made = '' ORDER BY id ASC";

		$result = mysql_query($query) or die(mysql_error());;

		$bucket = 0;

		$rows = array();

		while($row = mysql_fetch_array($result))
		{
			$format = ("D d M Y H:i");
			$timestamp = $row["date_time"];
			if (is_numeric($timestamp))
			{
				$date_time = date($format, $row["date_time"]);
			}
			else
			{
				$row["date_time"] = strtotime($timestamp);
				$date_time = date($format, $row["date_time"]);
			}

			$country = $row['country'];
			$outside = true;
			if($country == 'England') $outside = false;
			if($country == 'Ireland') $outside = false;
			if($country == 'Scotland') $outside = false;
			if($country == 'Wales') $outside = false;

			if($row['payment_made'] == "") $row['payment_made'] = "No";
			if($outside) if($row['ad_hoc_paid'] == "") $row['ad_hoc_paid'] = "No";
			$display_ov = str_pad($row['order_value'], 6, "____________", STR_PAD_LEFT);
			$display_dp = "";
			if(!$outside) $display_dp = str_pad($row['DPtot'], 5, "____________", STR_PAD_LEFT);
			$display_ah = "";
			if($outside) $display_ah = str_pad($row['ad_hoc'], 6, "____________", STR_PAD_LEFT);
			$rows[] = array( htmlspecialchars_decode($date_time, ENT_QUOTES), htmlspecialchars_decode($row["ordno"], ENT_QUOTES), htmlspecialchars_decode($row["rname"], ENT_QUOTES), htmlspecialchars_decode($row["country"], ENT_QUOTES), htmlspecialchars_decode($display_ov, ENT_QUOTES), htmlspecialchars_decode($display_dp, ENT_QUOTES), htmlspecialchars_decode($row["payment_made"], ENT_QUOTES), htmlspecialchars_decode($display_ah, ENT_QUOTES), htmlspecialchars_decode($row["ad_hoc_paid"], ENT_QUOTES), " [URL]EDIT <img src=\"spanner.jpg\" align=\"top\" title=\"Entry Edit/Print\">[/URL] | [URL] DELETE <img src=\"delete.jpg\" align=\"top\" title=\"Delete Entry\">[/URL]");
		}

		$contentopts = array(

			"desc" => "List Pending (Unpaid) Order Records in the System.",
			"nonce" => "action",
			"hidden" => array(
				"action" => ""
			),
			"fields" => array(
				"startrow",
				array(
					"title" => "--------------------------------------------------------------------------------------------------- Delivery Outside the U.K.",
					"type" => "label",
					"name" => "desclabel",
				),
				"endrow",
				"startrow",
				array(
					"type" => "table",
					"cols" => array("Date", "Order No.", "Recipient", "Country", "Nett", "Del.", "Paid?", "Ad Hoc", "Del paid?", "Options"),
					"rows" => $rows
				),
				"endrow",
			),
		);

		BB_GeneratePage("Pending Order Records", $menuopts, $contentopts);
		echo "

		";
	}

//******* Pending ORDERS

	else if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "outside_orders")

	{

		$desc = "";

		$rows = array();

		OpenDatabase();

		$tbl_name="`orders`";		// table name

		$query = "SELECT * FROM $tbl_name WHERE outside = 'Yes' ORDER BY id ASC";

		$result = mysql_query($query) or die(mysql_error());;

		$bucket = 0;

		$rows = array();

		while($row = mysql_fetch_array($result))
		{
			$format = ("D d M Y H:i");
			$timestamp = $row["date_time"];
			if (is_numeric($timestamp))
			{
				$date_time = date($format, $row["date_time"]);
			}
			else
			{
				$row["date_time"] = strtotime($timestamp);
				$date_time = date($format, $row["date_time"]);
			}

			$country = $row['country'];
			$outside = true;
			if($country == 'England') $outside = false;
			if($country == 'Ireland') $outside = false;
			if($country == 'Scotland') $outside = false;
			if($country == 'Wales') $outside = false;

			if($row['payment_made'] == "") $row['payment_made'] = "No";
			if($outside) if($row['ad_hoc_paid'] == "") $row['ad_hoc_paid'] = "No";
			$display_ov = str_pad($row['order_value'], 6, "____________", STR_PAD_LEFT);
			$display_dp = "";
			if(!$outside) $display_dp = str_pad($row['DPtot'], 5, "____________", STR_PAD_LEFT);
			$display_ah = "";
			if($outside) $display_ah = str_pad($row['ad_hoc'], 6, "____________", STR_PAD_LEFT);
			$rows[] = array( htmlspecialchars_decode($date_time, ENT_QUOTES), htmlspecialchars_decode($row["ordno"], ENT_QUOTES), htmlspecialchars_decode($row["rname"], ENT_QUOTES), htmlspecialchars_decode($row["country"], ENT_QUOTES), htmlspecialchars_decode($display_ov, ENT_QUOTES), htmlspecialchars_decode($display_dp, ENT_QUOTES), htmlspecialchars_decode($row["payment_made"], ENT_QUOTES), htmlspecialchars_decode($display_ah, ENT_QUOTES), htmlspecialchars_decode($row["ad_hoc_paid"], ENT_QUOTES), " [URL]EDIT <img src=\"spanner.jpg\" align=\"top\" title=\"Entry Edit/Print\">[/URL] | [URL] DELETE <img src=\"delete.jpg\" align=\"top\" title=\"Delete Entry\">[/URL]");
		}

		$contentopts = array(

			"desc" => "List Outside the U.K. Order Records in the System.",
			"nonce" => "action",
			"hidden" => array(
				"action" => ""
			),
			"fields" => array(
				"startrow",
				array(
					"title" => "--------------------------------------------------------------------------------------------------- Delivery Outside the U.K.",
					"type" => "label",
					"name" => "desclabel",
				),
				"endrow",
				"startrow",
				array(
					"type" => "table",
					"cols" => array("Date", "Order No.", "Recipient", "Country", "Nett", "Del.", "Paid?", "Ad Hoc", "Del paid?", "Options"),
					"rows" => $rows
				),
				"endrow",
			),
		);

		BB_GeneratePage("Outside U.K. Order Records", $menuopts, $contentopts);
		echo "

		";
	}

	else if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "logout")

	{
		session_destroy();

		header("Location: " . BB_GetFullRequestURLBase());
	}
	else if (isset($_REQUEST["action"]) && $_REQUEST["action"] == "bb_setlayout")
	{
		SetCookieFixDomain("bb_layout", preg_replace('/[^a-z]/', "", $_REQUEST["layout"]), time() + 365 * 24 * 60 * 60);

		BB_RedirectPage("success", "Successfully switched the layout.");
	}
	else
	{
		$contentopts = array(
			"desc" => "Pick an option from the menu."
		);

		BB_GeneratePage("Home", $menuopts, $contentopts);
	}

?>
```
As you can see I use jQuery to interface with the user to a large degree in the cart process and yes it's for just one user - but it won't be to big a mission to adapt it for a multi-user, multi-database environment ...


----------



## oldcelt (Jan 28, 2008)

Thanks a million - that'll take me a while to examine in detail but it looks fascinating. Miraculously, it's mid 30s Celsius here in the UK at the mo and I'm taking a bit of time off. Too hot to work as we have no aircon here - not justified with our normal weather pattern.

Really appreciate your help.
cheers,
Ken


----------



## JiminSA (Dec 15, 2011)

Cool Ken - 'scuse the awful pun - what part of the UK are you in? My folks are in Shropshire ...


----------



## oldcelt (Jan 28, 2008)

Near - we're North Herefordshgire - Pembridge.


----------

