Viewing File: /home/cienp/public_html/portal/res_forn.php
<?php
if ($_POST[passa] == 'yes') {
require "$this->include_dir/conecta.php";
if ($_POST[v_nm_forn] != "")
$selforn = "AND UPPER(nm_forn) LIKE UPPER('%$_POST[v_nm_forn]%')";
if ($_POST[v_de_cidd] != "")
$selcidd = "AND UPPER(de_cidd) LIKE UPPER('%$_POST[v_de_cidd]%')";
if ($_POST[v_fl_atvo] != "")
$selatvo = "AND fl_atvo = '$_POST[v_fl_atvo]'";
$sql = "SELECT id_forn, nm_forn, de_barr, de_cidd, nu_fone, sg_uf, fl_atvo ";
$sql .= "FROM ".$pref_tabl."forn ";
$sql .= "WHERE id_forn = id_forn ";
$sql .= "$selforn $selcidd $selatvo ";
$sql .= "ORDER BY nm_forn ";
$res = mysqli_query($conn, $sql);
if (mysqli_num_rows($res) > 0){
?>
<div class="right_col" role="main">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Resultado da Busca - Fornecedores<small>Gerenciador de Fornecedores</small></h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>Fornecedores</th>
<th>Bairro</th>
<th>Cidade</th>
<th>Telefone</th>
<th width="10%" class="text-center">Ativo</th>
<th width="10%" class="text-center">Alterar</th>
</tr>
</thead>
<tbody>
<?php
$cont = 1;
while ($linha = mysqli_fetch_array($res)){
unset($fundo);
if (($cont % 2) == 0)
$fundo = 'class="dif"';
$cont++;
$totl++;
switch($linha[fl_atvo]) {
case 'S':
$fl_atvo = '<i class="fa fa-check" aria-hidden="true" style="color:#26B99A;"></i>';
break;
case 'N':
$fl_atvo = '<i class="fa fa-close" aria-hidden="true" style="color:#d9534f;"></i>';
break;
}
?>
<tr>
<td>
<a href="javascript:alt_forn('<?php echo $linha['id_forn'] ?>')">
<?php echo $linha['nm_forn'] ?>
</a>
</td>
<td>
<?php echo $linha['de_barr'] ?>
</td>
<td>
<?php echo $linha['de_cidd'] ?> / <?php echo $linha['sg_uf'] ?>
</td>
<td>
<?php echo $linha['nu_fone'] ?>
</td>
<td class="text-center">
<?=$fl_atvo?>
</td>
<td class="text-center">
<a href="javascript:alt_forn('<?php echo $linha['id_forn'] ?>')" class="btn btn-info btn-xs">
<i class="fa fa-pencil" aria-hidden="true"></i> Alterar
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12" style="padding:0px; margin-bottom:10px;">
<a href="javascript:voltar();"><button class="btn btn-primary" type="button">Voltar</button></a>
</div>
</div>
</div>
</div>
</div>
<?php
} else {
?>
<div class="right_col" role="main">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Resultado da Busca - Fornecedores<small>Gerenciador de Fornecedores</small></h2>
<div class="clearfix"></div>
</div>
<div class='alert alert-danger alert-dismissible fade in' role='alert' style='margin-top:30px;'>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button>
<strong>Alerta!</strong> Nenhum Fornecedor com estas caracteristicas foi encontrado!
</div>
<div class="form-group">
<div class="col-md-6 col-sm-6 col-xs-12" style="padding:0px; margin-bottom:10px;">
<a href="javascript:voltar();"><button class="btn btn-primary" type="button">Voltar</button></a>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<SCRIPT LANGUAGE="javascript">
function alt_forn(xb){
document.acidente.action = "index1.php?pg=alt_forn";
document.acidente.id_forn.value = xb;
document.acidente.submit();
}
function voltar(){
document.acidente.action = "index1.php?pg=pesq_forn";
document.acidente.submit();
}
</script>
<form name="acidente" method="post" action="" style="margin:0px !important;">
<input type="hidden" name="id_forn">
<input type="hidden" name="v_nm_forn" id="v_nm_forn" value="<?=$_POST[v_nm_forn]?>">
<input type="hidden" name="v_de_cidd" id="v_de_cidd" value="<?=$_POST[v_de_cidd]?>">
<input type="hidden" name="v_fl_atvo" id="v_fl_atvo" value="<?=$_POST[v_fl_atvo]?>">
<input type="hidden" name="passa" id="passa" value="yes">
</form>
<?php
} else
require "erro.php";
?>
Back to Directory
File Manager