<?php
/*----include header file----*/
require_once APPPATH."/views/common/header.php"; ?>
<style type="text/css">
    .alert, .alert.alert-default
    {
        background: #F2DEDE !important; border-radius: 5px !important;
    }
</style>
    <div class="boxLwd">
        <h2><span>LWD</span>   <?php if($this->session->userdata('contractarealwd')!="" && $this->session->userdata('officelwd')!=""){?> <span style="display:inline-block;"><a href="<?= base_url() ?>index.php/lwd">
                    <button class="btn thumbnail" type="submit">View all list<div class="ripple-container"></div></button>
                </a></span> <?php } ?></h2>
        
        <div class="row costLine">
		  <form class="lwd" method="post" action="<?php echo base_url() ?>index.php/lwd">
            <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 ui-widget">
              <b>Cost centre:</b>
			  <?php if($this->session->userdata('type')=="admin") { ?> 
                 <select  name="costcenterlwd" class="combobox costcenterlwd">
				    <option selected="selected">Select Cost Centre</option>
					 <?php
						if( !empty( $costcenter ) )
						{
							foreach( $costcenter as $val ):
						?>
							<option <?php if($val['lindex']==$this->session->userdata('costcenterlwd')){ echo "selected"; } ?> value="<?= $val['lindex']; ?>"><?= $val['description']; ?></option>
						<?php
							endforeach;
						}
					?>                   
                </select>
			  <?php }else { ?>
			       <select disabled  name="costcenterlwd" class="combobox costcenterlwd">
				    <option selected="selected"><?php echo $costcentername ?></option>     
                </select>
			  
			  <?php } ?>
            </div>
             <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 cost2">
			
             <b>Contract Area:</b>
			   <?php if($this->session->userdata('type')=="admin") { ?>
                <select name="contractarealwd" class="combobox contractarealwd">
                    <option>Select Contract Area</option>
					<?php if($this->session->userdata('contractarealwd')!="") { ?> 
                     <?php
                            if( !empty( $contract_areas ) )
                            {
								
                               foreach( $contract_areas as $vals ) 
							   {
								  if($this->session->userdata('contractarealwd')==$vals['lindex']) {
                            ?>  
                                   <option selected="selected" value="<?= $vals['lindex']; ?>"><?= ucfirst($vals['description']); ?></option>
								
                             <?php
							      }
							   }
                            }
                        ?>
					<?php } ?>
                </select>
				<span style="padding-left:30px; display:none; font-size:20px;"  class="loadingcontract" ><i class="fa fa-spinner" aria-hidden="true"></i></span>
			   <?php }else { ?>
			     <select disabled name="contractarealwd" class="combobox contractarealwd">
                    <option selected="selected"><?php echo $contractareaname ?></option>
                </select>
				<span style="padding-left:10px; display:none; font-size:20px;"  class="loadingcontract" ><i class="fa fa-spinner" aria-hidden="true"></i></span>
			   <?php } ?>
            </div>
           <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 cost2">
		  
          <b> Office name:</b>
		    <?php if($this->session->userdata('type')=="admin") { ?> 
               <select name="officelwd" class="combobox officelwd">
                    <option>Select Office</option>
					<?php if($this->session->userdata('officelwd')!="") { ?> 
                     <?php
                            if( !empty( $office_list ) )
                            {
                               foreach( $office_list as $vals ) 
							   {
								  if($this->session->userdata('officelwd')==$vals['lindex']) {
                            ?>  
                                    <option selected="selected" value="<?= $vals['lindex']; ?>"><?= ucfirst($vals['description']); ?></option>
								
                             <?php
							      }
							   }
                            }
                        ?>
					<?php } ?>
				  </select>
				  <span style="padding-left:30px; display:none;"  class="loadingoffice" ><i class="fa fa-spinner" aria-hidden="true"></i></span>
			    <?php }else { ?>
				    <select disabled="disabled" name="contractarealwd" class="combobox contractarealwd">
					
                       <option selected="selected"><?php echo $this->session->userdata('login_name') ?></option>
					
                   </select>
				   <span style="padding-left:10px; display:none;"  class="loadingoffice" ><i class="fa fa-spinner" aria-hidden="true"></i></span>
			    <?php } ?>
					
              
            </div>
		  </form>
        </div>
        


        <div class="row LwdButtons">
		   
		     <div style="float:left;" class="col-xs-2 col-sm-2 col-md-2 col-lg-4 addNewButton">
			    <select class="settingselect form-control">
				    <option value="">Bulk Action</option>
					<option value="settings">Setting</option>
				</select>               
             </div>
             <div class="col-xs-6 col-sm-6 col-md-6 col-lg-4">
             	
             		
             	
             </div>
             <?php if($this->session->userdata('type')=="admin") { ?>
             <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 addNewButton">
                <a href="<?= base_url() ?>index.php/lwd/lwd_add">
                    <button class="btn thumbnail" type="submit">Add New</button>
                </a>
                <button class="btn btn-default" type="submit">Export</button>
            </div>
		   <?php }else{ ?>
		     <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 addNewButton">
                <button class="btn thumbnail" type="submit" data-toggle="modal" data-target="#lightbox">Add New</button>
                <button class="btn btn-default" type="submit">Export</button>
            </div>
		   <?php } ?>
			
        </div>
        <div class="row showNewTable">
            <div class="col-sm-12">
                <div class="col-sm-3">
                    <form method="post">
                    <label> Show </label>
                    <select id="select_limit" name="select_limit" onchange="this.form.submit()">
                        <option <?= ($current_limit == '25')? 'selected' : '' ; ?> value="25">25</option>
                        <option <?= ($current_limit == '50')? 'selected' : '' ; ?> value="50">50</option>
                        <option <?= ($current_limit == '100')? 'selected' : '' ; ?> value="100">100</option>
                        <option <?= ($current_limit == '500')? 'selected' : '' ; ?> value="500">500</option>
                    </select>
                     <label> Entries </label>
                    </form>
                </div>
				<div class="col-sm-3">
                   <form method="get">
             			<input type="text" name="searchbar" placeholder="Search" value="<?php echo $this->input->get('searchbar') ?>" class="form-control searchbar_LWD">
             		</form>
                </div>
				
                <div class="col-sm-6">
                    <?= $this->pagination->create_links(); ?>
                </div>
            </div>
        </div>

        <div class="row tableLWD tableLWD2">
            <table id="examplelwd" class="table table-striped table-bordered" width="98%" cellpadding="1" cellspacing="1">
                <thead>
                    <tr>
                    <th></th>
                       <th>Number</th>
                        <th>Login Name</th>
                        <th style="display: none;"></th>
                        <th>Number</th>
                        <th>Email</th>
                        <th>Signals</th>
                        <th>Status</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                     <?php
                       
                        if( !empty( $detail ) ):
						
						    foreach ($detail as $detail):
                           
                    ?>
                        <tr>
                            <td><input type="checkbox" class="usercheck" name="lwd_id" value="<?= $detail['ref'] ?>"></td>
                            <td><?= $detail['ref'] ?></td>
                            <td><?= ucfirst($detail['loginname'] ) ?></td>
                            <td style="display: none"><?= $detail['createdate'] ?></td>
                            <td><?= ucfirst( $detail['number'] )  ?></td>
                            <td><?= ucfirst( $detail['emailaddress'] ) ?></td>
                            <td>
                                <select data-lwd_id="<?= $detail['ref'] ?>" data-device_token="<?= $detail['device_token']; ?>" data-type="<?= $detail['device_type']; ?>" name="signal_kill" class="signal_kill">
                                    <option <?= ($detail['signal_kill'] == '0')? 'selected' : '';  ?> value="0">Restricted</option>
                                    <option <?= ($detail['signal_kill'] == '1')? 'selected' : '';  ?> value="1">Allowed</option>
                                </select>
                            </td>
                            <td> 
                                <select data-cost_id="<?= $detail->office_id ?>" name="status" class="office_status custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left ui-autocomplete-input">
                                    <option value="0" <?php if( $detail['is_verified'] == 0 || $detail['is_verified'] == "" ) { echo 'selected'; } ?> >Pending</option>
                                    <option value="1" <?php if( $detail['is_verified'] == 1 ) { echo 'selected'; } ?>>Inactive</option>
                                    <option value="2" <?php if( $detail['is_verified'] == 2 ) { echo 'selected'; } ?>>Active</option>
                                </select>
                            </td>
                            <td class="iconBox"><a class="editlwd" id="<?php echo $detail['ref'] ?>"  href="javascript:void(0)">
                            <i class="fa fa-pencil" aria-hidden="true"></i>
