E:
/
home
/
kbcomunicacao1
/
Web
/
innterage
/
includes
/
Upload File
HOME
<link href="midia/css/estilos.css" rel="stylesheet"> <link href="midia/css/style.min.css" rel="stylesheet"> <link href="midia/css/jquery.steps2.css" rel="stylesheet"> <link href="midia/css/datatables.min.css" rel="stylesheet"> <script src="midia/js/jquery.js"></script> <?php session_start(); $sessao = session_id(); require 'conexao/funcao.inc.php'; require 'conexao/config.php'; require 'conexao/conn.php'; require 'conexao/function.php'; $pesquisa = $_POST['filteros']; $pesquisadata = DateTodbDate2($pesquisa); $status = $_POST['status']; if($pesquisa==''){$limit = "LIMIT 0,20";}else{$limit = '';} $query = "SELECT * FROM cw_crm WHERE status_crm='$status' AND user_crm='$_SESSION[IDCLI]' AND erro_crm='0' AND vencimento_crm!='0000-00-00' AND razao_crm LIKE '%$pesquisa%' OR status_crm='$status' AND user_crm='$_SESSION[IDCLI]' AND erro_crm='0' AND vencimento_crm!='0000-00-00' AND arquivo_crm LIKE '%$pesquisa%' ORDER BY id_crm DESC $limit"; $link = DBConnect(); $result = @mysqli_query($link, $query) or die(mysqli_error($link)); $row = mysqli_num_rows($result); $x = 0; if($status==0){ ?> <div class="table-responsive"> <table class="footable table table-bordered table-hover dataTables-example" data-filter=#filter> <thead> <tr> <td></td> <td></td> <td></td> <th> <i class="fa fa-pencil-square-o" style="margin-right: 5px"></i>Empresa</th> <th> <i class="fa fa-user" style="margin-right: 5px"></i>Responsável</th> <th> <i class="fa fa-file-pdf-o" style="margin-right: 5px"></i>Arquivo</th> <th> <i class="fa fa-share-square" style="margin-right: 5px"></i>Criado em</th> <th> <i class="fa fa-calendar" style="margin-right: 5px"></i>Vencimento</th> </tr> </thead> <tbody class="tbody"> <?php while($res = mysqli_fetch_assoc($result)){ $x++; ?> <tr class="gradeX" id="linha-<?php echo $x; ?>" > <td><a style="font-size: 16px; color: #757A7A" href='crm/baixar_arquivo.php?arquivo=<?php echo $res['caminho_crm']; ?>'><i class="fa fa-download"></i></a></td> <td> <?php if($res['status_crm']==0){ ?> <a href="#myModal" data-toggle="modal" id="<?php echo $res['id_crm']; ?>" data-target="#edit-modalmotivos" class="btn btn-xs btn-white"><i class="fa fa-check-circle"> </i> Ler</a> <?php }else{ ?> <a href="#" class="btn btn-xs btn-white" title="<?php echo $res['motivo_crm']; ?>"><i class="fa fa-check-circle"> </i> Lido</a> <?php } ?> </td> <td><a href="#" class="btn btn-xs btn-white reenviar" id="<?php echo $res['id_crm']; ?>" title="Reenviar"><i class="fa fa-mail-forward"> </i> </a></td> <td><?php echo $res['razao_crm']; ?></td> <td><?php echo $res['dp_crm']; ?> - <?php echo $res['nome_crm']; ?> - <?php echo $res['email_crm']; ?></td> <td><?php echo $res['arquivo_crm']; ?></td> <td><?php echo dbDateToDate2($res['data_crm']); ?> às <?php echo $res['hora_crm']; ?></td> <td><?php echo dbDateToDate2($res['vencimento_crm']); ?> <?php if($res['vencimento_crm'] < date('Y-m-d')){echo"<i class='fa fa-warning' title='Vencido'></i>";} ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php }else{ ?> <div class="table-responsive"> <table class="footable table table-bordered table-hover dataTables-example" data-filter=#filter> <thead> <tr> <td width="3%"></td> <td width="3%"></td> <td width="3%"></td> <th width="30%"><i class="fa fa-pencil-square-o" style="margin-right: 5px"></i>Empresa</th> <th width="20%"><i class="fa fa-user" style="margin-right: 5px"></i>Responsável</th> <th width="20%"><i class="fa fa-file-pdf-o" style="margin-right: 5px"></i>Arquivo</th> <th width="11%"><i class="fa fa-share-square" style="margin-right: 5px"></i>Criado</th> <th width="10%"><i class="fa fa-calendar" style="margin-right: 5px"></i>lido</th> </tr> </thead> <tbody class="tbody"> <?php while($res = mysqli_fetch_assoc($result)){ $x++; ?> <tr class="gradeX" id="linha-<?php echo $x; ?>" > <td><a style="font-size: 16px; color: #757A7A" href='crm/baixar_arquivo.php?arquivo=<?php echo $res['caminho_crm']; ?>'><i class="fa fa-download"></i></a></td> <td> <?php if($res['status_crm']==0){ ?> <a href="#myModal" data-toggle="modal" id="<?php echo $res['id_crm']; ?>" data-target="#edit-modalmotivos" class="btn btn-xs btn-white"><i class="fa fa-check-circle"> </i> Ler</a> <?php }else{ ?> <a href="#" class="btn btn-xs btn-white" title="<?php echo $res['motivo_crm']; ?>"><i class="fa fa-check-circle"> </i> Lido</a> <?php } ?> </td> <td><a href="#" class="btn btn-xs btn-white reenviar" id="<?php echo $res['id_crm']; ?>" title="Reenviar"><i class="fa fa-mail-forward"> </i> </a></td> <td><?php echo $res['razao_crm']; ?></td> <td><?php echo $res['dp_crm']; ?> - <?php echo $res['nome_crm']; ?> - <?php echo $res['email_crm']; ?></td> <td><?php echo $res['arquivo_crm']; ?></td> <td><?php echo dbDateToDate2($res['data_crm']); ?> às <?php echo $res['hora_crm']; ?></td> <td><?php echo dbDateToDate2($res['lido_crm']); ?> às <?php echo $res['horalido_crm']; ?> | <?php echo $res['por_crm']; ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> <!-- Mainly scripts --> <script src="midia/js/datatables.min.js"></script> <script src="midia/js/dataTables.bootstrap4.min.js"></script> <script src="midia/bootstrap/js/bootstrap.min.js"></script> <script> $(document).ready(function(){ $('.dataTables-example').DataTable({ paging: false, info: false, searching: false, autoFill: true, responsive: true, dom: '<"html5buttons"B>lTfgitp', buttons: [ ] }); }); </script>