Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request! #2

Open
offternet opened this issue Oct 14, 2024 · 16 comments
Open

Feature request! #2

offternet opened this issue Oct 14, 2024 · 16 comments
Labels
enhancement New feature or request

Comments

@offternet
Copy link

offternet commented Oct 14, 2024

  • Display Thumbnail image via url (or uploaded) --> hyperlink thumbnail to external url (image not stored in database)
  • (options table) size, color 1, color 2, color 3, single / double (Dropdown selections by user - for each product)
  • location, serial number, key number, invoice number (varchar; text; number as appropriate - all manually entered)
  • discount price by either percentage or manually entered discount amount resulting in final price (for each product)
  • Customer table: Name, address, city, state, zip, email, phone1, phone2 (available for quote.php each yes/no selected)
  • frontend customer display of product via QRcode - NO Password (works by committing out Login Check in stock.php)
  • frontend search of products for customers
  • Current Category works well for Model Type of product.
@aftechro aftechro added the enhancement New feature or request label Oct 14, 2024
@aftechro
Copy link
Owner

The system was originally built to track stock ins and outs, but it’s a bit of a time-consuming project. To be honest, I’m not sure when I’ll get around to focusing on it since I’m tied up with other things right now. I usually just work on it in my spare time. That said, I’m keeping the idea open and may develop it further down the line—it would just take a fair amount of time to add new features and rework the code.

I also get the feeling you might need something more customized to suit your needs. I just need to find some time to expand it when I can!

@offternet
Copy link
Author

offternet commented Oct 14, 2024

The system was originally built to track stock ins and outs, but it’s a bit of a time-consuming project. To be honest, I’m not sure when I’ll get around to focusing on it since I’m tied up with other things right now. I usually just work on it in my spare time. That said, I’m keeping the idea open and may develop it further down the line—it would just take a fair amount of time to add new features and rework the code.

I also get the feeling you might need something more customized to suit your needs. I just need to find some time to expand it when I can!


Thank you for being honest and I understand about too many projects and not enough time for supporting all of them or providing custom work for others. Yes you are correct, what I need is custom options. I can work your code once I understand it (to some degree) to help my brother be more efficient in small building sales (I am just old and very slow at my limited abilities with PHP, javascript and bootstrap UI).

I'll only post actual bug issues (if any) I may find with your official coding (and not my changes).

You have been very kind to assist me which has indeed helped me so much.

Thanks, Robert Cooper, Kansas, USA

@aftechro
Copy link
Owner

aftechro commented Oct 15, 2024

just added customers option.
check customers.php, nav.php and stock-db.sql for creating table

image

@aftechro aftechro reopened this Oct 15, 2024
@aftechro aftechro changed the title Will any of these suggested options be workable for future development of your inventory program ? Feature request! Oct 15, 2024
@offternet
Copy link
Author

just added customers option. check customers.php, nav.php and stock-db.sql for creating table

AWESOME ! Last night I started creating customer input form/table using accounts.php file. I'll follow your lead :) as I am not a programmer. Title change was needed too 👍

bobbyC-mod-customer

@offternet
Copy link
Author

Just installed your latest updates, WOW - I could never accomplish what you can do in 50 years even if I tried. Great Work ! Paypal will be incoming.
pro-customer-awesome-AFTECH

@aftechro
Copy link
Owner

Hey Robert, glad you are happy with it. And thank you for the generous donation! Much appreciate it!

@offternet
Copy link
Author

offternet commented Oct 16, 2024 via email

@offternet
Copy link
Author

offternet commented Oct 17, 2024

Additional Feature - Anycode popup page.
A popup page displaying any html, css and javascript that a user inserts in that product record table. Of course width, height and alignment would need to be configurable as well. A link would be added to product page in each record and such link name could be changed by user. Similar to my crude popup in this video where link is "YES".

https://youtu.be/ZP1mH7tUKpw?si=SI6tZFl41KLTVUt0&t=80

@aftechro
Copy link
Owner

aftechro commented Oct 17, 2024

Additional Feature - Anycode popup page. A popup page displaying any html, css and javascript that a user inserts in that product record table. Of course width, height and alignment would need to be configurable as well. A link would be added to product page in each record and such link name could be changed by user. Similar to my crude popup in this video where link is "YES".

https://youtu.be/ZP1mH7tUKpw?si=SI6tZFl41KLTVUt0&t=80

oh wow, thanks for the video presentation :)) i seen you customized it for your needs, so well done!
look into echoing the success/error message. products have

  $success_message = '';
   $error_message = '';

then play with your insert/edit functions using this example:

