D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
idoso
/
adm
/
vendor
/
api
/
Filename :
ler_resid_inv.php
back
Copy
<?php include_once "ConectaApi.php"; $link = mysqli_connect(HOST, USER, PASS); if (!$link) { die('Não conseguiu conectar: ' . mysql_error()); } // seleciona o banco devcodes $filial_id = $_POST['filial_id']; //$sub_tipo_id = $_POST['sub_tipo_id']; $db_selected = mysqli_select_db( $link,DBNAME); if (!$db_selected) { die ('Não pode selecionar o banco '.DBNAME.' : ' . mysql_error()); } $query = "select i.gre_residente_id, r.nome from gre_inventario_residente i inner join gre_residente r on i.gre_residente_id = r.id where i.adms_sit_id = 1 and i.gre_filial_id = {$filial_id} group by i.gre_residente_id, r.nome order by r.nome"; $result = mysqli_query($link, $query) or die(mysqli_error()); $stringRes = ""; // $stringForn .= "<option value=''>Selecione</option>"; while ($row = mysqli_fetch_array($result)) { $stringRes .= "<option value='$row[0]'>$row[1]</option>"; } echo $stringRes; ?>