Esempio n. 1
0
 function openpostingAction()
 {
     $this->_helper->layout->setLayout('layout-event');
     $lang['days'] = array("Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu");
     $lang['months'] = array("Januari", "Februari", "Maret", "April", "May", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
     $pid = $this->_getParam('pid');
     $tblCalendar = new App_Model_Db_Table_Calendar();
     $row = App_Model_Show_Calendar::show()->openPosting($pid);
     $d = $row[0]['d'];
     $m = $row[0]['m'];
     $y = $row[0]['y'];
     $dateline = $d . " " . $lang['months'][$m - 1] . " " . $y;
     $wday = date("w", mktime(0, 0, 0, $m, $d, $y));
     $this->view->dateline = $dateline;
     $this->view->wday = $lang['days'][$wday - 1];
     // write posting
     $rowposting = App_Model_Show_Calendar::show()->writePosting($pid);
     $title = stripslashes($rowposting[0]['title']);
     $body = stripslashes(str_replace("\n", "<br />", $rowposting[0]['text']));
     $postedby = "Posted by : " . $rowposting[0]['username'];
     if (!($rowposting[0]["start_time"] == "55:55:55" && $rowposting[0]["end_time"] == "55:55:55")) {
         if ($rowposting[0]["start_time"] == "55:55:55") {
             $starttime = "- -";
         } else {
             $starttime = $rowposting[0]["stime"];
         }
         if ($rowposting[0]["end_time"] == "55:55:55") {
             $endtime = "- -";
         } else {
             $endtime = $rowposting[0]["etime"];
         }
         $timestr = "{$starttime} - {$endtime}";
     } else {
         $timestr = "";
     }
     $this->view->title = $title;
     $this->view->body = $body;
     $this->view->postedby = $postedby;
     $this->view->timestr = $timestr;
     $this->view->pid = $pid;
     $this->view->month = $m;
     $this->view->year = $y;
     $this->_helper->layout()->headerTitle = "Event Calendar";
 }
Esempio n. 2
0
 /**
  * getEventDataArray
  * @param $month, $year
  */
 function getEventDataArray($month, $year)
 {
     $eventdata = array();
     $sql = App_Model_Show_Calendar::show()->EventDateCalendar($month, $year);
     foreach ($sql as $sqlDB) {
         $eventdata[$sqlDB->d]["id"][] = $sqlDB->id;
         if (strlen($sqlDB->title) > TITLE_CHAR_LIMIT) {
             $eventdata[$sqlDB->d]["title"][] = substr(stripslashes($sqlDB->title), 0, TITLE_CHAR_LIMIT) . "...";
         } else {
             $eventdata[$sqlDB->d]["title"][] = stripslashes($sqlDB->title);
         }
         if (!($sqlDB->start_time == "55:55:55" && $sqlDB->end_time == "55:55:55")) {
             if ($sqlDB->start_time == "55:55:55") {
                 $starttime = "- -";
             } else {
                 $starttime = $sqlDB->stime;
             }
             if ($sqlDB->end_time == "55:55:55") {
                 $endtime = "- -";
             } else {
                 $endtime = $sqlDB->etime;
             }
             $timestr = "<div align=\"right\" class=\"time_str\">({$starttime} - {$endtime})&nbsp;</div>";
         } else {
             $timestr = "<br>";
         }
         $eventdata[$sqlDB->d]["timestr"][] = $timestr;
     }
     return $eventdata;
 }
Esempio n. 3
0
 function openpostingAction()
 {
     $lang['days'] = array("Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu");
     $lang['months'] = array("Januari", "Februari", "Maret", "April", "May", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
     $pid = $this->_getParam('pid');
     $tblCalendar = new App_Model_Db_Table_Calendar();
     $row = App_Model_Show_Calendar::show()->openPosting($pid);
     $d = $row[0]['d'];
     $m = $row[0]['m'];
     $y = $row[0]['y'];
     $dateline = $d . " " . $lang['months'][$m - 1] . " " . $y;
     $wday = date("w", mktime(0, 0, 0, $m, $d, $y));
     $this->view->dateline = $dateline;
     $this->view->wday = $lang['days'][$wday - 1];
     // write posting
     $rowposting = App_Model_Show_Calendar::show()->writePosting($pid);
     $title = stripslashes($rowposting[0]['title']);
     $body = stripslashes(str_replace("\n", "<br />", $rowposting[0]['text']));
     $postedby = "Posted by : " . $rowposting[0]['username'];
     if (!($rowposting[0]["start_time"] == "55:55:55" && $rowposting[0]["end_time"] == "55:55:55")) {
         if ($rowposting[0]["start_time"] == "55:55:55") {
             $starttime = "- -";
         } else {
             $starttime = $rowposting[0]["stime"];
         }
         if ($rowposting[0]["end_time"] == "55:55:55") {
             $endtime = "- -";
         } else {
             $endtime = $rowposting[0]["etime"];
         }
         $timestr = "{$starttime} - {$endtime}";
     } else {
         $timestr = "";
     }
     if (Pandamp_Controller_Action_Helper_IsAllowed::isAllowed('eventcalendar', 'all')) {
         $zl = Zend_Registry::get("Zend_Locale");
         $editstr = "<span class=\"display_edit\">";
         $editstr .= "[<a href=\"" . ROOT_URL . "/" . $zl->getLanguage() . "/calendar/event/editposting/pid/" . $pid . "\">edit</a>]&nbsp;";
         $editstr .= "[<a href=\"" . ROOT_URL . "/" . $zl->getLanguage() . "/calendar/event/deleteposting/pid/" . $pid . "\">delete</a>]&nbsp;</span>";
     } else {
         $editstr = "";
     }
     $this->view->title = $title;
     $this->view->body = $body;
     $this->view->postedby = $postedby;
     $this->view->timestr = $timestr;
     $this->view->editstr = $editstr;
     $this->view->pid = $pid;
     $this->view->month = $m;
     $this->view->year = $y;
     $this->_helper->layout()->headerTitle = "Event Calendar";
 }