diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..b0b3063 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,32 @@ +@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap'); + +body { + font-family: 'Noto Sans', sans-serif; + background-color: #F8F9FA; +} + +.table th { + cursor: pointer; +} + +[dir="rtl"] .table th { + text-align: right; +} + +.form-control { + display: block; + width: 100%; + padding: 0.375rem 0.75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #212529; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ced4da; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border-radius: 0.25rem; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..a5ea6ed --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,53 @@ +document.addEventListener('DOMContentLoaded', function () { + const searchInput = document.getElementById('searchInput'); + const vocabularyTable = document.getElementById('vocabularyTable'); + const tableBody = vocabularyTable.getElementsByTagName('tbody')[0]; + const rows = tableBody.getElementsByTagName('tr'); + + // Search functionality + searchInput.addEventListener('keyup', function () { + const filter = searchInput.value.toLowerCase(); + for (let i = 0; i < rows.length; i++) { + let cells = rows[i].getElementsByTagName('td'); + let found = false; + for (let j = 0; j < cells.length; j++) { + if (cells[j].innerHTML.toLowerCase().indexOf(filter) > -1) { + found = true; + break; + } + } + if (found) { + rows[i].style.display = ''; + } else { + rows[i].style.display = 'none'; + } + } + }); + + // Sort functionality + const headers = vocabularyTable.getElementsByTagName('th'); + for (let i = 0; i < headers.length; i++) { + headers[i].addEventListener('click', function () { + const column = i; + const sortOrder = this.classList.contains('asc') ? 'desc' : 'asc'; + for (let j = 0; j < headers.length; j++) { + headers[j].classList.remove('asc', 'desc'); + } + this.classList.add(sortOrder); + + const sortedRows = Array.from(rows).sort((a, b) => { + const aText = a.getElementsByTagName('td')[column].innerText; + const bText = b.getElementsByTagName('td')[column].innerText; + return aText.localeCompare(bText, undefined, { numeric: true }) * (sortOrder === 'asc' ? 1 : -1); + }); + + while (tableBody.firstChild) { + tableBody.removeChild(tableBody.firstChild); + } + + sortedRows.forEach(row => { + tableBody.appendChild(row); + }); + }); + } +}); diff --git a/db/setup.php b/db/setup.php new file mode 100644 index 0000000..889d502 --- /dev/null +++ b/db/setup.php @@ -0,0 +1,153 @@ +exec($sql); + + echo "Table 'vocabulary' created successfully (if not exists)." . PHP_EOL; + + // Check if table is empty before inserting data + $stmt = $pdo->query("SELECT COUNT(*) FROM vocabulary"); + if ($stmt->fetchColumn() > 0) { + echo "Table is not empty. Skipping data insertion." . PHP_EOL; + exit; + } + + // Insert data + $vocabulary = [ + ['الْحَمْدُ', 'حمد', 'Praise'], + ['لِ', 'لے، واسطے، لہذا', 'For, to'], + ['رَبِّ', 'رب', 'Lord'], + ['الْعٰلَمِیْنَ', 'جہان، رحمت للعالمین', 'The worlds'], + ['الرَّحْمٰنِ', 'رحمن', 'The Most Merciful'], + ['الرَّحِیْمِ', 'رحیم', 'The Compassionate'], + ['مَالِكِ', 'مالک', 'Master, Owner'], + ['یَوْمِ', 'دن', 'Day'], + ['وَ', 'اور', 'And'], + ['عَن', 'بارے میں، سے', 'About, from'], + ['تَا', 'ہمارا', 'Our'], + ['الصِّرَاطَ', 'راستہ', 'The path'], + ['الْمُسْتَقِیْمَ', 'سیدھا', 'The straight'], + ['عَلَی', 'پر', 'On, upon'], + ['غَیْرِ', 'سوا', 'Other than'], + ['الْمَغْضُوْبِ', 'غضب کیا گیا', 'Those who earned anger'], + ['لَا', 'نہیں', 'No, not'], + ['ب', 'ساتھ', 'With, by'], + ['إِسْمُ', 'نام', 'Name'], + ['اللّٰهُ', 'الله', 'Allah'], + ['مِن', 'سے', 'From'], + ['الشَّيْطَانِ', 'شیطان', 'The Satan'], + ['اِلٰی', 'کی طرف', 'To, towards'], + ['فِى', 'میں', 'In'], + ['بَيْنَ', 'درمیان', 'Between'], + ['آيَةً', 'بشارت، ازل ساے بردبک', 'Sign, verse'], + ['كُل', 'تمام', 'All, every'], + ['تَحْت', 'نیچے', 'Under, beneath'], + ['فَوْق', 'اوپر', 'Above, over'], + ['كِتَاب', 'کتاب', 'Book'], + ['رِزْق', 'رزق', 'Provision'], + ['قَبْل', 'پہلے', 'Before'], + ['آخِرَة', 'آخرت', 'Hereafter'], + ['هُدًى', 'ہدایت', 'Guidance'], + ['خلَق', 'خلق', 'Creation'], + ['بیَان', 'بیان کرنا', 'Explanation'], + ['غَيْب', 'غیب', 'Unseen'], + ['قَلْب', 'دل', 'Heart'], + ['عَذَاب', 'عذاب', 'Punishment'], + ['مَرَض', 'بیماری', 'Disease'], + ['فَسَاد', 'فساد', 'Corruption'], + ['تِجَارَةً', 'تجارت', 'Trade'], + ['مَثَل', 'مثال', 'Example'], + ['عَقْل', 'عقل', 'Intellect'], + ['أَهْل', 'والا', 'People of'], + ['سَمَاء', 'آسمان', 'Sky, heaven'], + ['بَرْق', 'بجلی', 'Lightning'], + ['مَوْت', 'موت', 'Death'], + ['حَفِيظ', 'حفظ کرنے والا', 'Guardian, protector'], + ['شَيْء', 'چیز', 'Thing'], + ['آيَة', 'نشانی', 'Sign, miracle'], + ['ثَمَرَات', 'پھل', 'Fruits'], + ['مُؤْمِن', 'مومن', 'Believer'], + ['كَافِر', 'کافر', 'Disbeliever'], + ['صَالِح', 'نیک', 'Righteous'], + ['بَعْد', 'بعد', 'After'], + ['أَزْوَاج', 'بیویاں', 'Spouses, pairs'], + ['حَجّ', 'حج', 'Pilgrimage'], + ['بَيْت', 'گھر', 'House'], + ['كَثِير', 'بہت', 'Much, many'], + ['عَهْد', 'وعدہ', 'Covenant, promise'], + ['بَعِيد', 'دور', 'Far, distant'], + ['نَائِب', 'نائب', 'Deputy'], + ['جَمِيع', 'تمام', 'All, entire'], + ['مُخْتَلِف', 'مختلف', 'Different'], + ['شَرّ', 'شر', 'Evil'], + ['إِبْلِيس', 'ابلیس', 'Iblis, Satan'], + ['بَعْض', 'بعض', 'Some, part'], + ['مَتَاع', 'سامان، دولت', 'Provision, wealth'], + ['كَلِمَات', 'الفاظ', 'Words'], + ['خَوْف', 'خوف', 'Fear'], + ['حُزْن', 'غم', 'Grief'], + ['قَبِيل', 'قبیلہ', 'Tribe, clan'], + ['نَفْس', 'جان', 'Soul, self'], + ['شَفَاعَة', 'شفاعت', 'Intercession'], + ['عَدْل', 'عدل', 'Justice'], + ['بَلَاء', 'آزمائش', 'Trial, test'], + ['بَحْر', 'سمندر', 'Sea'], + ['لَيْلَة', 'رات', 'Night'], + ['نِهَايَة', 'دن', 'Day, daytime'], + ['بَاب', 'دروازہ', 'Door, gate'], + ['جَمَعَ', 'جمع کرنا', 'To gather'], + ['ذَكَر', 'ذکر', 'Remembrance'], + ['طَعَامًا', 'کھانا', 'Food'], + ['بَشِير', 'بشیر', 'Bearer of glad tidings'], + ['ذَات', 'ذات', 'Essence, self'], + ['عَمَل', 'عمل', 'Action, deed'], + ['إِلَّا', 'سوائے', 'Except'], + ['شَجَرَ', 'درخت', 'Tree'], + ['ذُو', 'والا', 'Possessor of'], + ['فَرِيق', 'گروہ', 'Group, party'], + ['شَكّ', 'شک', 'Doubt'], + ['سِرًّا', 'پوشیدہ', 'Secret'], + ['شَمْس', 'سورج', 'Sun'], + ['صِدْق', 'سچ', 'Truth'], + ['وَالِدِين', 'والدین', 'Parents'], + ['يَتِيمًا', 'یتیم', 'Orphan'], + ['مِسْكِينًا', 'مسکین', 'Needy, poor'], + ['زَكَاة', 'زکوة', 'Charity, alms'], + ['نُورًا', 'نور', 'Light'], + ['جَزَاء', 'بدلہ', 'Reward'], + ['حَيَاة', 'زندگی', 'Life'], + ['عَبْدًا', 'بندہ', 'Servant, slave'], + ['صَلَاة', 'نماز', 'Prayer'], + ['صَبْر', 'صبر', 'Patience'], + ['رَسُول', 'رسول', 'Messenger'], + ['نَبِي', 'نبی', 'Prophet'], + ['جَنَّة', 'جنت', 'Paradise'], + ['نَار', 'آگ', 'Fire, Hell'], + ['إِيمَان', 'ایمان', 'Faith'], + ['كُفْر', 'کفر', 'Disbelief'], + ['حَقّ', 'حق', 'Truth, right'], + ['بَاطِل', 'باطل', 'Falsehood'], + ['خَيْر', 'خیر', 'Good'], + ]; + + $stmt = $pdo->prepare("INSERT INTO vocabulary (arabic, urdu, english) VALUES (?, ?, ?)"); + + foreach ($vocabulary as $word) { + $stmt->execute($word); + } + + echo "Data inserted successfully." . PHP_EOL; + +} catch (PDOException $e) { + die("DB ERROR: " . $e->getMessage()); +} diff --git a/index.php b/index.php index 7205f3d..5d8c1ef 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,46 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + Quran Vocabulary + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+
+

Quran Vocabulary

+ +
+ + + + + + + + + + query("SELECT arabic, urdu, english FROM vocabulary ORDER BY id"); + while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } catch (PDOException $e) { + echo ""; + } + ?> + +
ArabicUrduEnglish
" . htmlspecialchars($row['arabic']) . "" . htmlspecialchars($row['urdu']) . "" . htmlspecialchars($row['english']) . "
Error: " . $e->getMessage() . "
+
-
- + - + \ No newline at end of file