'; */ // ------------------------------------------------------- /* 04/09/2013 ubah unit_of_measure char(1) unit_of_measure char(2) 1. Samudra (Chandra) sudah diintall 14 Sep 2013 2. OMC Sudah diinstall 7 Okt 2013 3. 2014-01-24 Laris Jaya Motor 4. 2014-06-26 Kurnia Motor 5. 2014-11-03 Mahkota Motor */ // ------------------------------------------------------- /* // ----------------------------------- // 1. alter goods // ----------------------------------- // Tidak ada goods di center. bisa dihilangkan 26/6/2014 $db = "omc"; $file = "goods"; $sql = " alter table " . $db . "." . $file . " change unit_of_measure unit_of_measure char(2), drop unit_of_measure1, drop unit_of_measure1x "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $uo_measure1 = 'Y'; include("../_utility/_update_unit.php"); $db = "omc_cpa"; $file = "goods"; $sql = " alter table " . $db . "." . $file . " change unit_of_measure unit_of_measure char(2), drop unit_of_measure1, drop unit_of_measure1x "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $uo_measure1 = 'Y'; include("../_utility/_update_unit.php"); $db = "omc_bsa"; $file = "goods"; $sql = " alter table " . $db . "." . $file . " change unit_of_measure unit_of_measure char(2), drop unit_of_measure1, drop unit_of_measure1x "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $uo_measure1 = 'Y'; include("../_utility/_update_unit.php"); $db = "omc_dpa"; $file = "goods"; $sql = " alter table " . $db . "." . $file . " change unit_of_measure unit_of_measure char(2), drop unit_of_measure1, drop unit_of_measure1x "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $uo_measure1 = 'Y'; include("../_utility/_update_unit.php"); // ----------------------------------- // 2. alter buy_detail // ----------------------------------- $db = "omc"; $file = "buy_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_cpa"; $file = "buy_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_bsa"; $file = "buy_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_dpa"; $file = "buy_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // ----------------------------------- // 3. alter order_buy_detail // ----------------------------------- $db = "omc"; $file = "order_buy_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // ----------------------------------- // 4. alter sale_detail // ----------------------------------- $db = "omc_cpa"; $file = "sale_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_bsa"; $file = "sale_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_dpa"; $file = "sale_detail"; $sql = " alter table " . $db . "." . $file . " drop unit_of_measure "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } */ // ------------------------------------------------------- /* 08/10/2013 ubah description tinytext not null 1. OMC CPA Sudah diinstall 8 Okt 2013 BSA OK DPA ok 2. 2013-12-21 Selamat Jaya Motor (Sampai disini sdh dilakukan) 3. 2014-01-24 Laris Jaya Motor 4. 2014-06-26 Kurnia Motor 5. 2014-11-03 Mahkota Motor 6. 2015-04-20 Samudra (Chandra) */ // ------------------------------------------------------- /* $db = "omc_cpa"; $file = "cash_in_out"; $sql = " alter table " . $db . "." . $file . " change description description tinytext not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_bsa"; $file = "cash_in_out"; $sql = " alter table " . $db . "." . $file . " change description description tinytext not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_dpa"; $file = "cash_in_out"; $sql = " alter table " . $db . "." . $file . " change description description tinytext not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } */ // ======================================================================================= // 18 April 2014 // Modul Move (Penyisihan Barang) // Khusus buat PT OMC /* 1. 2014-06-26 Kurnia Motor 2. 2014-10-08 Laris Jaya Motor 3. 2014-11-03 Mahkota Motor 4. 2015-04-20 Samudra (Chandra) */ // ======================================================================================= // ----------------------------------- // create table // ----------------------------------- echo "

---------Move Start-----------
"; $sql_br = "select lower(branch_code) from $db_center.branch where status_code <> '0' "; if (!$res_br=mysql_query($sql_br, $dbh)) { echo mysql_error() . '

' . $sql_br; exit; } while ($row_br = mysql_fetch_row($res_br)) { $branch_code = $row_br[0]; $file = "$branch_code.move"; include("../_utility/move_refresh_table.php"); $file = "$branch_code.move_detail"; include("../_utility/move_detail_refresh_table.php"); } // while ($row_br = mysql_fetch_row($res_br)) echo "---------Move End-----------

