<?php

include('views/_header.tpl.php');

?>

<script type="text/javascript" src="/static/js/jQuery/js/jquery.lightbox.js"></script>
<link rel="stylesheet" type="text/css" href="/static/js/jQuery/css/jquery.lightbox.css" media="screen" />

<style>
    label { width:75px !important; }
    #mmen {  }
    .form .txt { 
        margin-bottom:10px;
        padding: 15px;
        font-size:15px;
    }    
    .form .row-item .lbl {
        float: left;
        padding-top: 14px;
    }    
   .form .description-input {
        margin-left: 79px;    
    }
.form .row-item .btn {
    padding: 10px 30px;
    margin-bottom: 3px;
    margin-left: 5px;
    margin-right:5px;
}    
input[type="button"], input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] {
    font-size:15px;
    padding: 7px 20px;
}    

input[type="button"], input[type="reset"], input[type="submit"] {
    font-size: 15px;
    padding: 7px 20px;
    font-weight:300;
    border-radius: 50px; -moz-border-radius: 50px; -webkit-border-radius: 50px;
}    
    
a.confirm { 
    margin-top: 7px;
    color:#ff0000; 
    background: rgba(255,255,255,.2);
    padding:5px 15px;
    border-radius: 50px; -moz-border-radius: 50px; -webkit-border-radius: 50px;
}   

    .fancybox-close {
        position: absolute;
        top: 250px;
        right: -50px;
        width: 36px;
        height: 36px;
        cursor: pointer;
        z-index: 8040;
    } 
    
    .fancybox-next span {
    right: 5px;
    position: fixed;
}

#footer {
    padding: 0px 0 0 0;
}

#footer .main-footer {
    display:none;
}

    
/* ############################################### */
/* ####### The Switch - the box around the slider ####### */
/* ############################################### */

.switch {
  position: relative;
  display: inline-block;
  width: 60px !important;
  height: 32px;
}

/* Hide default HTML checkbox */
.switch input {display:none;}

