-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinput.php
More file actions
74 lines (50 loc) · 1.4 KB
/
Copy pathinput.php
File metadata and controls
74 lines (50 loc) · 1.4 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
<?php
require("includes/functions.php");
$index=($_POST["stocks"]);
$array=($_POST["symbols"]);
//year globals
$fromYear=($_POST["fromyear"]);
$toYear=($_POST["toyear"]);
//month globals
$fromMonth=($_POST["frommonth"]);
$toMonth=($_POST["tomonth"]);
//day globals
$fromDay=($_POST["fromday"]);
$toDay=($_POST["today"]);
//place user input into an array
if($array !=NULL)
{
if(strpos($array,' ') !==FALSE && strpos($array,',') !==FALSE)
{
echo("<h3>Please properly format stock tickers</h3>");
break;
}
else if(strpos($array,' ') !==FALSE)
{
$symbol=explode(' ', $array);
}
else if(strpos($array,',') !==FALSE)
{
$symbol=explode(',', $array);
}
else if(((count($array))==1) !==FALSE)
{
$symbol=array($array);
}
}
else
{
$symbol=explode(' ', $index);
}
//year
$years=$fromYear." ".$toYear;
$year=explode(' ', $years);
//month
$months=($fromMonth-1)." ".($toMonth-1);
$month=explode(' ', $months);
//days
$days=$fromDay." ".$toDay;
$day=explode(' ', $days);
$stock=lookup($year,$month,$day,$symbol);
render ("charts.php", ["notThroughout"=>$stock["notThroughout"],"notExist"=>$stock["notExist"],"bb" => $stock["bb"], "stockTwelveTwentySix" =>$stock ["stockTwelveTwentySix"],"stockTwelve" =>$stock["stockTwelve"], "twentyDay" =>$stock["twentyDay"],"stockIndex" =>$stock["stockIndex"]]);
?>