<?php defined('BASEPATH') or exit('No direct Access is Allowed'); ?>
<style>

.container-tb {
    height: 500px;
    width: 100%;
    overflow: auto;
    border: 2px solid #999;
}
* {
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
table {
    border-collapse: collapse;
    table-layout: fixed;
    width: auto;
    min-width: 100%;
}
td, th {
    border: 1px solid #ccc;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}
thead td, thead th {
    border-top: none;
    border-bottom: none;
}
tfoot td, thead th {
    border-top: none;
    border-bottom: none;
}
td.fth-header, th.fth-header, td.fth-footer, th.fth-footer {
    border-top: none !important;
    border-bottom: none !important;
}
td.fth-header, th.fth-header {
        padding: 3px;
    background-color: #444;
    border-bottom: rgba(0,0,0,0.2);
    color: white;
}
td.fth-footer, th.fth-footer {
    background-color:  #444;
    border-top:  rgba(0,0,0,0.2);
    color: white;
}
</style>
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
<?php /*?>  <section class="content-header">
    <h1>  <small>WorkPackage Master</small> </h1>
    <ol class="breadcrumb">
      <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
      <li><a href="#">Manage</a></li>
      <li class="active">WorkPackage Master</li>
    </ol>
  </section><?php */?>
  <!-- Main content -->
  <section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box">
          <div class="box-header">
        <!--<h3 class="box-title pull-left">Manage inventorys</h3>-->
		<?=form_open('admin/student_master/Studentinfo');?><?php if( count($list)==10 ){?><?php echo form_hidden('all','all');?><?php  } ?>
		<?php echo form_submit('All','All',['class'=>'form-control','style'=>'width:150px;','class'=>'form-control input-sm pull-right','style'=>'width: 100px;']);?>
        <?=form_close();?>
        <?php echo anchor('',strtoupper($list[0]->category),['class'=>'form-control input-sm pull-left','style'=>'width: 100px;']); ?>
        <?php echo anchor('',strtoupper($list[0]->class),['class'=>'form-control input-sm pull-left','style'=>'width: 150px;']); ?>
        <?php echo anchor('',strtoupper($list[0]->subject),['class'=>'form-control input-sm pull-left','style'=>'width: 100px;']); ?>
        <?php echo anchor('',strtoupper($list[0]->subject_code),['class'=>'form-control input-sm pull-left','style'=>'width: 100px;']); ?>
        <?php echo anchor('',strtoupper($list[0]->month),['class'=>'form-control input-sm pull-left','style'=>'width: 50px;']); ?>
        <?php echo anchor('',strtoupper($list[0]->year),['class'=>'form-control input-sm pull-left','style'=>'width: 50px;']); ?>
        <?php echo anchor('',strtoupper($list[0]->first_name." ".$list[0]->last_name),['class'=>'form-control input-sm pull-left','style'=>'width: 200px;']); ?>
        <?php echo anchor('',strtolower($list[0]->email),['class'=>'form-control input-sm pull-left','style'=>'width: 250px;']); ?>
        <?php echo anchor('',strtoupper($list[0]->mobile),['class'=>'form-control input-sm pull-left','style'=>'width: 100px;']); ?>
          </div>
          <?php //echo $message;?>
          <?php echo form_hidden('my_array',['name'=>'doaction','id'=>'doaction']);?>
     <div class="box-body table-responsive no-padding" >
        <div  id="reportsummary">
        <!-- <table id="example2" class="table table-bordered table-hover  table-responsive" style="font-size: 10px;">-->
                
  <div id="tableContainer2" class="container-tb">
        <table>
          <thead>
            <tr>
              <th>#</th>
              <th>User Message</th>
              <th>Date</th>
              <th>Admin Reply</th>
              <th>Reply date</th>
              <th>Action</th>
            </tr>
          </thead>
          <tbody>
			<?php if( count($list) ):$sn=1;
			$count = $this->uri->segment(4);
			foreach($list as $lists ): ?>
            <tr >
              	<td><?php echo  $sn; ?></td>
              	<td><?php echo  ucwords($lists->user_message);?></td>
              	<td><?php echo  strtoupper(date('d-M-Y',strtotime($lists->user_msg_date)));?></td>
              	<td><?php echo  ucwords($lists->admin_reply);?></td>
              	<td><?php if($lists->admin_reply_date!=""){echo  strtoupper(date('d-M-Y',strtotime($lists->admin_reply_date)));}?></td>
              	<td><?php //echo  strtoupper($lists->admin_reply);?>
              	<span class="label label-info label-mini" data-toggle="modal" data-target="#myModal-<?=$lists->chat_id?>" style="cursor:pointer;">Reply</span>
            <div class="modal-wrapper row">
                <div class="pull-left">
                <div class="modal fade" id="myModal-<?=$lists->chat_id?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog">
                	<div class="modal-content">
                	  <div class="modal-header">
                		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                		<h4 class="modal-title" id="myModalLabel">
                		User Asked : <?php echo  ucwords($lists->user_message);?>?
                		</h4>
                	  </div>
                	  <div class="modal-body">
                	  	<?php echo form_open("admin/student_master/Studentinfo/admin_reply_chat_user",['name'=>'login_form']);?>
                	  	<?php echo  form_hidden("pr_id",$lists->id);?>
                            <?php echo  form_hidden("id",$lists->chat_id);?>
                          <p> <input type="text" name="admin_reply" class="form-control"  value="<?php echo  ucwords($lists->admin_reply);?>"placeholder="please enter your Reply"></p>
                      <button type="submit" class="btn btn-primary btn-sm pull-right" style="currsor:pointer;">Send Reply</button>
                      </div>
                	  
                	  <?php echo form_close();?>
                	</div><!-- /.modal-content -->
                  </div><!-- /.modal-dialog -->
                </div><!-- /.modal -->
                	</div>
                </div>
              	</td>
              	
            </tr>
            <?php $sn++;?>
			<?php endforeach; ?>
            <?php else : ?>
            <tr>
              <td colspan="6"><strong>No record found</strong></td>
            </tr>
            <?php endif; ?>
          </tbody>
        <?php echo form_close();?>
         <tfoot>
            <tr>
             <th>#</th>
              <th>User Message</th>
              <th>Date</th>
              <th>Admin Reply</th>
              <th>Reply date</th>
              <th>Action</th>
            </tr>
          </tfoot>
        </table>
		 </div>
        </div>
        <?php $count++; //echo  $link; ?>
        
        </div>
    </div>
  </div>
</div>
</section>
</div>
   