<?
$tecnic="Entrandor no valid";
if(isset($_POST['username'])){
$tecnic=$_POST['username'];
}
$trim="Trimestre no valid";
if(isset($_POST['trim'])){
$trim=$_POST['trim'];
}
$cole="Escola no valida";
if(isset($_POST['cole'])){
$cole=$_POST['cole'];
}
$id=$_POST['id'];
if(isset($_POST['alumnes'])){
$alumne=$_POST['alumnes'];
list($cognoms,$nom,$id,$curs) = explode(",","$alumne");
}
$link=@mysql_connect('localhost','s020d938_diver','divertenis');
if (!$link){
die('error #1: No ha sigut possible la conexi� amb la base de dades, reintenta-ho en breu');
}
//echo 'Connected successfully';
mysql_select_db('s020d938_notas',$link);
if(!mysql_select_db('s020d938_notas',$link)){
die('error #2: No ha sigut possible la conexi� amb la base de dades, reintenta-ho en breu');
}
$query = ("SELECT * FROM `$trim` WHERE id=$id");
$result = mysql_query( $query,$link );
if( !is_resource( $result ) ) {
die("notas error #3: Problema con el Query:".mysql_error());
}
$avaluat=mysql_fetch_array($result);
$nom="$avaluat[nom]";
$cognoms="$avaluat[cognoms]";
$curs=$avaluat[curs];
$tecnic="$avaluat[entrenador]";
$data=$avaluat[data];
//notes
$coordinacio1="blank";
$lectura1="blank";
$desplacament1="blank";
$general1="blank";
$vdrive1="blank";
$vreves1="blank";
$drive1="blank";
$reves1="blank";
$smash1="blank";
$servei1="blank";
$desplacajoc1="blank";
$comportament1="blank";
$comunica1="blank";
$motivacio1="blank";
$assistencia1="blank";
$coordinacio2="blank";
$lectura2="blank";
$desplacament2="blank";
$general2="blank";
$vdrive2="blank";
$vreves2="blank";
$drive2="blank";
$reves2="blank";
$smash2="blank";
$servei2="blank";
$desplacajoc2="blank";
$comportament2="blank";
$comunica2="blank";
$motivacio2="blank";
$assistencia2="blank";
$coordinacio3="blank";
$lectura3="blank";
$desplacament3="blank";
$general3="blank";
$vdrive3="blank";
$vreves3="blank";
$drive3="blank";
$reves3="blank";
$smash3="blank";
$servei3="blank";
$desplacajoc3="blank";
$comportament3="blank";
$comunica3="blank";
$motivacio3="blank";
$assistencia3="blank";
$coordinacio4="blank";
$lectura4="blank";
$desplacament4="blank";
$general4="blank";
$vdrive4="blank";
$vreves4="blank";
$drive4="blank";
$reves4="blank";
$smash4="blank";
$servei4="blank";
$desplacajoc4="blank";
$comportament4="blank";
$comunica4="blank";
$motivacio4="blank";
$assistencia4="blank";
$jugant=$avaluat[jugant];
$global=$avaluat[comentari];
switch ($avaluat[coordinacio]){
case '1':
$coordinacio1="seleccio";
break;
case '2':
$coordinacio2="seleccio";
break;
case '3':
$coordinacio3="seleccio";
break;
case '4':
$coordinacio4="seleccio";
break;
}
switch ($avaluat[lectura]){
case 1:
$lectura1="seleccio";
break;
case 2:
$lectura2="seleccio";
break;
case 3:
$lectura3="seleccio";
break;
case 4:
$lectura4="seleccio";
break;
}
switch ($avaluat[desplacament]){
case 1:
$desplacament1="seleccio";
break;
case 2:
$desplacament2="seleccio";
break;
case 3:
$desplacament3="seleccio";
break;
case 4:
$desplacament4="seleccio";
break;
}
switch ($avaluat[general]){
case 1:
$general1="seleccio";
break;
case 2:
$general2="seleccio";
break;
case 3:
$general3="seleccio";
break;
case 4:
$general4="seleccio";
break;
}
switch ($avaluat[vdrive]){
case 1:
$vdrive1="seleccio";
break;
case 2:
$vdrive2="seleccio";
break;
case 3:
$vdrive3="seleccio";
break;
case 4:
$vdrive4="seleccio";
break;
}
switch ($avaluat[vreves]){
case 1:
$vreves1="seleccio";
break;
case 2:
$vreves2="seleccio";
break;
case 3:
$vreves3="seleccio";
break;
case 4:
$vreves4="seleccio";
break;
}
switch ($avaluat[drive]){
case 1:
$drive1="seleccio";
break;
case 2:
$drive2="seleccio";
break;
case 3:
$drive3="seleccio";
break;
case 4:
$drive4="seleccio";
break;
}
switch ($avaluat[reves]){
case 1:
$reves1="seleccio";
break;
case 2:
$reves2="seleccio";
break;
case 3:
$reves3="seleccio";
break;
case 4:
$reves4="seleccio";
break;
}
switch ($avaluat[smash]){
case 1:
$smash1="seleccio";
break;
case 2:
$smash2="seleccio";
break;
case 3:
$smash3="seleccio";
break;
case 4:
$smash4="seleccio";
break;
}
switch ($avaluat[servei]){
case 1:
$servei1="seleccio";
break;
case 2:
$servei2="seleccio";
break;
case 3:
$servei3="seleccio";
break;
case 4:
$servei4="seleccio";
break;
}
switch ($avaluat[desplacajoc]){
case 1:
$desplacajoc1="seleccio";
break;
case 2:
$desplacajoc2="seleccio";
break;
case 3:
$desplacajoc3="seleccio";
break;
case 4:
$desplacajoc4="seleccio";
break;
}
switch ($avaluat[comportament]){
case 1:
$comportament1="seleccio";
break;
case 2:
$comportament2="seleccio";
break;
case 3:
$comportament3="seleccio";
break;
}
switch ($avaluat[comunica]){
case 1:
$comunica1="seleccio";
break;
case 2:
$comunica2="seleccio";
break;
case 3:
$comunica3="seleccio";
break;
case 4:
$comunica4="seleccio";
break;
}
switch ($avaluat[motivacio]){
case 1:
$motivacio1="seleccio";
break;
case 2:
$motivacio2="seleccio";
break;
case 3:
$motivacio3="seleccio";
break;
}
switch ($avaluat[assistencia]){
case 1:
$assistencia1="seleccio";
break;
case 2:
$assistencia2="seleccio";
break;
case 3:
$assistencia3="seleccio";
break;
}
$logo="judo.png";
// ???? Texto Html almacenado en la variable $html ??????
$html = "
<html>
<head>
<title>$nom $cognoms, $cole $trim</title>
<meta http-equiv=Content-Type content=\"text/html;charset=utf-8\" />
<style type=\"text/css\">
<!--
div
{
background-image:url(\"logo/$logo\");
background-attachment:fixed;
background-repeat:no-repeat;
background-position: center;
}
-->
</style>
<link href=\"print.css\" type=\"text/css\" rel=\"stylesheet\" media=\"print\">
";
$body="<body>
<style id=\"Divertenis\">
<!--table
.sub0
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:12.0pt;
font-weight:700;
font-style:normal;
text-decoration:underline;
text-underline-style:single;
text-align:general;
vertical-align:bottom;
border-top:3pt solid windowtext;
border-right:none;
border-bottom:none;
border-left:none;
white-space:nowrap;}
.sub1
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:12.0pt;
font-weight:700;
font-style:normal;
text-decoration:none;
text-underline-style:single;
text-align:left;
vertical-align:top;
border-top:3pt solid windowtext;
border-right:none;
border-bottom:none;
border-left:none;
white-space:nowrap;}
.sub2
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:9.0pt;
font-weight:700;
font-style:normal;
text-decoration:underline;
text-underline-style:single;
text-align:general;
vertical-align:bottom;
white-space:nowrap;}
.sub2b
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:9.0pt;
font-weight:700;
font-style:normal;
text-decoration:underline;
text-underline-style:single;
text-align:general;
vertical-align:bottom;
border-top:3pt solid windowtext;
white-space:nowrap;}
.trim
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:11.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
text-align:general;
vertical-align:bottom;
border-top:3pt solid windowtext;
border-right:none;
border-left:none;
white-space:nowrap;}
.nom
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:10.0pt;
font-weight:700;
font-style:normal;
text-decoration:none;
text-align:general;
vertical-align:bottom;
white-space:nowrap;}
.blank
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:8.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
text-align:general;
vertical-align:bottom;
white-space:nowrap;}
.titol0
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:12.0pt;
font-weight:700;
font-style:normal;
text-decoration:none;
text-underline-style:single;
text-align:left;
vertical-align:top;
border-top:3pt solid windowtext;
border-right:none;
border-bottom:3pt solid windowtext;
border-left:none;
white-space:nowrap;}
.seleccio
{border-top:0.5pt solid windowtext;
border-right:0.5pt solid windowtext;
border-bottom:0.5pt solid windowtext;
border-left:0.5pt solid windowtext;
padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:8.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
text-align:general;
vertical-align:bottom;
white-space:nowrap;}
.dades
{padding-top:1px;
padding-right:1px;
padding-left:1px;
color:black;
font-size:10.0pt;
font-weight:100;
font-style:normal;
text-decoration:none;
text-align:justify;
vertical-align:top;
-->
</style>
<div id=\"avaluacio\" align=center>
<table border=0 cellpadding=0 cellspacing=0 width=895 style='border-collapse: collapse;table-layout:fixed;width:672pt'>
<col width=216 >
<col width=26 >
<col width=187 >
<col width=26 >
<col width=208 >
<col width=26 >
<col width=35 >
<col width=170 >
<tr height=23 style='height:17.25pt'>
<td colspan=3 height=23 class=titol0 width=429 style='height:17.25pt; width:322pt'>ESCOLA/COL�LEGI: $cole</td>
<td colspan=3 width=260 style='width:196pt'></td>
<td width=35 style='width:56pt'></td>
<td class=trim width=170 style='width:120pt'>Trimestre: $trim</td>
</tr>
<tr height=22 style='height:16.5pt'>
<td height=22 class=sub0 style='height:16.5pt'>DADES DE L ALUMNE:</td>
<td rowspan=32></td>
<td class=sub0>B-ASPECTE T�CNIC</td>
<td rowspan=32></td>
<td class=sub2>COMBINACI� I CONTRAATAC</td>
<td rowspan=32></td>
<td colspan=2 class=sub2b>4. ASSIST�NCIA:</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=nom style='height:15.0pt'>COGNOMS:<span class=dades> $cognoms</span></td>
<td class=sub2>1. JUDO TERRA:</td>
<td class=$desplacajoc1>MOLT B�</td>
<td colspan=2 class=$assistencia1>BONA</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=nom style='height:15.0pt'>NOM:<span class=dades> $nom</span></td>
<td class=sub2>IMMOBILITZACIONS</td>
<td class=$desplacajoc2>B�</td>
<td colspan=2 class=$assistencia2>NORMAL</td>
</tr>
<tr height=21 style='height:15.75pt'>
<td height=21 class=nom style='height:15.75pt'>CURS:<span class=dades> $curs</span></td>
<td class=$vdrive1>MOLT B�</td>
<td class=$desplacajoc3>NORMAL</td>
<td colspan=2 class=$assistencia3>POCA</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=nom style='height:15.0pt'>NIVELL:<span class=dades> $nivell</span></td>
<td class=$vdrive2>B�</td>
<td class=$desplacajoc4>AMB DIFICULTAT</td>
<td colspan=2 class=sub1>COMENTARI GLOBAL:</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=nom style='height:15.0pt'>T�CNICS:</td>
<td class=$vdrive3>NORMAL</td>
<td class=sub2>3. T�CNICA DE COMBAT:</td>
<td colspan=2 rowspan=17 class=dades>$global</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td rowspan=4 style='border-bottom:1.5pt solid black; height:75.75pt'class=dades>$tecnic</td>
<td class=$vdrive4>AMB DIFICULTAT</td>
<td class=$servei1>MOLT B�</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=sub2 style='height:15.0pt'>FORMES DE TOMBAR:</td>
<td class=$servei2>B�</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$vreves1 style='height:15.0pt'>MOLT B�</td>
<td class=$servei3>NORMAL</td>
</tr>
<tr height=21 style='height:15.75pt'>
<td height=20 class=$vreves2 style='height:15.0pt'>B�</td>
<td class=$servei4>AMB DIFICULTAT</td>
</tr>
<tr height=22 style='height:16.5pt'>
<td height=22 class=sub0 style='height:16.5pt;'>A-ASPECTE MOTRIU</td>
<td height=21 class=$vreves3 style='height:15.75pt'>NORMAL</td>
<td rowspan=2 class=dades> </td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=sub2 style='height:15.0pt'>1. VALORACI� GENERAL:</td>
<td class=$vreves4>AMB DIFICULTAT</td>
</tr>
<tr height=21 style='height:15.75pt'>
<td height=20 class=$general1 style='height:15.0pt'>MOLT B�</td>
<td class=sub2>ROL DEFENSIU:</td>
<td></td>
</tr>
<tr height=22 style='height:16.5pt'>
<td height=22 class=$general2 style='height:16.5pt'>B�</td>
<td class=$drive1>MOLT B�</td>
<td class=sub0>C-ACTITUD</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$general3 style='height:15.0pt'>NORMAL</td>
<td class=$drive2>B�</td>
<td class=sub2>1. COMPORTAMENT:</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$general4 style='height:15.0pt'>AMB DIFICULTAT</td>
<td class=$drive3>NORMAL</td>
<td class=$comportament1>B�</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=sub2 style='height:15.0pt'>2. COORDINACI�:</td>
<td class=$drive4>AMB DIFICULTAT</td>
<td class=$comportament2>NORMAL</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$coordinacio1 style='height:15.0pt'>MOLT B�</td>
<td class=sub2>ROL ATACANT:</td>
<td class=$comportament3>PASSIU</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$coordinacio2 style='height:15.0pt'>B�</td>
<td class=$reves1>MOLT B�</td>
<td class=sub2>2. DAVANT DEL GRUP ES COMUNICA:</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$coordinacio3 style='height:15.0pt'>NORMAL</td>
<td class=$reves2>B�</td>
<td class=$comunica1>AMB TOTHOM</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$coordinacio4 style='height:15.0pt'>AMB DIFICULTAT</td>
<td class=$reves3>NORMAL</td>
<td class=$comunica2>GRUP REDU�T</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=sub2 style='height:15.0pt'>3. DESPLA�AMENT:</td>
<td class=$reves4>AMB DIFICULTAT</td>
<td class=$comunica3>L�DER</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$desplacament1 style='height:15.0pt'>MOLT B�</td>
<td class=sub2>2. JUDO PEU:</td>
<td class=$comunica4>NORMAL</td>
<td colspan=2></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$desplacament2 style='height:15.0pt'>B�</td>
<td class=sub2>CLAUS</td>
<td class=sub2>3. MOTIVACI�</td>
<td colspan=2 class=sub2>SIGNATURA T�CNICS</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$desplacament3 style='height:15.0pt'>NORMAL</td>
<td class=$smash1>MOLT B�</td>
<td class=$motivacio1>BONA</td>
<td colspan=2 rowspan=4 class=xl1531821></td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 class=$desplacament4 style='height:15.0pt'>AMB DIFICULTAT</td>
<td class=$smash2>B�</td>
<td class=$motivacio2>NORMAL</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 > </td>
<td class=$smash3>NORMAL</td>
<td class=$motivacio3>POCA</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20 style='height:15.0pt'> </td>
<td class=$smash4>AMB DIFICULTAT</td>
</tr>
<tr height=20 style='height:15.0pt'>
<td colspan=2 rowspan=4></td>
</tr>
<tr height=20 style='height:15.0pt'>
</tr>
<tr height=20 style='height:15.0pt'>
</tr>
<tr height=20 style='height:15.0pt'>
<td height=20></td>
<td></td>
<td></td>
</tr>
</table>
</div>
</body>
";
$html2="</html>
";
//* ----------HTML2PDF------------
//*
$content = "
<page>
<h1>Exemple d'utilisation</h1>
<br>
Ceci est un <b>exemple d'utilisation</b>
de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>
</page>";
require_once('../html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('L','A4','es');
$html2pdf->WriteHTML($body);
$html2pdf->Output('/prova/exemple.pdf');
//*/
// ???? Texto Html ??????
echo("$html $body $html2");
?>