"; // ======================================================================================= // 6/11/2013 - 18/3/2014 // Tambah Group Name // 1. 2014-06-26 Kurnia Motor // 2. 2014-10-08 Laris Jaya Motor // 3. 2014-11-03 Mahkota Motor // 4. 2015-04-20 Samudra (Chandra) // ======================================================================================= // ----------------------------------- // 1. create table // ----------------------------------- include("../_utility/goods_group_refresh_table.php"); // ----------------------------------- // 2. alter goods // add goods_group_code di semua cabang // ----------------------------------- $db = "omc_cpa"; $file = "goods"; $sql = " alter table " . $db . "." . $file . " add goods_group_code char(4) not null after goods_code_ref, change goods_name goods_group_name varchar(50) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_bsa"; $file = "goods"; $sql = " alter table " . $db . "." . $file . " add goods_group_code char(4) not null after goods_code_ref, change goods_name goods_group_name varchar(50) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_dpa"; $file = "goods"; $sql = " alter table " . $db . "." . $file . " add goods_group_code char(4) not null after goods_code_ref, change goods_name goods_group_name varchar(50) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // ---------------------------------------------------------------- // 3. Initialize table goods_group dan field goods.goods_group_code // ---------------------------------------------------------------- // a. goods_group // create goods_group_code // => ambil dari goods_group_name di cabang utama omc_cpa saja (yg lbh lengkap) // ---------------------------------------------------------------- $db = "omc_cpa"; $file = "goods"; $sql = "select goods_group_name from $db.$file where goods_group_name != '' group by goods_group_name "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); exit; } $last_update_by = "yosa"; $last_update_date = date("Y-m-d H:i:s"); $last_ip_address = $REMOTE_ADDR; $class = ''; $i = 1; while ($row = mysql_fetch_row ($res)) { $goods_group_name = $row[0]; $goods_group_code = str_pad($i, 4, "0", STR_PAD_LEFT); $sql1 = "insert into omc.goods_group values ( '$goods_group_code', '$goods_group_name', '$class', '$last_update_by', '$last_update_date', '$last_ip_address' ) "; if (!$res1=mysql_query($sql1, $dbh)) { echo mysql_error() . '

' .$sql1; exit; } $i++; } echo 'Table omc.goods_group has been initialized successfully!
br>'; // b. goods.goods_group_code // initialize goods_group_code (dan sekalian goods_group_name) di di goods.goods_group_code di semua cabang // => ambil dari goods_group // ---------------------------------------------------------------- $file = "goods"; $sql = "select goods_group_code, goods_group_name from omc.goods_group "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); exit; } while ($row = mysql_fetch_row ($res)) { $goods_group_code = $row[0]; $goods_group_name = $row[1]; $db = "omc_cpa"; $sql1 = "update $db.$file set goods_group_code = '$goods_group_code' where goods_group_name = '$goods_group_name' "; if (!$res1=mysql_query($sql1, $dbh)) { echo mysql_error() . '

' .$sql1; exit; } $db = "omc_bsa"; $sql1 = "update $db.$file set goods_group_code = '$goods_group_code' where goods_group_name = '$goods_group_name' "; if (!$res1=mysql_query($sql1, $dbh)) { echo mysql_error() . '

' .$sql1; exit; } $db = "omc_dpa"; $sql1 = "update $db.$file set goods_group_code = '$goods_group_code' where goods_group_name = '$goods_group_name' "; if (!$res1=mysql_query($sql1, $dbh)) { echo mysql_error() . '

' .$sql1; exit; } } echo "Pendefiniasian Group Name Selesai!

"; // ======================================================================================= // SYNC yg Baru // 1. 2014-06-26 Kurnia Motor // 2. 2014-10-08 Laris Jaya Motor // 3. 2014-11-03 Mahkota Motor // 4. 2015-04-20 Samudra (Chandra) // ======================================================================================= // ---------------------------------------------------- // 20/3/2014 // Tabel Sync // ---------------------------------------------------- if ($sync_branch) { // 20/3/2014 // Tabel pencatatan kode barang yang dihapus atau // diubah (del yg lama upd ke yang baru) // Hanya di mainbranch $file = "scpa_omc.goods_del_upd"; //goods_code hanya bisa diubah dan dihapus di CPA include("../_utility/goods_del_upd_refresh_table.php"); $sql_br = "select lower(branch_code), status_code from $db_center.branch "; if (!$res_br=mysql_query($sql_br, $dbh)) { echo mysql_error() . '

' . $sql_br; exit; } while ($row_br = mysql_fetch_row($res_br)) { $branch_code = $row_br[0]; $status_code = $row_br[1]; if ($status_code == '0') { // Center = omc // goods $file = "s$db_current_short" . "_" . "$branch_code.goods"; // scpa_omc.goods include("../_utility/goods_refresh_table.php"); // Add field goods_code_del_upd // goods_code_del_upd = '' (Blank) => Add/Update tanpa perubahan goods_code (key) // goods_code_del_upd = goods_code => Delete // goods_code_del_upd <> goods_code <> '' => Update dengan perubahan goods_code (key $sql = " alter table $file add goods_code_del_upd varchar(20) not null after last_ip_address "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '

' . $sql; exit; } // goods_car $file = "s$db_current_short" . "_" . "$branch_code.goods_car"; // scpa_omc.goods_car include("../_utility/goods_car_refresh_table.php"); // sync_table $file = "s$db_current_short" . "_" . "$branch_code.sync_table"; // scpa_omc.sync_table include("../_utility/sync_table_refresh_table.php"); } else { // non center: cpa, bsa, dpa // goods_for_branch $file = "s$db_current_short" . "_" . "$branch_code.goods_for_branch"; // scpa_omc.goods_for_branch include("../_utility/goods_for_branch_refresh_table.php"); // sync_log $file = "$branch_code.sync_log"; include("../_utility/sync_log_refresh_table.php"); } } // while ($row_br = mysql_fetch_row($res_br)) } echo "Create Table Sync Selesai!