/* The slider */
.sliderr {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.sliderr:before {
  position: absolute;
  content: "";
  height: 28px;
  width: 28px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .sliderr {
  background-color: #98cb54;
}

input:focus + .sliderr {
  box-shadow: 0 0 1px #98cb54;
}

input:checked + .sliderr:before {
  -webkit-transform: translateX(28px);
  -ms-transform: translateX(28px);
  transform: translateX(28px);
}

/* Rounded sliders */
.sliderr.round {
  border-radius: 32px; -moz-border-radius: 32px; -webkit-border-radius: 32px;
}

.sliderr.round:before {
  border-radius: 50%;
  -moz-border-radius: 50%;
  -webkit-border-radius: 50%;
  
}
/* ############################################### */
/* ##############     The Switch ENDS     ############## */
/* ############################################### */    
</style>

 <div class="home-feature-category" style="background:none; border:none;">
     <div class="container_12 clearfix">
        <div class="grid_12 marked-category">

        <h1 style="margin-bottom:0px;"><?php
        
        if ($user) {
            echo "Edit";
        } else {
            echo "Add";
            $def = "/static/uploads/logos/placeholder.jpg";
        }
        
        ?> Member Account</h1>

        <form method="post" class="form form-profile" enctype="multipart/form-data" style="padding:25px 0px 0px;">
            <div class="row-item clearfix" style="padding-bottom:10px;">
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Img:</label>
                <div class="val" style="margin-left:0px; margin-bottom:10px;">
                    <img src="<?php if($user) { echo "" .$user['image']. ""; } else { echo "" . $def . ""; } ?>" style="border:3px solid #fff; border-radius:50%; height:200px; width:auto;" 
                        onerror="this.src='/static/images/users/default-avatar.jpg'" />
                    <br /><br />                        
                    <p class="rs description-input" style="font-size:11px; color:#aaa;"><?= $user['image'] ?></p>
                </div>    
                
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">User Img:</label>
                <div class="val" style="margin-left:0px; font-size:12px !important;">
                    <input class="txt" type="file" name="image" style="font-size:12px;">
                    <p class="rs description-input"></p>
                </div>           
                
                <br />                            
 
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Reg Email:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="email" value="<?= $user['email'] ?>" readonly style="background:#ccc;">
                    <p class="rs description-input"></p>
                </div>
                
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Reg Date:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="reg_date" value="<?= $user['reg_date'] ?>"  readonly style="background:#ccc;">
                    <p class="rs description-input"></p>
                </div>         
                
                <br />
                
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">&nbsp;</label>
                <div class="val" style="margin-left:0px; font-weight:800; color:#ccc; font-size:32px;">  
                            MEMBER INFO
                    <p class="rs description-input"></p>
                </div>       
                <div class="clear"></div>     
                
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Type:</label>
                <div class="val" style="margin-left:0px;">
                            <select class="txt" type="text" name="account_type" style="height:52px;">
                                <option value="">Select Type</option>
                                <option value="User" <?php if($user['account_type'] == 'User') { ?> selected="selected"<?php } ?>>User</option>
                                <option value="Shop" <?php if($user['account_type'] == 'Shop') { ?> selected="selected"<?php } ?>>Shop</option>
                                <option value="Bank" <?php if($user['account_type'] == 'Bank') { ?> selected="selected"<?php } ?>>Bank</option>
                                <option value="Developer" <?php if($user['account_type'] == 'Developer') { ?> selected="selected"<?php } ?>>Developer</option>                           
                            </select>                    
                    <p class="rs description-input">'Shop','User','Person','Developer','Bank'</p>
                </div>                                       
  
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Email:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="x_email" value="<?= $user['x_email'] ?>">
                    <p class="rs description-input"></p>
                </div>
                
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Phone:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="phone" value="<?= $user['phone'] ?>">
                    <p class="rs description-input"></p>
                </div>                                                
 
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Company:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="occupation_at" value="<?= $user['occupation_at'] ?>">
                    <p class="rs description-input"></p>
                </div>

                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Full Name:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="name" value="<?= $user['name'] ?>">
                    <p class="rs description-input"></p>
                </div>  

                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">First:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="first_name" value="<?= $user['first_name'] ?>">
                    <p class="rs description-input"></p>
                </div>       
                
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Last:</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="last_name" value="<?= $user['last_name'] ?>">
                    <p class="rs description-input"></p>
                </div>   
    
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px;">Admin</label>
                <div class="val" style="margin-left:0px;">
                    <input class="txt" type="text" name="is_admin" value="<?= $user['is_admin'] ?>">
                    <p class="rs description-input"></p>
                </div>       
                
                <br />

                <div class="clear"></div>
                <br />                                                                       
     
                <!-- ########### SWITCH FIELD STARTS HERE ########### -->
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px; margin-top:5px">Approved?</label>
                    <div style="display:inline-block; float:left; width:auto; min-width:150px; height:41px; line-height:41px; background:none; padding-top:9px; margin-top:5px;">
                        <?php 
                            $is_activated = !empty($user['is_activated']) ? " checked='checked'" : ""; 
                            $is_active = isset($user['is_activated']) ? 1 : 0;                            
                        ?>
                         <label class='switch'>                           
                           <input class='' id='' data-toggle='toggle' type='checkbox' name="is_activated"<?= $is_activated ?> /><span class='sliderr round'></span>
                         </label>                                          
                    </div>                         
                   <div class="clear"></div>                      
  
                <!-- ########### SWITCH FIELD STARTS HERE ########### -->
                <label class="lbl" for="txt_name1" style="text-align:left; width:auto; margin-right:5px; margin-top:5px">Premium?</label>
                    <div style="display:inline-block; float:left; width:auto; min-width:150px; height:41px; line-height:41px; background:none; padding-top:9px; margin-top:5px;">
                        <?php 
                            $is_premium = !empty($user['is_premium']) ? " checked='checked'" : ""; 
                            $is_active = isset($user['is_premium']) ? 1 : 0;                            
                        ?>
                         <label class='switch'>                           
                           <input class='' id='' data-toggle='toggle' type='checkbox' name="is_premium"<?= $is_premium ?> /><span class='sliderr round'></span>
                         </label>                                          
                    </div>                         
                   <div class="clear"></div>      

            </div>
            <br />
            <input type="submit" style="font-weight:300" class="btn btn-blue" /> 
            <input type="button" value="Cancel" class="btn btn-black" onclick="location = '/admin/'" />
        </form>
        </div><!-- DIV 8 -->
        <div class="grid_4 marked-category" style="display:none;">
           <h1 style="margin-bottom:0px;">EXTRA COLUMN</h1>

           <br /><br />
           
        </div>  
    </div><!-- DIV 12 CONTAINER -->
</div><!-- DIV HOME -->

<?php

include('views/_footer.tpl.php');

?>