PATH:
home
/
centosnipponia
/
public_html
/
wh
/
rd
/
VA_BAL_RD
<?php require __DIR__ . '/functions_csv_handle.php'; $folder_path='/home/centosnipponia/public_html/wh/rd/VA_BAL_RD/'; check_for_updates($folder_path); function create_insert_db($filepath) { //echo $filepath; $sql_delivery =//"INSERT INTO saleunitscapetown(ArticuloCodigo,AnoFactura,MesFactura,ArticuloDescripcion,ArticuloClasificacion1,Zona,Bodega,Cliente,Vendedor,FACTURA,FechaFactura,SemanaFactura,TrimestreFactura,Cantidad,Impuesto1Local,Impuesto1Dolar,TotalImpuestoLocal,vin) VALUES "; "DROP TABLE IF EXISTS `customer_balance_rds`; CREATE TABLE IF NOT EXISTS `customer_balance_rds` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `customer_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `currency` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `balance` double DEFAULT NULL, `date_updated` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; INSERT INTO `customer_balance_rds`(`customer_code`, `currency`, `balance`, `date_updated`) VALUES"; $max_rows=count_csv_rows($filepath); if($max_rows>0){ $row_current_nbr=2; $lines=""; $row_comma_separated=""; $first_row=false;//den exei epikefalides fix_file($filepath); $file = fopen($filepath,"r"); while($row_current_nbr<$max_rows+1) { $row_current_nbr=$row_current_nbr+1; if($first_row) { $first_row=false; fgetcsv($file); } else { //echo fgetcsv($file)[0]; //$cleaned_row=str_replace(",","",); $cleaned_row=str_replace("'","\'",fgetcsv($file)[0]); //$cleaned_row=str_replace(",",";", $cleaned_row); $row_array =explode(";",$cleaned_row); // print_r($row_array); $row_comma_separated="('".implode("','", $row_array)."'),"; //print_r($row_comma_separated); //echo ($row_comma_separated); } $lines.= $row_comma_separated; } fclose($file); $sql_delivery.=$lines; $sql_delivery=substr_replace($sql_delivery,";",-1); } else { $sql_delivery ="SELECT 1"; } //echo $sql_delivery; return $sql_delivery; } ?>
[+]
..
[+]
imported
[-] functions_csv_handle.php
[edit]
[-] sql_command_import_capetown.php
[edit]
[-] .htaccess.disabled
[edit]