' . INPUT_DATA . ''; echo '
'; if ($dbmake) { $db = NewADOConnection($dbtype); $dbh = $db->Connect($dbhost, $dbuname, $dbpass); if (!$dbh) { $dbpass = ""; die("$dbtype://$dbuname:$dbpass@$dbhost failed to connect" . $db->ErrorMsg()); } $dict = NewDataDictionary($db); $sqlarray = $dict->CreateDatabase($dbname); $dict->ExecuteSQLArray($sqlarray); } oosDBInit($dbhost, $dbuname, $dbpass, $dbname, $dbtype); if (!$prefix_table == '') $prefix_table = $prefix_table . '_'; include('newtables.php'); echo '
'; } /** * This function inserts the default data on new installs */ function oosInputData($gender, $firstname, $name, $pwd, $repeatpwd, $email, $phone, $prefix_table, $update) { global $currentlang, $db, $update; echo '' . INPUT_DATA . ''; echo '
'; if (!$prefix_table == '') $prefix_table = $prefix_table . '_'; // Put basic information in first $today = date("Y-m-d H:i:s"); require('newdata.php'); $owp_pwd = oos_encrypt_password($pwd); include_once 'newconfigdata.php'; $admin_groups_id = '1'; $sql = "INSERT INTO ". $prefix_table . "admin (admin_groups_id, admin_gender, admin_firstname, admin_lastname, admin_email_address, admin_telephone, admin_password, admin_created) VALUES (" . $db->qstr($admin_groups_id) . ',' . $db->qstr($gender) . ',' . $db->qstr($firstname) . ',' . $db->qstr($name) . ',' . $db->qstr($email) . ',' . $db->qstr($phone) . ',' . $db->qstr($owp_pwd) . ',' . $db->DBTimeStamp($today) . ")"; $result = $db->Execute($sql); if ($result === false) { echo '
' . $db->ErrorMsg() . NOTMADE . ''; } else { echo '
' . $prefix_table . 'admin '. UPDATED . ''; } $login = '1'; $status = '1'; $max_order = '800'; $default_address = '1'; $logs = 0; $sTime = time(); $wishlist_link_id = ''; for ($x=3;$x<10;$x++) { $wishlist_link_id .= substr($sTime,$x,1) . oos_create_random_value(1, $type = 'chars'); } $sql = "INSERT INTO ". $prefix_table . "customers (customers_gender, customers_firstname, customers_lastname, customers_email_address, customers_telephone, customers_status, customers_login, customers_max_order, customers_password, customers_wishlist_link_id, customers_default_address_id) VALUES (" . $db->qstr($gender) . ',' . $db->qstr($firstname) . ',' . $db->qstr($name) . ',' . $db->qstr($email) . ',' . $db->qstr($phone) . ',' . $db->qstr($status) . ',' . $db->qstr($login) . ',' . $db->qstr($max_order) . ',' . $db->qstr($owp_pwd) . ',' . $db->qstr($wishlist_link_id) . ',' . $db->qstr($default_address) . ")"; $result = $db->Execute($sql); if ($result === false) { echo '
' . $db->ErrorMsg() . NOTMADE . ''; } else { echo '
' . $prefix_table . 'customers '. UPDATED . ''; } $customer_id = $db->Insert_ID(); $book_id = 1; $country = 81; $sql = "INSERT INTO ". $prefix_table . "address_book (customers_id, address_book_id, entry_firstname, entry_lastname, entry_country_id) VALUES (" . $db->qstr($customer_id) . ',' . $db->qstr($book_id) . ',' . $db->qstr($firstname) . ',' . $db->qstr($name) . ',' . $db->qstr($country) . ")"; $result = $db->Execute($sql); if ($result === false) { echo '
' . $db->ErrorMsg() . NOTMADE . ''; } else { echo '
' . $prefix_table . 'address_book '. UPDATED . ''; } $sql = "INSERT INTO ". $prefix_table . "customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) VALUES (" . $db->qstr($customer_id) . ',' . $db->qstr($logs) . ',' . $db->DBTimeStamp($today) . ")"; $result = $db->Execute($sql); if ($result === false) { echo '
' . $db->ErrorMsg() . NOTMADE . ''; } else { echo '
' . $prefix_table . 'customers_info '. UPDATED . ''; } echo '
'; }