Code Duplication    Length = 14-14 lines in 12 locations

search-csv.php 1 location

@@ 7-20 (lines=14) @@
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
7
if (isset($_GET['start_date'])) {
8
        //for the date manipulation into the query
9
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
10
                $start_date = $_GET['start_date'].":00";
11
                $end_date = $_GET['end_date'].":00";
12
                $sql_date = $start_date.",".$end_date;
13
        } else if($_GET['start_date'] != ""){
14
                $start_date = $_GET['start_date'].":00";
15
                $sql_date = $start_date;
16
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
17
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
18
                $sql_date = $end_date;
19
        } else $sql_date = '';
20
} else $sql_date = '';
21
22
if (isset($_GET['highest_altitude'])) {
23
        //for altitude manipulation

search-geojson.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter=new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-georss.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-gpx.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-json.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-kml.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-php.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-rss.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-wkt.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-xml.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search-yaml.php 1 location

@@ 6-19 (lines=14) @@
3
require_once('require/class.Spotter.php');
4
require_once('require/class.Language.php');
5
$Spotter = new Spotter();
6
if (isset($_GET['start_date'])) {
7
        //for the date manipulation into the query
8
        if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
9
                $start_date = $_GET['start_date'].":00";
10
                $end_date = $_GET['end_date'].":00";
11
                $sql_date = $start_date.",".$end_date;
12
        } else if($_GET['start_date'] != ""){
13
                $start_date = $_GET['start_date'].":00";
14
                $sql_date = $start_date;
15
        } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
16
                $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00";
17
                $sql_date = $end_date;
18
        } else $sql_date = '';
19
} else $sql_date = '';
20
21
if (isset($_GET['highest_altitude'])) {
22
        //for altitude manipulation

search.php 1 location

@@ 17-30 (lines=14) @@
14
//$title = "Search";
15
require_once('header.php');
16
17
if (isset($_GET['start_date'])) {
18
	//for the date manipulation into the query
19
	if($_GET['start_date'] != "" && $_GET['end_date'] != ""){
20
		$start_date = $_GET['start_date']." 00:00:00";
21
		$end_date = $_GET['end_date']." 00:00:00";
22
		$sql_date = $start_date.",".$end_date;
23
	} else if($_GET['start_date'] != ""){
24
		$start_date = $_GET['start_date']." 00:00:00";
25
		$sql_date = $start_date;
26
	} else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){
27
		$end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date']." 00:00:00";
28
		$sql_date = $end_date;
29
	} else $sql_date = '';
30
} else $sql_date = '';
31
32
if (isset($_GET['highest_altitude'])) {
33
	//for altitude manipulation