for adding option:

            if ($stmt->execute()) {
               // Log the addition
               logAction($conn, $user_id, 'add', $conn->insert_id, "Added product: $name"); 
               $success_message = "Product added successfully!";
            } else {
            $error_message = "Error adding product: " . $stmt->error;
           }
 

for editing option:

       if ($stmt->execute()) {
           // Log the update
           logAction($conn, $user_id, 'edit', $id, "Updated product: $name");
           $success_message = "Product updated successfully!";
       } else {
           $error_message = "Error updating product: " . $stmt->error;
       }

that will then output the success message in the div alert where needed using the html bellow, which can be place in the location where you want the message to be shown

   <?php if ($success_message): ?>
   <div class="alert alert-success alert-dismissible fade show" role="alert">
       <?= htmlspecialchars($success_message) ?>
       <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
   </div>
   <?php endif; ?>
   
   
   as for the popup message, i wont recommend that. you can use show modal and include the coding within the modal
check the sql_import.php file where the row inserted is output into a success div alert:

// Insert product
$stmt = $conn->prepare("INSERT INTO products (name, description, buying_price, selling_price, quantity, category_id, account_id, vendor_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssddiiii", $name, $description, $buyingPrice, $sellingPrice, $quantity, $categoryId, $accountId, $vendorId);

if ($stmt->execute() === false) {
    echo "<div class='alert alert-danger'>Failed to insert product: " . htmlspecialchars($stmt->error) . "</div>";
} else {
    echo "<div class='alert alert-success'>Inserted product successfully.</div>";
}

you can customize with modal like this, add it at the bottom page:

<!-- Modal Structure -->
<div id="statusModal" class="modal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="modalTitle"></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <p id="modalMessage"></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

change your insert sql query:

// Insert product
$stmt = $conn->prepare("INSERT INTO products (name, description, buying_price, selling_price, quantity, category_id, account_id, vendor_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssddiiii", $name, $description, $buyingPrice, $sellingPrice, $quantity, $categoryId, $accountId, $vendorId);

if ($stmt->execute() === false) {
    // Error message to show in modal
    echo "<script>
            document.getElementById('modalTitle').innerText = 'Error';
            document.getElementById('modalMessage').innerHTML = 'Failed to insert product: " . htmlspecialchars($stmt->error) . "';
            $('#statusModal').modal('show');
          </script>";
} else {
    // Success message to show in modal
    echo "<script>
            document.getElementById('modalTitle').innerText = 'Success';
            document.getElementById('modalMessage').innerHTML = 'Inserted product successfully.';
            $('#statusModal').modal('show');
          </script>";
}

add/edit buttons as well as needed

<div class="d-flex justify-content-between mb-3">
    <button class="btn btn-primary" id="dynamicModalTrigger" data-bs-toggle="modal">Add Product</button>


<script>

function setModalTrigger(modalId) {
    const button = document.getElementById('dynamicModalTrigger');
    button.setAttribute('data-bs-target', '#' + modalId); // dynamically set target modal
}
</script>

Give it a try and let me know what you manage!

@offternet
Copy link
Author

I will try your code and THANK YOU for sharing it ! I really appreciate it as this will allow me to get up to speed much faster.

@offternet
Copy link
Author

offternet commented Oct 17, 2024

I properly formated an import file to see message. It appeared at top, very nice.
import-successful

If the output was to the lower part of the page like is done in quote.php, it would open a whole new dynamic, including images, etc. and the menu would still be at the top. Maybe use Reset Button to refresh page and clear message ? Lower output Example:
new-output-successfull-import

@offternet
Copy link
Author

offternet commented Oct 17, 2024

Above image enhancement is from the mind of uneducated code crafter but, my heart is in it for the long run. Additonally, listing the successfully imported rows below the message would be useful for admin (or Agen/User) to verify all data was correctly formated to table. (Not everyone has access to phpmyadmin, i.e., agent most likely would not have access).

@aftechro
Copy link
Owner

Well done Robert! you see, if you look at the code you`ll get it :d with me is just functionality in first place then the looking :d but yeah, that was meant for the torubleshooting as i had some issues, then forgot to removed, final message should just show total number of products were added. but having the current code, will tell you which line is with issue so its good to have it.

@offternet
Copy link
Author

Thank you for claification about debugging messages. So often I miss the obvious :( . I have lots to work with now, for next few weeks... lots of fun :)

@offternet
Copy link
Author

offternet commented Oct 21, 2024

I am sitting here in total awe and appreciation about your latest update. I'm Updating my test install with each upate you make and testing them. Customer & Quotes associated - Now that is some Awesome Enhancement !

quotes-customers-married-awesome

@aftechro
Copy link
Owner

Click on the customer name inside customers table, that should take you to customer_id where the quotes tab will show quotes and status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants