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 |
|
if (! isset($type)) { |
24 |
|
$sql_where .= " and type='i'"; |
25 |
|
} |
26 |
|
$title.=" : Investors News"; |
27 |
} elseif ($section == "about") { |
} elseif ($section == "about") { |
28 |
$title="ABOUT US"; |
$title="ABOUT US"; |
29 |
$lpic="about"; $lext=".gif"; |
$lpic="about"; $lext=".gif"; |
37 |
|
|
38 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); |
39 |
|
|
40 |
$sql_where="where visible is true"; |
include("find_html_file.inc"); |
|
|
|
|
function find_html_file($dir,$file) { |
|
|
$file="./$dir/$file"; |
|
|
if (is_file("$file") && file_exists("$file")) { return "$file"; } |
|
|
if (is_file("$file.htm") && file_exists("$file.htm")) { return "$file.htm"; } |
|
|
if (is_file("$file.html") && file_exists("$file.html")) { return "$file.html"; } |
|
|
return 0; |
|
|
} |
|
41 |
|
|
42 |
if (file_exists(find_html_file("news",$more))) { |
if (file_exists(find_html_file("news",$more))) { |
43 |
|
|
51 |
|
|
52 |
if (isset($type)) { |
if (isset($type)) { |
53 |
if ($type == "n") { |
if ($type == "n") { |
54 |
$sql_where .= " and type='n'"; |
$sql_where .= " and (type='n' or type='i')"; |
55 |
$title.=" : News"; |
$title.=" : News"; |
56 |
} elseif ($type == "e") { |
} elseif ($type == "e") { |
57 |
$sql_where .= " and type='e'"; |
$sql_where .= " and type='e'"; |
69 |
} |
} |
70 |
|
|
71 |
|
|
72 |
|
if (isset($days)) { |
73 |
|
if ($days != 0) { |
74 |
|
$sql_where.=" and date(now())-date(date) > 0 and date(now())-date(date) < $days"; |
75 |
|
$title.=" : News in last $days days"; |
76 |
|
} |
77 |
|
$smarty->assign("days",$days); |
78 |
|
$smarty->assign("last_days",array(14,30,160,240,365)); |
79 |
|
$smarty->assign("last_desc",array("two weeks","one month","four months","six months","one year")); |
80 |
|
} |
81 |
|
|
82 |
$num_selected=0; |
$num_selected=0; |
83 |
$sql="select |
$sql="select |
84 |
id,upper(title) as title,town_date,body,more,pdf, |
id,upper(title) as title,town_date,body,more,pdf, |
93 |
} |
} |
94 |
|
|
95 |
if ($num_selected == 10) { |
if ($num_selected == 10) { |
96 |
|
$tmp="$PHP_SELF?start=".($start+10); |
97 |
|
if ($days) $tmp.="&days=$days"; |
98 |
$smarty->assign(array( |
$smarty->assign(array( |
99 |
"multi_page_show" => 1, |
"multi_page_show" => 1, |
100 |
"multi_page_next" => "$PHP_SELF?start=".($start+10), |
"multi_page_next" => $tmp |
101 |
)); |
)); |
102 |
} |
} |
103 |
if ($start && $start >= 10) { |
if ($start && $start >= 10) { |
104 |
|
$tmp="$PHP_SELF?start=".($start-10); |
105 |
|
if ($days) $tmp.="&days=$days"; |
106 |
$smarty->assign(array( |
$smarty->assign(array( |
107 |
"multi_page_show" => 1, |
"multi_page_show" => 1, |
108 |
"multi_page_prev" => "$PHP_SELF?start=".($start-10), |
"multi_page_prev" => $tmp |
109 |
)); |
)); |
110 |
} |
} |
111 |
|
|
118 |
$title.=" : Community : ".$data[0][title_lc]; |
$title.=" : Community : ".$data[0][title_lc]; |
119 |
} elseif ($data[0][type] == "r") { |
} elseif ($data[0][type] == "r") { |
120 |
$title.=" : Result : ".$data[0][title_lc]; |
$title.=" : Result : ".$data[0][title_lc]; |
121 |
|
} elseif ($data[0][type] == "i") { |
122 |
|
$title.=" : Investors News : ".$data[0][title_lc]; |
123 |
|
} elseif ($data[0][type] == "a") { |
124 |
|
$title.=" : Annual Report : ".$data[0][title_lc]; |
125 |
} |
} |
126 |
} |
} |
127 |
|
|
128 |
$smarty->assign("data",$data); |
|
129 |
|
if (isset($days) && $num_selected == 0) { |
130 |
|
$warning = "There are no news for last $days days."; |
131 |
|
} elseif ($main == "" && $num_selected == 0) { |
132 |
|
$warning = "This news item is no longer available"; |
133 |
|
} |
134 |
|
|
135 |
|
$smarty->assign(array( |
136 |
|
data=>$data, |
137 |
|
warning=>$warning |
138 |
|
)); |
139 |
|
|
140 |
$main=$smarty->fetch("new.tpl"); |
$main=$smarty->fetch("new.tpl"); |
141 |
|
|
143 |
$main=join('',file(find_html_file("news",$data[0][more]))); |
$main=join('',file(find_html_file("news",$data[0][more]))); |
144 |
} |
} |
145 |
|
|
|
if ($main == "") { |
|
|
$main = "This news item is no longer available"; |
|
|
} |
|
146 |
|
|
147 |
} |
} |
148 |
|
|