-
Notifications
You must be signed in to change notification settings - Fork 0
/
newview.php
140 lines (111 loc) · 4.97 KB
/
newview.php
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<head>
<link href="css/apaccordion.css" rel="stylesheet" type="text/css" />
</head>
<body>
</body>
<?
//ini_set("display_errors","1");
//error_reporting(E_ALL ^ E_NOTICE);
//echo "hello world!<br />"; <link href="../css/viewAP.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="https://www.chesterfield.mo.us/cmss_files/js/viewActiveProjects.js"></script>
$db2 = mssql_connect("","",""); //credentials removed
$dbName = "[APTest]";
//echo "hello world";
if(!isset($_REQUEST['pid'])){
$q = "SELECT * FROM TABLE_NAME AS P
WHERE P.Status = 'active'
order by P.OBJECTID "; //TABLE_NAME removed
$qry = mssql_query( $q );
//echo '<ul >'; //class="list-main clearfix"
echo '<table class="list-main">';
$alt = '';
$count = 1;
while ($row = mssql_fetch_array($qry)) {
// echo '<li>';
echo '<tr class="allproj">';
echo '<td style="padding:20px">';
echo '<h2 >'.'<a href="?index='.$count.'&pid='.$row['OBJECTID'].'" >'.$row['proj_name'].' </a> </h2>';
echo '<span>Status: '.$row['DevelopmentStatus'].'</span> <br>';
echo '<span>Description: '.$row['Description'].'</span>';
echo '</td>';
echo '<td style="padding:20px">';
echo '<a href="?index='.$count.'&pid='.$row['OBJECTID'].'" class="detail-thumbnail" title="'.$row['proj_name'].'" >';
echo '<div style="height: 200px;" > <img width="350px" style="max-height: 100%;min-height: 100%;" alt="'.$row['proj_name'].'" src="'.$row['thumb_url'].'" /> </div>';
echo '</a>';
echo '</td>';
// echo '<ul class="detail-list">';
// echo '<li>';
// echo '<span class="detail-list-label">Address:</span>';
// echo '<span class="detail-list-value">'.$row['project_location'].'</span>';
// echo '</li>';
// echo '</ul>';
// echo '</li>';
echo '</tr>';
$count++;
}
//echo '</ul>';
echo '</table>';
}
else{
$where = ' and P.OBJECTID='.$_REQUEST['pid'];
$count = $_REQUEST['index'];
$q = " where PP.project_active = 'active' $where"; //query modified
$qry = mssql_query( $q );
echo '<table >';
while ($row = mssql_fetch_array($qry)) {
echo '<tr >';
echo '<td style="padding:20px">';
echo '<h2 >'.$row['proj_name'].'</h2>';
echo '<span>Address: '.$row['project_location'].'</span> <br>';
echo '<span>Ward: '.$row['project_ward'].'</span> <br>';
echo '<span>Development Stage: '.$row['DevelopmentStatus'].'</span>';
echo '</td>';
echo '</tr>';
echo '<tr >';
echo '<td style="padding:20px">';
echo '<div style="height: 200px;" > <img width="350px" style="max-height: 100%;min-height: 100%;" alt="'.$row['proj_name'].'" src="'.$row['thumb_url'].'" /> </div>';
echo '</td>';
echo '</tr>';
echo '<tr >';
echo '<td style="padding:20px">';
echo '<div style="height: 200px;" ><img width="350px" style="max-height: 100%;min-height: 100%;" alt="'.$row['proj_name'].'" src="'.$row['pic_url'].'">';
echo '</td>';
echo '</tr>';
echo '<tr><td style="padding:0px 0px 0px 20px"><h3>Detailed Information </h3></td></tr>';
if(isset($row['project_details'])){
$line = split("\n", $row['project_details']);
foreach($line as $l)
echo '<tr><td style="padding:0px 0px 0px 20px">'.$l.'</td></tr>';
//echo '<tr><td style="padding:0px 0px 0px 20px">'.$row['project_details'].'</td></tr>';
}
echo '<tr><td style="padding:0px 0px 0px 20px"><h3>Projects </h3></td></tr>';
}
echo '</table>';
$q = ""; //query removed
$qry = mssql_query( $q );
echo '<ul class="accord">';
while ($row = mssql_fetch_array($qry)) {
// echo '<tr >';
echo '<li>';
echo '<input type="checkbox" checked><i></i>';
// echo '<td style="padding:0px 0px 10px 20px">';
// echo '<strong>Name: </strong>'.$row['project_name'].'</span> <br>';
echo '<h2>'.$row['type_name'].'</h2>';
echo '<p>';
//echo '<span>Address: '.$row['project_location'].'</span> <br>';
echo '<span><strong>Name: </strong>'.$row['project_name'].'</span> <br>';
echo '<span><strong>Status: </strong>'.$row['project_status'].'</span> <br>';
echo '<span><strong>Type: </strong>'.$row['type_name'].'</span> <br>';
echo '<span><strong>Planner: </strong>'.$row['pname'].' <a href="mailto:'.$row['pemail'].'" target="_blank">[contact]</a> </span> <br>';
echo '<span><strong>Engineer: </strong>'.$row['cname'].' <a href="mailto:'.$row['cemail'].'" target="_blank">[contact]</a> </span> <br>';
//echo '<a href="http://www.chesterfield.mo.us/active-projects.html?pid='.$row['projid'].'" class="detail-thumbnail" target="_blank"> More </a>';
// echo '</td>';
echo '</p>';
echo '</li>';
// echo '</tr>';
}
echo '</ul>';
// echo '</table>';
echo '<a href="http://mapping.chesterfield.mo.us/maptour/src/index.html?webmap=7526cb721b7c43c3afacd301ece8d659&index='.$count.'" target="_blank" style = "float:right;">Go to story map >></a> ';
echo '<a href="https://www.chesterfield.mo.us/test-active-projects.html" style = "float:left;"><< Return to all list </a> ';
}
?>