Viewing File: /home/cienp/public_html/portal/res_almx_regs.php

<?php

    if ($_POST[passa] == 'yes') {

    require "$this->include_dir/conecta.php";

    $s_id_resp = protecao($_POST[v_id_resp],'inteiro');
    
    if ($s_id_resp != "")
        $selresp = "AND id_resp = '$s_id_resp'";
    
    $sql  = "SELECT id_regs, id_resp, vl_debt, vl_sald, de_finl, ";
    $sql .= "DATE_FORMAT(dt_regs, '%d/%m/%Y') as dt_reg2 ";
    $sql .= "FROM ".$pref_tabl."almx_regs ";
    $sql .= "WHERE id_regs = id_regs ";
    $sql .= "$selresp ";
    $sql .= "ORDER BY id_regs DESC ";
    $res  = mysqli_query($conn, $sql);
    #echo $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 de Registro de Almoxarifado<small>Gerenciador de Registro de Almoxarifado</small></h2>
                  <div class="clearfix"></div>
                </div>
<?php
                if ($_GET[certo] == 'N') {
                    echo "<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>Resultado da busca de Registro de Almoxarifado!</strong> Erro ao efetuar a operação. Entre em contato com o administrador!
                        </div>";
                }
?>
                <div class="x_content">
                    <table id="datatable" class="table table-striped table-bordered">
                        <thead>
                            <tr>
                                <th>Responsável</th>
                                <th>Data Registro</th>
                                <th>Valor Delt</th>
                                <th>Valor Sald</th>
                                <th>Finl</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_almx_regs('<?php echo $linha['id_regs'] ?>')">
                                        <?php echo $linha['id_resp'] ?>
                                    </a>
                                </td>
                                <td>
                                    <?php echo ($linha['dt_reg2']) ?>
                                </td>
                                <td>
                                    <?php echo moeda ($linha['vl_debt']) ?>
                                </td>
                                <td>
                                    <?php echo moeda ($linha['vl_sald']) ?>
                                </td>
                                <td>
                                    <?php echo ($linha['de_finl']) ?>
                                </td>
                                <td class="text-center">
                                    <a href="javascript:alt_almx_regs('<?php echo $linha['id_regs'] ?>')" 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 de Registro de Almoxarifado<small>Gerenciador de Registro de Almoxarifado</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 registro 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_almx_regs(xb){
        document.acidente.action = "index1.php?pg=alt_almx_regs";
        document.acidente.id_regs.value = xb;
        document.acidente.submit();
    }
    function voltar(){
        document.acidente.action = "index1.php?pg=pesq_almx_regs";
        document.acidente.submit();
    }
</script>
<form name="acidente" method="post" action="" style="margin:0px !important;">
  <input type="hidden" name="id_regs">
  <input type="hidden" name="v_id_resp" id="v_id_resp" value="<?=$_POST[v_id_resp]?>">
  <input type="hidden" name="opc">
  <input type="hidden" name="passa" id="passa" value="yes">
</form>
<?php
    } else {
        require "erro.php";
    }
?>
Back to Directory File Manager