</a>&nbsp&nbsp<a href="<?= base_url() ?>index.php/lwd/profile_view/<?= base64_encode($detail['ref']); ?>" >
							<i class="fa fa-search-plus" aria-hidden="true"></i>

</a>&nbsp&nbsp<a id="<?php echo $detail['ref'] ?>" class="editsetting" href="javascript:void(0)" >
							<i class="fa fa-wrench" aria-hidden="true"></i>
</a></td>
                        </tr>
                    <?php
                            endforeach;
                        endif;
                    ?>
                    
                </tbody>
            </table>                  
            <!--<?= $this->pagination->create_links(); ?>-->
        </div>
           
   </div>
</div>
 <div id="resultDiv"></div>


<div id="lightbox" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <div class="modal-content">
            <div class="modal-body">
            
            <div class="row">
            <div class="col-lg-12">
                <h2>Add LWD</h2>
            </div>
            </div>
            <form id="add_lwd">
            <div class="ajax_msg"></div>
             <!-- <div class="row lighboxInner selectpopup">
            	<div class="col-lg-12">
                <select name="costcenter" class="costCenterSelect costcenterpopup">
                	<option value="">Select Cost Center</option>
                    <?php
						if( !empty( $costcenter ) )
						{
							foreach( $costcenter as $val ):
						?>
							<option <?php if($val['costcenter_id']==$this->session->userdata('costcenterlwd')){ echo "selected"; } ?> value="<?= $val['costcenter_id']; ?>"><?= $val['costcenter_name']; ?></option>
						<?php
							endforeach;
						}
					?>
                </select>
                </div>
             </div>
			 
			 <div class="row lighboxInner selectpopup">
            	<div class="col-lg-12">
                <select name="contractarea" class="costCenterSelect contractareapopup">
                	<option value="">Select Contract Area</option> 
                </select>
                </div>
             </div>
			 
			 <div class="row lighboxInner selectpopup">
            	<div class="col-lg-12">
                <select name="office" class="costCenterSelect officepopup">
                	<option value="">Select Office</option>
                </select>
                </div>
             </div> -->
			 
             <span id="restpartpopup">
             <div class="row lighboxInner">
            	<div class="col-lg-6">
                    <div class="form-group label-floating">
                            <label class="control-label">Full Name</label>
                            <input type="text" name="fname" class="form-control fullNameField">
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="form-group label-floating">
                            <label class="control-label">Last Name</label>
                            <input type="text" name="login_name" id="login_name" class="form-control fullNameField" onchange="return login_name_check()">
                            <input type="hidden" name="office_id" value="<?= $this->session->userdata('office_id'); ?>">
                    </div>
                    
                    <span class="login_name_error"></span>
                </div>
             </div>
             
             <div class="row lighboxInner">
            	<div class="col-lg-6">
                    <div class="form-group label-floating">
                            <label class="control-label">Email Address</label>
                            <input type="email" id="email_address" name="email" onchange="return email_address_check()" class="form-control fullNameField">
                    </div>
                    <span class="email_error"></span>
                </div>
                <div class="col-lg-6">
                     <div class="form-group label-floating">
                            <label class="control-label">Password</label>
                            <input type="password" class="form-control fullNameField" name="password">
                    </div>
              	</div>
              </div>
                
              <div class="row lighboxInner">
                    <div class="col-lg-6 selectLwdNew">
                        <select name="gender">
                            <option value="">Gender</option>
                            <option value="male">Male</option>
                            <option value="female">Female</option>
                        </select>
                    </div>
                    <div class="col-lg-6 lwdDob">
                        <label class="control-label"></label>
                        <select name="device_type">
                            <option value="">Select Device Type</option>
                            <option value="1000series">1000 Series</option>
                            <option value="red alert app">Red Alert App</option>
                            <option value="1100 series">1100 Series</option>
                            <option value="red alert id">Red Alert ID</option>
                            <option value="code 5 companion">Code 5 Companion</option>
                            <option value="spot gen">Spot Gen</option>
                            <option value="sonim">Sonim</option>
                            <option value="1400 series">1400 Series</option>
                          </select>
                    </div>
              </div>
              
              <div class="row lighboxInner">
                    <div class="col-lg-6">
                        <div class="form-group label-floating">
                            <label class="control-label">Phone Number Ex. 440123456789</label>
                            <input type="text" class="form-control fullNameField" name="number">
                    	</div>
                    </div>
                    <div class="col-lg-6">
                        <div class="form-group label-floating">
                            <label class="control-label">IMEI Number</label>
                            <input type="text" class="form-control fullNameField" name="imei">
                    	</div>
                    </div>
              </div>
              <div class="row lighboxInner lightBoxSelect">
                    <div class="col-lg-12">
                    <textarea name="address" class="fullNameField" placeholder="Address"></textarea>
                    </div>
              </div>

              	<div class="row lighboxInner lightBoxSelect">
	              	<div class="col-xs-12 col-sm-12 col-md-2 col-lg-12">
                        <button class="btn btn-default" id="submit_button" type="submit" value="Add New">Add New</button>
		            </div>
	            </div>
				</span>
	            </form>
            </div>
        </div>
    </div>