"; // ---------------------------------------------------- // Setelah proses di atas lakukan: // 1. replace goods_name menjadi goods_group_name di OMC (LJM dan lain2) // Ganti Index_2 // create index index_2 on $file ( // goods_group_name, goods_code)"; // 1. 2014-06-26 Kurnia Motor // 2. 2014-10-08 Laris Jaya Motor // 3. 2014-11-03 Mahkota Motor // 4. 2015-04-20 Samudra (Chandra) // ---------------------------------------------------- // ---------------------------------------------------- // 24/3/2014 // Add Field of goods_car for SYNC // 1. 2014-06-26 Kurnia Motor // 2. 2014-10-08 Laris Jaya Motor // 3. 2014-11-03 Mahkota Motor // 4. 2015-04-20 Samudra (Chandra) // ---------------------------------------------------- echo "

-----------Add Field of goods_car Table-----------
"; $db = "omc"; $file = "goods_car"; $sql = " alter table $db.$file add last_update_by varchar(10) not null after description, add last_update_date datetime not null after last_update_by, add last_ip_address char(15) not null after last_update_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(); } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // ===================================================================== // Progress SYNC (Belum Selesai) // maintain: // goods Hampir Selesai (24/3/2014) // Yg Dilakukan saat SYNC di Cabang2: // Add : Insert Table based on database s_ // Delete : Simulasikan Proses Delete berdasarkan tabel s_goods_del_upd // Update : Simulasikan Proses Update berdasarkan tabel s_goods_del_upd // // 1. 2014-06-26 Kurnia Motor // 2. 2014-10-08 Laris Jaya Motor // 3. 2014-11-03 Mahkota Motor // 4. 2015-04-20 Samudra (Chandra) // ===================================================================== // ---------------------------------------------------- // 29/3/2014 (Sudah selesai) // Redisign goods table // ada yang di center dan ada yg di setiap cabang // center: goods dan setiap cabang: goods_for_branch // // 1. 2014-06-26 Kurnia Motor // 2. 2014-10-08 Laris Jaya Motor // 3. 2014-11-03 Mahkota Motor // 4. 2015-04-20 Samudra (Chandra) // ---------------------------------------------------- echo "

-----------Redisign goods Table-----------
"; $file = "goods"; $last_update_by = "yosa"; $last_update_date = date("Y-m-d H:i:s"); $last_ip_address = $REMOTE_ADDR; $sql_br = "select lower(branch_code), status_code from $db_center.branch where status_code <> '0' "; if (!$res_br=mysql_query($sql_br, $dbh)) { echo '
'. mysql_error() . '
====
' . $sql_br; exit; } while ($row_br = mysql_fetch_row($res_br)) { $branch_code = $row_br[0]; $status_code = $row_br[1]; // Create Table $file = "$branch_code.goods_for_branch"; include("../_utility/goods_for_branch_refresh_table.php"); // Init Table $sql_g = "select goods_code, place_code, unit_buy_price, unit_sale_price, total_quantity_buy, total_quantity_sale, stock_min from $branch_code.goods "; if (!$res_g=mysql_query($sql_g, $dbh)) { echo mysql_error() . '

' . $sql_g; exit; } while ($row_g = mysql_fetch_row ($res_g)) { $goods_code = $row_g[0]; $place_code = $row_g[1]; $unit_buy_price = $row_g[2]; $unit_sale_price = $row_g[3]; $total_quantity_buy = $row_g[4]; $total_quantity_sale = $row_g[5]; $stock_min = $row_g[6]; $sql1 = "insert into $branch_code.goods_for_branch values ( '$goods_code', '$place_code', '$unit_buy_price', '$unit_sale_price', '$total_quantity_buy', '$total_quantity_sale', '$stock_min', '$last_update_by', '$last_update_date', '$last_ip_address' ) "; if (!$res1=mysql_query($sql1, $dbh)) { echo mysql_error() . '

' .$sql1; exit; } } echo "$branch_code.goods_for_branch has been initialized successfully!
"; if ($status_code == '1') { // Hapus field goods di cabang utama $sql_g = "alter table $branch_code.goods drop place_code, drop unit_buy_price, drop unit_sale_price, drop total_quantity_buy, drop total_quantity_sale, drop stock_min "; if (!$res_g=mysql_query($sql_g, $dbh)) { echo mysql_error() . '

' . $sql_g; exit; } // ++++++++++++++++++++++++++++++++++++++++++++++++++++ // copy goods ke center // ++++++++++++++++++++++++++++++++++++++++++++++++++++ // drop goods di center // -------------------------------------------- // Get database directory // o: $dir_db (c:/data/, f:/data/, d:/data/, atau .... // -------------------------------------------- include("../common/inc/get_dir_db.inc"); $dir_db_mainbranch = $dir_db . "$branch_code/"; $dir_db_center = $dir_db . "$db_center/"; $file_name = "goods.frm"; $file_from = "$dir_db_mainbranch$file_name"; $file_to = "$dir_db_center$file_name"; if (!copy($file_from, $file_to )) { echo "copy $file_from ke $file_to tidak berhasil"; Exit; } else { echo "copy $file_from ke $file_to berhasil
"; } $file_name = "goods.MYI"; $file_from = "$dir_db_mainbranch$file_name"; $file_to = "$dir_db_center$file_name"; if (!copy($file_from, $file_to )) { echo "copy $file_from ke $file_to tidak berhasil"; Exit; } else { echo "copy $file_from ke $file_to berhasil
"; } $file_name = "goods.MYD"; $file_from = "$dir_db_mainbranch$file_name"; $file_to = "$dir_db_center$file_name"; if (!copy($file_from, $file_to )) { echo "copy $file_from ke $file_to tidak berhasil"; Exit; } else { echo "copy $file_from ke $file_to berhasil
"; } } // Drop goods di cabang cpa, bsa, dpa $sql_g = "drop table $branch_code.goods"; if (!$res_g=mysql_query($sql_g, $dbh)) { echo mysql_error() . '

