13 |
$section="new"; |
$section="new"; |
14 |
} |
} |
15 |
|
|
16 |
|
$sql_where="where visible is true"; |
17 |
|
|
18 |
if ($section == "investor") { |
if ($section == "investor") { |
19 |
$title="INVESTOR'S PAGE"; |
$title="INVESTOR'S PAGE"; |
20 |
$lpic="investor"; $lext=".jpg"; |
$lpic="investor"; $lext=".jpg"; |
21 |
$mpic="investors.gif"; |
$mpic="investors.gif"; |
22 |
$back_url="investor.php"; |
$back_url="investor.php"; |
23 |
|
$sql_where .= " and type='i'"; |
24 |
|
$title.=" : Investors News"; |
25 |
|
} elseif ($section == "about") { |
26 |
|
$title="ABOUT US"; |
27 |
|
$lpic="about"; $lext=".gif"; |
28 |
|
$mpic="about.gif"; |
29 |
} else { |
} else { |
30 |
$title="What's New"; |
$title="What's New"; |
31 |
$lpic="new"; $lext=".jpg"; |
$lpic="new"; $lext=".jpg"; |
33 |
$back_url="index.php"; |
$back_url="index.php"; |
34 |
} |
} |
35 |
|
|
36 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); |
37 |
|
|
|
$sql_where="where visible is true"; |
|
38 |
|
|
39 |
function find_html_file($dir,$file) { |
function find_html_file($dir,$file) { |
40 |
$file="./$dir/$file"; |
$file="./$dir/$file"; |
56 |
|
|
57 |
if (isset($type)) { |
if (isset($type)) { |
58 |
if ($type == "n") { |
if ($type == "n") { |
59 |
$sql_where .= " and type='n'"; |
$sql_where .= " and (type='n' or type='i')"; |
60 |
|
$title.=" : News"; |
61 |
} elseif ($type == "e") { |
} elseif ($type == "e") { |
62 |
$sql_where .= " and type='e'"; |
$sql_where .= " and type='e'"; |
63 |
|
$title.=" : Events"; |
64 |
|
} elseif ($type == "c") { |
65 |
|
$sql_where .= " and type='c'"; |
66 |
|
$title.=" : Community"; |
67 |
} |
} |
68 |
} |
} |
69 |
|
|
77 |
$num_selected=0; |
$num_selected=0; |
78 |
$sql="select |
$sql="select |
79 |
id,upper(title) as title,town_date,body,more,pdf, |
id,upper(title) as title,town_date,body,more,pdf, |
80 |
(date-now()::date) as comming |
(date-now()::date) as comming,type,title as title_lc |
81 |
from news $sql_where order by priority desc,date desc $sql_limit"; |
from news $sql_where order by priority desc,date desc $sql_limit"; |
82 |
print "$sql"; |
# print "$sql"; |
83 |
$sth = $dbh->prepare("$sql"); |
$sth = $dbh->prepare("$sql"); |
84 |
$sth->execute(); |
$sth->execute(); |
85 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
100 |
)); |
)); |
101 |
} |
} |
102 |
|
|
103 |
|
if (isset($id) && $num_selected == 1) { |
104 |
|
if ($data[0][type] == "n") { |
105 |
|
$title.=" : News : ".$data[0][title_lc]; |
106 |
|
} elseif ($data[0][type] == "e") { |
107 |
|
$title.=" : Event : ".$data[0][title_lc]; |
108 |
|
} elseif ($data[0][type] == "c") { |
109 |
|
$title.=" : Community : ".$data[0][title_lc]; |
110 |
|
} elseif ($data[0][type] == "r") { |
111 |
|
$title.=" : Result : ".$data[0][title_lc]; |
112 |
|
} |
113 |
|
} |
114 |
|
|
115 |
$smarty->assign("data",$data); |
$smarty->assign("data",$data); |
116 |
|
|
117 |
$main=$smarty->fetch("new.tpl"); |
$main=$smarty->fetch("new.tpl"); |
127 |
} |
} |
128 |
|
|
129 |
include("common.inc"); |
include("common.inc"); |
130 |
$smarty->assign( array(back_url=>$back_url, MAIN=>$main)); |
$smarty->assign( array(back_url=>$back_url, MAIN=>$main, |
131 |
|
Section_title=>$title ) ); |
132 |
|
|
133 |
$smarty->display("index.tpl"); |
$smarty->display("index.tpl"); |
134 |
?> |
?> |