<?php 
	include ('header.php'); ?>
    <!-- Compose Message List -->
    
    
    
    <div class="col-sm-8 col-lg-9">
    	<div class="alert alert-success alert-dismissable animation-fadeIn">
        <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
      <strong>Important</strong><br>Make sure the first line of your mail is pure text and *NOT* any graphical content, this helps the reciver to know what the content is!
    </div>
        <!-- Compose Message Block -->
        <div class="block">
            <!-- Compose Message Title -->
            <div class="block-title">
                <h2><i class="hi hi-pencil"></i> Compose <strong>Message</strong></h2>
            </div>
            <!-- END Compose Message Title -->

            <!-- Compose Message Content -->
            <form action="<?php echo url('/Mail');?>" method="post" class="form-horizontal form-bordered" enctype="multipart/form-data">
                <div class="form-group">
                    	<label class="col-md-3 col-lg-2 control-label" for="compose-subject">To</label>
                    	<div class="col-md-9 col-lg-10">
                    	<select class="select-chosen" name="who_to">
                    	<div class="col-md-9 col-lg-10">
                    	<option value="">Select a Pilot</option>
                    	</div>
                    	<?php if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) {
                        ?>
                    	<option value="all">NOTAM (All Pilots)</option>
                    	<?php
                    	}
                    	foreach($allpilots as $pilots) {
                        	echo '<option value="'.$pilots->pilotid.'">'.$pilots->firstname.' '.$pilots->lastname.' - '.PilotData::GetPilotCode($pilots->code, $pilots->pilotid).'</option>';
                    	}
                    	?>
                		</select>
                </div>		
                </div>
                <div class="form-group">
                    <label class="col-md-3 col-lg-2 control-label" for="compose-subject">Subject</label>
                    <div class="col-md-9 col-lg-10">
                        <input type="text" name="subject" class="form-control form-control-borderless" value="<?php echo $_GET['subject']; ?>" placeholder="Your Subject.." >
                    </div>
                </div>
                <!--<div class="form-group">
                    <label class="col-md-3 col-lg-2 control-label" for="compose-message">Message</label>
                    <div class="col-md-9 col-lg-10">
                        <textarea name="message" rows="20" class="form-control" placeholder="Your Message.."></textarea>
                    </div>
                </div>-->
                <div class="form-group">
                  <label class="col-md-3 col-lg-2 control-label" for="compose-message">Message</label>
                <div class="col-md-9 col-lg-10">
                    <textarea id="textarea-ckeditor" name="message" class="ckeditor" style="visibility: hidden; display: none;"><?php echo $_GET['message']; ?></textarea>
                </div>
                </div>
                
                <div class="form-group form-actions">
                    <div class="col-md-9 col-md-offset-3 col-lg-10 col-lg-offset-2">
                    	<input type="hidden" name="who_from" value="<?php echo Auth::$userinfo->pilotid ?>" />
                		<input type="hidden" name="action" value="send" />
                        <input type="submit" class="btn btn-sm btn-success" value="Send iMail">
                        <input type="reset" class="btn btn-sm btn-default" value="Reset">
                        <h5> <span class="pull-right">iMail <strong><em>v4</em></strong></span></h5>
                    </div>
                </div>
                
             </form>
             
            <!-- END Compose Message Content -->
        </div>
        <!-- END Compose Message Block -->
    </div>
    <!-- END Compose Message -->
</div>
<!-- END Inbox Content -->