' . $sql_g; exit; } else { echo "=>Hapus $branch_code.goods berhasil
"; } } // ---------------------------------------------------- // 02/07/2014 // Bersihkan Database, hapus tabel2 yg tdk diperlukan // 1. 2014-10-08 Laris Jaya Motor // 2. 2014-11-03 Mahkota Motor // 3. 2015-03-30 Kurnia Motor // 4. 2015-04-20 Samudra (Chandra) // ---------------------------------------------------- echo "

-----------Bersihkan Database-----------
"; include("../omc/inc/init_db.inc"); $sql_br = "select lower(branch_code), status_code from $db_center.branch "; if (!$res_br=mysql_query($sql_br, $dbh)) { echo '
'. mysql_error() . '
----
' . $sql_br; exit; } while ($row_br = mysql_fetch_row($res_br)) { $branch_code = $row_br[0]; $status_code = $row_br[1]; if ($status_code == '0') { // ....................................... // Di Pusat (omc) // ....................................... // Drop goods_check_stock di center (omc) $sql_g = "drop table $branch_code.goods_check_stock"; if (!$res_g=mysql_query($sql_g, $dbh)) { echo '
' . mysql_error() . '
' . $sql_g . '

' ; } else { echo "Hapus $branch_code.goods_check_stock berhasil
"; } // Drop goods_customer di center (omc) $sql_g = "drop table $branch_code.goods_customer"; if (!$res_g=mysql_query($sql_g, $dbh)) { echo '
' . mysql_error() . '
' . $sql_g . '

' ; } else { echo "Hapus $branch_code.goods_customer berhasil
"; } // Drop goods_car_trn di center (omc) $sql_g = "drop table $branch_code.goods_car_trn"; if (!$res_g=mysql_query($sql_g, $dbh)) { echo '
' . mysql_error() . '
' . $sql_g . '

' ; } else { echo "Hapus $branch_code.goods_car_trn berhasil
"; } // Drop goods_stock di center (omc) $sql_g = "drop table $branch_code.goods_stock"; if (!$res_g=mysql_query($sql_g, $dbh)) { echo '
' . mysql_error() . '
' . $sql_g . '

' ; } else { echo "Hapus $branch_code.goods_stock berhasil
"; } } else { // ....................................... // Di Cabang-Cabang // ....................................... // Drop goods_trn // di Versi baru goods_trn tdk digunakan lagi $sql_g = "drop table $branch_code.goods_trn"; if (!$res_g=mysql_query($sql_g, $dbh)) { echo '
' . mysql_error() . '
' . $sql_g . '

' ; } else { echo "Hapus $branch_code.goods_trn berhasil
"; } // Drop goods_car_trn $sql_g = "drop table $branch_code.goods_car_trn"; if (!$res_g=mysql_query($sql_g, $dbh)) { echo '
' . mysql_error() . '
' . $sql_g . '

' ; } else { echo "Hapus $branch_code.goods_car_trn berhasil
"; } } } // ---------------------------------------------------- // 3/9/2014 // Create new tables // ---------------------------------------------------- echo "

-----------Create goods_car_del_upd Table-----------
"; if ($sync_branch) { // goods_car_del_upd bisa dihapus dan diubah di setiap cabang $sql_br = "select lower(branch_code) from $db_center.branch where status_code <> '0' "; if (!$res_br=mysql_query($sql_br, $dbh)) { echo mysql_error() . '

' . $sql_br; exit; } while ($row_br = mysql_fetch_row($res_br)) { $branch_code = $row_br[0]; $branch_code_short = substr($branch_code,$undisp_length_branch); // mis: cpa $file = "s$branch_code_short" . "_" . "$db_center.goods_car_del_upd"; // scpa_omc.goods_car_del_upd, sbsa_omc.goods_car_del_upd, sdpa_omc.goods_car_del_upd include("../_utility/goods_car_del_upd_refresh_table.php"); } } // ---------------------------------------------------- // 18/09/2014 // Kosongkan isi tabel-tabel di db sync // ---------------------------------------------------- if ($sync_branch) { echo "

-----------Kosongkan Database Sync-----------

"; $sql_br = "select lower(branch_code), status_code from $db_center.branch "; if (!$res_br=mysql_query($sql_br, $dbh)) { echo mysql_error() . '

' . $sql_br; exit; } while ($row_br = mysql_fetch_row($res_br)) { $branch_code = $row_br[0]; $status_code = $row_br[1]; // goods $database_br_tmp = "s$db_current_short" . "_" . "$branch_code"; // scpa_omc $table_number = 0; $sql1 = "show tables from " . $database_br_tmp; if (!$res1=mysql_query($sql1, $dbh)) { echo mysql_error() . '

