From afedf18e67c1bd184febb533d31d94e2ef16149f Mon Sep 17 00:00:00 2001 From: Kamran Zafar Date: Thu, 24 Oct 2024 12:37:17 +0500 Subject: [PATCH] updated form --- createBox.php | 50 ++----------------- .../get_branches.php => get_branches.php | 2 +- 2 files changed, 4 insertions(+), 48 deletions(-) rename unnecessary-files/get_branches.php => get_branches.php (77%) diff --git a/createBox.php b/createBox.php index 6e84181..147701f 100644 --- a/createBox.php +++ b/createBox.php @@ -499,23 +499,7 @@ - - + - - + @@ -589,7 +546,6 @@ function updateBarcodeInput() { // Initialize dselect for the initial dropdowns dselect(document.querySelector('#lev1'), config); dselect(document.querySelector('#level2'), config); - dselect(document.querySelector('#level3'), config); // When company is changed, fetch the branches $('#lev1').change(function() { @@ -610,7 +566,7 @@ function updateBarcodeInput() { $('#level2').append(''); // Add the new options from the response $.each(branches, function(index, branch) { - $('#level2').append(''); + $('#level2').append(''); }); // Refresh or reinitialize dselect dselect(document.querySelector('#level2'), config); diff --git a/unnecessary-files/get_branches.php b/get_branches.php similarity index 77% rename from unnecessary-files/get_branches.php rename to get_branches.php index 18ad761..24c072a 100644 --- a/unnecessary-files/get_branches.php +++ b/get_branches.php @@ -5,7 +5,7 @@ $company_id = $_POST['company_id']; // Simple SQL query to get branches for the selected company - $result = $conn->query("SELECT branch_id, acc_lev_2, account_desc FROM branches WHERE comp_id_fk = '$company_id'"); + $result = $conn->query("SELECT branch_id, branch_name FROM branches WHERE comp_id_fk = '$company_id'"); //store data into array $branches = array();