

  <link href="<?php echo base_url(); ?>assets/select/chosen.min.css" rel="stylesheet" media="screen">
	
		     
	
			  <script src="<?php echo base_url(); ?>assets/select/jquery-1.7.2.min.js"></script>

		  <script src="<?php echo base_url(); ?>assets/select/chosen.jquery.min.js"></script>
         <script type="text/javascript">
  
		
		 $(document).on("click", "#managebtndelete", function()
        {
          var itemid = $(this).data('id');
		  $("#itemid1").val(itemid); 
		  
		  
		   
        });
		  $(document).on("click", "#editbtn", function()
        {
          var mycategoryid = $(this).data('id');
		  $("#mycategoryid").val(mycategoryid); 
		   
 
		    var message = $(this).data('message');
		   $("#message").val(message); 
		   
		     var status = $(this).data('status');
		   $("#status").val(status); 
		     var duedate = $(this).data('duedate');
		   $("#duedate").val(duedate); 
		     var duetime = $(this).data('duetime');
		   $("#duetime").val(duetime); 
		     var deliverystatus = $(this).data('deliverystatus');
		   $("#deliverystatus").val(deliverystatus); 
		     var name = $(this).data('name');
		   $("#name").val(name); 
		   
		   
		   
		        var groupname = $(this).data('groupname');
		   $("#mygroupname").val(groupname); 
		        var type = $(this).data('type');
		   $("#mytype").val(type); 
		   
		   
		     var contact = $(this).data('contact');
		   $("#contact").val(contact); 
		 
		  
		       
			   
			   

			   if (type == "single") {
                $("#mycontact").show();
				 $("#mygroup").hide();
				
            } 
            else{
                $("#mycontact").hide();
			 $("#mygroup").show();

				//alert(studentstatus);
            }
 
 

			 
             
			
			
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		   
        });
		
		
		
		
    </script> 
				   
	
        <script>
        $(function() {
<!--             $(".datepicker").datepicker(); -->
<!--             $(".uniform_on").uniform() -->;
            $(".chzn-select").chosen();
   <!--          $('.textarea').wysihtml5(); -->

        });
		         $(function () {
        $("#mysmstype").change(function () {
			 if ($(this).val() == "onePersonalized") {
                $("#greetings").show();
            } 
            else if ($(this).val() == "manyPersonalized") {
                $("#greetings").show();
            } 
			
            else {
                $("#greetings").hide();
            }
        });
    });
	
	

        </script>
 
 
 <div class="row">
  
   	

   	<div class="col-md-12">
	
  
		<div class="panel panel-default" data-collapsed="0">
        	<div class="panel-heading">
            	<div class="panel-title" id="redcolor" >
            		<i class="entypo-plus-circled"></i>
						 <span class="pull-right">Balance: <span class="btn btn-warning"> <?php echo $total_amount;?></span> </span>					                     
						 <a data-toggle='modal' data-target='#addModal' class="btn btn-primary">Add General Sms Alert </a>


						 <a data-toggle='modal' data-target='#addgroupModal' class="btn btn-primary">Add Group Sms Alert </a>

										 <a href="<?php echo base_url(). "user/viewsms"; ?>" class="btn btn-info">Go to sms window</a>

						 

		  

            	</div>
            </div>
			<div class="panel-body">

				<div class="widget-content nopadding table_holder table-responsive" >				
	<?PHP

	$session_data = $this->session->userdata('logged_in');
 $data['usertype'] = $session_data['usertype'];
	 $usertype = $data['usertype'];	
	
$data['surname'] = $session_data['surname'];
$data['id'] = $session_data['id'];
 $data['companyid'] = $session_data['companyid'];
	 $companyid = $data['companyid'];
$surname=$data['surname'];
   $userid=$data['id'];
   $mydate=date("Y-m-d");
 
				echo $this->session->flashdata('msg'); 
								?>	
										
					<div class="row">
						<div class="col-md-12">
							
							<div class="panel-body">
	
									
									
				<table class="tablesorter table table-bordered  table-hover" id="sortable_table">			

             <thead>
			 <tr>
    
     <th colspan="9"><CENTER>TOTAL SMSES SENT BY NOW</CENTER></th>
	
	

                 </tr>
         <tr>
       <th>Name</th>
     <th>Type</th>
	   
	  <th>Date</th>
	  <th>Time</th>
	     <th>Message</th>
		 	
			
		 <th>Sent By?</th>
	 	 <th> Status</th>
		<td> more</td>	
	

                 </tr>
             </thead>
