function getDBConn($user) { if (in_array($user->get('userID'), \OnlineOrders\Config::get('demoUsers'))) { $conn = 'dbConfigDemo'; } else { $conn = 'dbConfig'; } return \OnlineOrders\Core::getInstance(\OnlineOrders\Config::get($conn)); }
public function __construct() { //$this->dbh = \OnlineOrders\Core::getInstance(Config::get('dbConfig')); $userID = isset($_SESSION[\OnlineOrders\Config::get('sessionVarName')]) ? $_SESSION[\OnlineOrders\Config::get('sessionVarName')] : ""; if (in_array($userID, Config::get('demoUsers'))) { $this->dbh = \OnlineOrders\Core::getInstance(Config::get('dbConfigDemo')); } else { $this->dbh = \OnlineOrders\Core::getInstance(Config::get('dbConfig')); } }
\t\t\t\t\t<p>Success! Your order has been submitted to our office in Little Rock.</p> \t\t\t\t\t<a href="/account/home/"><button type="button" class="btn btn-primary" id="homeBtn">Return Home</button></a> html; echo $htmlString; } catch (\SSRSReportException $serviceException) { echo $serviceException->GetErrorMessage(); } } }); /** * * @AJAX Action - Returns Unordered list of Top-Teir Product Categories * **/ $app->get('/productCategoryList/', function () use($app) { $db = \OnlineOrders\Core::getInstance(\Config::get('dbConfig')); $productCats = array(); $stmt = $db->prepare("SELECT Description, CategoryID FROM AT_ACodeCategory WHERE ShowInList = 1 ORDER BY FormOrder"); $stmt->execute(); while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { $productCats[] = $row; } echo '<ul>'; foreach ($productCats as $category) { echo '<li><a href="/webOrders/products/' . $category['CategoryID'] . '">' . $category['Description'] . '</a></li>'; } echo '</ul>'; }); /** * * @AJAX Action - Returns JSON encoded string of all ACodes in a certain category