</div>


<div id="editlwd" class="modal fade popupOrbis" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <div class="modal-content">
            <div class="modal-body">
            
            <div class="row">
            <div class="col-lg-12">
                <h3>Edit Lwd</h3>
            </div>
            </div>
            
            
            <ul class="nav nav-tabs">
                <li class="active"><a data-toggle="tab" href="#menu1">Personal Details</a></li>
                <li><a data-toggle="tab" href="#menu2">Escalation Details</a></li>
              </ul>

            
            <div class="tab-content">
             
                <div id="menu1" class="tab-pane fade in active">
                   <form id="setting_screen" method="post">
                    <div class="ajax_msg"></div>
                        <div class="row lighboxInner selectpopup">
                        <div class="col-lg-6">
                           <div class="form-group label-floating is-focused">
                                <label class="control-label">First Name</label>
                                <input type="text" class="form-control fullNameField redalert firstname" name="firstname">
                                <input type="hidden" name="lwd_ids" id="lwd_ids" value="">
                            </div>
                        </div>
                        <div class="col-lg-6">
                           <div class="form-group label-floating is-focused">
                                <label class="control-label">Last Name</label>
                                <input type="text" class="form-control fullNameField redalert lastname" name="lastname">
                            </div>
                           
                        </div>
                        </div>
                        
                        <div class="row lighboxInner selectpopup">
                        <div class="col-lg-6">
                          <div class="form-group label-floating is-focused" >
                                <label class="control-label">Email Address</label>
                                <input type="text" class="form-control fullNameField amberalert emailaddress" name="emailaddress">
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="form-group label-floating is-focused selectPopupDropdown">
                                    <label class="control-label">Gender</label>
                                    <select class="falldetectsensitivity gender form-control" name="falldetectedsensitivity">
                                       <option value="">Select gender</option>
                                       <option id="valueMale" value="male">Male</option>
                                       <option id="valueFemale" value="female">Female</option>
                                    </select>
                             </div>
                        </div>
                        </div>
                        
                        <div class="row lighboxInner selectpopup">
                        <div class="col-lg-6">
                          <div class="form-group label-floating is-focused selectPopupDropdown devicetype_edit">
                                <label class="control-label">Device Type</label>
                                <!--input type="text" class="form-control fullNameField port devicetype" name="devicetype" -->
                                <select name="devicetype" required="" class="form-control devicetype">
                                    <option value="">Select Device Type</option>
                                    <option value="android">Android</option>
                                    <option value="ios">IOS</option>
                                    <option value="1000series">1000 Series</option>
                                    <option value="red alert app">Red Alert App</option>
                                    <option value="1100 series">1100 Series</option>
                                    <option value="red alert id">Red Alert ID</option>
                                    <option value="code 5 companion">Code 5 Companion</option>
                                    <option value="spot gen">Spot Gen</option>
                                    <option value="sonim">Sonim</option>
                                    <option value="1400 series">1400 Series</option>
                                  </select>
                            </div>
                        </div>
                        <div class="col-lg-6">
                          <div class="form-group label-floating is-focused">
                                <label class="control-label">Phone Number</label>
                                <input type="text" class="form-control fullNameField redalertsms phonenumber" name="phonenumber">
                            </div>
                        </div>
                        </div>
                        
                        <div class="row lighboxInner selectpopup">
                        <div class="col-lg-6">
                          <div class="form-group label-floating is-focused">
                                <label class="control-label">IMEI Number</label>
                                <input type="text" class="form-control fullNameField silentdial imeinumber" name="imeinumber">
                            </div>
                        </div>
                        </div>
                        
                        <div class="row lighboxInner lightBoxSelect">
                            
                            <textarea name="address" class="fullNameField address" placeholder="Address"></textarea>
                            
                        </div>
                        <div class="row lighboxInner selectpopup">
                    
                    <div class="row lighboxInner lightBoxSelect lightBoxBtn">
                        <div class="col-xs-12 col-sm-12 col-md-2 col-lg-12">
                            <input type="submit" class="btn btn-default" id="edit_lwd" value="Edit lwd">
                        </div>
                        <div class="error_msg"></div>
                    </div>
                    
                    </div>
                       
                    </form>
                    </div>
                    
                <div id="menu2" class="tab-pane fade">
                  <form id="escalation_tab" method="post">
                    <div class="ajax_msg"></div>
                    
                      <div class="row lighboxInner selectpopup">
                            <div class="col-lg-6">
                               <div class="form-group label-floating is-focused">
                                    <label class="control-label">Name</label>
                                    <input type="text" class="form-control  redalert" id="name1" name="name1">
                                    <input type="hidden" name="escalationID" id="escalationID"  value="">
                                    <input type="hidden" name="escalation_option" id="escalation_option"  value="">
                                </div>
                            </div>
                       
                            <div class="col-lg-6">
                               <div class="form-group label-floating is-focused">
                                    <label class="control-label">Phone No.</label>
                                    <input type="text" class="form-control  redalert" id="phone1" name="phone1">
                                </div>
                            </div>
                        </div>
                        
                        <div class="row lighboxInner selectpopup">
                            <div class="col-lg-6">
                               <div class="form-group label-floating is-focused">
                                    <label class="control-label">Name</label>
                                    <input type="text" class="form-control  redalert" id="name2" name="name2">
                                </div>
                            </div>
                       
                            <div class="col-lg-6">
                               <div class="form-group label-floating is-focused">
                                    <label class="control-label">Phone No.</label>
                                    <input type="text" class="form-control redalert" id="phone2" name="phone2">
                                </div>
                            </div>
                        </div>
                        
                        <div class="row lighboxInner selectpopup">
                            <div class="col-lg-6">
                               <div class="form-group label-floating is-focused">
                                    <label class="control-label">Name</label>
                                    <input type="text" class="form-control  redalert" id="name3" name="name3">
                                </div>
                            </div>
                        
                            <div class="col-lg-6">
                               <div class="form-group label-floating is-focused">
                                    <label class="control-label">Phone No.</label>
                                    <input type="text" class="form-control redalert" id="phone3" name="phone3">
                                </div>
                            </div>
                        </div>
                    	<div class="row lighboxInner selectpopup">
                            
                            <div class="row lighboxInner lightBoxSelect lightBoxBtn">
                                <div class="col-xs-12 col-sm-12 col-md-2 col-lg-12" id="button_div">
                                    <input type="submit" class="btn btn-default" id="" value="Escalation Update">
                                </div>
                                <div class="error_msg"></div>
                            </div>
                            
                            </div>
                    </form>
                </div>
          
            </div>
            
                       
            
            </div>
        </div>
    </div>
