Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {
- $tabela1 .= '<tr>';
- $tabela1 .= '<td>'.$rows_cursos['nome'].'</td>';
- $tabela1 .= '<td> <input type="text" name= "Colaborador" value=""</td>';
- <label for=""><h5><strong>Colaborador</strong></h5></label>
- <select name="Colaborador" required>
- <option></option>
- <?php
- $servername = "xxx.xxx.x.xx";
- $username = "xxxx";
- $password = "xxxxxx";
- $dbname = "xxxxxx";
- $conn = new mysqli($servername, $username, $password, $dbname);
- $conn->set_charset('utf8');
- $sql = "SELECT * FROM centrodb.colaboradores WHERE descricaovalencia = 'lar' AND estado = 1 AND Funcao = 'AAD' ORDER BY nome ASC";
- $qr = mysqli_query($conn, $sql);
- while($ln = mysqli_fetch_assoc($qr)){
- echo '<option value="'.$ln['nome'].'">'.$ln['nome'].'</option>';
- }
- ?>
- </select>
- <select name="produto" id="Produto" onchange="javascript:associaInput();"*>
- function associaInput() {
- //pega o value do select
- var e = document.getElementById("Produto");
- var itemSelecionado = e.options[e.selectedIndex].value;
- //injeta no value do input
- document.getElementByName('produto.Produto').value = itemSelecionado;
- }
- <label for=""><h5><strong>Colaborador</strong></h5></label>
- <select name="Colaborador" required>
- <option></option>
- <?php
- $servername = "xxx.xxx.x.xx";
- $username = "xxxx";
- $password = "xxxxxx";
- $dbname = "xxxxxx";
- $mysqli = new mysqli($servername, $username, $password, $dbname);
- if($th = $mysqli->query("SELECT * FROM centrodb.colaboradores WHERE descricaovalencia = 'lar' AND estado = 1 AND Funcao = 'AAD' ORDER BY nome ASC");
- whiel($row = $th->fetch_assoc()){
- echo '<option value="'.$row['nome'].'">'.$row['nome'].'</option>';
- }
- ?>
- </select>
Add Comment
Please, Sign In to add comment