-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.php
129 lines (74 loc) · 3.03 KB
/
test.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
<?php
/*
$sql1="
SELECT ayat.*,sorah.* ,tafsser.* from ayat , sorah ,tafsser
WHERE tafsser.aya_id = ayat.ayaano AND tafsser.sura_id = ayat.soraano AND tafsser.type ='2' AND ayat.soraano = sorah.soraano LIMIT 0 , 1";
*/
$sql="SELECT w.soraano,w.ayaano,w.ayaa AS ayat , m.aya_id,m.sura_id , m.text AS tafsser ,s.soraano,s.soraaname AS sorah
FROM ayat w , tafsser m , sorah s WHERE m.aya_id = w.ayaano AND m.sura_id = w.soraano AND m.type ='2' AND s.soraano = w.soraano LIMIT 0 , 1";
/* $sql_k = mysqli_query($db,"
SELECT * FROM ayat
LEFT JOIN sorah ON ayat.soraano = sorah.soraano WHERE ayat.AyaaIndex LIKE '%".$search_word."%'
UNION
SELECT * FROM ayat
RIGHT JOIN sorah ON ayat.soraano = sorah.soraano WHERE ayat.AyaaIndex LIKE '%".$search_word."%'
limit 0,10
");*/
/*
$sql_k = mysqli_query($db,"
SELECT * FROM ayat
LEFT JOIN sorah ON ayat.soraano = sorah.soraano WHERE ayat.chapterNO = '3'
UNION
SELECT * FROM ayat
RIGHT JOIN sorah ON ayat.soraano = sorah.soraano WHERE ayat.chapterNO = '3'
limit 0,10
");
*/
/*
$sql_k = mysqli_query($db,"SELECT ayat.*,sorah.* from ayat , sorah
WHERE ayat.AyaaIndex LIKE '%".$search_word."%'
AND ayat.soraano = sorah.soraano");
*/
$sql1 = "select c.sura_no,
t.name,
c.aya_no,
c.aya_text,
s.text AS altafsir
from hafs_ayat c
join surah_names t on t.id = ".$result[0]['sura']."
join ar_muyassar s on s.aya = ".$result[0]['aya']." AND s.sura = ".$result[0]['sura']."
where c.aya_no = ".$result[0]['aya']." AND c.sura_no = ".$result[0]['sura']."";
$sql="SELECT w.sura_no,w.aya_no,w.aya_text , m.name , s.text AS altafsir
FROM hafs_ayat w , surah_names m , ar_muyassar s WHERE w.aya_no = ".$result[0]['aya']." AND w.sura_no=".$result[0]['sura']." AND m.id = ".$result[0]['sura']." AND s.aya = ".$result[0]['aya']." AND s.sura = ".$result[0]['sura']."";
/*
require 'includes/adodb5/adodb.inc.php';
$db = ADONewConnection('pdo');
$db->debug = false;
if(!$db->Connect('mysql:host=localhost','root','12345678','quran1'))
{
exit($db->ErrorMsg());
}
$db->Execute('SET NAMES utf8');
$db->Execute('SET CHARACTER SET utf8');
$db->Execute('SET COLLATION_CONNECTION="utf8_unicode_ci"');
//$ADODB_FETCH_MODE = ADODB_FETCH_NUM;
//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$SQL = 'select count(*) AS total from quran';
$maxTickets = $db->GetOne($SQL);
echo $maxTickets.'---';
print_r($maxTickets);
$ADODB_CACHE_DIR = 'cache/';
//$rs2 = $db->CacheExecute(3000,'select * from quran ORDER BY rand() LIMIT 0 , 1');
//print_r($rs2->fields);
$rs2 = $db->getAll('select * from quran ORDER BY rand() LIMIT 0 , 1');
print_r($rs2);*/
function is_rtl( $string ) {
$rtl_chars_pattern = '/[\x{0590}-\x{05ff}\x{0600}-\x{06ff}]/u';
return preg_match($rtl_chars_pattern, $string);
}
// Arabic Or Persian
var_dump(is_rtl('نص عربي أو فارسي'));
// Hebrew
var_dump(is_rtl('חופש למען פלסטין'));
// Latin
var_dump(is_rtl('Hello, World!'));