include ("forixinc.php");
include ("nc_util.php");
include ("ci_util.php");
include ("co_util.php");
include ("mo_util.php");
include ("util.php");
function sel_box ($name, $idx, $lista)
{
echo("".chr(10));
foreach ($lista as $key => $entry) {
echo("$entry ".chr(10));
}
echo(" ".chr(10));
}
$ix=0;
$autor="none";
function chaveok()
{
extract($GLOBALS);
$cha=intval($key/10000);
if ($LoginOk==1 && $cha==$Chave)
{
$kus=$key-$cha*10000;
if (($user=="v12" && $kus==$KeyJmb && $lin==$linPor) || ($user=="jp" && $kus==$KeyJpc && ($lin==$linEng || $lin==$linPor)) || ($user=="fx" && $kus==$KeyFlx && $lin==$linEsp) || ($user=="si" && $kus==$KeySal && $lin==$linIta) || ($user=="alcc" && $kus==$KeyAcc && $lin==$linBra) || ($user=="edma" && $kus==$KeyEma && $lin==$linBra) || ($user=="acam" && $kus==$KeyAca && $lin==$linBra))
{
$function_ret=true;
}
else
{
$function_ret=false;
}
}
else
{
$function_ret=false;
}
$function_ret=true;
return $function_ret;
}
function entidade($cref,$ref)
{
global $lin;
tab_ini();
tab_bar(5);
echo("
");
link_ref($cref,$ref,$lin);
echo(" ");
tab_bar(5);
tab_bor();
}
function news_head($tit)
{
extract($GLOBALS);
tab_ini();
tab_bar(5);
?> echo $tit; ?>
tab_bar(5);
tab_bor();
return $function_ret;
}
function news_tail($ixx)
{
tab_bar(5);
news_menu($ixx);
tab_bar(5);
tab_fim();
}
function news_menu($ix)
{
extract($GLOBALS);
if (chaveok())
{
?>
echo(" ");
}
}
function news()
{
extract($GLOBALS);
fxhead("Forix: ".$titulo[$N_NEWS]);
$SQLQuery="Select year(notes.dat) as ano, month(notes.dat) as mes from notes where notes.lin=".$lin." group by year(notes.dat), month(notes.dat) order by year(notes.dat) desc, month(notes.dat) desc";
if (($result = mysql_query($SQLQuery)) and ($RSmes= mysql_fetch_array($result)))
{
$mes=$RSmes["mes"];
$ano=$RSmes["ano"];
}
else
{
$mes=0;
$ano=0;
}
if ($aa<$ano || $mm<$mes)
{
$mes=$mm;
$ano=$aa;
}
$SQLQuery="Select notes.id, notes.dat, notes.titulo, notes.texto from notes where notes.lin=".$lin." and month(notes.dat)=".$mes." and year(notes.dat)=".$ano." order by notes.dat desc, notes.id";
news_head($titulo[$N_HEAD]);
if (($result2 = mysql_query($SQLQuery)) and mysql_num_rows($result2) > 0)
{
?>
}
else
{
?>Não há notícias disponíveis
}
tab_bor();
tab_bar(8);
?>
if ($RSmes)
{
?>
}
if (chaveok())
{
news_menu(-1);
}
?>
tab_bar(6);
tab_fim();
fxtail();
return $function_ret;
}
/*
function news_p()
{
extract($GLOBALS);
fxhead("Forix: Pesquisa de Notícias");
news_head($titulo[$N_HEAD]);
?>
$nome1=$HTTP_POST_VARS["nome1"];
if (strlen($nome1)>0)
{
tab_bar(8);
?>
Título contem: echo $nome1; ?>
tab_bar(6);
tab_bor();
$SQLQuery="Select notes.id, notes.dat, notes.titulo from notes where notes.lin=".$lin." and notes.titulo like '%".$nome1."%' order by notes.dat desc, notes.id";
$dbc->Execute $SQLQuery);
if (!$RSList->EOF)
{
?>
$BGC=$TR2_BGC;
$daa=0;
while(!$RSList->EOF)
{
$da=$RSList["dat"];
if ($da!=$daa)
{
if ($BGC==$TR1_BGC)
{
$BGC=$TR2_BGC;
}
else
{
$BGC=$TR1_BGC;
}
$dd=$fdia[$da];
$mm=$fmes[$da];
$aa=$fano[$da];
$daa=$da;
?> echo $pri_data[$dd][$mm][$aa][0]; ?>
}
else
{
?>
}
?>
)"> echo $RSList["titulo"]; ?>
$RSList->MoveNext;
}
?>
}
else
{
?>Não há notícias disponíveis
}
}
tab_bor();
tab_bar(8);
?>
if (chaveok())
{
news_menu(-1);
}
?>
tab_bar(6);
tab_fim();
fxtail();
return $function_ret;
}
function news_d()
{
extract($GLOBALS);
fxhead("Forix: ".$titulo[$N_NEWS].", ".$pri_data[$dd][$mm][$aa][1]);
$SQLQuery="Select notes.*, contactos.copynote from notes inner join contactos on notes.autor=contactos.sig where notes.lin=".$lin." and day(notes.dat)=".$dd." and month(notes.dat)=".$mm." and year(notes.dat)=".$aa." order by notes.id";
$dbc->Execute $SQLQuery);
if (!$RSList->EOF)
{
while(!$RSList->EOF)
{
$da=$RSList["dat"];
$dd=$Day[$da];
$mm=strftime("%m")$da;
$aa=strftime("%Y")$da;
tab_ini();
tab_bar(4);
?> echo $RSList["titulo"]; ?> echo $pri_data[$dd][$mm][$aa][1]; ?> / echo $RSList["copynote"]; ?>
tab_bar(6);
tab_bor();
?> echo $RSList["texto"]; ?>
tab_fim();
?>
$RSList->MoveNext;
}
}
?>
tab_ini();
tab_bar(6);
?>
tab_bar(8);
?>
tab_bar(6);
tab_fim();
fxtail();
return $function_ret;
}
function news_1()
{
extract($GLOBALS);
$SQLQuery="Select notes.*, contactos.copynote from notes inner join contactos on notes.autor=contactos.sig where notes.id=".$ix;
$dbc->Execute $SQLQuery);
if (!$RSnotes->EOF)
{
fxhead("Forix: Notas");
entidade($RSnotes["cref"],$RSnotes["ref"]);
tab_bar1(4);
$da=$RSnotes["dat"];
?>
Data echo $pri_data[$fdia[$da]][$fmes[$da]][$fano[$da]][1]; ?>
Autor echo $RSnotes["autor"]; ?>
if (strlen($RSnotes["copynote"])>0)
{
?> ( echo $RSnotes["copynote"]; ?>)
}
?>
Título echo $RSnotes["titulo"]; ?>
Texto echo str_replace("#args#",$args,$RSnotes["texto"]); ?>
tab_bar1(4);
tab_bor();
news_tail($ix);
fxtail();
}
return $function_ret;
}
*/
function news_text()
{
extract($GLOBALS);
$SQLQuery="Select notes.*, contactos.copynote from notes inner join contactos on notes.autor=contactos.sig where (notes.lin=".$lin;
if ($lin_base[$lin]>0)
{
$SQLQuery=$SQLQuery." or notes.lin=".$lin_base[$lin];
}
$SQLQuery=$SQLQuery.") and notes.id=".$ix;
if (($result = mysql_query($SQLQuery)) and ($RSnotes= mysql_fetch_array($result)))
{
fxhead("Forix: ".$RSnotes["titulo"]);
tab_ini();
tab_bar(5);
if ($RSnotes["cref"]!=$REF_TEXT)
{
?> link_ref($RSnotes["cref"],$RSnotes["ref"],$lin);?>
}
?> echo $RSnotes["titulo"]; ?>
echo $RSnotes["copynote"]; ?>
tab_bar(5);
tab_bor();
?>
if ($RSnotes["store"]==1)
{
?> echo str_replace("#args#",$args, read_txt($base_dir.$RSnotes["texto"],0)); ?>
}
else
{
?> echo str_replace("#args#",$args,$RSnotes["texto"]); ?>
}
if ($super_modo==$Modo_total)
{
?>[Edit ]
}
?>
tab_fim();
fxtail();
}
return $function_ret;
}
function news_redir($cref,$ref,$page,$tipo,$ix)
{
global $args, $REF_CP, $REF_GP, $REF_NC, $REF_CI, $REF_PI, $REF_PA, $REF_CO, $REF_MA, $REF_CA, $REF_MO, $REF_FIAQ, $REF_FLAG, $REF_CHT, $REF_GLOS, $REF_TEXT, $REF_ASK, $REF_QUE, $REF_GOLD, $REF_QRY, $REF_SOS;
if ($tipo==5)
{
// No_tipo_X
header("Location: "."notes.asp?".$args."&c=6&i=".$ix);
}
switch ($cref)
{
case $REF_CP:
header("Location: "."cp.asp?".$args."&r=".$ref."&c=".$page);
break;
case $REF_GP:
header("Location: "."gp.asp?".$args."&r=".$ref."&c=".$page);
break;
case $REF_NC:
header("Location: "."nc.asp?".$args."&r=".$ref."&c=0");
break;
case $REF_CI:
header("Location: "."ci.asp?".$args."&r=".$ref."&c=0");
break;
case $REF_PI:
header("Location: "."pi.asp?".$args."&r=".$ref."&c=".$page);
break;
case $REF_PA:
header("Location: "."pa.asp?".$args."&r=".$ref."&c=".$page);
break;
case $REF_CO:
header("Location: "."cm.asp?".$args."&x=".$REF_CO."&r=".$ref."&c=".$page);
break;
case $REF_MA:
header("Location: "."cm.asp?".$args."&x=".$REF_MA."&r=".$ref."&c=".$page);
break;
case $REF_CA:
header("Location: "."ca.asp?".$args."&r=".$ref."&c=".$page);
break;
case $REF_MO:
header("Location: "."mo.asp?".$args."&r=".$ref."&c=".$page);
break;
case $REF_FIAQ:
header("Location: "."question.asp?".$args."&c=1&i=".$page);
break;
case $REF_FLAG:
header("Location: "."flag.asp?".$args."&c=0&i=".$page);
break;
case $REF_CHT:
header("Location: "."statix.asp?".$args."&c=0&i=".$page);
break;
case $REF_GLOS:
header("Location: "."glossary.asp?".$args."&c=0&i=".$page);
break;
case $REF_TEXT:
header("Location: "."notes.asp?".$args."&c=6&i=".$ix);
break;
case $REF_ASK:
header("Location: "."ask.asp?".$args."&c=2&i=".$ix);
break;
case $REF_QUE:
header("Location: "."gbook.asp?".$args."&x=".$REF_QUE."&c=1&i=".$ix);
break;
case $REF_GOLD:
header("Location: "."gbook.asp?".$args."&x=".$REF_GOLD."&c=1&i=".$ix);
break;
case $REF_QRY:
header("Location: "."mysql.asp?".$args."&c=2");
break;
case $REF_SOS:
header("Location: sos.asp?$args&c=2&i=$ix");
break;
default:
header("Location: "."notes.asp?".$args."&c=".$cmdList);
break;
}
exit();
}
/*
function news_list()
{
extract($GLOBALS);
$SQLQuery="Select notes.*, contactos.copynote, tlin.nome from (notes inner join contactos on notes.autor=contactos.sig) inner join tlin on tlin.cod=notes.lin where notes.cref=".$cref." and notes.ref=".$ref." and tlin.lin=".$lin." order by notes.lin, notes.id";
$dbc->Execute $SQLQuery);
if (!$RSnotes->EOF)
{
fxhead("Forix: Notas");
entidade($RSnotes["cref"],$RSnotes["ref"]);
while(!$RSnotes->EOF)
{
tab_bar1(4);
$da=$RSnotes["dat"];
?>
echo $pri_data[$fdia[$da]][$fmes[$da]][$fano[$da]][1]; ?>, echo $RSnotes["nome"]; ?>
echo str_replace("#args#",$args,$RSnotes["texto"]); ?>
if (strlen($RSnotes["copynote"])>0)
{
?> ( echo $RSnotes["copynote"]; ?>)
}
?> [&i= echo $RSnotes["id"]; ?>&c= echo $cmdAlt; ?>">Editar ]
tab_bar1(4);
tab_bor();
$RSnotes->MoveNext;
}
news_tail($ix);
fxtail();
}
return $function_ret;
}
function notes_autor()
{
extract($GLOBALS);
$SQLQuery="Select notes.*, contactos.* from notes inner join contactos on notes.autor=contactos.sig where contactos.name like '".$autor."%' order by notes.marca desc Limit 10";
$dbc->Execute $SQLQuery);
if (!$RSnotes->EOF)
{
fxhead("Forix: Notes");
tab_ini();
tab_bar(5);
?>Notes
if (strlen($autor)>0)
{
?> echo $RSnotes["copynote"]; ?>
}
?>
tab_bar(5);
tab_bor();
while(!$RSnotes->EOF)
{
if ($BGC==$TR1_BGC)
{
$BGC=$TR2_BGC;
tab_bar2(6);
}
else
{
$BGC=$TR1_BGC;
tab_bar1(6);
}
$args_local="z=".$zip."&k=".$key."&l=".$RSnotes["lin"];
?>
$RSnotes->MoveNext;
}
tab_fim();
fxtail();
}
return $function_ret;
}
function news_1u()
{
extract($GLOBALS);
$SQLQuery="Select notes.id from notes where notes.lin=".$lin." order by notes.dat desc, notes.id desc Limit 1";
$dbc->Execute $SQLQuery);
if (!$RSList->EOF)
{
$ix=$RSList["id"];
news_1();
}
return $function_ret;
}
function news_1p()
{
extract($GLOBALS);
fxhead("Forix: ".$titulo[$N_NEWS]);
?>
$SQLQuery="Select notes.*, contactos.copynote from notes inner join contactos on notes.autor=contactos.sig where notes.id=".$ix;
$dbc->Execute $SQLQuery);
if (!$RSnotes->EOF)
{
$da=$RSnotes["dat"];
tab_ini();
tab_bar(4);
?> echo $RSnotes["titulo"]; ?> echo $pri_data[$fdia[$da]][$fmes[$da]][$fano[$da]][1]; ?> / echo $RSnotes["copynote"]; ?>
tab_bar(4);
tab_bor();
?> echo $RSnotes["texto"]; ?>
}
else
{
?>Notícia não disponível
}
tab_bor();
tab_bar(4);
?>Fechar esta janela
tab_bar(4);
tab_fim();
$dbc->Close;
$dbc=null;
?>