Пример #1
0
   require_once $current_dir . "/install/validator.php";
   $country_list = (require_once $current_dir . "/protected/components/CountryCode.php");
   $forms = new forms();
   $currency_list = array('AUD' => "AUD-$", 'CAD' => "CAD-$", 'CNY' => "CNY-¥", 'EUR' => "EUR-€", 'HKD' => "HKD-$", 'JPY' => "JPY-¥", 'MXN' => "MXN-$", 'USD' => "USD-$", 'NZD' => "NZD-$");
   $currency_list = array_flip($currency_list);
   ?>
 
 <?php 
   if ($_SERVER['REQUEST_METHOD'] == 'POST') {
       ?>
 <?php 
       $err = '';
       $data = $_POST;
       $req = array('website_title' => "Website title is required", 'admin_country_set' => "Country is required", 'website_address' => "Address is required", 'website_contact_phone' => "Phone is required", 'website_contact_email' => "Email is required", 'admin_currency_set' => "Currency is required", 'username' => "Username is required", 'password' => "Password is required");
       $validator = new validator();
       $validator->required($req, $data);
       if ($validator->validate()) {
           $admin_currency_set = explode("-", $data['admin_currency_set']);
           $db_con = $_SESSION['kr_install_data'];
           $table_prefix = isset($db_con['db_table_prefix']) ? $db_con['db_table_prefix'] : '';
           $table_prefix = !empty($table_prefix) ? $table_prefix : "mt_";
           require_once $current_dir . "/protected/config/table_structure.php";
           require_once $current_dir . "/install/class.MySQL.php";
           echo "<p class=\"uk-icon-chevron-right\"> Connecting to database..</p>";
           //$db = new Db( 'mysql', $db_con['db_host'], $db_con['db_name'], $db_con['db_username'],$db_con['db_pass'] );
           $db = new MySQL($db_con['db_name'], $db_con['db_username'], $db_con['db_pass'], $db_con['db_host']);
           echo "<div>Connection [ok]</div>";
           echo "<p class=\"uk-icon-chevron-right\"> Saving information ...</p>";
           $params = array('website_title' => $data['website_title'], 'admin_country_set' => $data['admin_country_set'], 'website_address' => $data['website_address'], 'website_contact_phone' => $data['website_contact_phone'], 'website_contact_email' => $data['website_contact_email'], 'admin_currency_set' => $admin_currency_set[0]);
           $truncate = "TRUNCATE TABLE " . $table_prefix . "option";
           $db->raw($truncate);