' . $sql1; exit; } while ($row1 = mysql_fetch_row($res1)) { $table_name = $database_br_tmp . "." . $row1[0]; $sql2 = "truncate $table_name"; if (!$res2=mysql_query($sql2, $dbh)) { echo '
' . mysql_error() . '
' . $sql2 . '

' ; } else { echo "Kosongkan $table_name ..... berhasil
"; $table_number++; } } echo "Database $database_br_tmp: $table_number Tabel berhasil dikosongkan

"; } } // ========================================================================== // 16/2/2015 // Create main_product yg akan ditampilkan di main page // Untuk Web OtomotifCenter // ========================================================================== include("../_utility/main_product_table.php"); // ========================================================================== // untuk penyesuaian // supaya Salitrosa bisa gunakan // Samudra 14/08/2017 18:40 // ========================================================================== // --------------------------------------------------------------------- // 17/04/2017 // change buy.invoice_no buy.container_no buy.buy_seq_no // change buy_detail.invoice_no // drop buy_detail.worker_code // change sale_detail.container_no sale_detail.buy_seq_no // change goods_stock.container_no goods_stock.buy_seq_no // 17/04/2017 add buy.buy_ref_no /* 23/06/2017 14:43 Table buy Fungsikan pay_status yg sebelumnya pake status buy.status buy.pay_status buy.status_date buy.pay_status_date // Samudra 14/08/2017 18:40 */ // --------------------------------------------------------------------- $file = "buy"; $db = "omc"; $sql = " alter table " . $db . "." . $file . " add buy_ref_no varchar(15) not null after in_date, change invoice_no invoice_no char(5) not null, change container_no buy_seq_no char(12) not null, change pay_status pay_status_code char(1) not null, change discount discount decimal(5,2) not null, change issued_code bic_code char(4) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // update buy_seq_no $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } // init pay_status_code, pay_date $sql = " update $db.$file set pay_status_code= status, pay_date = status_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . "

$sql"; } else { echo "Table $db.$file (status) has been copied to (pay_status_code) successfully!
"; } $db = "omc_cpa"; $sql = " alter table " . $db . "." . $file . " add buy_ref_no varchar(15) not null after in_date, change invoice_no invoice_no char(5) not null, change container_no buy_seq_no char(12) not null, change pay_status pay_status_code char(1) not null, change discount discount decimal(5,2) not null, change issued_code bic_code char(4) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // update buy_seq_no $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } // init pay_status_code, pay_date $sql = " update $db.$file set pay_status_code= status, pay_date = status_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . "

$sql"; } else { echo "Table $db.$file (status) has been copied to (pay_status_code) successfully!
"; } $db = "omc_bsa"; $sql = " alter table " . $db . "." . $file . " add buy_ref_no varchar(15) not null after in_date, change invoice_no invoice_no char(5) not null, change container_no buy_seq_no char(12) not null, change pay_status pay_status_code char(1) not null, change discount discount decimal(5,2) not null, change issued_code bic_code char(4) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // update buy_seq_no $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } // init pay_status_code, pay_date $sql = " update $db.$file set pay_status_code= status, pay_date = status_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . "

$sql"; } else { echo "Table $db.$file (status) has been copied to (pay_status_code) successfully!
"; } $db = "omc_dpa"; $sql = " alter table " . $db . "." . $file . " add buy_ref_no varchar(15) not null after in_date, change invoice_no invoice_no char(5) not null, change container_no buy_seq_no char(12) not null, change pay_status pay_status_code char(1) not null, change discount discount decimal(5,2) not null, change issued_code bic_code char(4) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // update buy_seq_no $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } // init pay_status_code, pay_date $sql = " update $db.$file set pay_status_code= status, pay_date = status_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . "

