bug-1198: crop the payment icon to the same size as the subscribe icon
[cacert-devel.git] / www / ac.php
1 <? /*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 header('Content-Type: text/html; charset=UTF-8');
19
20 if($_REQUEST['i'] != "")
21 echo "<html><body><script language=\"JavaScript\"><!--\n";
22
23 $s = mysql_real_escape_string($_REQUEST['s']);
24
25 $id = mysql_real_escape_string(strip_tags($_REQUEST['id']));
26 echo "parent._ac_rpc('".sanitizeHTML($id)."',";
27
28 $bits = explode(",", $s);
29
30 $loc = trim(mysql_real_escape_string($bits['0']));
31 $reg = trim(mysql_real_escape_string($bits['1']));
32 $ccname = trim(mysql_real_escape_string($bits['2']));
33 $query = "select `locations`.`id` as `locid`, `locations`.`name` as `locname`, `regions`.`name` as `regname`,
34 `countries`.`name` as `ccname` from `locations`, `regions`, `countries` where
35 `locations`.`name` like '$loc%' and `regions`.`name` like '$reg%' and `countries`.`name` like '$ccname%' and
36 `locations`.`regid`=`regions`.`id` and `locations`.`ccid`=`countries`.`id`
37 order by `locations`.`acount` DESC, `locations`.`name` ASC limit 10";
38 $res = mysql_query($query);
39 while($row = mysql_fetch_assoc($res))
40 {
41 $rc++;
42 if($rc > 1)
43 echo ",";
44 echo '"'.$row['locname'].', '.$row['regname'].', '.$row['ccname'].'", "'.$row['locid'].'"';
45 }
46 echo ");";
47
48 if($_REQUEST['i'] != "")
49 echo "\n\n// -->\n</script></body></html>";
50
51 exit;
52 ?>