<div class="cc_hubadm_content">
    <div class="cc_hubadm_box cc_hubadm_full">
    <div class="cc_hubadm_boxtitle">Email all Hub Pilots</div>
        <?php echo $message; ?>
    <form method="post" class="cc_hubopsform" action="<?php echo SITE_URL ?>/<?php echo $mloc ?>.php/HubOps/sendallmail">
           <table class="cc_hubadm_formtable">
               <tr>
                <td>Select Receipient:</td>
               <td><select name="pilotid"><option value="">All Pilots</option>
                 <?php if($pilots) foreach($pilots as $pil) { if($pil->pilotid == $pilotid) { $selected = "selected"; } else { $selected = ""; } ?>
                 <option value="<?php echo $pil->pilotid ?>" <?php echo $selected ?>><?php echo PilotData::GetPilotCode($pil->code ,$pil->pilotid) ?> - <?php echo $pil->firstname ?> <?php echo $pil->lastname ?></option>
                 <?php }?>
                 </select></td>
               </tr>
               <tr>
                   <td>Subject:</td>
                   <td>
                   <input type="text" name="subject" value="<?php echo $subj ?>" />
                   </td>
               </tr>
               <tr>
                   <td>Text:</td>
                   <td>
                       <textarea id="editor" name="message" style="width: 600px; height: 250px;">Dear {PILOT_FNAME} {PILOT_LNAME}, <?php echo $mailmsg; ?></textarea>
                   </td></tr>
               <tr><td></td><td>
                   <input type="submit" value="Send Email" /><br /><?php echo $message; ?></td></tr>
           </table>
    </form>
    </div>
</div>