<?php include ('header.php'); ?>
    <!-- Compose Message List -->
    <div class="col-md-9">
        <!-- Compose Message Block -->
        <div class="block">
            <!-- Compose Message Title -->
            <div class="block-title">
               <h2><i class="hi hi-pencil"></i> Reply</h2>
            </div>
            <!-- END Compose Message Title -->
			<?php foreach($mail as $data) ?>
            <!-- Compose Message Content -->
            <form action="<?php echo url('/Mail');?>" method="post" class="form-horizontal form-bordered" enctype="multipart/form-data">
                <input type="hidden" name="who_from" value="<?php echo Auth::$userinfo->pilotid ?>" />
            	<input type="hidden" name="who_to" value="<?php echo $data->who_from; ?>" />
            	<input type="hidden" name="oldmessage" value="<?php echo ' '.$data->thread_id.'<br /><br />'; ?>" />
              <?php $user = PilotData::GetPilotData($data->who_from); $pilot = PilotData::GetPilotCode($user->code, $data->who_from); ?>
				      <div class="col-md-12">
                 <div class="alert alert-info">
				             Replying to <strong><?php echo $user->firstname.' '.$user->lastname; ?></strong>
				          </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"  value="Re: <?php echo $data->subject;?>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-3 col-lg-2 control-label" for="compose-subject">Last Message</label>
                    <div class="col-md-9">
                        <span class="h3"><blockquote><?php echo $data->message; ?><span class="text-muted pull-right"><i>- <?php echo date('d-m-Y @ h:ia', strtotime($data->date)); ?></i></span></blockquote></span>
                        
                    </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;"></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="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 -->
        