I have created a plug-in with an Admin Menu that displays a list of artists saved into the database in a custom table. This page is a “master” page and I am trying to figure out how to link the artist name to a “details” page all in the backend. From the codex and other books I have determined that the second level pages should be like the top level pages in that it will be a function that displays the content. I cannot figure out how do I “link” to that callback function.
I add the first level page with this:
add_submenu_page('ppmtalentexpo', 'TARSTE II', 'TARSTE II', 'administrator', 'tarste2submenu2', 'jwg_talentexpo_options2_page');
and diplay the first level with this:
function jwg_talentexpo_options2_page() {
global $wpdb;
$cnt = 0;
$rows = $wpdb->get_results("SELECT * from ppm_tarste2_bands ORDER BY band_name");
//echo '<pre>'; echo var_dump( $rows ); echo '</pre>';
$retHTML = "<div class="wrap trkr"><h2><div id='icon-upload' class="icon32"></div> PPM Talent Expo Administrator -- TARSTE II</h2><br><br>";
$retHTML .= "<table cellpadding='5' cellspacing='0' border="1" style="width:96%;margin:auto;">";
$retHTML .= "<tr><td colspan='4'>" . count($rows) . " registered.</td></tr>";
for( $c = 0; $c<count($rows);$c++ ) :
$retHTML .= "<tr>";
$retHTML .= "<td><span style="font:bold 16px sans-serif;color:#F87114;"><a href="#">" . $rows[$c]->band_name . "</a></span>";
$retHTML .= "<br><b>Contact: " . $rows[$c]->band_contact_person . "</b></td>";
$retHTML .= "<td><a href="mailto:" . $rows[$c]->band_email . "">EMAIL</a>";
if( $rows[$c]->band_url != '' && $rows[$c]->band_url != 'n/a' ){
$retHTML .= " | <a target="_blank" href="" . $rows[$c]->band_url . "">WEB</a></td>";
} else {
$retHTML .= "</td>";
} // end if
$retHTML .= "<td>" . formatPhone($rows[$c]->band_contact_phone) . "</td>";
$retHTML .= "<td>";
switch( (int) $rows[$c]->status ){
case 1:
$retHTML .= "Registered";
break;
case 2:
$retHTML .= "Selected";
break;
case 3:
$retHTML .= "Face-Off";
break;
case 4:
$retHTML .= "Winner";
break;
} // end switch
$retHTML .= "</td>";
$retHTML .= "</tr>";
endfor;
$retHTML .= "</table>";
$resHTML .= "</div>";
echo $retHTML;
} // end function
So, within the for loop I am trying to link to the details page of each registered artist in the second $retHTML line with an anchor tag. My plan is to create a function to display the details of that artist. Again, what do I put in the anchor tag OR is there a better way to do what I am trying?
Thanks in advance for any guidance or help provided,
Jon