$sql"; } else { echo "Table $db.$file (status) has been copied to (pay_status_code) successfully!
"; } $file = "buy_detail"; $db = "omc"; $sql = " alter table " . $db . "." . $file . " change discount discount decimal(5,2) not null, change invoice_no invoice_no char(5) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_cpa"; $sql = " alter table " . $db . "." . $file . " change discount discount decimal(5,2) not null, change invoice_no invoice_no char(5) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_bsa"; $sql = " alter table " . $db . "." . $file . " change discount discount decimal(5,2) not null, change invoice_no invoice_no char(5) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_dpa"; $sql = " alter table " . $db . "." . $file . " change discount discount decimal(5,2) not null, change invoice_no invoice_no char(5) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $file = "sale"; $db = "omc_cpa"; $sql = " alter table $db.$file change discount discount decimal(5,2) not null, change worker_code sic_code char(4) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; exit; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_bsa"; $sql = " alter table $db.$file change discount discount decimal(5,2) not null, change worker_code sic_code char(4) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; exit; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_dpa"; $sql = " alter table $db.$file change discount discount decimal(5,2) not null, change worker_code sic_code char(4) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; exit; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $file = "sale_detail"; $db = "omc_cpa"; $sql = " alter table " . $db . "." . $file . " change discount discount decimal(5,2) not null, change container_no buy_seq_no char(12) not null, drop worker_code "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } $db = "omc_bsa"; $sql = " alter table " . $db . "." . $file . " change discount discount decimal(5,2) not null, change container_no buy_seq_no char(12) not null, drop worker_code "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } $db = "omc_dpa"; $sql = " alter table " . $db . "." . $file . " change discount discount decimal(5,2) not null, change container_no buy_seq_no char(12) not null, drop worker_code "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } $file = "goods_stock"; $db = "omc_cpa"; $sql = " alter table " . $db . "." . $file . " change container_no buy_seq_no char(12) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } $db = "omc_bsa"; $sql = " alter table " . $db . "." . $file . " change container_no buy_seq_no char(12) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } $db = "omc_dpa"; $sql = " alter table " . $db . "." . $file . " change container_no buy_seq_no char(12) not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " update $db.$file set buy_seq_no = LPAD(trim(buy_seq_no),12,'0') "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been updated successfully!
'; } // --------------------------------------------------------------------- // 11/05/2017 change customer.credit_limit customer.credit_limit // add customer.total_credit // Samudra 14/08/2017 18:40 // --------------------------------------------------------------------- $file = "customer"; $db = "omc_cpa"; $sql = " alter table " . $db . "." . $file . " change debt_limit credit_limit double unsigned not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " alter table " . $db . "." . $file . " add total_credit double unsigned not null after credit_limit "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_bsa"; $sql = " alter table " . $db . "." . $file . " change debt_limit credit_limit double unsigned not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " alter table " . $db . "." . $file . " add total_credit double unsigned not null after credit_limit "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $db = "omc_dpa"; $sql = " alter table " . $db . "." . $file . " change debt_limit credit_limit double unsigned not null "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } $sql = " alter table " . $db . "." . $file . " add total_credit double unsigned not null after credit_limit "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error(). '

' . $sql; } else { echo 'Table ' . $db . '.' . $file . ' has been alterred successfully!
'; } // --------------------------------------------------------------------- /* 28/06/2017 1. Create table: buy_in_charge (BIC) 2. Convert table: issued_by to buy_in_charge 3. Drop issued_by 4. Change buy.issued_code buy.sic_code // Samudra 14/08/2017 18:40 */ // --------------------------------------------------------------------- // create tabel buy_in_charge include("../_utility/buy_in_charge_refresh_table.php"); // init tabel buy_in_charge $t_table = "$db_center.buy_in_charge"; $sql = " REPLACE into $t_table (bic_code, bic_name) select issued_code, issued_name from $db_center.issued_by "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been initialized successfully!

"; } // drop tabel issued_by $t_table = "$db_center.issued_by"; $sql = " drop table $t_table "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been dropped successfully!

"; } // --------------------------------------------------------------------- /* 28/06/2017 1. Create table: sale_in_charge (SIC) 2. Convert table: worker to sale_in_charge (SIC) 3. Drop worker // Samudra 14/08/2017 18:40 */ // --------------------------------------------------------------------- $db = "omc_cpa"; $t_table = "$db.sale_in_charge"; // create tabel sale_in_charge include("../_utility/sale_in_charge_refresh_table.php"); // init tabel sale_in_charge $sql = " REPLACE into $t_table (sic_code, sic_name, input_by, input_date, last_update_by, last_update_date) select worker_code, worker_name, input_by, input_date, last_update_by, last_update_date from $db.worker "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been initialized successfully!

"; } // drop tabel worker $t_table = "$db.worker"; $sql = " drop table $t_table "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been dropped successfully!

"; } $db = "omc_bsa"; $t_table = "$db.sale_in_charge"; // create tabel sale_in_charge include("../_utility/sale_in_charge_refresh_table.php"); // init tabel sale_in_charge $sql = " REPLACE into $t_table (sic_code, sic_name, input_by, input_date, last_update_by, last_update_date) select worker_code, worker_name, input_by, input_date, last_update_by, last_update_date from $db.worker "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been initialized successfully!

"; } // drop tabel worker $t_table = "$db.worker"; $sql = " drop table $t_table "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been dropped successfully!

"; } $db = "omc_dpa"; $t_table = "$db.sale_in_charge"; // create tabel sale_in_charge include("../_utility/sale_in_charge_refresh_table.php"); // init tabel sale_in_charge $sql = " REPLACE into $t_table (sic_code, sic_name, input_by, input_date, last_update_by, last_update_date) select worker_code, worker_name, input_by, input_date, last_update_by, last_update_date from $db.worker "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been initialized successfully!

"; } // drop tabel worker $t_table = "$db.worker"; $sql = " drop table $t_table "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo "Table $t_table has been dropped successfully!

"; } // --------------------------------------------------------------------- // 03/07/2017 17:20 // Tabel Unit disempurnakan // Samudra 14/08/2017 18:40 // --------------------------------------------------------------------- include("../_utility/unit_refresh_table.php"); // Initialize $sql = "replace into $file (unit_of_measure, unit_of_measure_name) values ('SE', 'Set' ), ('BH', 'Buah' ), ('PS', 'Pasang'), ('BT', 'Botol' ), ('KL', 'Kaleng'), ('GL', 'Galon' ), ('LT', 'Liter' ), ('PL', 'Pail' ), ('MT', 'Meter' ), ('CM', 'Cm' ), ('KG', 'Kg' ), ('GR', 'Gram' ), ('ON', 'Ons' ), ('SA', 'Sak' ), ('TR', 'Truk' ), ('KJ', 'Kijang') "; if (!$res=mysql_query($sql, $dbh)) { echo '
' . mysql_error() . '

