<!-- Modal -->
<div class="modal fade" id="editsociomodal"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <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">Editar Sócio</h4>
            </div>
            <form  method="POST" id="frmEditSocio" class="frmEditSocio" action="teste.php" >
                <div class="modal-body">                
                    <?php if ($_SESSION['UsuarioNivel'] == 1) { ?> 

                        <div class="form-group input-group">
                            <span class="input-group-addon"> <i class="fa fa-user-plus fa-fw"></i></span>

                            <select name="apoio" id="apoio" class="form-control">

                                <option value ="" >Selecione um cliente</option>																			

                                <?php
                                // $resultUser2 = mysql_query("SELECT id,username FROM user WHERE  nivel = 3  AND id NOT IN (".$rowUser2['id'].") ORDER BY username ASC");
                                $resultUser2 = mysql_query("SELECT id,username FROM user WHERE  nivel = 3 ORDER BY username ASC");

                                while ($rowUser2 = mysql_fetch_array($resultUser2)) {

                                    $selected = ($rowEdit['id_apoio'] == $rowUser2['id']) ? 'selected' : '';

                                    echo "<option $selected value='$rowUser2[id]' >$rowUser2[username]</option>";
                                }
                                ?>

                            </select>								
                        </div>
                        <?php
                    }
                    ?>						
                    <div class="form-group input-group">
                        <span class="input-group-addon"> <i class="fa fa-user fa-fw"></i></span>
                        <input type="text" class="form-control" name="nome" placeholder="Nome" autofocus required>
                        <input type="hidden" class="form-control" name="perfil" value="4">
                        <input type="hidden" class="form-control" name="id"  value="<?php echo $editar ?>" >
                    </div>
                    <div class="form-group input-group">
                        <span class="input-group-addon"><i class="fa fa-user fa-fw"></i></span>
                        <input type="text" class="form-control" name="login" placeholder="Login" required>
                    </div>

                    <div class="form-group input-group">
                        <span class="input-group-addon">%</span>
                        <input min="0" max="100" type="number" class="form-control" name="porcent" placeholder="Porcentagem de Locação" required>
                    </div>

                    <div class="form-group input-group">
                        <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span>
                        <input type="password" class="form-control" name="pass" placeholder="Senha" required >
                    </div>
                    <div class="form-group input-group">
                        <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span>
                        <input type="password" class="form-control"  name="pass2" placeholder="Confirmar Senha" required>
                    </div>
                    
                    <?php if ($_SESSION['UsuarioNivel'] == 3) { ?>
                    <div class="form-group input-group">
                        <span class="input-group-addon"> Status</span>
                        <select name="status" id="" class="form-control">		
                            <?php?>
                                <option value="1"><?php echo 'Ativado' ?></option> 
                                <option value="2"><?php echo 'Bloqueado' ?></option> 
                             <?php?>					
                        </select>	
                    </div>
                    <?php } ?>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btnCancelarNewSocio" >Cancelar</button>
                    <button type="submit" class="btn btn-primary" id="btnSalvarNewSocio" >Salvar</button>                
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->