-
Notifications
You must be signed in to change notification settings - Fork 1
/
testr.php
51 lines (36 loc) · 1.73 KB
/
testr.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
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require_once __DIR__ . '/vendor/autoload.php';
$sourceQuranBahasa = new Alquran\Resource\AlquranRepository\AlquranRepositoryBahasa\AlquranRepositoryBahasa;
$sourceQuranArabic = new Alquran\Resource\Arabic\DataSource\DataArabic;
$alquranArabic = new \Alquran\Resource\Ayat\Ayat($sourceQuranArabic);
$alquranBahasa = new \Alquran\Resource\Ayat\Ayat($sourceQuranBahasa);
$surrah = new Alquran\Resource\Surrah\Surrah;
$surrahNumber = 114;
$alquranBahasa->setSurrahNumber($surrahNumber);
$alquranArabic->setSurrahNumber($surrahNumber);
$html = "<h3>Menampilkan surat ".$alquranArabic->getSurrahName()." ke ".$alquranArabic->getSurrahNumber()." </h3><br>";
foreach ($alquranArabic->getSurrah() as $ayat) {
$html .= $ayat->getAyatNumber() . ') ' . $ayat->getContent();
$html .= "<br>";
$html .= $ayat->translate($alquranBahasa);
$html .= "<br>";
$html .= "<br>";
}
echo $html;
$alquranArabic = new Alquran\Resource\Component\RandomAlquran\RandomAyat\RandomAyat($sourceQuranArabic);
$html = "<h3>Menampilkan surat ".$alquranArabic->getSurrahName()." ke {$surrahNumber} </h3><br>";
foreach ($alquranArabic->randomSurrah() as $ayat) {
$html .= $ayat->getAyatNumber() . ') ' . $ayat->getContent();
$html .= "<br>";
$html .= $ayat->translate($alquranBahasa);
$html .= "<br>";
$html .= "<br>";
}
echo $html;
$alquranArabic->setSurrahNumber(rand(1, 144));
$content = $alquranArabic->randomAyat();
$html = "<i><span style='font-size:36'>\"</span><span style='font-size:20'>".$content->translate($alquranBahasa)."</span><span style='font-size:36'>\"</span>";
$html .= "<br>";
$html .= "- Surat " . $alquranArabic->getSurrahName(). " Ayat " . $alquranArabic->getSurrahNumber();;
echo $html;