</div>
</div>

<div id="settingpopup" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <div class="modal-content">
            <div class="modal-body">
            
            <div class="row">
            <div class="col-lg-12">
                <h3>Change Setting</h3>
            </div>
            </div>
           <form id="setting_screen" method="post">
            <div class="ajax_msg"></div>
             <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                   <div class="form-group label-floating">
                        <label class="control-label">Red Alert Number</label>
                        <input type="text" class="form-control fullNameField redalert" name="redalertnumber">
                        <input type="hidden" name="lwd_ids" id="lwd_ids" value="">
                    </div>
                </div>
				<div class="col-lg-6">
                   <div class="form-group label-floating">
                        <label class="control-label">Amber Alert Number</label>
                        <input type="text" class="form-control fullNameField amberalert" name="amberalertnumber">
                    </div>
                </div>
             </div>
			 
			 
			 <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">IP Address</label>
                        <input type="text" class="form-control fullNameField ipaddress" name="ipaddress">
                    </div>
                </div>
				<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Port</label>
                        <input type="text" class="form-control fullNameField port" name="port">
                    </div>
                </div>
             </div>
			 
			  <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Red Alert SMS Number</label>
                        <input type="text" class="form-control fullNameField redalertsms" name="redalertsmsnumber">
                    </div>
                </div>
				<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Silent Dial</label>
                        <input type="text" class="form-control fullNameField silentdial" name="silentdial">
                    </div>
                </div>
             </div>
			 
			 <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Position Update Interval</label>
                        <input type="text" class="form-control fullNameField positionupdate" name="positionupdateinterval">
                    </div>
                </div>
				<div class="col-lg-6">
				  <div class="form-group label-floating">
                        <label class="control-label">Fixed Amber Time</label>
                        <input type="text" class="form-control fullNameField fixedamber" name="fixedambertime">
                    </div>
                </div>
             </div>
			 
			 <div class="row lighboxInner selectpopup">
             <div class="col-lg-6">
             <h5>Fall Detect</h5>
            	
                  <div class="form-group-new">
                        <label class="control-label">Enabled</label>
                        <input type="radio" value="1" class="falldetectenabled" name="falldetectenabled" id="falldetectenabled">
                   </div>
                   <div class="form-group-new">
                   		<label class="control-label">Disabled</label>
						<input type="radio" value="0" class="falldetectenabled" name="falldetectenabled" id="falldetectdisable">
                   </div>
                 </div>
                 
              <div class="col-lg-6">
                  <div class="form-group label-floating">
                   <label class="control-label">Amber Timer</label>
            	       <input type="text" name="limitamber" class="form-control" class="limitamber">
                 </div>
              </div></div>
			 
			  <div class="row lighboxInner selectpopup">
            	
                    <div class="col-lg-6">
                        <div class="form-group">
                            <label class="control-label">Fall Detect Sensitivity</label><br>
                            <select disabled="true" class="falldetectsensitivity" name="falldetectedsensitivity">
    						   <option value="">Select option</option>
    						   <option value="0">0</option>
    						   <option value="1">1</option>
                               <option value="2">2</option>
                               <option value="3">3</option>
                               <option value="4">4</option>
                               <option value="5">5</option>
    						</select>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="form-group">
                            <label class="control-label">Allow User to change setting</label><br>
                            <input type="checkbox" name="allow_user" value="1">
                        </div>
                    </div>
               
             </div>
			 <div class="row lighboxInner lightBoxSelect lightBoxBtn">
	              	<div class="col-xs-12 col-sm-12 col-md-2 col-lg-12">
                        <input type="submit" class="btn btn-default" id="change_setting" value="Change settings">
		            </div>
                    <div class="error_msg"></div>
	          </div>
	        </form>
            </div>
        </div>
    </div>
