Jump to content

How to add search feature and css to this table


Go to solution Solved by jjf3,

Recommended Posts

  • Solution

Ok, so what is the significance of the 10? Why are you counting to 10?

 

I really need to know the structure of your webinvt.txt file if I'm going to be able to run any tests myself.. Just putting 'stuff' in there won't work, as you're echoing out array indexes of strings, which means it's only going to grab a single letter, which would actually be a number from the real data I would assume.

 

To be honest, this is really a terrible way to manage your inventory, it's exceptionally clunky and nearly impossible to maintain.

 

I suggest you put your efforts into a writing a script that will parse your webinvt.txt file, and instead of writing it to a html file, save it to a database. You can then use phpmyadmin to manage the values in the database, or you could write your own, very basic, CMS (content management system).

 

But as I said, without knowing what each field in your txt file is supposed to be (they're not going to all be strings), it's incredibly hard for me to give you definitive help, without just throwing guesses at you..

 

 

OK increasing that count seems to have worked. I can get the datatable to load correctly, however, there is still a problem. It generates another table first which then feeds into the datatable after a couple of seconds. The datatable should just load up without having to do that, I would think. This I'm guess is a problem with the way the PHP is set up. 

@jjf3, you have been asked what the structure of this data is, not for actual data. your code implies there's at least 24 fields (0-23) to a line (you were asked if there were 20 and you confirmed the 20 value), some with specific prefixes. no one here is going to sift through the code (which is questionable code anyway with things like the if($i==10) in it) to reverse engineer what the format of the data in the file looks like in order to make up some test data that matches what the code expects.

 

if you want specific help, take a line of your actual data and alter the sensitive data part of it and post it.

 

the performance problem is because you are outputting a huge amount of markup to the browser each time the page is requested. this is not an efficient solution, which is why using an actual database, which is optimized to find and sort data, is how this is normally done.

 

also, a scheme that writes an updated .html file every x amount of time would go away when using a database. you would use the current live data stored in the database on every page request.

 

you are struggling to get this to work with 5000 items. a database solution will easily work with a million items in a table.

 

edit: and please don't use the forum's quote button to make replies unless you are calling attention to something specifically in a post. all that does it clutter up the page with things we have already read before. there's a quick reply form at the bottom of the thread, there's a 'More reply options' button at the bottom of the quick reply form, and there's a 'Reply to this topic' button a the top of the thread that all can be used to write a reply.

Edited by mac_gyver

1. @jjf3, you have been asked what the structure of this data is, not for actual data. your code implies there's at least 24 fields (0-23) to a line (you were asked if there were 20 and you confirmed the 20 value), some with specific prefixes. no one here is going to sift through the code (which is questionable code anyway with things like the if($i==10) in it) to reverse engineer what the format of the data in the file looks like in order to make up some test data that matches what the code expects.

 

if you want specific help, take a line of your actual data and alter the sensitive data part of it and post it.

My apologies.

 

1. I thought that's what I was doing. I just told denno020 that if he wanted to create the webinvt.txt file himself he should just input about 20 elements of w/e. I only used "stuff" as an example in place of the sensitive data which is located in the webinvt. He seems to want the data in the txt file which is irrelevant to the problem. 

 

 

 

2. The performance problem is because you are outputting a huge amount of markup to the browser each time the page is requested. this is not an efficient solution, which is why using an actual database, which is optimized to find and sort data, is how this is normally done.

 

also, a scheme that writes an updated .html file every x amount of time would go away when using a database. you would use the current live data stored in the database on every page request.

 

you are struggling to get this to work with 5000 items. a database solution will easily work with a million items in a table.

 

 

As I said before, I'm not sure if the environment that I get the data from will be able to communicate nicely with a database like that. It doesn't like outputting data. And I have no idea how the webinvt.txt was created in the first place. I will have to see from my end what else can be done with the limited capabilities of the system. However, I believe that the main problem has been solved. Thanks all for your help! 

Edited by jjf3

php has sqlite built-in that would provide a better solution than the "write everything to a inventory4.html file" scheme currently being used.

 

you would use datatables on the front end with a sqlite backend.

 

hm, thanx I will definitely look into that. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.