E:
/
home
/
kbcomunicacao1
/
Web
/
innterage
/
webChat
/
Upload File
HOME
<?php session_start(); if ( isset($_SESSION['LOGIN']) && isset($_SESSION['SENHA']) ) { require '../includes/conexao/funcao.inc.php'; require '../includes/conexao/config.php'; require '../includes/conexao/conn.php'; require '../includes/conexao/function.php'; date_default_timezone_set("America/Sao_Paulo"); setlocale(LC_ALL, 'pt_BR'); $userid = $_GET['idu']; $ref = $_GET['ref']; $data_atual = date("Y-m-d"); if($ref==1){ $parametros = ''; }elseif($ref==2){ $parametros = "AND cw_flw.prazo_flw > '$data_atual'"; }elseif($ref==3){ $parametros = "AND cw_flw.prazo_flw = '$data_atual'"; }elseif($ref==4){ $parametros = "AND cw_flw.prazo_flw < '$data_atual'"; } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title id="atualizarchat2"></title> <link href="css/summernote.css" rel="stylesheet"> <link href="css/summernote-bs3.css" rel="stylesheet"> <link href="css/bootstrap-chosen.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <script src="../midia/js/jquery.js"></script> </head> <body class="fixed-navigation" style="height: 100%;"> <div class="row" style="height: 100%;"> <div class="col-lg-12" style="height: 100%;"> <div class="wrapper wrapper-content animated fadeInRight" style="height: 100%;"> <div class="row" style="height: 100%;"> <div class="col-sm-4" style="height: 100%;"> <div class="ibox" style="height: 105%;"> <div class="ibox-content" style="height: 100%;"> <div class="tab-content" style="height: 100%;"> <div id="tab-1" class="tab-pane active" style="height: 100%"> <div class="row m-b-lg" style="height: 10%;"> <div class="col-lg-6" style="margin: 10px 0;"> </div> <div class="col-lg-6" style="margin: 10px 0"> <a href="javascript: void(0)" onClick="javascript:window.close();" class="btn btn-info btn-sm" style="float: right;"><i class="fa fa-home"></i> Home</a> </div> </div> <div class="client-detail" style="height: 80%;"> <div class="full-height-scroll" style="height:100%; overflow-y: scroll;"> <div id="pesquisas"><!--INICIO DA DIV DE PESQUISAS--> <div class="table-responsive"><!--INICIO DA DIV CONVERSAS ALIMENTADA VINDO DO AJAX--> <table class="table table-striped table-hover"> <tbody> <?php $query = "SELECT cw_relaciona_fw.data_relaciona_flw, cw_relaciona_fw.horario_relaciona_flw, cw_relaciona_fw.msg_relaciona_flw, cw_relaciona_fw.ultima_relaciona_flw, cw_relaciona_fw.timestamp, cw_flw.id_flw, cw_flw.tipo_flw, cw_flw.img_flw, cw_flw.assunto_flw, cw_flw.destacar_flw, cw_flw.responsavel_flw, cw_flw.sub_flw, cw_flw.tsub_flw, cw_cliente.razao_cliente FROM cw_relaciona_fw, cw_flw, cw_cliente WHERE cw_relaciona_fw.fw_relaciona_fw=cw_flw.id_flw AND cw_relaciona_fw.user_relaciona_fw='$userid' AND cw_flw.cliente_flw=cw_cliente.id_cliente AND cw_flw.status_flw='0' AND cw_relaciona_fw.status_relaciona_flw='0' AND cw_flw.responsavel_flw='$userid' $parametros ORDER BY cw_relaciona_fw.timestamp DESC"; $link = DBConnect(); $result = @mysqli_query($link, $query) or die(mysqli_error($link)); while($res = mysqli_fetch_assoc($result)){ $queryuser = "SELECT nome_user, img_user FROM cw_user WHERE id_user='$res[responsavel_flw]'"; $resultuser = DBExecute($queryuser); $resuser = mysqli_fetch_assoc($resultuser); $nome_user = $resuser['nome_user']; $img_user = $resuser['img_user']; ?> <span class="ultima" id="<?php echo $res['timestamp']; ?>"></span> <tr title="" class="mudavisitado irgerenciadorpainel" data-toggle="#<?php echo $res['id_flw'] ?>" id="<?php echo $res['id_flw'] ?>" > <td class="client-avatar"> <?php if($resuser['img_user']==""){ ?> <img alt="image" src="../midia/img/profile_small.jpg"> <?php }else{ ?> <img title="Responsável <?php echo $resuser['nome_user']; ?>" alt="image" src="../img-perfil/img/perfil/<?php echo $resuser['img_user']; ?>"> <?php } ?> </td> <td> <a style="color:#333" data-toggle="tab" href="#" class="client-link" title="<?php echo $res['assunto_flw']; ?>"> <?php if($res['tipo_flw']==7){echo"<i class='fa fa-user' style='color:#FFFF00; font-size:16px'></i>  ";} ?> <?php echo limita_caracteres($res['assunto_flw'], 35); ?><br /> <small style="font-size:10px; font-family:Tahoma, Geneva, sans-serif; font-weight:normal"> <?php echo limita_caracteres($res['razao_cliente'], 35); ?><br /> </small> <small> <?php echo limita_caracteres($res['ultima_relaciona_flw'], 40); ?> </small> </a> </td> <td align="right"> <a style="color:#333" data-toggle="tab" href="#"> <small> <?php if($res['msg_relaciona_flw']>0){ ?> <span class="label label-info pull-right"><?php echo $res['msg_relaciona_flw'] ?></span> <?php }else{} ?> </small><br /> <?php $d = date("d"); $m = date("m"); $Y = date("Y"); $data_banco = dbDateToDate2($res['data_relaciona_flw']); $hoje = date("d/m/Y"); $ontem = date("d/m/Y", mktime(0, 0, 0, $m, $d-1, $Y)); $anteontem = date("d/m/Y", mktime(0, 0, 0, $m, $d-2, $Y)); if($data_banco==$hoje){ echo limita_caracteres2($res['horario_relaciona_flw'], 5); }elseif($data_banco==$ontem){ echo"Ontem"; }elseif($data_banco==$anteontem){ echo"Anteontem"; }else{ echo $data_banco; } ?> </a> </td> </tr> <?php } ?> </tbody> </table> </div><!--FECHAMENTO DOS NOMES DAS CONVERSAS--> </div><!--FECHAMENTO DA DIV DE PESQUISAS--> </div> </div> </div> </div> </div> </div> </div> <div class="col-sm-8" style="height: 100%;"> <div class="ibox" style="height: 105%;"> <div class="ibox-content" style="height: 100%;"> <div class="tab-content" style="height: 100%;" id="palco"> <!--INICIO DO PALCO QUE APARECEM AS MENSSAGENS--> <div id="contact-1" class="tab-pane active" style="height: 100%; "> <div class="row m-b-lg" style="height: 10%;"> <div class="col-md-12 text-center"> <h1>BEM VINDO AO WEBCHAT</h1> </div> </div> <div class="client-detail" style="height: 80%; background:url(../midia/img/webchat.jpg); margin-top:-15px; margin-bottom:10px"> <div class="full-height-scroll"> <img src="../midia/img/logo.png" alt="grupoCaom" title="Innterage" class="img-responsive center-block" > </div> </div> <div class="col-lg-12"> </div> </div> <!--FINAL DO PALCO QUE APARECEM AS MENSSAGENS--> </div> </div> </div> </div> </div> </div> </div> </div> <script src="script/chosen.jquery.js"></script> <script src="script/classes.js" type="text/javascript"></script> <script src="script/script.min.js" type="text/javascript"></script> <script> function atualizarchat2() { var url="../includes/newchat2.php"; jQuery("#atualizarchat2").load(url); } setInterval("atualizarchat2()", 5000); $(document).on("click", "#textomsg", function() { $('#textomsg').focus(); }); var edit = function() { $('.click2edit').summernote({focus: true}); }; var save = function() { var aHTML = $('.click2edit').code(); //save HTML If you need(aHTML: array). $('.click2edit').destroy(); }; $(document).ready(function() { $('.summernote').summernote({ styleWithSpan: false }); }); function postForm() { $('textarea[name="content"]').html($('.summernote').code()); } function popup(url) { params = 'width='+screen.width; params += ', height='+screen.height; params += ', top=0, left=0' params += ', fullscreen=yes'; newwin=window.open(url,'windowname4', params); if (window.focus) {newwin.focus()} return false; } $(document).on("mouseover", ".conversas", function() { var idchat = $(this).attr('id'); var fav = ".fav_"+idchat; $(fav).show(); }); $(document).on("mouseout", ".conversas", function() { var idchat = $(this).attr('id'); var fav = ".fav_"+idchat; $(fav).hide(); }); $(document).on("click", ".star", function() { var idchat = $(this).attr('id'); var fav = ".fav_"+idchat; $.ajax({ cache: false, type: 'POST', url: 'favoritos.php', data: {idchat: idchat}, success: function(html) { var sucesso = html; $(fav).empty(); $(fav).html(sucesso); } }); return false; }); $(document).on("click", ".star2", function() { var idchat = $(this).attr('id'); var fav = ".fav_"+idchat; $.ajax({ cache: false, type: 'POST', url: 'favoritos2.php', data: {idchat: idchat}, success: function(html) { var sucesso = html; $(fav).empty(); $(fav).html(sucesso); } }); return false; }); $('.chosen-select').chosen({width: "100%"}); </script> </body> </html> <?php }else{ require"login.php"; } ?>