-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetails.php
135 lines (108 loc) · 4.81 KB
/
details.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
<?php
/**
* TSW Details NanoBlog
* Author: Larry Judd Oliver @tradesouthwest | http://tradesouthwest.com/details
* Contributors in readme.md file
* License in LICENSE.md file
*/
require 'header.php';
?>
<title>Dev App for Looping Details</title>
<style> div.detail-item{font-size: initial;} </style>
</head>
<body>
<?php include 'nav.php'; ?>
<div class="clearfix"></div>
<div class="container">
<div class="row">
<header class="col-md-12 text-center">
<h2 class="page-header"><?php esc( $det_moniker ); ?></h2>
</header>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-2 sm-hidden"><!--fake gutter-->
</div>
<?php
if( isset( $_GET['id'] )){
// var stored for response form below
$id = filter_var( $_GET['id'], FILTER_VALIDATE_INT );
require_once 'inc/dbh.php';
$stmt = $dbh->prepare("SELECT * FROM tsw_details
WHERE idd = ?");
if( $stmt->execute( array( $_GET['id'] ))) {
$row = $stmt->fetch(PDO::FETCH_ASSOC);
// save these two values as string for form 'respondform'
$idd = $row['idd'];
$title = $row['title'];
?>
<!--========== Custom details panels inside Boots panels ==========-->
<article class="col-md-8 col-sm-12">
<div class="panel panel-default" id="details-panel">
<header class="panel-heading">
<h3 class="panel-title"><?php esc( $row['title'] ); ?></h3>
</header>
<div class="panel-leftheading">
<i class="panel-lefttitle fa fa-external-link"></i>
</div>
<div class="panel-rightbody">
<div class="detail-item">
<?php if( !empty( $row['website']) ) : ?>
<a href="<?php esc( $row['website'] ); ?>" title="opens in new window" class="btn btn-link col-lg-12" id="wrap-text" target="_blank"><?php esc( $row['website'] ); ?></a>
<?php else : ?>
<a href="javascript: void(0)" title="no url"><span class="blank-spc"> </span></a>
<?php endif; ?>
</div>
</div><div class="clearfix"></div><hr>
<div class="panel-leftheading" id="panel-leftheading-2">
<i class="panel-lefttitle fa fa-commenting-o"></i>
</div>
<div class="panel-rightbody" role="content">
<div class="detail-item">
<?php esc( $row['detail'] ); ?>
</div>
</div><div class="clearfix"></div>
<div class="panel-body">
<blockquote>
<span class="note-text"><?php esc( $row['note'] ); ?></span><br>
<span class="dev-url"><?php esc ( $row['dev_url'] ); ?></span><br>
<span class="date-in"><?php esc ( $row['date_in'] ); ?></span>
</blockquote>
</div>
<?php
$noreply_is = (int)1;
// grab the value of noreply state
$sql = ("SELECT noreply FROM tsw_settings
ORDER BY ids DESC LIMIT 1");
$result = $dbh->query($sql);
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
$noreply_state = $row['noreply'];
}
if( $noreply_state === "0" ) :
// responses are set to 1 OK to proceed
?>
<div class="panel-body" id="respond">
<form action="respond.php" method="POST" name="respondform">
<input type="submit" name="respond" class='btn btn-default btn-sm' value="Respond">
<input type="hidden" name="idd_is" value="<?php esc( $idd ); ?>">
<input type="hidden" name="respond_to" value="<?php esc( $title ); ?>">
</form>
<!--========== Responses Section ==========-->
<?php include 'response.php'; ?>
</div>
<?php endif; ?> <div class="clearfix"></div>
<footer class="panel-footer">
<p class="textcenter"><a href="javascript:history.back(0)" title="Back" role="navigation">Return ←</a></p>
</footer>
</div><!--ends panel-->
</article><div class="clearfix"></div>
<?php
} else { print("Could not get id of item"); }
}
?>
<div class="col-md-2 sm-hidden"><!--fake gutter-->
</div>
</div>
</div>
<?php include 'footer.php'; ?>