$smarty->assign('to', $_POST['to']); $smarty->assign('weight', $_POST['weight']); $smarty->assign('proceed', $proceed); } } else { echo "COMPLETE INFORMATION NECCESSARY"; } } if (isset($_POST['payNow'])) { $order = new orders(); $order->add($_SESSION['userid'], $_POST['from'], $_POST['to'], $_POST['weight'], 0); echo "thankyou"; } if (isset($_POST['POD'])) { echo "thankyou"; $order = new orders(); $order->add($_SESSION['userid'], $_POST['from'], $_POST['to'], $_POST['weight'], 1); } $route = new routes(); $allRoutes = $route->getAll(); $smarty->assign('allRoutes', $allRoutes); $smarty->display('neworder.tpl'); //include neworder template $smarty->display('footer.tpl'); //include footer file } else { header('Location:' . URL . 'notauthorised.php'); } } else { header('Location:' . URL . 'noaccess.php'); }