<?php
 if(!is_array($viewsms)) {
				    echo '<div class="alert alert-danger text-center">You have not set any SMS alert. Feel free to post SMS Alerts to your friends and clients. You have free 10 sms thereafter you should recharge your account to send more SMS</div>';

			 }else{
 if(!is_array($viewsms)) 

 {


   echo "<tr  style='margin-bottom:0px;margin-top:0px;' '>";
      echo "<td colspan='1'>";
    
       echo '<div class="alert alert-warning text-center">There no records found..</div>';
    echo "</td>";
   echo "</tr>";
    }else {
?>
    
             <?php 
  
  	foreach ($viewsms as $c): 
$contacttype=$c->contact;
		 

             ?>



             <tr>
                
            <?php 
			$id=$c->id;


?>

             <td><?php echo $c->name ; ?></td>   

  
   

  
  
  
  
    <td><?php 
	if($contacttype=="group"){
		$groupname=$c->groupname;
		
	?>
	                              <a  id="more" class="btn btn-primary" href="<?php echo base_url();?>user/viewmembersbygrouping?randomitemidentifier=<?php   {echo  $groupname;}  ?>&needed=1">Group  </a>


								  
	
	<?php 	
	}else{
		echo htmlspecialchars($c->type) ;
	}
	
	
	 ?></td>
  <td><?php echo $c->duedate ; ?></td>
   <td><?php echo $c->duetime ; ?></td>
     <td><?php echo htmlspecialchars($c->message); ?></td>

	 
   <td><?php ; 
   $userid=$c->userid;
   if($userid!=""){
	  
      $myname = $this->usermodel->geteuser($userid);
  
     $fname=$myname[0]['firstname']; 
echo $names= $fname; 
	
   }else{
	    echo "No Sender";  
   }
  
  
  ?></td>
 
 <td><?php echo $c->deliverystatus ; ?></td>
			 	 <td> 

 
 
					<div class="btn-group">
                                    <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                                        More <span class="caret"></span>
                                    </button>
									<?php
										if($usertype=="admin"){
											
											?>
                                    <ul class="dropdown-menu dropdown-primary pull-right" role="menu">
                                        
                                        <!-- teacher EDITING LINK -->
                                      
										
											  <li> 
										 <a class="btn btn-danger managebtn" id="managebtndelete"		 data-id='<?php echo  $c->id;?>'    data-toggle='modal' data-target='#deleteModal<?php  $c->id; ?>'>	 


                                                <i class="glyphicon glyphicon-pencil"></i>
																Delete
                                                </a>
                                                        </li>
									
									
                                        <li class="divider"></li>
                                                          
                                     	  <li> 

	 <a class="btn btn-primary editbtn" id="editbtn"data-name='<?php echo  $c->name;?>' data-message='<?php echo  $c->message;?>'  data-status='<?php echo  $c->status;?>'data-duedate='<?php echo  $c->duedate;?>'data-duetime='<?php echo  $c->duetime;?>'data-deliverystatus='<?php echo  $c->deliverystatus;?>'data-groupname='<?php echo  $c->groupname;?>'data-type='<?php echo  $c->type;?>'data-contact='<?php echo  $c->contact;?>'  data-id='<?php echo  $c->id;?>' data-toggle='modal' data-target='#editProductModel'> 	 

                                                <i class="glyphicon glyphicon-pencil"></i>
																View/Update
                                                </a>
                                                        </li>
                                        <!-- teacher DELETION LINK -->
                                        
                                    </ul>
											<?php
										}
										?>
                                </div>
</td> 
             </tr>

	<?php endforeach;} ?>

              <?php }?>
	
        </table>
 <div class="row">
        <div class="col-md-12 text-center">   <?php echo $links; ?>
					   		<span style="color:red; font-size:20px"><?php  echo $total_rows. "   SMS. " ;?> <?php "    Since  24-Dec-2016 10:00 am. " ;?>   </span>

         
        </div>
    </div>
									
									
									
					</div>	
					
				





