-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.php
220 lines (186 loc) · 7.99 KB
/
index.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php
require_once dirname(__FILE__)."/config.php";
require_once dirname(__FILE__)."/quran.php";
require_once dirname(__FILE__)."/audio.php";
$q = @$_GET['q'];
$s = @$_GET['s'];
$j = @$_GET['j'];
$scroll = @$_GET['scroll'];
$q = preg_replace('/[^A-Za-z0-9\-\"\' ]/', '', $q);
$q = str_replace("'", '"', $q);
$quran = new Quran($serverName, $port, $username, $password, $databaseName, $tableAyat, $tableTranslation);
$quran->connect();
if($q != '')
{
$result = $quran->search($q, 68, true, true);
}
else if($j != '')
{
$result = $quran->getJuz($j, 68);
}
else if($s != '')
{
$result = $quran->getAyat($s, 68);
}
else
{
$result = $quran->getAyat(1, 68);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Al Quran</title>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="apple-touch-icon" type="image/png"
href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png" />
<meta name="apple-mobile-web-app-title" content="CodePen">
<link rel="shortcut icon" type="image/x-icon"
href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico" />
<link rel="mask-icon" type="image/x-icon"
href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-8f3771b1072e3c38bd662872f6b673a722f4b3ca2421637d5596661b4e2132cc.svg"
color="#111" />
<!-- Bootstrap CSS CDN -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.6.1.min.js"
integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
<script src="js/js.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"
integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous">
</script>
<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css'>
<link rel="stylesheet" href="css/style.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<script>
var surat = '<?php echo $s;?>';
var scroll = '<?php echo $scroll;?>';
</script>
</head>
<body translate="no">
<div class="wrapper">
<!-- Sidebar -->
<nav id="sidebar">
<div class="sidebar-header">
<h3>Daftar Isi</h3>
</div>
<ul class="list-unstyled components">
<div class="list-surat">
<h4>Daftar Surat</h4>
<ul>
<?php echo $quran->buildMenu();
?>
</ul>
<h4>Daftar Juz</h4>
<ul>
<?php echo $quran->buildJuz();
?>
</ul>
</div>
<li class="active">
<a href="#homeSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Link</a>
<ul class="collapse list-unstyled" id="homeSubmenu">
<li>
<a href="https://planetbiru.com">Our Website</a>
</li>
<li>
<a href="https://www.youtube.com/channel/UCY-qziSbBmJ7iZj-cXqmcMg">Our YouTube Channel</a>
</li>
</ul>
</li>
<li>
<a href="https://planetbiru.com">About</a>
</li>
<li>
<a href="https://planetbiru.com">Contact</a>
</li>
</ul>
<ul class="list-unstyled CTAs">
<li>
<a href="https://github.com/kamshory/Al-Quran" class="download">Download source</a>
</li>
<li>
<a href="https://planetbiru.com" class="article">Our Website</a>
</li>
</ul>
</nav>
<!-- Page Content -->
<div id="content">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button type="button" id="sidebarCollapse" class="btn btn-info">
<i class="fas fa-align-left"></i>
<span>Sidebar</span>
</button>
<button class="btn btn-dark d-inline-block d-lg-none ml-auto" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-align-justify"></i>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="https://planetbiru.com">Website</a>
</li>
<li class="nav-item">
<a class="nav-link"
href="https://www.youtube.com/channel/UCY-qziSbBmJ7iZj-cXqmcMg">YouTube</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="search-form">
<form action="" method="get">
<input type="text" name="q" id="q" value="<?php echo htmlspecialchars($q);?>" autocomplete="off">
<input type="submit" value="Cari" class="btn btn-sm btn-success">
</form>
</div>
<div class="main-content">
<?php
$audio = new Audio($cdn);
foreach($result as $data)
{
?>
<div class="ayat-item" data-anchor="<?php echo str_replace(':', '', $data['ayat_key']);?>">
<div class="text arab">
<?php
echo ($data['text']);
echo ' '.$quran->arabicNumber($data['ayat']);
?>
</div>
<div class="text translation">
<?php
echo $data['translation'];
?>
</div>
<div class="sound">
<audio onended="endAudio(this)" onplay="playAudio(this)"
data-ayat-key="<?php echo str_replace(':', '', $data['ayat_key']);?>"
data-src="<?php echo $audio->createAudio($data);?>"
controls></audio>
</div>
<div class="link-surat">
<a
href="./?s=<?php echo $data['surat'];?>&scroll=<?php echo str_replace(':', '', $data['ayat_key']);?>">
<?php
echo $quran->getAyatLabel($data['ayat_key']);
?>
</a>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
<button type="button" class="btn btn-success btn-floating btn-lg" id="btn-back-to-top">
<i class="fas fa-arrow-up"></i>
</button>
</body>
</html>