<!-- Modal -->
<div class="modal fade" id="newoperador" 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">Novo operador</h4>
            </div>

            <form id="frmNewOperador" method="POST">
                <div class="modal-body">

                    <?php
                    if ($_SESSION['UsuarioNivel'] == 1) {
                        $resultUser = mysql_query("SELECT id,nome FROM ponto "
                                . " WHERE id > 0 "
                                . " AND status = 1 "
                                . " ORDER BY nome ASC");
                    }

                    if ($_SESSION['UsuarioNivel'] == 3 || $_SESSION['UsuarioNivel'] == 4) {
                        $resultUser = mysql_query("SELECT id,nome FROM ponto "
                                . " WHERE id_apoio = " . $_SESSION['UsuarioID'] . " "
                                . " AND id > 0 "
                                . " AND status = 1 "
                                . "ORDER BY nome ASC");
                    }
                    ?> 	
                    <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="usuario" class="form-control" autofocus required > 
                            <option value ="" selected="selected">Selecione um ponto</option>
                            <?php
                            while ($rowUser = mysql_fetch_array($resultUser)) {
                                echo '<option value="' . $rowUser['id'] . '">' . $rowUser['nome'] . '</option>';
                            }
                            ?>
                        </select>
                    </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="nome" placeholder="Nome" required >
                        <input type="hidden" class="form-control" name="perfil" value="6">

                    </div>

                    <div class="form-group input-group">
                        <span class="input-group-addon"> <i class="fa fa-dollar fa-fw"></i></span>
                        <select name="fecharFaturasPonto" id="fecharFaturasPonto" class="form-control" required > 
                            <option value ="" selected="selected">Pode fechar faturas do ponto?</option>
                            <option value ="1" >Sim</option>
                            <option value ="0" >Não</option>							
                        </select>
                    </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"><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>
                </div>

                <input type="hidden" class="form-control"  name="id_pais" value="<?php echo $_SESSION['pais'] ?>">

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btnCancelarNewOperador" >Cancelar</button>
                    <button type="submit" class="btn btn-primary" id="btnSalvarNewOperador" >Salvar</button>

                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