' . $sql; exit; } // =========================================================================== // Alter producer 05/07/2017 // Samudra 14/08/2017 18:40 // =========================================================================== $file = "$db_center.producer"; $sql = " alter table $file change producer_code producer_code varchar(5) not null, change producer_name producer_name varchar(40) not null, change country_code country_code char(2) not null, add input_by varchar(10) not null after country_code, add input_date datetime not null after input_by, add input_ip_address char(15) not null after input_date, add last_update_by varchar(10) not null after input_ip_address, add last_update_date datetime not null after last_update_by, add last_ip_address char(15) not null after last_update_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo 'Table ' . $file . ' has been alterred successfully!

'; } // =========================================================================== // Alter user_profile 05/07/2017 // Samudra 14/08/2017 18:40 // =========================================================================== /* user_profile dicopy saja khuss buat OMC $file = "$db_center.user_profile"; // Add $sql = " alter table $file add user_group_id char(3) not null after pass "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo 'Table ' . $file . '. Field user_group_id has been added successfully!

'; } // Init $sql = " update $file set user_group_id = 'AD1' where user_group = '0' and position = '0' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } $sql = " update $file set user_group_id = 'US1' where user_group = '1' and position = '1' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } $sql = " update $file set user_group_id = 'US2' where user_group = '1' and position = '2' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } echo "Table $file has been initialized successfully!

"; // Drop $sql = " alter table $file change status record_status_code char(1) not null, add input_by  varchar(10) not null after record_status_code, add input_date  datetime not null after input_by , add input_ip_address char(15) not null after input_date , drop user_group, drop position, drop approver, drop authority, drop phone, drop email "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo 'Table ' . $file . '. Some Fields has been altered successfully!

'; } // Init record_status_code $sql = " update $file set record_status_code = 'A' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo 'Table ' . $file . '. Field record_status_code has been initialized successfully!

'; } */ // =========================================================================== // supplier 10/08/2017 20:22 // Samudra 14/08/2017 18:40 // =========================================================================== $file = "$db_center.supplier"; $sql = " alter table $file add input_by varchar(10) not null after description, add input_date datetime not null after input_by, add input_ip_address char(15) not null after input_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } else { echo 'Table ' . $file . ' has been alterred successfully!

'; } // =========================================================================== // alter supplier_cp 11/08/2017 20:38 // Samudra 14/08/2017 18:40 // =========================================================================== $file = "$db_center.supplier_cp"; // alter $sql = " alter table $file change phone phone varchar(60) not null, add input_by  varchar(10) not null after description, add input_date  datetime not null after input_by , add input_ip_address char(15) not null after input_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // concat phone and hp $sql = " update $file set phone = hp where phone = '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } $sql = " update $file set phone = concat(phone, ', ', hp) where phone <> '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // drop hp $sql = " alter table $file drop hp "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } echo 'Table ' . $file . ' has been alterred successfully!

'; // =========================================================================== // supplier_product 10/08/2017 20:22 // Samudra 14/08/2017 18:40 // =========================================================================== $t_table = "$db_center.supplier_product"; $sql = " alter table $t_table add product_id char(2) not null after supplier_code, add input_by varchar(10) not null after description, add input_date datetime not null after input_by, add input_ip_address char(15) not null after input_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // init product_id $sql = "select supplier_code, product_code, mark_code from $t_table order by supplier_code, product_code, mark_code " ; if (!$res=mysql_query($sql, $dbh)) { echo '
' . mysql_error() . '

' . $sql; exit;} $t_supplier_code = ''; $t_product_id = 0; while ($row = mysql_fetch_row ($res)) { $supplier_code = $row[0]; $product_code = $row[1]; $mark_code = $row[2]; // get t_product_id if ($t_supplier_code != $supplier_code) { $t_supplier_code = $supplier_code; $t_product_id = '01'; } else { $t_product_id = ($t_product_id*1) + 1; $t_product_id = str_pad($t_product_id, 2 , "0", STR_PAD_LEFT); } // set product_id $sql1 = " update $t_table set product_id = '$t_product_id' where supplier_code = '$supplier_code' and product_code = '$product_code' and mark_code = '$mark_code' "; if (!$res1=mysql_query($sql1, $dbh)) { echo mysql_error() . '
' . $sql1; exit; } } // create index $sql = "create UNIQUE index index_2 on $t_table ( supplier_code, product_id)"; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // drop old index dan mark_code $sql = " alter table $t_table drop index index_1, drop mark_code "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } echo 'Table ' . $t_table . ' has been alterred successfully!

'; // =========================================================================== // alter customer_cp 11/08/2017 20:38 // Samudra 14/08/2017 18:40 // =========================================================================== $file = "omc_cpa.customer_cp"; // alter $sql = " alter table $file change phone phone varchar(60) not null, add description text null after email "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // concat phone and hp $sql = " update $file set phone = hp where phone = '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } $sql = " update $file set phone = concat(phone, ', ', hp) where phone <> '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // drop hp $sql = " alter table $file drop hp "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } echo 'Table ' . $file . ' has been alterred successfully!

