<!DOCTYPE html>
<html>
    <head>
        <title>Edit User.</title>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url().'assets/css/bootstrap.min.css'?>" >
        
          <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
        
    <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <link rel="stylesheet" type="text/css" href="jquery.datetimepicker.css"/>
    
    </head>

    <body>
    
    <div class="navbar navbar-dark bg-dark">
        <div class="container">
            <a href="a" class="navbar-brand">Platinum Live</a>
        </div>
    </div>

    <div class="container" style="padding-top: 10px;">

        <h3>Edit User</h3>
        <hr>

     <form method="post" name="createUser" action="<?php echo base_url().'index.php/users/edit/'.$user['id'];?>">
    
        <div class="row">

            <div class="col-md-6">

                <div class="form-group">
                    <label>Mac ID</label>
                    <input type="text" name="macid" value="<?php echo set_value('macid', $user['macid']);?>" class="form-control">
                    <?php echo form_error("macid"); ?>
                </div>

                <div class="form-group">
                    <label>Email</label>
                    <input type="text" name="email" value="<?php echo set_value('email', $user['email']);?>" class="form-control">
                    <?php echo form_error("email"); ?>
                </div>

                <div class="form-group">
                    <label>Phone</label>
                    <input type="text" name="phone" value="<?php echo set_value('phone', $user['phone']);?>" class="form-control">
                    <?php echo form_error("phone"); ?>
                </div>

                 <div class="form-group">
                    <label>Expiry</label><br>
                    <input type="radio" value="0" name="exp" checked="checked"> None <br>
                    <input type="radio" value="1" name="exp" > 1 Day <br>
                    <input type="radio" value="3" name="exp" > 3 Months <br>
                    <input type="radio" value="6" name="exp" > 6 Months <br>
                    <input type="radio" value="12" name="exp" > 12 Months <br>
                    <input type="radio" value="24" name="exp" > 24 Months <br>
                    <?php echo form_error("expiry"); ?>
                </div>

                <div class="form-group">
                    <label>Device Info</label>
                    <input type="text" name="deviceinfo" value="<?php echo set_value('deviceinfo', $user['deviceinfo']);?>" class="form-control">
                    <?php echo form_error("deviceinfo"); ?>
                </div>

                <div class="form-group">
                    <label>Status</label>
                    
                <?php if(strcmp($user['status'], 'false') == 0) {?>
                
                    <input type="checkbox" name="status" value="<?php echo set_value('status', $user['status']);?>" class="form-control">
                        
                <?php } else { ?>
                    
                    <input type="checkbox" name="status" value="<?php echo set_value('status', $user['status']);?>" class="form-control" checked>
                    
                <?php } ?>
                    
                </div>
                
                <div class="form-group">
                    <label>Comment</label>
                    <textarea class="form-control" name="note" rows="4" id="comment"><?php echo set_value('note', $user['note']);?></textarea>
                </div>

                <div class="form-group">
                    <button class="btn btn-primary">Update</button>
                    <a href="<?php echo base_url().'index.php/Users/index'?>" class="btn btn-secondary">Cancel</a>
                </div>

            </div>   

        </div>

     </form>         
    
    </div>

    </body>
</html>
<script>
  $( function() {
    $( "#datepicker" ).datepicker({
        dateFormat: "DD, d MM, yy",
        changeMonth: "true",
        changeYear: "true"
    });
  } );
  </script>