progress bar/graph with php and mysql need help displaying and calculating
Hello I have a progress bar (a image) and i want it to displa a certain % of something however the x/x will be dynamic example:
task viriable = taskincrease|task information
task1 = 5|this is task one
task2 = 1|this is task two
task3 = 1|this is task three i wish i knew what i was doing
task4 = 3|this is task 4 this one is a rating of a three
task5 = 5|this is task 5 weee
task6 = 2|this is task and 6
now my theory is task/taskamount so if task 5 taks of the 6 are complete that'll be something like 95% but however i wanted to make the little taskincrease value change the progress/precent of the bar so say task/taskincrase so blank of 100 where 100 would = 17 since there are 17 task points so 5-17=12=amountleft
this is really hard to explain but in other worlds i want some tasks to be of greater value on the progress meter then others, so if i complete task1 (with a 5)high priority tasks it'll show the same value in completed if i completed task4 & task6
task1 completed would be something like %completed/100% (%left)
now i need to display this in both a text format and a graphic bar
something below is how i wanted to make my database
Code:CREATE TABLE `task` (
`task_id` int(10) unsigned NOT NULL auto_increment,
`task_open` enum('0','1') NOT NULL default '0',
`task_value` enum('1','2','3','4','5') NOT NULL default '1',
`task_submitted` datetime NOT NULL default '0000-00-00 00:00:00',
`task_updated` datetime NOT NULL default '0000-00-00 00:00:00',
`task_completed_est` datetime NOT NULL default '0000-00-00 00:00:00',
`task_completed` datetime NOT NULL default '0000-00-00 00:00:00',
`task_title` varchar(255) NOT NULL default '',
`task_content` text NOT NULL,
PRIMARY KEY (`task_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;INSERT INTO `task` (`task_id`, `task_open`, `task_value`, `task_submitted`, `task_updated`, `task_completed_est`, `task_completed`, `task_title`, `task_content`) VALUES
(1, '0', '5', '0000-00-00 00:00:00', '2007-12-05 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '\0', '\0'),
(2, '0', '3', '0000-00-00 00:00:00', '2007-12-05 00:00:00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '\0', '\0');
anyway i need to know how to calculate the stuff to get the percents in php/mysql and output them in a graphics and text format, i uploaded some samples of thep rogress bar colors i want and the basic design of them
Attachments:
Image2.gif
(Download)
2.95 Kb, 202 views
