E:
/
home
/
kbcomunicacao1
/
Web
/
innterage
/
webChat
/
Upload File
HOME
<?php session_start(); 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'); $id = $_POST['essay_id']; $query = "UPDATE cw_relaciona_fw SET msg_relaciona_flw = '0' WHERE fw_relaciona_fw = '$id' AND user_relaciona_fw='$_SESSION[IDCLI]'"; $result = DBExecute($query); $query = "SELECT cw_flw.chave_flw, cw_flw.tipo_flw, cw_flw.responsavel_flw, cw_flw.img_flw, cw_flw.prazo_flw, cw_flw.assunto_flw, cw_flw.descricao_flw, cw_flw.sub_flw, cw_flw.tsub_flw, cw_cliente.razao_cliente FROM cw_flw, cw_cliente WHERE cw_flw.cliente_flw=cw_cliente.id_cliente AND cw_flw.id_flw='$id' LIMIT 1"; $result = DBExecute($query); $res = mysqli_fetch_assoc($result); $query2 = "SELECT cw_user.id_user, cw_user.nome_user, cw_user.sobrenome_user FROM cw_relaciona_fw, cw_user WHERE user_relaciona_fw=id_user AND fw_relaciona_fw='$id'"; $link2 = DBConnect(); $result2 = @mysqli_query($link2, $query2) or die(mysqli_error($link2)); $rows1 = mysqli_num_rows($result2); $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="flw" id="<?php echo $id; ?>"></span> <span class="usuario" id="<?php echo $_SESSION['IDCLI']; ?>"></span> <!--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: 15%; border-bottom:1px solid #D7D7D7; "> <div class="col-md-1"> <a href='#modalPrazo' class="modalPrazo" data-toggle='modal' id='3'> <?php if($resuser['img_user']==""){ ?> <img alt="image" src="../midia/img/profile_small.jpg" style="width: 42px" alt="image" class="img-circle"> <?php }else{ ?> <img title="Responsável <?php echo $resuser['nome_user']; ?>" alt="image" src="../img-perfil/img/perfil/<?php echo $resuser['img_user']; ?>" style="width: 42px" alt="image" class="img-circle"> <?php } ?> </a> </div> <div class="col-md-4" style="height:100%; overflow: auto"> <div class="col-lg-12"> <strong title="<?php echo $res['assunto_flw']; ?>"><?php echo limita_caracteres($res['assunto_flw'], 50); ?></strong> </div> <div class="col-lg-12"> <small style="font-size:10px; font-family:Tahoma, Geneva, sans-serif; font-weight:normal"> <?php echo limita_caracteres($res['razao_cliente'], 50); ?><br /> </small> </div> <div class="col-lg-12"> <small> <?php while($res2 = mysqli_fetch_assoc($result2)){ if($rows1>0){ echo $res2['nome_user']; ?>, <?php }else{} } ?> </small> </div> </div> <div class="col-md-7" style="height:100%; overflow: auto"> <div class="col-lg-12"> <strong>Prazo: <a href='#modalPrazo' class="prazo" data-toggle='modal' id='1' style="color:#333"><?php echo dbDateToDate2($res['prazo_flw']); ?></a></strong> </div> <div class="col-lg-12"> <?php $descricao_flw = nl2br($res['descricao_flw']); ?> <small style="cursor:pointer" title="<?php echo $res['descricao_flw']; ?>"><i>"<?php echo limita_caracteres($descricao_flw, 190); ?>"</i> </small> </div> </div> </div> <div class="client-detail" style="height: 75%; background:url(../midia/img/webchat.jpg); margin-top:-15px; margin-bottom:10px"> <!--MENSAGENS--> <div id="janela" style="height:100%; overflow-y: scroll;"> <?php $queryc = "SELECT * FROM cw_chat, cw_user WHERE cw_chat.usuario_chat=cw_user.id_user AND flw_chat='$id'"; $linkc = DBConnect(); $resultc = @mysqli_query($linkc, $queryc) or die(mysqli_error($linkc)); while($resc = mysqli_fetch_assoc($resultc)){ if($resc['usuario_chat']==$_SESSION['IDCLI']){$lado = "pull-right";}else{$lado = "pull-left";} ?> <div class="feed-element" style="padding:10px 20px; color:#000; margin:3px"> <div class="media-body" style="margin-bottom:-14px; margin-top:-18px"> <?php if($resc['tipo_chat']==0){ ?> <!--AQUI É A CONVERSA--> <div class="well <?php echo $lado; ?> conversas" style="background-color:#FFF; color:#000; max-width:60%; min-width:30%; padding-top:5px; padding-left:10px; padding-right:7px; padding-bottom:-5px" id="<?php echo $resc['id_chat']; ?>"> <a href="#" class="<?php echo $lado; ?>"> <img alt="image" style="margin-right:3px; margin-left:3px" class="img-circle" src="../img-perfil/img/perfil/<?php if($resc['img_user']==''){echo"img/profile_small.jpg";}else{echo $resc['img_user'];} ?>"> </a> <strong><?php echo $resc['nome_user']; ?> <?php echo $resc['sobrenome_user']; ?></strong> <small class="text-muted "> <?php echo dbDateToDate2($resc['data_chat']); ?> às <?php echo $resc['hora_chat']; ?></small> <span class="fav_<?php echo $resc['id_chat']; ?>" style="cursor:pointer; display:none"> <?php $queryf = "SELECT id_favoritos FROM cw_favoritos WHERE chat_favoritos='$resc[id_chat]' AND user_favoritos='$_SESSION[IDCLI]'"; $linkf = DBConnect(); $resultf = @mysqli_query($linkf, $queryf) or die(mysqli_error($linkf)); $rowsf = mysqli_num_rows($resultf); if($rowsf==0){ ?>   <i class="fa fa-star-o star" id="<?php echo $resc['id_chat']; ?>" title="Adicionar aos favoritos" style="float:right; font-size:16px"></i> <?php }else{ ?>   <i class="fa fa-star star2" id="<?php echo $resc['id_chat']; ?>" title="Adicionado aos favoritos" style="float:right; font-size:16px"></i> <?php } ?> </span><br /> <span style="margin-top:8px; font-size:12px; text-align:justify"> <?php echo nl2br($resc['texto_chat']); ?> </span> </div> <!--AQUI É A CONVERSA--> <?php }elseif(($resc['tipo_chat']==99)OR($resc['tipo_chat']==98)){ ?> <!--AQUI É A CONVERSA--> <div class="well <?php echo $lado; ?> conversas" style="background-color:#FF9; color:#000; max-width:60%; min-width:30%; padding-top:5px; padding-left:10px; padding-right:7px; padding-bottom:-5px" id="<?php echo $resc['id_chat']; ?>"> <?php if($resc['destino_chat']==0){ ?> <a href="#" class="<?php echo $lado; ?>"> <img alt="image" style="margin-right:3px; margin-left:3px" class="img-circle" src="../img-perfil/img/perfil/<?php if($resc['img_user']==''){echo"img/profile_small.jpg";}else{echo $resc['img_user'];} ?>"> </a> <?php } ?> <small class="text-muted "> <?php echo dbDateToDate2($resc['data_chat']); ?> às <?php echo $resc['hora_chat']; ?></small> <span class="fav_<?php echo $resc['id_chat']; ?>" style="cursor:pointer; display:none"> <?php $queryf = "SELECT id_favoritos FROM cw_favoritos WHERE chat_favoritos='$resc[id_chat]' AND user_favoritos='$_SESSION[IDCLI]'"; $linkf = DBConnect(); $resultf = @mysqli_query($linkf, $queryf) or die(mysqli_error($linkf)); $rowsf = mysqli_num_rows($resultf); if($rowsf==0){ ?>   <i class="fa fa-star-o star" id="<?php echo $resc['id_chat']; ?>" title="Adicionar aos favoritos" style="float:right; font-size:16px"></i> <?php }else{ ?>   <i class="fa fa-star star2" id="<?php echo $resc['id_chat']; ?>" title="Adicionado aos favoritos" style="float:right; font-size:16px"></i> <?php } ?> </span><br /> <span style="margin-top:8px; font-size:12px; text-align:justify"> <?php echo nl2br($resc['texto_chat']); ?> </span> </div> <!--AQUI É A CONVERSA--> <?php } elseif($resc['tipo_chat']==1){ ?> <!--AQUI É A CONVERSA--> <div class="text-center well" style="padding:10px; border:0; background: transparent"> <span style="background-color:#E1F3FB; margin-top:8px; font-size:12px; text-align:justify; padding:7px; -webkit-box-shadow: 1px 1px 0px #ccc; border-radius:5px; color:#202020"> <?php echo nl2br($resc['texto_chat']); ?> </span> </div> <!--AQUI É A CONVERSA--> <?php }elseif($resc['tipo_chat']==2){ ?> <!--AQUI É A CONVERSA--> <div class="text-center well" style="padding:10px; border:0; background: transparent"> <span style="background-color:#F00; margin-top:8px; font-size:12px; text-align:justify; padding:7px; -webkit-box-shadow: 1px 2px 0px #ccc; border-radius:5px; color:#FFF; font-weight:bold"> <?php echo nl2br($resc['texto_chat']); ?> </span> </div> <!--AQUI É A CONVERSA--> <?php }elseif($resc['tipo_chat']==3){ ?> <!--AQUI É A CONVERSA--> <div class="text-center well" style="padding:10px; border:0; background: transparent"> <span style="background-color:#E1F3FB; margin-top:8px; font-size:12px; text-align:justify; padding:7px; -webkit-box-shadow: 1px 1px 0px #ccc; border-radius:5px; color:#202020; font-weight:bold"> <?php echo nl2br($resc['texto_chat']); ?> </span> </div> <!--AQUI É A CONVERSA--> <?php }elseif($resc['tipo_chat']==5) { ?> <!--AQUI É A CONVERSA--> <div class="well <?php echo $lado; ?> conversas" style="background-color:#FFF; color:#000; max-width:60%; min-width:30%; padding-top:5px; padding-left:10px; padding-right:7px; padding-bottom:-5px" id="<?php echo $resc['id_chat']; ?>"> <a href="#" class="<?php echo $lado; ?>"> <img alt="image" style="margin-right:3px; margin-left:3px" class="img-circle" src="../img-perfil/img/perfil/<?php if($resc['img_user']==''){echo"img/profile_small.jpg";}else{echo $resc['img_user'];} ?>"> </a> <strong><?php echo $resc['nome_user']; ?> <?php echo $resc['sobrenome_user']; ?></strong> <small class="text-muted "> <?php echo dbDateToDate2($resc['data_chat']); ?> às <?php echo $resc['hora_chat']; ?></small> <span class="fav_<?php echo $resc['id_chat']; ?>" style="cursor:pointer; display:none"> <?php $queryf = "SELECT id_favoritos FROM cw_favoritos WHERE chat_favoritos='$resc[id_chat]' AND user_favoritos='$_SESSION[IDCLI]'"; $linkf = DBConnect(); $resultf = @mysqli_query($linkf, $queryf) or die(mysqli_error($linkf)); $rowsf = mysqli_num_rows($resultf); if($rowsf==0){ ?>   <i class="fa fa-star-o star" id="<?php echo $resc['id_chat']; ?>" title="Adicionar aos favoritos" style="float:right; font-size:16px"></i> <?php }else{ ?>   <i class="fa fa-star" title="Adicionado aos favoritos" style="float:right; font-size:16px"></i> <?php } ?> </span> <br /> <span style="margin-top:8px; font-size:12px; text-align:justify"> <a href="javascript: void(0)" onclick="popup('galeria.php?id=<?php echo $res['chave_flw']; ?>&img=<?php echo $resc['caminho_anexo_chat']; ?>&flw=<?php echo $resc['flw_chat']; ?>')"> <?php echo nl2br($resc['texto_chat']); ?> </a> </span> </div> <!--AQUI É A CONVERSA--> <?php } ?> </div> </div> <?php } ?> <div id="resultados"></div> <div id="response"></div> </div> <!--MENSAGENS--> </div> </div> <!--FINAL DO PALCO QUE APARECEM AS MENSSAGENS--> <script type="text/javascript"> $("#janela").scrollTop($("#janela")[0].scrollHeight); $(document).on("click", "#textomsg", function() { $('#textomsg').focus(); }); $('#textomsg').focus(); </script> <!-- MODAL DE ALTERAR DATA DE PRAZO --> <!-- Modal Login start --> <div class="modal signUpContent fade" id="modalPrazo" tabindex="-1" role="dialog" > <div class="modal-dialog"> <div class="modal-content" id="modalContent"> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> <!-- MODAL DE ALTERAR DATA DE PRAZO -->