rafaelhcr 0 Denunciar post Postado Outubro 26, 2016 resultado da tabela em forma de formulario usando php 5.6 comando mysqli colocar o codigo como ja esta feito error_reporting(E_ERROR | E_PARSE); session_start(); include '../functions/connect.php'; $sql = "SELECT * FROM pessoa, funcionario, usuario where pessoa.id_pessoa = funcionario.pessoa_id_pessoa and usuario.email = '$_SESSION'"; $sql_query = $conn->query($sql) or die($conn->error); $dado = $sql_query->fetch_assoc(); $id = $dado['id_pessoa']; $chapa = $dado['chapa'];?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="://www.w3.org/1999/xhtml"><head> <meta charset="utf-8"> <!-- Mobile Meta --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Favicon --> <link rel="shortcut icon" href="../template/images/icon-storm.ico"> <!-- Web Fonts --> <link href='://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic' rel='stylesheet' type='text/css'> <link href='://fonts.googleapis.com/css?family=Raleway:700,400,300' rel='stylesheet' type='text/css'> <link href='://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'> <link href='://fonts.googleapis.com/css?family=PT+Serif' rel='stylesheet' type='text/css'> <!-- Bootstrap core CSS <link href="../template/bootstrap/css/bootstrap.css" rel="stylesheet"> --> <!--Font Awesome CSS --> <link href="../template/fonts/font-awesome/css/font-awesome.css" rel="stylesheet"> <!-- Fontello CSS <link href="../template/fonts/fontello/css/fontello.css" rel="stylesheet"> <!-- Plugins <link href="../template/plugins/magnific-popup/magnific-popup.css" rel="stylesheet"> <link href="../template/plugins/rs-plugin/css/settings.css" rel="stylesheet"> <link href="../template/css/animations.css" rel="stylesheet"> <link href="../template/plugins/owl-carousel/owl.carousel.css" rel="stylesheet"> <link href="../template/plugins/owl-carousel/owl.transitions.css" rel="stylesheet"> <link href="../template/plugins/hover/hover-min.css" rel="stylesheet"> <link href="../template/plugins/morphext/morphext.css" rel="stylesheet"> <!-- The Project core CSS file <link href="../template/css/style.css" rel="stylesheet" > <!-- Color Scheme (In order to change the color scheme, replace the blue.css with the color scheme that you prefer)--> <link href="../template/css/skins/light_blue.css" rel="stylesheet"> <!-- Custom css <link href="../template/css/custom.css" rel="stylesheet"> --><title>Contra-cheque</title><style type="text/css">.style4 {font-family: Arial, Helvetica, sans-serif}.style5 {font-family: Arial, Helvetica, sans-serif; font-size: 9px;}.style14 {font-family: Arial, Helvetica, sans-serif}table { border-color: black; font-family: Arial, Helvetica, sans-serif;}td{ border-top:1px; border-right:1px;}.style6 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #232222;}.style9 {font-size: 8px; color: #232222; text-align: center;}.style11 {font-size: 12px; color: #232222; text-align: center;}.style13 {font-size: 12px; color: #232222;}.fonte {font-size: 9px; color: #232222; text-align: center;}.linkButton { background: none; border: none; color: #0066ff; text-decoration: underline; cursor: pointer;}</style></style><style>@page { margin: 40px; } .style16 {font-weight: bold}.style17 {font-weight: bold}</style></head><body><table width="730" border="1" cellspacing='0' cellpadding='2' align='center'><tr><td style="border-left: 1px;" class="style11"><div align="center" class="style11">Chapa</td><td class="style11" colspan="4"><div align="center" class="style11">Nome</td><td class="style11" colspan="5"><div align="center" class="style11">Visualizar</td></tr><?php$rs = "SELECT * FROM pessoa, funcionario, usuario where pessoa.id_pessoa = funcionario.pessoa_id_pessoa and usuario.email = '$_SESSION' and pessoa.email= '$_SESSION'"; $con = mysqli_query($conn, $rs) or die($conn-error); if (!empty($id)){ while($row = mysqli_fetch_object($con)){ echo (utf8_encode("<tr><td style='border-left: 1px; border-bottom:1px;' class='style11' value='".$row->id_pessoa."'>". $row->chapa." </td>")); echo (utf8_encode("<td style='border-top:0px; border-bottom:1px;' colspan='4' class='style13' value='".$row->id_pessoa."'> ". $row->nome." </td>")); echo (utf8_encode("<td style='border-top:0px; border-bottom:1px;' colspan='4' class='style11' value='".$row->id_pessoa."'><form method='post' action='ficha.php'> <input id='chapa' name='chapa' type='hidden' value=".$row->chapa." /> <button class='linkButton' title='Visualizar' type='submit'><i class='fa fa-external-link' aria-hidden='true'></i></form></td>")); echo (utf8_encode("<td style='border-top:0px; border-bottom:1px; border-left:0px;' colspan='4' class='style11' value='".$row->id_pessoa."'><form method='post' action='busca_cc.php'> <input id='chapa' name='chapa' type='hidden' value=".$row->chapa." /> <input id='nome' name='nome' type='hidden' value=".$row->nome." /> <button class='linkButton' title='Contra-cheque' type='submit'><i class='fa fa-external-link' aria-hidden='true'></i></form></td>")); echo "</tr>"; } } ?></table></body></html> Compartilhar este post Link para o post Compartilhar em outros sites
Visitante Denunciar post Postado Outubro 26, 2016 Bom não intendi muito bem a pergunta/dúvida, o que você realmente quer? 1 - Deu problema? 2 - Não entendeu o código (por que pegou de terceiros)? 3 - Ou "não sei fazer, façam pra mim"? Compartilhar este post Link para o post Compartilhar em outros sites
LaerteDias 17 Denunciar post Postado Outubro 26, 2016 Bom cara, para nos ajudar a te ajudar? 1. coloque o código utilizando a opção de formatação code (simbolo <> em azul na sua barra de formatação). 2.Não entendi esse session estão com aspa simples no parametro: veja o link abaixo: http://php.net/manual/pt_BR/reserved.variables.session.php Compartilhar este post Link para o post Compartilhar em outros sites