function __construct() { try { parent::__construct(); } catch (mysqli_sql_exception $e) { throw $e; } }
public static function openConnection() { if (!is_resource(self::$connection)) { $properties = parse_ini_file("localhost_db_connection.ini"); extract($properties); self::$connection = mysqli_connect($host, $user, $password, $db_name); mysqli_set_charset(self::$connection, 'cp1251'); } return self::$connection; }
public function __construct() { parent::__construct(); }
public function __construct() { parent::__construct('Model\\Account'); }
function __construct() { parent::__construct($this); }
public function __construct() { parent::__construct('Model\\Owner'); }
require './userDAO.php'; session_start(); if (isset($_SESSION['abstractDAO'])) { if ($_SESSION['abstractDAO']->isAuthenticated()) { session_write_close(); header('Location:internal.php'); } } $missingFields = false; if (isset($_POST['submit'])) { if (isset($_POST['username']) && isset($_POST['password'])) { if ($_POST['username'] == "" || $_POST['password'] == "") { $missingFields = true; } else { //All fields set, fields have a value $abstractDAO = new AbstractDAO(); if (!$abstractDAO->hasDbError()) { $username = $_POST['username']; $password = $_POST['password']; $abstractDAO->authenticate($username, $password); if ($abstractDAO->isAuthenticated()) { $_SESSION['abstractDAO'] = $abstractDAO; $_SESSION['abstractDAO']->setAdminID(1); $_SESSION['abstractDAO']->setAdminLevel('Administrator'); /*Here I will add the username and password and other info to the adminuser DB and later retrieve it in internal*/ $userDAO = new userDAO(); /* $username = $_POST['username']; $password = $_POST['password']; $adminLevel = 'Administrator';*/ $userDAO->insertUser(null, $_POST['username'], $_POST['password'], 'Administrator', null); header('Location:internal.php');
* Time: 10:35 */ set_include_path("C:/wamp/www/testserver.int/imsmedia/"); include_once "parser/xml_parser/XMLParser.php"; include_once "loader/file_loader/FileLoader.php"; include_once "IMSMediaHeader.html"; $parser = new XMLParser(); $loader = new FileLoader(); $output = '<a href="/imsmedia/Import.html"><button>Back</button></a><hr>'; try { $uploadFileName = $loader->load(); $output .= "A file was imported succesfully<br>"; $content = file_get_contents($uploadFileName); $parser->parse($content); $currencies = $parser->parseCurrencies(); $measurements = $parser->parseMeasurements(); $categories = $parser->parseCategories(); $products = $parser->parseProducts(); AbstractDAO::closeConnection(); $output .= "<h2>Measurements</h2>"; $output .= nl2br($measurements); $output .= "<h2>Currencies</h2>"; $output .= nl2br($currencies); $output .= "<h2>Categories</h2>"; $output .= nl2br($categories); $output .= "<h2>Products</h2>"; $output .= nl2br($products); } catch (Exception $e) { $output .= "Upload is failed<hr>" . $e->getMessage() . " " . $e->getTraceAsString(); } echo $output;