');
}
break;
case 'products':
//Start Products Conversion
//here we start the queury for CUBE Cart Customers Table
$numrows_query = mysql_query('SELECT * FROM '. $cc_inven .'');
$cc_query = mysql_query('SELECT * FROM '. $cc_inven .' Limit ' . $start.',' . $parse_limit . '');
$numrows = mysql_num_rows($numrows_query);
while ($row = mysql_fetch_array($cc_query)){
//Build Data Conversion Array
$data_array = array('products_id' => $row['productId'],
'products_quantity' => $row['quantity'],
'products_model' => '',
'products_image' => $row['image'],
'products_price' => $row['price'],
'products_date' => '',
'products_weight' => '',
'products_status' => '1' ,
'products_tax_class' => '1',
'manufacturers_id' => '',
'products_ordered' => $row['popularity']
);
//build the Query
$query = build_insert( $dname , $osc_products, $data_array );
$data_array_2 = array('products_id' => $row['productId'],
'categories_id' => $row['cat_id']
);
$query_2 = build_insert( $dname , $osc_products_to_categories, $data_array_2 );
//Run the Query
if ($debug = 1){
mysql_query($query);
mysql_query($query_2);
}
// Print the Query
echo ('
');
}
//Start Next Query and Check Proceedures
$start_math = $r_start + $parse_limit ;
$check_math = $numrows - $start_math;
if ($debug = 1){
echo ('
This is For Debugging Use.');
}
if ($check_math > 0 ){
//Print out Links for Next Item
echo ('
Your Done with the Products Table --
Click here to Start the Product Desciptions');
}
break ;
case 'orders':
//Start Orders Conversion
//here we start the queury for CUBE Cart Orders Tables
$numrows_query = mysql_query('SELECT * FROM '. $cc_ord_sum .'');
$cc_query = mysql_query('SELECT * FROM '. $cc_ord_sum .' Limit ' . $start.',' . $parse_limit . '');
//echo 'SELECT * FROM '. $cc_cat .' WHERE priority > 0 ';
$numrows = mysql_num_rows($numrows_query);
while ($row = mysql_fetch_array($cc_query)){
//Build Data ORDERS Array
$data_array = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'customers_id' => $row['customer_id'],
'customers_name' => $row['name'],
'customers_street_address' => $row['add_1'],
'customers_city' => $row['town'],
'customers_postcode' => $row['postcode'],
'customers_country' => $row['country'],
'customers_address_format_id'=> '1',
'delivery_name' => $row['name_d'],
'delivery_street_address' => $row['add_1_d'],
'delivery_city' => $row['town_d'],
'delivery_postcode' => $row['postcode_d'],
'delivery_city' => $row['town_d'],
'delivery_country' => $row['country_d'],
'customers_telephone' => $row['phone'],
'customers_email_address' => $row['email'],
'delivery_address_format_id'=> '1',
'billing_name' => $row['name'],
'billing_street_address' => $row['add_1'],
'billing_city' => $row['town'],
'billing_postcode' => $row['postcode'],
'billing_city' => $row['town'],
'billing_country' => $row['country'],
'billing_address_format_id'=> '1',
'date_purchased' => $row['time'],
'currency' => 'GBP',
'currency_value'=> '1.00000',
'orders_status'=> '3'
);
//Build Data ORDERS_TOTAL Array
$data_array_orders_total_discount = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'title' => 'Test Discount',
'text' => $row['discount'],
'value' => $row['discount'],
'class' => 'ot_discount_coupon',
'sort_order' => '2'
);
$data_array_orders_total_sub_total = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'title' => 'Sub-Total:',
'text' => $row['subtotal'],
'value' => $row['subtotal'],
'class' => 'ot_subtotal',
'sort_order' => '1'
);
$data_array_orders_total_total = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'title' => 'Total:',
'text' => $row['prod_total'],
'value' => $row['prod_total'],
'class' => 'ot_total',
'sort_order' => '3'
);
$data_array_orders_total_tax = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'title' => 'UK VAT:',
'text' => $row['total_tax'],
'value' => $row['total_tax'],
'class' => 'ot_tax',
'sort_order' => '3'
);
$data_array_orders_total_shipping = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'title' => 'Shipping:',
'text' => $row['total_ship'],
'value' => $row['total_ship'],
'class' => 'ot_shipping',
'sort_order' => '2'
);
//build the Query
$query = build_insert( $dname , $osc_orders, $data_array );
$query2 = build_insert( $dname , $osc_orders_total, $data_array_orders_total_discount );
$query3 = build_insert( $dname , $osc_orders_total, $data_array_orders_total_sub_total );
$query4 = build_insert( $dname , $osc_orders_total, $data_array_orders_total_total );
$query5 = build_insert( $dname , $osc_orders_total, $data_array_orders_total_tax );
$query6 = build_insert( $dname , $osc_orders_total, $data_array_orders_total_shipping );
$data_array_orders_status = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'orders_status_id' => '1',
'date_added' => $row['time'],
'customer_notified' => '1',
);
$data_array_orders_status_2 = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'orders_status_id' => '3',
'date_added' => $row['time'],
'customer_notified' => '1',
);
$query7 = build_insert( $dname , $osc_orders_status_history, $data_array_orders_status );
$query8 = build_insert( $dname , $osc_orders_status_history, $data_array_orders_status_2 );
//Build Data Conversion Array
/*$data_array_2 = array('categories_id' => $row['cat_id'],
'language_id' => '1',
'categories_name' => $row['cat_name']
);
//print_r($data_array_2);
//build the Query
$query_2 = build_insert( $dname , $osc_categories_desc, $data_array_2 );*/
//Run the Query
if ($debug = 1){
mysql_query($query);
mysql_query($query2);
mysql_query($query3);
mysql_query($query4);
mysql_query($query5);
mysql_query($query6);
mysql_query($query7);
mysql_query($query8);
}
// Print the Query
echo ('
');
echo $query;
echo('
');
echo ('
');
echo $query2;
echo('
');
echo ('
');
echo $query3;
echo('
');
echo ('
');
echo $query4;
echo('
');
echo ('
');
echo $query5;
echo('
');
echo ('
');
echo $query6;
echo('
');
echo ('
');
echo $query7;
echo('
');
echo ('
');
echo $query8;
echo('
');
//print a line break
echo ('
');
}
//Start Next Query and Check Proceedures
$start_math = $r_start + $parse_limit ;
$check_math = $numrows - $start_math;
if ($debug = 1){
echo ('
Check Math=' . $check_math . ' This is For Debugging Use.');
}
if ($check_math > 0 ){
//Print out Links for Next Item
echo ('
Run Next Starting with Record' . $start_math . '' );
}else{
echo ('
Your Done with the Orders Tables --
');
echo ('
Click here to Start the Orders Inventory');
}
break ;
case 'orders_inv':
//Start Orders Inventory Conversion
//here we start the queury for CUBE Cart Orders Inventory Table
$numrows_query = mysql_query('SELECT * FROM '. $cc_ord_inv .' ');
$cc_query = mysql_query('SELECT * FROM '. $cc_ord_inv .' Limit ' . $start.',' . $parse_limit . '');
//echo 'SELECT * FROM '. $cc_cat .' WHERE priority > 0 ';
$numrows = mysql_num_rows($numrows_query);
while ($row = mysql_fetch_array($cc_query)){
//Build Data Conversion Array
$data_array = array('orders_id' => str_replace("-", "",$row['cart_order_id']),
'products_id' => $row['productId'],
'orders_products_id' => $row['id'],
'products_tax' => "0.00",
'products_model' => $row['productCode'],
'products_name' => $row['name'],
'products_price' => $row['price']/$row['quantity'],
'final_price' => $row['price']/$row['quantity'],
//'products_quantity' => $row['quantity']
'products_quantity' => $row['quantity']
);
//build the Query
$query = build_insert( $dname , $osc_orders_products, $data_array );
//Run the Query
if ($debug = 1){
mysql_query($query);
}
// Print the Query
echo ('
');
echo $query;
echo('
');
//print a line break
echo ('
');
}
//Start Next Query and Check Proceedures
$start_math = $r_start + $parse_limit ;
$check_math = $numrows - $start_math;
if ($debug = 1){
echo ('
Check Math=' . $check_math . ' This is For Debugging Use.');
}
if ($check_math > 0 ){
//Print out Links for Next Item
echo ('
Run Next Starting with Record' . $start_math . '' );
}else{
echo ('
Your Done with the Orders Inv Table -- ');
echo ('');
}
break ;
case 'categories':
//Start Categories Conversion
//here we start the queury for CUBE Cart Customers Table
$numrows_query = mysql_query('SELECT * FROM '. $cc_cat .' WHERE priority > 0 ');
$cc_query = mysql_query('SELECT * FROM '. $cc_cat .' WHERE priority > 0 Limit ' . $start.',' . $parse_limit . '');
//echo 'SELECT * FROM '. $cc_cat .' WHERE priority > 0 ';
$numrows = mysql_num_rows($numrows_query);
while ($row = mysql_fetch_array($cc_query)){
//Build Data Conversion Array
$data_array = array('categories_id' => $row['cat_id'],
'categories_image' => $row['cat_image'],
'parent_id' => $row['cat_father_id'],
'sort_order' => $row['priority']
);
//build the Query
$query = build_insert( $dname , $osc_categories, $data_array );
//Build Data Conversion Array
$data_array_2 = array('categories_id' => $row['cat_id'],
'language_id' => '1',
'categories_name' => $row['cat_name']
);
//print_r($data_array_2);
//build the Query
$query_2 = build_insert( $dname , $osc_categories_desc, $data_array_2 );
//Run the Query
if ($debug = 1){
mysql_query($query);
mysql_query($query_2);
}
// Print the Query
echo ('
');
echo $query;
echo('
');
echo ('
');
echo $query_2;
echo('
');
//print a line break
echo ('
');
}
//Start Next Query and Check Proceedures
$start_math = $r_start + $parse_limit ;
$check_math = $numrows - $start_math;
if ($debug = 1){
echo ('
Check Math=' . $check_math . ' This is For Debugging Use.');
}
if ($check_math > 0 ){
//Print out Links for Next Item
echo ('
Run Next Starting with Record' . $start_math . '' );
}else{
echo ('
Your Done with the Categories Table -- ');
echo ('
Click here to Start the Orders');
}
break ;
case 'products_desc':
//Start Products Description Conversion
//here we start the queury for CUBE Cart Customers Table
$numrows_query = mysql_query('SELECT * FROM '. $cc_inven .'');
$cc_query = mysql_query('SELECT * FROM '. $cc_inven .' Limit ' . $start.',' . $parse_limit . '');
echo 'SELECT * FROM '. $cc_inven .' Limit ' . $start.',' . $parse_limit . '';
$numrows = mysql_num_rows($numrows_query);
while ($row = mysql_fetch_array($cc_query)){
//Build Data Conversion Array
$data_array = array('products_id' => $row['productId'],
'language_id' => '1',
'products_name' => $row['name'],
'products_description' => $row['description'],
'products_url' => '',
'products_viewed' => $row['popularity']
);
//build the Query
$query = build_insert( $dname , $osc_products_desc, $data_array );
//Run the Query
if ($debug = 1){
mysql_query($query);
}
// Print the Query
echo ('
');
echo $query;
echo('
');
//print a line break
echo ('
');
}
//Start Next Query and Check Proceedures
$start_math = $r_start + $parse_limit ;
$check_math = $numrows - $start_math;
if ($debug = 1){
echo ('
Check Math=' . $check_math . ' This is For Debugging Use.');
}
if ($check_math > 0 ){
//Print out Links for Next Item
echo ('
Run Next Starting with Record' . $start_math . '' );
}else{
echo ('
Your Done with the Products Description Table -- ');
echo ('
Click here to Start the Categories');
}
break ;
default:
//Start Customer Conversion
//here we start the queury for CUBE Cart Customers Table
$numrows_query = mysql_query('SELECT * FROM '. $cc_cus .'');
$cc_query = mysql_query('SELECT * FROM '. $cc_cus .' Limit ' . $start.',' . $parse_limit . '');
$numrows = mysql_num_rows($numrows_query);
while ($row = mysql_fetch_array($cc_query)){
//Build Data Conversion Array
$data_array = array('customers_id' => $row['customer_id'],
'customers_gender' => '',
'customers_firstname' => $row['name'],
'customers_lastname' => '',
'customers_dob' => '',
'customers_email_address' => $row['email'],
'customers_default_address_id' => $row['customer_id'],
'customers_telephone' => $row['phone'],
'customers_fax' => '',
'customers_password' => $row['password'],
'customers_newsletter' => '1'
);
//build the Query
$query = build_insert( $dname , $osc_cus, $data_array );
//Run the Query
if ($debug = 1){
mysql_query($query);
}
// Print the Query the Query
echo ('
');
echo $query;
echo('
');
//print a line break
echo ('
');
}
$start_math = $r_start + $parse_limit ;
$check_math = $numrows - $start_math;
if ($debug = 1){
echo ('
Check Math=' . $check_math . ' This is For Debugging Use.');
}
if ($check_math > 0 ){
echo ('
Run Next Starting with Record' . $start_math . '' );
}else{
echo ('