Can someone tell me why I'm getting an undefined function error?
Call to undefined function get_checkbox_labels() i
//beginning of check head
/* insert code to connect to your database here */
/* get the checkbox labels */
$videotypes = get_checkbox_labels("esu_videotypes");
// $focustypes = get_checkbox_labels("esu_focusareas");
// $poptypes = get_checkbox_labels("esu_populationtags");
/* create the html code for a formatted set of
checkboxes */
$video_types = make_checkbox_html($videotypes, 1, 200, "vid[]", $checked);
// $focus_types = make_checkbox_html($focustypes, 1, 200, "focus[]");
//$pop_types = make_checkbox_html($poptypes, 1, 200, "pop[]");
//end of check head
//form post here
echo "$video_types";
echo "$focus_types";
echo "$pop_types";
//submit
/* Prints a nicely formatted table of checkbox choices.
$arr is an array of objects that contain the choices
$num is the number of elements wide we display in the table
$width is the value of the width parameter to the table tag
$name is the name of the checkbox array
$checked is an array of element names that should be checked
*/
function make_checkbox_html($arr, $num, $width, $name, $checked=array()) {
/* create string to hold out html */
$str = "";
/* make it */
$str .= "<table width=\"$width\" border=\"0\">\n";
$str .= "<tr>\n";
/* determine if we will have to close add
a closing tr tag at the end of our table */
if (count($arr) % $num != 0) {
$closingTR = true;
}
$i = 1;
if (isset($checked)) {
/* if we passed in an array of the checkboxes we want
to be displayed as checked */
foreach ($arr as $ele) {
$str .= "<td><input type=\"checkbox\" name=\"$name\" value=\"$ele->id\"";
foreach ($checked as $entry) {
if ($entry == $ele->value) {
$str .= "checked";
continue;
}
}
$str .= ">";
$str .= "$ele->value";
if ($i % $num == 0) {
$str .= "</tr>\n<tr>";
} else {
$str .= "</td>\n";
}
$i++;
}
} else {
/* we just want to print the checkboxes. none will have checks */
foreach ($arr as $ele) {
$str .= "<td><input type=\"checkbox\" name=\"$name\" value=\"$ele->id\">";
$str .= "$ele->value";
if ($i % $num == 0) {
$str .= "</tr>\n<tr>";
} else {
$str .= "</td>\n";
}
$i++;
}
}
/* tack on a closing tr tag if necessary */
if ($closingTR == true) {
$str .= "</tr></table>\n";
} else {
$str .= "</table>\n";
}
return $str;
}
//end of function read