Hijri
3 years ago
Processors
1 month ago
QuranADay
2 months ago
StartTime
1 year ago
design
1 month ago
AdminMenu.php
2 years ago
AssetsLoader.php
1 year ago
CustomPluginSettings.php
4 years ago
DPTAjaxHandler.php
4 years ago
DPTHelper.php
1 month ago
DSTemplateLoader.php
2 years ago
DailyShortCode.php
2 months ago
DigitalScreen.php
1 month ago
HijriDate.php
3 years ago
Init.php
4 years ago
MonthlyShortCode.php
2 years ago
MonthlyTimeTable.php
3 years ago
Shortcodes.php
2 months ago
Translator.php
4 years ago
UpdateStyles.php
1 month ago
Validator.php
3 years ago
db.php
2 months ago
dptWidget.php
4 years ago
MonthlyTimeTable.php
67 lines
| 1 | <?php |
| 2 | require_once('db.php'); |
| 3 | require_once(__DIR__.'/../Views/MonthlyTimetablePrinter.php'); |
| 4 | |
| 5 | class MonthlyTimeTable |
| 6 | { |
| 7 | /** @var integer */ |
| 8 | private $monthNumber; |
| 9 | |
| 10 | /** @var array */ |
| 11 | private $row = array(); |
| 12 | |
| 13 | /** @var MonthlyTimetablePrinter */ |
| 14 | private $timetablePrinter; |
| 15 | |
| 16 | public function __construct($monthNumber) |
| 17 | { |
| 18 | $this->monthNumber = $monthNumber; |
| 19 | $this->row = $this->getMonthlyCalendar($this->monthNumber); |
| 20 | $this->timetablePrinter = new MonthlyTimetablePrinter(); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @param $options |
| 25 | * |
| 26 | * @return string |
| 27 | */ |
| 28 | public function displayTable($options) |
| 29 | { |
| 30 | return $this->timetablePrinter->displayTable($this->row, $options); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @param $options |
| 35 | * |
| 36 | * @return string |
| 37 | */ |
| 38 | public function displayTableJamahOnly($options) |
| 39 | { |
| 40 | return $this->timetablePrinter->displayTableJamahOnly($this->row, $options); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @param $options |
| 45 | * |
| 46 | * @return string |
| 47 | */ |
| 48 | public function displayTableAzanOnly($options) |
| 49 | { |
| 50 | return $this->timetablePrinter->displayTableAzanOnly($this->row, $options); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * return monthly prayer time |
| 55 | * @param integer $month |
| 56 | * @return array |
| 57 | */ |
| 58 | private function getMonthlyCalendar($month) |
| 59 | { |
| 60 | $db = new DatabaseConnection(); |
| 61 | if ( $month == 13 ) { // ramadan |
| 62 | return $db->getPrayerTimeForRamadan(); |
| 63 | } |
| 64 | return $db->getPrayerTimeForMonth($month, date('Y')); |
| 65 | } |
| 66 | } |
| 67 |