Forum Moderators: coopster
$web_array = array();
$web_array['web_custom']['name'] = "Custom software (or else we'll modify somebody elses)";
$web_array['web_custom']['milk'] = 4;
$web_array['web_users']['name'] = "Users database";
$web_array['web_users']['milk'] = 2;
$web_array['web_forum']['name'] = "Discussion forums";
$web_array['web_forum']['milk'] = 1;
$web_array['web_audio']['name'] = "Audio compilation";
$web_array['web_audio']['milk'] = 3;
$web_array['web_video']['name'] = "Video compilation";
$web_array['web_video']['milk'] = 3;
$web_array['web_photo']['name'] = "Photography";
$web_array['web_photo']['milk'] = 4;
$web_array['web_flash']['name'] = "Shockwave flash";
$web_array['web_flash']['milk'] = 1;
$web_array['web_logos']['name'] = "We'll create Logos for you";
$web_array['web_logos']['milk'] = 3;
$web_array['web_graphics']['name'] = "Intensive graphic design";
$web_array['web_graphics']['milk'] = 3;
$web_array['web_news']['name'] = "News page";
$web_array['web_news']['milk'] = 3;
$web_array['web_shop']['name'] = "Shopping cart application";
$web_array['web_shop']['milk'] = 2;
$web_array['web_admin']['name'] = "Complete administration suite";
$web_array['web_admin']['milk'] = 3;
$web_array['web_tweaks']['name'] = "30 days tweaking after contract close";
$web_array['web_tweaks']['milk'] = 4;
Now for each member of the array I want to show it as a checkbox on the page if it's "milk" value is greater than the value of the page they are on.
For instance if they are supposed to see a value of three they will see this:
<input type="checkbox" id="web_options[]" value="web_custom" /> Custom software (or else we'll modify somebody elses)<br />
<input type="checkbox" id="web_options[]" value="web_audio" /> Audio compilation<br />
<input type="checkbox" id="web_options[]" value="web_video" /> Video compilation<br />
<input type="checkbox" id="web_options[]" value="web_photo" /> Photography<br />
<input type="checkbox" id="web_options[]" value="web_logos" /> We'll create Logos for you<br />
<input type="checkbox" id="web_options[]" value="web_graphics" /> Intensive graphic design<br />
<input type="checkbox" id="web_options[]" value="web_news" /> News page<br />
<input type="checkbox" id="web_options[]" value="web_admin" /> Complete administration suite<br />
<input type="checkbox" id="web_options[]" value="web_tweaks" /> 30 days tweaking after contract close
I want to know if I am going about this all wrong or what is it I am even doing. I'm sure there must be a more efficient way of doing this then what I might be trying because I don't even have it to work yet.
Please help me. I'm totally swamped by this project.
foreach($web_array as $key => $arr) {
if($arr['milk'] >= 3) echo "$key :: ",$arr['name'],"<br />\n";
} ;)