Código:
<html> <head> </head> <body> <form action="fijos.php" method="POST"> <div align="center"><img src="imagenes/gobierno.gif" width="780" height="48"></div> <h1 align="center">Reporte de Nomina</h1> <P align="center"> REPUBLICA BOLIVARIANA DE VENEZUELA MINISTERIO DEL PODER POPULAR PARA LA EDUCACION VICEMINISTERIO DE ASUNTOS EDUCATIVOS COORDINACION REGIONAL DE ESCUELAS BOLIVARIANAS </P> <SCRIPT LANGUAGE="JavaScript"> <!-- function imprimir() { if (window.print) window.print() else alert("Disculpe, su navegador no soporta esta opción."); } // --> </SCRIPT> <A HREF="javascript:imprimir()">Imprimir Planilla</A> </tbody> </html> <?php $ccedula=$_POST["ccedula"]; $link = mysql_connect("localhost", "root", ""); mysql_select_db("laborales", $link); $result=mysql_query("SELECT dcargo,cdependencia,ddependencia,dnombre,ccedula,mneto,mletra,dasigna1,masigna1,dasigna2,masigna2,dasigna3,masigna3,dasigna4,masigna4,dasigna5,masigna5,dasigna6,masigna6,dasigna7,masigna7,dasigna8,masigna8,dasigna9,masigna9,dasigna10,masigna10,dasigna11,masigna11,dasigna12,masigna12,ddeduccion1,mdeduccion1,n_anos,n_meses,mtot_asigna FROM fijos WHERE ccedula='$ccedula'", $link); $mtot_asigna=$_POST['m1']+$_POST['m2']+$_POST['m3']+$_POST['m4']+$_POST['m5']; echo" </p><table border='5'>"; echo "<tr>"; echo "<td><b>cargo</b></td>"; echo "<td><b>cependencia</b></td>"; echo "<td><b>dependencia</b></td>"; echo "<td><b>Nombre</b></td>" ; echo "<td><b>cedula</b></td>"; echo "<td><b>Monto Neto</b></td>"; echo "<td><b>Monto en Letra</b></td>"; echo "<td><b>Asignacion1</b></td>"; echo "<td><b>Monto Asignacion1</b></td>"; echo "<td><b>Asignacion2</b></td>"; echo "<td><b>Monto Asignacion2</b></td>"; echo "<td><b>Asignacion3</b></td>"; echo "<td><b>Monto Asignacion3</b></td>"; echo "<td><b>Asignacion4</b></td>"; echo "<td><b>Monto Asignacion4</b></td>"; echo "<td><b>Asignacion5</b></td>"; echo "<td><b>Monto Asignacion5</b></td>"; echo "<td><b>Asignacion6</b></td>"; echo "<td><b>Monto Asignacion6</b></td>"; echo "<td><b>Asignacion7</b></td>"; echo "<td><b>Monto Asignacion7</b></td>"; echo "<td><b>Asignacion8</b></td>"; echo "<td><b>Monto Asignacion8</b></td>"; echo "<td><b>Asignacion9</b></td>"; echo "<td><b>Monto Asignacion9</b></td>"; echo "<td><b>Asignacion10</b></td>"; echo "<td><b>Monto Asignacion10</b></td>"; echo "<td><b>Asignacion11</b></td>"; echo "<td><b>Monto Asignacion11</b></td>"; echo "<td><b>Asignacion12</b></td>"; echo "<td><b>Monto Asignacion12</b></td>"; echo "<td><b>Deduccion</b></td>"; echo "<td><b>Monto Deduccion</b></td>"; echo "<td><b>Anos</b></td>"; echo "<td><b>Meses</b></td>"; echo "<td><b>Monto Total</b></td>"; echo "</tr>"; while ($row = mysql_fetch_row($result)){ echo "<tr>"; echo "<td><INPUT type=\"text\" name=\"cargo\" value=\"$row[0]\"></td>"; echo "<td><INPUT type=\"text\" name=\"cdependencia\" value=\"$row[1]\"></td>"; echo "<td><INPUT type=\"text\" name=\"ddependencia\" value=\"$row[2]\"></td>"; echo "<td><INPUT type=\"text\" name=\"dnombre\" value=\"$row[3]\"></td>"; echo "<td><INPUT type=\"text\" name=\"ccedula\" value=\"$row[4]\"></td>"; echo "<td><INPUT type=\"text\" name=\"mneto\" value=\"$row[5]\"></td>"; echo "<td><INPUT type=\"text\" name=\"mletra\" value=\"$row[6]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d1\" value=\"$row[7]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m1\" value=\"$row[8]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d2\" value=\"$row[9]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m2\" value=\"$row[10]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d3\" value=\"$row[11]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m3\" value=\"$row[12]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d4\" value=\"$row[13]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m4\" value=\"$row[14]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d5\" value=\"$row[15]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m5\" value=\"$row[16]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d6\" value=\"$row[17]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m6\" value=\"$row[18]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d7\" value=\"$row[19]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m7\" value=\"$row[20]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d8\" value=\"$row[21]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m8\" value=\"$row[22]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d9\" value=\"$row[23]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m9\" value=\"$row[24]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d10\" value=\"$row[25]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m10\" value=\"$row[26]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d11\" value=\"$row[27]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m11\" value=\"$row[28]\"></td>"; echo "<td><INPUT type=\"text\" name=\"d12\" value=\"$row[29]\"></td>"; echo "<td><INPUT type=\"text\" name=\"m12\" value=\"$row[30]\"></td>"; echo "<td><INPUT type=\"text\" name=\"de1\" value=\"$row[31]\"></td>"; echo "<td><INPUT type=\"text\" name=\"mc1\" value=\"$row[32]\"></td>"; echo "<td><INPUT type=\"text\" name=\"n_anos\" value=\"$row[33]\"></td>"; echo "<td><INPUT type=\"text\" name=\"n_meses\" value=\"$row[34]\"></td>"; echo "<td><INPUT type=\"text\" name=\"mtot_asigna\" value=\"$mtot_asigna\"></td>"; echo "</tr>"; } echo "</table>"; ?> <table> <tbody> <tr> <td><INPUT type="submit" name="suma" value="suma"></td> <td><INPUT type="submit" name="verr" value="Ver_Planilla" onclick="this.form.action='constancia1.php'"></td> <td><INPUT type="submit" name="ingresar" value="Ingresar" onclick="this.form.action='gfijos.php'"></td> </tr> </tbody> </table> </form>