���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /proc/self/root/var/www/html/tien-dien/code/admin/shipping/ |
<?php global $DB, $print; $install_messages = array(); // Create tb_shipping_methods table if it doesn't exist $check_table = $DB->query("SHOW TABLES LIKE 'tb_shipping_methods'"); if ($DB->get_num_rows() == 0) { $sql = "CREATE TABLE IF NOT EXISTS `tb_shipping_methods` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `description` text, `cost` decimal(10,2) NOT NULL DEFAULT '0.00', `status` tinyint(1) NOT NULL DEFAULT '1', `sort_order` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; $DB->query($sql); // Insert default shipping methods $DB->query("INSERT INTO `tb_shipping_methods` (`name`, `description`, `cost`, `status`, `sort_order`) VALUES ('Giao hàng tiêu chuẩn', 'Giao hàng trong 3-5 ngày làm việc', 30000.00, 1, 1), ('Giao hàng nhanh', 'Giao hàng trong 1-2 ngày làm việc', 50000.00, 1, 2), ('Giao hàng miễn phí', 'Miễn phí giao hàng cho đơn hàng trên 500,000 VNĐ', 0.00, 1, 3)"); $install_messages[] = "Đã tạo bảng tb_shipping_methods và thêm các phương thức vận chuyển mặc định."; } // Check if orders table exists and if shipping_method column exists $check_orders_table = $DB->query("SHOW TABLES LIKE 'tb_orders'"); if ($DB->get_num_rows() > 0) { // Check if shipping_method_id column exists $check_column = $DB->query("SHOW COLUMNS FROM `tb_orders` LIKE 'shipping_method_id'"); if ($DB->get_num_rows() == 0) { // Add shipping_method_id and shipping_cost columns to tb_orders table $DB->query("ALTER TABLE `tb_orders` ADD COLUMN `shipping_method_id` int(11) DEFAULT NULL, ADD COLUMN `shipping_cost` decimal(10,2) NOT NULL DEFAULT '0.00'"); $install_messages[] = "Đã thêm các cột shipping_method_id và shipping_cost vào bảng tb_orders."; } } else { $install_messages[] = "Bảng tb_orders không tồn tại. Vui lòng chạy create_order_tables.php trước."; } $install_complete = true; ?>