-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch_functions.php
More file actions
116 lines (78 loc) · 2.65 KB
/
search_functions.php
File metadata and controls
116 lines (78 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<? php
function print_query($function_name, $query){
//input = function name as a string and query as a string
//output =
print "------------$function_name----------\n";
print "sql_query = $query\n";
print "---------------------------------\n";
}
function exact_match($search_term){
//takes string as an input and searches DB for an exact match
//return the series_id integer
//returns -1 if not found
//assumes $db_conn conntect is already connected to database
global $db_conn, $debug;
$sql_query = "SELECT `tvseries`.`id`
FROM `tvseries`
WHERE
`tvseries`.`SeriesName` = $search_term";
if($debug > 3){
print_query("exact_match", $sql_query);
}
}
function like_match($search_term){
//takes string as an input and returns a 2 D array with each line containing
//series name and series ID
//returns empty array if not found
//assumes $db_conn conntect is already connected to database
global $db_conn;
}
function series_ended($series_id){
//takes series id integer as an input and returns of the series is ended
//returns TRUE for ended
//returns FALSE for series still airing
//assumes $db_conn conntect is already connected to database
global $db_conn;
}
function in_active_season($series_id){
//input = series_id integer
//returns TRUE if season is currently active
//returns FALSE if season is not currently active
//assumes $db_conn conntect is already connected to database
global $db_conn;
}
function current_season($series_id){
//input = series_id integer
//returns the number of the current season.
//this is not the season ID number but just the current number of the season.
//assumes $db_conn conntect is already connected to database
global $db_conn;
}
function upcoming_season($series_id){
//input = series_id integer
//returns the number of the next upcoming season
//this will return the next season even if we are currently in an active season.
//this is not the season ID number
//assumes $db_conn conntect is already connected to database
global $db_conn;
}
function first_episode($series_id, $season){
//input = series id and season number
//returns the episode id integer of the season premier of that episode
//assumes $db_conn conntect is already connected to database
global $db_conn;
}
function date_and_time_of_episode($episode_id){
//input = episode id integer
//returns the date and time of the episode
//assumes $db_conn conntect is already connected to database
global $db_conn;
}
function current_date(){
//returns the current date in string format
}
function date_1_is_earlier($date1, $date2){
//takes 2 dates in string format as input
//returns TRUE if $date_1 is earlier than $date_2
}
?>