I have written a PHP code to parse my XML file using an array and a for loop and will set each and every value from the XML file to a varible and attached it to a new varible that builds everytime the script runs another line in table of the data parsed from the XML file.
for example my output is:
Host Name Uptime IP-Addr Status AC Notes [Click to Submit button]
ROY01 3hrs 42min 1.1.1.1 Backup ON [ ] Need to run maintinence at 09:00pm.
Now, the [] is the checkbox. I want to check the checkbox button and I want ONLY the notes cell to be colored in some kind of color.
How do I do that? Do I need to do that inside the for loop while parsing the XML file?
Example of how my PHP code is written
Code: Select all
<? php
$Filename=file.xml;
data=[];
$myfile= simplexml_load_file('$Filename');
<table syntax I cant remmber right now>
for loop parsing the xml.......... {
$machine=$xml->machine;
$uptime=$xml->uptime;
...
...
$mynotes=$xml->notes;
$data=<div><th>$machine</th><th>$uptime</th>..............<th>$mynotes</th></div>
}
echo $data
</table>
?>I thought about inserting a code that has a $color varible that stores the color varible name and if it is checked then the $color="yellow"
but I don't know how to validate if the checkbox is marked...
How can I do that?
Please Advise,
Roy.