<div id="editProductModel" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Update sms reminder</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/updatealerts' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
	<input type="hidden" id="mytype"name="type" class="single" placeholder="single" value="">

	<input type="hidden" name="mycategoryid" value=""id="mycategoryid" class="form-control" required placeholder="Enter mycategoryid">
			  		
	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Name/Title </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>" id="name" class="form-control" required placeholder="Enter name">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>
		
	<div class="form-group" id="mycontact">
    <label for="inputcontact" class="col-sm-2 control-label">	Contact </label>
    <div class="col-sm-10">
					<textarea name="contact" value="<?php echo set_value('contact'); ?>"  id="contact" class="form-control"  placeholder="Enter phone e.g  254712345678"></textarea>

	

	
				
		<span class="text-danger"> <?php echo form_error('contact'); ?>
		
		</span>
	</div>
  </div>
  <div class="form-group" id="mygroup">
    <label for="inputgroupname" class="col-sm-2 control-label">Group Name?</label>
    <div class="col-sm-10">
	<select class="form-control" name="groupname" id="mygroupname" >
	

	
	
	<?php 
					 
			
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $mycategoryrow->id;   ?>"><?=  $mycategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No category/ group available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('groupname'); ?>

	</div>
  </div>
     
  
  	<div class="form-group">
    <label for="inputduedate" class="col-sm-2 control-label">	Due Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="duedate"  id="duedate" value="<?php echo set_value('duedate',$mydate); ?>" class="form-control" required placeholder="Enter Date e.g  2017-01-31">
		 
				
		<span class="text-danger">YYY-MM-DD <?php echo form_error('duedate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputphoneduetime" class="col-sm-2 control-label">	Due time	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="duetime" id="duetime" >
	
	<option value=""  >---Select due time---</option>
	<option value="0:00"  >00:00</option>
		<option value="00:15">00:15</option>
		<option value="00:30">00:30</option>
		<option value="00:45">00:45</option>
		<option value="01:00">01:00</option>
		<option value="01:15">01:15</option>
		<option value="01:30">01:30</option>
		<option value="01:45">01:45</option>
		<option value="02:00">02:00</option>
		<option value="02:15">02:15</option>
		<option value="02:30">02:30</option>
		<option value="02:45">02:45</option>
		
		
		
			<option value="03:00">03:00</option>
		<option value="03:15">03:15</option>
		<option value="03:30">03:30</option>
		<option value="03:45">03:45</option>
			<option value="04:00">04:00</option>
		<option value="04:15">04:15</option>
		<option value="04:30">04:30</option>
		<option value="04:45">04:45</option>
			<option value="05:00">05:00</option>
		<option value="05:15">05:15</option>
		<option value="05:30">05:30</option>
		<option value="05:45">05:45</option>
			<option value="06:00">06:00</option>
		<option value="06:15">06:15</option>
		<option value="06:30">06:30</option>
		<option value="06:45">06:45</option>
			<option value="07:00">07:00</option>
		<option value="07:15">07:15</option>
		<option value="07:30">07:30</option>
		<option value="07:45">07:45</option>
			<option value="08:00">08:00</option>
		<option value="08:15">08:15</option>
		<option value="08:30">08:30</option>
		<option value="08:45">08:45</option>
			<option value="09:00">09:00</option>
		<option value="09:15">09:15</option>
		<option value="09:30">09:30</option>
		<option value="09:45">09:45</option>
			<option value="10:00">10:00</option>
		<option value="10:15">10:15</option>
		<option value="10:30">10:30</option>
		<option value="10:45">10:45</option>
			<option value="11:00">11:00</option>
		<option value="11:15">11:15</option>
		<option value="11:30">11:30</option>
		<option value="11:45">11:45</option>
		
			<option value="12:00">12:00</option>
		<option value="12:15">12:15</option>
		<option value="12:30">12:30</option>
		<option value="12:30">12:45</option>
		
			<option value="13:00">13:00</option>
		<option value="13:15">13:15</option>
		<option value="13:30">13:30</option>
		<option value="13:45">13:45</option>
			<option value="14:00">14:00</option>
		<option value="14:15">14:15</option>
		<option value="14:30">14:30</option>
		<option value="14:45">14:45</option>
			
			<option value="15:00">15:00</option>
		<option value="15:15">15:15</option>
		<option value="15:30">15:30</option>
		<option value="15:45">15:45</option>
			<option value="16:00">16:00</option>
		<option value="16:15">16:15</option>
		<option value="16:30">16:30</option>
		<option value="16:45">16:45</option>
		
			<option value="17:00">17:00</option>
		<option value="17:15">17:15</option>
		<option value="17:30">17:30</option>
		<option value="17:45">17:45</option>
			<option value="18:00">18:00</option>
		<option value="18:15">18:15</option>
		<option value="18:30">18:30</option>
		<option value="18:45">18:45</option>
			
			<option value="19:00">19:00</option>
		<option value="19:15">19:15</option>
		<option value="19:30">19:30</option>
		<option value="19:45">19:45</option>
		
		
		
			<option value="20:00">20:00</option>
		<option value="20:15">20:15</option>
		<option value="20:30">20:30</option>
		<option value="20:45">20:45</option>
		<option value="21:00">21:00</option>
		<option value="21:15">21:15</option>
		<option value="21:30">21:30</option>
		<option value="21:45">21:45</option>
		<option value="22:00">22:00</option>
		<option value="22:15">22:15</option>
		<option value="22:30">22:30</option>
		<option value="22:45">22:45</option>
		<option value="23:00">23:00</option>
		<option value="23:15">23:15</option>
		<option value="23:30">23:30</option>
		<option value="23:45">23:45</option>


	</select>		 
				
		<span class="text-danger"> <?php echo form_error('duetime'); ?>
		
		</span>
	</div>
  </div>
	<div class="form-group">
    <label for="inputdescription" class="col-sm-2 control-label">	message</label>
    <div class="col-sm-10">

				<textarea name="message" value="<?php echo set_value('message'); ?>"  id="message" class="form-control"  placeholder="Enter message"></textarea>
			
		<span class="text-danger"> <?php echo form_error('message'); ?>
		
		</span>
	</div>
  </div>
		

	

<div class="form-group">
    <label for="inputdeliverystatus" class="col-sm-2 control-label">	SMS Status	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="deliverystatus" id="deliverystatus" >
	
	<option value="" selected="selected" >---Select the status---</option>
	<option value=""  ></option>
		<option value="new">new</option>
		<option value="sent">sent</option>
		

	</select>		 
		
	</div>
  </div>
	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="sms" name="btn_updatsmsalerts" class="btn btn-primary"> Update SMS Alerts   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>














				

	<div id="deleteModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete</h4>
      </div>
      <div class="modal-body">
        <h3>Are you sure you want to delete this item? </h3>
      </div>
      <div class="modal-footer">
	  	

     
		<?PHP
				$session_data = $this->session->userdata('adminlogged_in');
 echo $this->session->flashdata('deletemsg'); 

		
                 echo form_open('user/deletebyid' , array('class' => 'form-horizontal ', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="table"name="table" class="table" placeholder="view" value="alerts">

 <input type="hidden" id="view"name="view" class="view" placeholder="view" value="user/viewalerts">
 <input type="hidden" id="itemid1"name="itemid" class="itemid" placeholder="itemid" value=""><br>
 <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
 		  	         <button type="submit" name="btn_delete" value="deletebyid" class="btn btn-danger"> Delete  </button>

	<?php echo form_close();?>
      </div>
    </div>

  </div>

  </div>
					
					
					
					
			<div id="addgroupModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new  Group Sms alert</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addalert' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="type"name="type" class="group" placeholder="group" value="group">

	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Name/Title </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter name/title of alert">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>
				  		
	
	
		  		<input type="hidden" name="contact" value="group" class="form-control" required placeholder="Enter phone e.g  254712345678,254712345678">
		 
	
	
  <div class="form-group">
    <label for="inputgroupname" class="col-sm-2 control-label">Group Name?</label>
    <div class="col-sm-10">
	<select class="form-control" name="groupname" required>
	
	<option value=""  >---Select Category---</option>

	
	<?php 
					 
			
	


if(is_array($mycategory)) {

   foreach($mycategory as $mycategoryrow){

   //echo $courserow->coursename;
    ?>
					<option value="<?=  $mycategoryrow->id;   ?>"><?=  $mycategoryrow->name; ?></option>



	<?php

}} else {
    echo 'No category/ group available.';
}
	
?>
</select>
		
						<span class="text-danger"><?php echo form_error('groupname'); ?>

	</div>
  </div>
     
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  	<div class="form-group">
    <label for="inputduedate" class="col-sm-2 control-label">	Due Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="duedate" value="<?php echo set_value('duedate',$mydate); ?>" class="form-control" required placeholder="Enter Date e.g  2017-01-31">
		 
				
		<span class="text-danger">YYY-MM-DD <?php echo form_error('duedate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputphoneduetime" class="col-sm-2 control-label">	Due time	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="duetime" >
	
	<option value=""  >---Select due time---</option>
	<option value="0:00"  >00:00</option>
		<option value="00:15">00:15</option>
		<option value="00:30">00:30</option>
		<option value="00:45">00:45</option>
		<option value="01:00">01:00</option>
		<option value="01:15">01:15</option>
		<option value="01:30">01:30</option>
		<option value="01:45">01:45</option>
		<option value="02:00">02:00</option>
		<option value="02:15">02:15</option>
		<option value="02:30">02:30</option>
		<option value="02:45">02:45</option>
		
		
		
			<option value="03:00">03:00</option>
		<option value="03:15">03:15</option>
		<option value="03:30">03:30</option>
		<option value="03:45">03:45</option>
			<option value="04:00">04:00</option>
		<option value="04:15">04:15</option>
		<option value="04:30">04:30</option>
		<option value="04:45">04:45</option>
			<option value="05:00">05:00</option>
		<option value="05:15">05:15</option>
		<option value="05:30">05:30</option>
		<option value="05:45">05:45</option>
			<option value="06:00">06:00</option>
		<option value="06:15">06:15</option>
		<option value="06:30">06:30</option>
		<option value="06:45">06:45</option>
			<option value="07:00">07:00</option>
		<option value="07:15">07:15</option>
		<option value="07:30">07:30</option>
		<option value="07:45">07:45</option>
			<option value="08:00">08:00</option>
		<option value="08:15">08:15</option>
		<option value="08:30">08:30</option>
		<option value="08:45">08:45</option>
			<option value="09:00">09:00</option>
		<option value="09:15">09:15</option>
		<option value="09:30">09:30</option>
		<option value="09:45">09:45</option>
			<option value="10:00">10:00</option>
		<option value="10:15">10:15</option>
		<option value="10:30">10:30</option>
		<option value="10:45">10:45</option>
			<option value="11:00">11:00</option>
		<option value="11:15">11:15</option>
		<option value="11:30">11:30</option>
		<option value="11:45">11:45</option>
		
			<option value="12:00">12:00</option>
		<option value="12:15">12:15</option>
		<option value="12:30">12:30</option>
		<option value="12:30">12:45</option>
		
			<option value="13:00">13:00</option>
		<option value="13:15">13:15</option>
		<option value="13:30">13:30</option>
		<option value="13:45">13:45</option>
			<option value="14:00">14:00</option>
		<option value="14:15">14:15</option>
		<option value="14:30">14:30</option>
		<option value="14:45">14:45</option>
			
			<option value="15:00">15:00</option>
		<option value="15:15">15:15</option>
		<option value="15:30">15:30</option>
		<option value="15:45">15:45</option>
			<option value="16:00">16:00</option>
		<option value="16:15">16:15</option>
		<option value="16:30">16:30</option>
		<option value="16:45">16:45</option>
		
			<option value="17:00">17:00</option>
		<option value="17:15">17:15</option>
		<option value="17:30">17:30</option>
		<option value="17:45">17:45</option>
			<option value="18:00">18:00</option>
		<option value="18:15">18:15</option>
		<option value="18:30">18:30</option>
		<option value="18:45">18:45</option>
			
			<option value="19:00">19:00</option>
		<option value="19:15">19:15</option>
		<option value="19:30">19:30</option>
		<option value="19:45">19:45</option>
		
		
		
			<option value="20:00">20:00</option>
		<option value="20:15">20:15</option>
		<option value="20:30">20:30</option>
		<option value="20:45">20:45</option>
		<option value="21:00">21:00</option>
		<option value="21:15">21:15</option>
		<option value="21:30">21:30</option>
		<option value="21:45">21:45</option>
		<option value="22:00">22:00</option>
		<option value="22:15">22:15</option>
		<option value="22:30">22:30</option>
		<option value="22:45">22:45</option>
		<option value="23:00">23:00</option>
		<option value="23:15">23:15</option>
		<option value="23:30">23:30</option>
		<option value="23:45">23:45</option>


	</select>		 
				
		<span class="text-danger"> <?php echo form_error('duetime'); ?>
		
		</span>
	</div>
  </div>
	

	<div class="form-group">
    <label for="inputmessage" class="col-sm-2 control-label">	Message</label>
    <div class="col-sm-10">
		
				<textarea required  value="<?php echo set_value("message"); ?>"  class="form-control"   id="message"   name="message"  maxlength="800" placeholder="Enter message. Maximum of 800 characters"></textarea>

	
		<span class="text-danger"> <?php echo form_error("message"); ?>
		
		</span>
	</div>
  </div>
		

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="sms" name="addalert" class="btn btn-primary"> SAVE SMS   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>		
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					
					

<div id="addModal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add new Sms alert</h4>
      </div>
      <div class="modal-body">
      
	  	

				<?PHP
//$session_data = $this->session->userdata('logged_in');



				echo $this->session->flashdata('msg'); 
		
                 echo form_open('user/addalert' , array('class' => 'form-horizontal form-groups-bordered validate', 'enctype' => 'multipart/form-data'));
				 if(validation_errors()):?>
<div class='alert alert-danger text-center'><?php echo validation_errors(); ?></div>
<?php endif;?>
 <input type="hidden" id="type"name="type" class="single" placeholder="single" value="single">
 <input type="hidden" id="groupname"name="groupname" class="group" placeholder="nogroup" value="nogroup">

	<div class="form-group">
    <label for="inputname" class="col-sm-2 control-label">	Name/Title </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="name" value="<?php echo set_value('name'); ?>" class="form-control" required placeholder="Enter name/title of alert">
		 
				
		<span class="text-danger"> <?php echo form_error('name'); ?>
		
		</span>
	</div>
  </div>
				  		
	<div class="form-group">
    <label for="inputcontact" class="col-sm-2 control-label">	Contact </label>
    <div class="col-sm-10">

	

	<textarea name="contact" value="<?php echo set_value('contact'); ?>"  class="form-control"  placeholder="Enter phone e.g  254712345678,254712345678"></textarea>

				
		<span class="text-danger"> <?php echo form_error('contact'); ?>
		
		</span>
	</div>
  </div>
  
  	<div class="form-group">
    <label for="inputduedate" class="col-sm-2 control-label">	Due Date </label>
    <div class="col-sm-10">
	
		  		<input type="text" name="duedate" value="<?php echo set_value('duedate',$mydate); ?>" class="form-control" required placeholder="Enter Date e.g  2017-01-31">
		 
				
		<span class="text-danger">YYY-MM-DD <?php echo form_error('duedate'); ?>
		
		</span>
	</div>
  </div>
  
    	<div class="form-group">
    <label for="inputphoneduetime" class="col-sm-2 control-label">	Duetime	 </label>
    <div class="col-sm-10">
	
	<select class="form-control" name="duetime" >
	
	<option value=""  >---Select duetime---</option>
	<option value="0:00"  >00:00</option>
		<option value="00:15">00:15</option>
		<option value="00:30">00:30</option>
		<option value="00:45">00:45</option>
		<option value="01:00">01:00</option>
		<option value="01:15">01:15</option>
		<option value="01:30">01:30</option>
		<option value="01:45">01:45</option>
		<option value="02:00">02:00</option>
		<option value="02:15">02:15</option>
		<option value="02:30">02:30</option>
		<option value="02:45">02:45</option>
		
		
		
			<option value="03:00">03:00</option>
		<option value="03:15">03:15</option>
		<option value="03:30">03:30</option>
		<option value="03:45">03:45</option>
			<option value="04:00">04:00</option>
		<option value="04:15">04:15</option>
		<option value="04:30">04:30</option>
		<option value="04:45">04:45</option>
			<option value="05:00">05:00</option>
		<option value="05:15">05:15</option>
		<option value="05:30">05:30</option>
		<option value="05:45">05:45</option>
			<option value="06:00">06:00</option>
		<option value="06:15">06:15</option>
		<option value="06:30">06:30</option>
		<option value="06:45">06:45</option>
			<option value="07:00">07:00</option>
		<option value="07:15">07:15</option>
		<option value="07:30">07:30</option>
		<option value="07:45">07:45</option>
			<option value="08:00">08:00</option>
		<option value="08:15">08:15</option>
		<option value="08:30">08:30</option>
		<option value="08:45">08:45</option>
			<option value="09:00">09:00</option>
		<option value="09:15">09:15</option>
		<option value="09:30">09:30</option>
		<option value="09:45">09:45</option>
			<option value="10:00">10:00</option>
		<option value="10:15">10:15</option>
		<option value="10:30">10:30</option>
		<option value="10:45">10:45</option>
			<option value="11:00">11:00</option>
		<option value="11:15">11:15</option>
		<option value="11:30">11:30</option>
		<option value="11:45">11:45</option>
		
			<option value="12:00">12:00</option>
		<option value="12:15">12:15</option>
		<option value="12:30">12:30</option>
		<option value="12:30">12:45</option>
		
			<option value="13:00">13:00</option>
		<option value="13:15">13:15</option>
		<option value="13:30">13:30</option>
		<option value="13:45">13:45</option>
			<option value="14:00">14:00</option>
		<option value="14:15">14:15</option>
		<option value="14:30">14:30</option>
		<option value="14:45">14:45</option>
			
			<option value="15:00">15:00</option>
		<option value="15:15">15:15</option>
		<option value="15:30">15:30</option>
		<option value="15:45">15:45</option>
			<option value="16:00">16:00</option>
		<option value="16:15">16:15</option>
		<option value="16:30">16:30</option>
		<option value="16:45">16:45</option>
		
			<option value="17:00">17:00</option>
		<option value="17:15">17:15</option>
		<option value="17:30">17:30</option>
		<option value="17:45">17:45</option>
			<option value="18:00">18:00</option>
		<option value="18:15">18:15</option>
		<option value="18:30">18:30</option>
		<option value="18:45">18:45</option>
			
			<option value="19:00">19:00</option>
		<option value="19:15">19:15</option>
		<option value="19:30">19:30</option>
		<option value="19:45">19:45</option>
		
		
		
			<option value="20:00">20:00</option>
		<option value="20:15">20:15</option>
		<option value="20:30">20:30</option>
		<option value="20:45">20:45</option>
		<option value="21:00">21:00</option>
		<option value="21:15">21:15</option>
		<option value="21:30">21:30</option>
		<option value="21:45">21:45</option>
		<option value="22:00">22:00</option>
		<option value="22:15">22:15</option>
		<option value="22:30">22:30</option>
		<option value="22:45">22:45</option>
		<option value="23:00">23:00</option>
		<option value="23:15">23:15</option>
		<option value="23:30">23:30</option>
		<option value="23:45">23:45</option>


	</select>		 
				
		<span class="text-danger"> <?php echo form_error('duetime'); ?>
		
		</span>
	</div>
  </div>
	

	<div class="form-group">
    <label for="inputmessage" class="col-sm-2 control-label">	Message</label>
    <div class="col-sm-10">
	

				<textarea required  value="<?php echo set_value("message"); ?>"  class="form-control"   id="message"   name="message"  maxlength="800" placeholder="Enter message. Maximum of 800 characters"></textarea>

		<span class="text-danger"> <?php echo form_error("message"); ?>
		
		</span>
	</div>
  </div>
		

	

	
	 <div class="form-group">

    <div class="col-sm-offset-2 col-sm-10">
     
	         <button type="submit"  value="sms" name="addalert" class="btn btn-primary"> SAVE SMS   </button>

    </div>
  </div>
  					<?php echo form_close();?>
			</div>							   
				
									
							
								
			<div class="modal-footer">

    

				</div>

		</div>
	    </div>
    </div>




				

			
			</div>
		</div>
  
  </div>
			
			
			
		
		
  

 
</div>


















