guma 0 Denunciar post Postado Julho 21, 2005 Tenho uma função em PHP que esta dentro de um arquivo PHP chamado inc.lib.php. Onde por sua vez tem esta função :: Tem um detalhes nesta função onde esta em Negrito se eu mudar para "align=center " ele funciona normalmente "Os links".. A minha grande dúvida é por que não funciona os links quando eu mudo de posição a tabela ??? OBS: FUNCIONA SO OS DA DIREITA (LINKS).... inc.lib.php PHP [*] [*] [*] function impr_calendar( $mes='', $ano='') { [*] [*] $mes_ext = array("", "Janeiro", "Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro", [*] "Outubro","Novembro","Dezembro"); [*] [*] $estiloMes = "font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; background-color: #003366;"; [*] $estiloSemana = "font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; background-color: #CCCCCC;"; [*] $estiloDia = "font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; color: #0033FF; background-color: #E6E6E6;"; [*] $estiloSeta = "font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8px; color: #FFFFFF; background-color: #FFFFFF; "; [*] [*] $MesAnt = $mes - 1; [*] $MesPro = $mes + 1; [*] [*] if ($MesAnt <= 0){ [*] $MesAnt = 1; [*] } [*] if ($MesPro >= 12){ [*] $MesPro = 12; [*] } [*] print("<br> <table align=right cellpadding=0 cellspacing=1 class=input2> [*] <tr> [*] <th style='$estiloSeta'><a href=home_meio.php?op=MD&mes=".$MesAnt."&ano=".$ano."> << </a></th> [*] <th colspan='5' style='$estiloMes'>" . $mes_ext[$mes]. "</th> [*] <th style='$estiloSeta'><a href=home_meio.php?op=MD&mes=".$MesPro."&ano=".$ano."> >> </a></th> [*] </tr> [*] <tr style='$estiloSemana'> [*] <th> D </th> [*] <th> S </th> [*] <th> T </th> [*] <th> Q </th> [*] <th> Q </th> [*] <th> S </th> [*] <th> S </th> [*] </tr>"); [*] [*] $dia = 1; [*] while ( $dia <= cal_days_in_month(1, $mes, $ano) ) { [*] print("<tr>"); [*] for ( $i = 0; $i <= 6; $i++ ) { [*] if ( $dia <= cal_days_in_month(1, $mes, $ano) ) { [*] if ( date('w', mktime(0,0,0,$mes,$dia,$ano)) == $i ) { [*] $dia = strlen($dia) <= 1 ? 0 . $dia : $dia; [*] $mes = strlen($mes) <= 1 ? 0 . $mes : $mes; [*] //echo "<a href=listar.php?op=CUR_EVE&data=".$ano."-".$mes."-".$dia.">" . $dia. "</a>"; [*] print("<td align='center' style='$estiloDia'> [*] <a href=listar.php?op=CUR_EVE&data=".$ano."-".$mes."-".$dia.">" . $dia++ . "</a></td>"); [*] } else [*] print("<td></td>"); [*] } [*] } [*] print("</tr>"); [*] } [*] print("</table>"); [*] } Dai depois eu chamo nesta pagina a função .. home.php PHP [*]<?php [*] [*] include('./site_inc/class.TemplatePower.inc.php'); [*] include('./site_inc/inc.lib.php'); [*] [*] $obj = new TemplatePower('./site_htm/home.htm'); [*] $obj->prepare(); [*] [*] $Ano = date ("Y"); [*] $Mes = date ("n"); [*] $obj->assign('_ROOT.Calendario',impr_calendar($Mes,$Ano) ); [*] [*] $obj->printToScreen(); [*] [*]?> Uma coisa que não da pra entender se eu misturar o codigo PHP com HTML funciona mas se eu usar Templates para separar o codigo não funciona quando mudo o "align=center " para "align=right " (Os Links fincam Inativos )????? Alguém pode me dar uma luz aiiiii Vlw Compartilhar este post Link para o post Compartilhar em outros sites
guma 0 Denunciar post Postado Julho 21, 2005 Ja consegui ....O meu erro era de querer pintar na tela a inves de armazenar numa variavel ..Mudançasprint("<br> <table align=right cellpadding=0 cellspacing=1 class=input2> <tr> <th style='$estiloSeta'><a href=home_meio.php?op=MD&mes=".$MesAnt."&ano=".$ano."> << </a></th> <th colspan='5' style='$estiloMes'>" . $mes_ext[$mes]. "</th> <th style='$estiloSeta'><a href=home_meio.php?op=MD&mes=".$MesPro."&ano=".$ano."> >> </a></th> </tr> <tr style='$estiloSemana'> <th> D </th> <th> S </th> <th> T </th> <th> Q </th> <th> Q </th> <th> S </th> <th> S </th> </tr>"); $HTM = "<br> <table align=right cellpadding=0 cellspacing=1 class=input2> <tr> <th style='$estiloSeta'><a href=home_meio.php?op=MD&mes=".$MesAnt."&ano=".$ano."> << </a></th> <th colspan='5' style='$estiloMes'>" . $mes_ext[$mes]. "</th> <th style='$estiloSeta'><a href=home_meio.php?op=MD&mes=".$MesPro."&ano=".$ano."> >> </a></th> </tr> <tr style='$estiloSemana'> <th> D </th> <th> S </th> <th> T </th> <th> Q </th> <th> Q </th> <th> S </th> <th> S </th> </tr>"; Erá so isto Obrigado Compartilhar este post Link para o post Compartilhar em outros sites