sted Posted March 19, 2014 Posted March 19, 2014 is it possible to get a csv file when displayed via php to have clickable header rows so you can sort it in the browser if so any pointers? so say my csv contains a row called alphabet but the file is in random order i could click it and it would display a b c d ...
localzuk Posted March 19, 2014 Posted March 19, 2014 Your best bet is to look at something like Tablesorter and JQuery. So, you'd generate the basic table from CSV using PHP, then apply tablesorter to it to allow end users to change sorting. jQuery plugin: Tablesorter 2.0 1
sonofsanta Posted March 19, 2014 Posted March 19, 2014 Never done it myself, but I imagine you'd just read the CSV file into an array and do all your work on that - and it seems there's a function that does just that. PHP: str_getcsv - Manual 1
sted Posted March 19, 2014 Author Posted March 19, 2014 cheers something to look at. Why is it when you think youve finished something you get a load of feature requests lol this seemed like the biggest "deal breaker"
localzuk Posted March 19, 2014 Posted March 19, 2014 No system is ever finished. First thing you learn when programming things.
sted Posted March 19, 2014 Author Posted March 19, 2014 No system is ever finished. First thing you learn when programming things. true but i was expectingminor things not can this be sorted and a "traffic light system" that has to somehow wade through pc specs and decide good/ok/bin not even sure HOW to calculate that one as too many variables
localzuk Posted March 19, 2014 Posted March 19, 2014 true but i was expectingminor things not can this be sorted and a "traffic light system" that has to somehow wade through pc specs and decide good/ok/bin not even sure HOW to calculate that one as too many variables For a system like that, I'd be assigning values to things, then basing the evaluation based on the final score. You can then add weighting to different components based on importance (eg. having lots of RAM is great, but if it has a pentium 2 processor the ends score is still going to be low).
sted Posted March 19, 2014 Author Posted March 19, 2014 (edited) For a system like that, I'd be assigning values to things, then basing the evaluation based on the final score. You can then add weighting to different components based on importance (eg. having lots of RAM is great, but if it has a pentium 2 processor the ends score is still going to be low). yeah but its hard deciding numbers for say a Intel® Pentium® D CPU 2.66GHz and then getting it to automatically assign that number for every instance not impossible but a bit of a head scratcher (and then it needs to be updatable unless i go for highest score wins and just change the thresholds (obvious but im just thinking out loud here)) I suspect it will require some lookup table (either in the code or as a separate table with processor names (for example hdd/ram is easy its just a number) and then just arbitrarily say a p2 scores 1 a p4 scores 5 an i7 4*** scores 50 or some such Edited March 19, 2014 by sted
localzuk Posted March 19, 2014 Posted March 19, 2014 How about using something based on the scores for CPUs at PassMark Software - CPU Benchmark Charts Then you just update thresholds as time goes by.
sted Posted March 19, 2014 Author Posted March 19, 2014 How about using something based on the scores for CPUs at PassMark Software - CPU Benchmark Charts Then you just update thresholds as time goes by. more software to run (atm im using a vbs that grabs system info so if its not recorded by wmi i cant get it). If windows 8.1 still used the same experience index as 7/8 id just use that
sted Posted March 19, 2014 Author Posted March 19, 2014 well i can get jQuery plugin: Tablesorter 2.0 working on a straight table just cant seem to get it to do owt with the csv its reading in hmm )after lots of fiddling
LosOjos Posted March 19, 2014 Posted March 19, 2014 No system is ever finished. First thing you learn when programming things. +1 Also, that awkward moment when you have "finished" coding [the current version of] your software and you discover a much more efficient way of doing things but that requires an almost complete rewrite to implement. We live and learn!
localzuk Posted March 19, 2014 Posted March 19, 2014 +1 Also, that awkward moment when you have "finished" coding [the current version of] your software and you discover a much more efficient way of doing things but that requires an almost complete rewrite to implement. We live and learn! I trimmed a project from 50,000 lines of code down to less than 10,000 between versions... Constantly going "what was I thinking?!!?"
sonofsanta Posted March 19, 2014 Posted March 19, 2014 +1 Also, that awkward moment when you have "finished" coding [the current version of] your software and you discover a much more efficient way of doing things but that requires an almost complete rewrite to implement. We live and learn! Do it twice to do it right 1
LosOjos Posted March 19, 2014 Posted March 19, 2014 I trimmed a project from 50,000 lines of code down to less than 10,000 between versions... Constantly going "what was I thinking?!!?" Yeah I'm always doing this, especially when it's something new (like my recent foray in to ASP.NET). Problem is, I start out with the basics and get to where I need but by the time I'm finished, I know a lot more about the technology than when I started and could do it again 10x quicker, faster and more efficiently! The problem with being a hobbyist programmer I suppose Do it twice to do it right Great quote
sted Posted March 19, 2014 Author Posted March 19, 2014 yeah my pc info gathering script has gone from approx 270 to aprrox 150 lines does a bit less but its now commented properly and i can see whats doing what (and id wager 10-20 lines are testing that ive just remmed out things like wscript.echo some variable to see if its right
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now