'; $file = "omc_bsa.customer_cp"; // alter $sql = " alter table $file change phone phone varchar(60) not null, add description text null after email "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // concat phone and hp $sql = " update $file set phone = hp where phone = '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } $sql = " update $file set phone = concat(phone, ', ', hp) where phone <> '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // drop hp $sql = " alter table $file drop hp "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } echo 'Table ' . $file . ' has been alterred successfully!

'; $file = "omc_dpa.customer_cp"; // alter $sql = " alter table $file change phone phone varchar(60) not null, add description text null after email "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // concat phone and hp $sql = " update $file set phone = hp where phone = '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } $sql = " update $file set phone = concat(phone, ', ', hp) where phone <> '' and hp <> '' "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } // drop hp $sql = " alter table $file drop hp "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } echo 'Table ' . $file . ' has been alterred successfully!

'; // =========================================================================== // alter product 21/08/2017 15:55 // =========================================================================== $file = "$db_center.product"; $sql = " alter table $file add input_by  varchar(10) not null after product_name, add input_date  datetime not null after input_by , add input_ip_address char(15) not null after input_date, add last_update_by varchar(10) not null after input_ip_address, add last_update_date datetime not null after last_update_by, add last_ip_address char(15) not null after last_update_date "; if (!$res=mysql_query($sql, $dbh)) { echo mysql_error() . '
.....Gagal.....
' . $sql . '

'; exit; } echo 'Table ' . $file . ' has been alterred successfully!

'; // =========================================================================== // Akuntansi // =========================================================================== /* // Chart 0f Account (center) include("../_utility/coa_01_refresh_table.php"); include("../_utility/coa_02_refresh_table.php"); include("../_utility/coa_03_refresh_table.php"); include("../_utility/coa_04_refresh_table.php"); // Journal per cabang $file = "omc_cpa.journal"; include("../_utility/journal_refresh_table.php"); $file = "omc_bsa.journal"; include("../_utility/journal_refresh_table.php"); $file = "omc_dpa.journal"; include("../_utility/journal_refresh_table.php"); // gl per cabang $file = "omc_cpa.gl"; include("../_utility/gl_refresh_table.php"); $file = "omc_bsa.gl"; include("../_utility/gl_refresh_table.php"); $file = "omc_dpa.gl"; include("../_utility/gl_refresh_table.php"); // trial_balance per cabang $file = "omc_cpa.trial_balance"; include("../_utility/trial_balance_refresh_table.php"); $file = "omc_bsa.trial_balance"; include("../_utility/trial_balance_refresh_table.php"); $file = "omc_dpa.trial_balance"; include("../_utility/trial_balance_refresh_table.php"); */ // =========================================================================== // The End // =========================================================================== echo "

S E L E S A I SEMUA ---------------" . date("Y-m-d H:i:s") . "

"; /* Progress ======== => replace goods menjadi $db_center.goods s/d program goods_rpt.form.inc - 4 Agustus 2014 => Review good_add_upd_del.inc Antara penghapusan table dengan waktu validasi penghapusan (spy sinkron) => ok 6/8/2014 ---------------------------------------------------------------------------------------------------- - 6 Agustus 2014 => Cek Penghapusan Barang => inprogress 1. goods_supplier hrs terhapus kalau barang utk supplier tsb sdh tidak ada (terhapus semua) => OK 2. goods_customer hrs terhapus juga ... sama dengan goods_supplier => Done (7/8/2014) Done 7 Agustus 2014 ---------------------------------------------------------------------------------------------------- 7 Agustus 2014 - Sempurnakan modul sync.php yg baru => Inprogress 8/8/2104 kumpulkan goods.last_update_date ke sync_table (sync.php): Apakah goods atau goods_for_branch lihat di goods_ad_upd_del.inc OK! => sync.php 2.2. Validater Sync Table: 12/8/2014 Done - sync_log .... rechek! ok 12/08/2014 ok 12/8/2014 => Test jalanin sync.php: 13/8/2014 Inprogress - Sedang dilengkapai Echo "log...."; Done 13/8/2104 - Review sync.php inprogress 13/8/2104 (Prinsip Sinkronisasi msh blm jelas .... lihat keterangan/header sync.php lg diedit) - Coba Cek hapus kode barang: '0 580 254 911' Inprogress 13/8/2104 (Masih ga ke hapus goods_supplier, kenapa ....?) */ /* Sipade Online 2019-06-10 Migrasi Data 1) Export dari www ke local, per database Hasil: Downloads/otomotif_omc.sql Downloads/otomotif_omc_bsa.sql Downloads/otomotif_omc_cpa.sql Downloads/otomotif_omc_dpa.sql 2) Create database (directory) data/omc, data/omc_bsa, data/omc_cpa,data/omc_dpa, Import per database hasil download data/omc =< (downloads/otomotif_omc.sql) data/omc_bsa =< (downloads/otomotif_omc_bsa.sql) data/omc_cpa =< (downloads/otomotif_omc_cpa.sql) data/omc_dpa =< (downloads/otomotif_omc_dpa.sql) 3) Copy omc.branch omc.user_group_position omc.user_profile 5) Run Admin/Instalasi Versi Baru */