</div>
</div>

<div id="editsettingpopup" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <div class="modal-content">
            <div class="modal-body">
                   <!--  <div class="alert alert-error">
                      <button type="button" class="close" data-dismiss="alert">&times;</button>
                      <strong>Warning!</strong> Best check yo self, you're not looking too good.
                    </div> -->
            <div class="row">
            <div class="col-lg-12">
                <h3>Edit setting</h3>
            </div>
            </div>
           <form id="setting_screen_edit" method="post" action="/">
            <div class="ajax_msg"></div>
             <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                   <div class="form-group label-floating">
                        <label class="control-label">Red Alert Number</label>
                        <input type="text" class="form-control fullNameField redalert" id="redalert" name="redalertnumber">
                        <input type="hidden" name="lwd_ids" id="setting_id" value="">
                    </div>
                </div>
				<div class="col-lg-6">
                   <div class="form-group label-floating">
                        <label class="control-label">Amber Alert Number</label>
                        <input type="text" class="form-control fullNameField amberalert" id="amberalert" name="amberalertnumber">
                    </div>
                </div>
             </div>
			 
			 
			 <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">IP Address</label>
                        <input type="text" class="form-control fullNameField ipaddress" id="ipaddress" name="ipaddress">
                    </div>
                </div>
				<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Port</label>
                        <input type="text" class="form-control fullNameField port" id="port" name="port">
                    </div>
                </div>
             </div>
			 
			  <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Red Alert SMS Number</label>
                        <input type="text" class="form-control fullNameField redalertsms" id="redalertsms" name="redalertsmsnumber">
                    </div>
                </div>
				<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Silent Dial</label>
                        <input type="text" class="form-control fullNameField silentdial" id="silentdial" name="silentdial">
                    </div>
                </div>
             </div>
			 
			 <div class="row lighboxInner selectpopup">
            	<div class="col-lg-6">
                  <div class="form-group label-floating">
                        <label class="control-label">Position Update Interval</label>
                        <input type="text" class="form-control fullNameField positionupdate" id="positionupdate" name="positionupdateinterval">
                    </div>
                </div>
				<div class="col-lg-6">
				  <div class="form-group label-floating">
                        <label class="control-label">Fixed Amber Time</label>
                        <input type="text" class="form-control fullNameField fixedamber" id="fixedamber" name="fixedambertime">
                    </div>
                </div>
             </div>
			 
			 <div class="row lighboxInner selectpopup">
             <div class="col-lg-6">
             <h5>Fall Detect</h5>
            	
                  <div class="form-group-new">
                        <label class="control-label">Enabled</label>
                        <input type="radio" value="1" class="falldetectenabled falldetect" name="falldetectenabled" id="falldetectenabled">
                   </div>
                   <div class="form-group-new">
                   		<label class="control-label">Disabled</label>
						<input type="radio" value="0" class="falldetectenabled falldetect" name="falldetectenabled" id="falldetectdisable">
                   </div>
                 </div>
                 
              <div class="col-lg-6">
                  <div class="form-group label-floating">
                   <label class="control-label">Amber Timer</label>
            	       <input type="text" name="limitamber" class="form-control" id="ambertimer" class="limitamber">
                 </div>
              </div>
			 
			  <div class="row lighboxInner selectpopup">
            	
                    <div class="col-lg-6">
                        <div class="form-group">
                            <label class="control-label">Fall Detect Sensitivity</label><br>
                            <select class="falldetectsensitivity" disabled="true" id="falldetect" name="falldetectedsensitivity">
    						   <option value="">Select option</option>
    						   <option value="0">0</option>
    						   <option value="1">1</option>
                               <option value="2">2</option>
                               <option value="3">3</option>
                               <option value="4">4</option>
                               <option value="5">5</option>
    						</select>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="form-group">
                            <label class="control-label">Allow User to change setting</label><br>
                            <input type="checkbox" name="allow_user" id="allowuser" value="1" class="checkboxForm2">
                        </div>
                   
                </div>
             </div>
			 <div class="row lighboxInner lightBoxSelect lightBoxBtn">
	              	<div class="col-xs-12 col-sm-12 col-md-2 col-lg-12">
                        <input type="submit" class="btn btn-default" id="update_setting" value="Change settings">
		            </div>
                    <div class="error_msg"></div>
	          </div>
	        </form>
            </div>
        </div>
    </div>
</div>
</div>




<?php require_once APPPATH."/views/common/footer.php"; ?>