当前位置: 首页>>代码示例>>PHP>>正文


PHP Calendar类代码示例

本文整理汇总了PHP中Calendar的典型用法代码示例。如果您正苦于以下问题:PHP Calendar类的具体用法?PHP Calendar怎么用?PHP Calendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Calendar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetInputField

function GetInputField($paramDTO)
{
    $calendar = new Calendar();
    switch ($paramDTO->tipoParametro) {
        // case 1 INTEIRO - input simples, cai no caso default
        // case 2 STRING  - input simples, cai no caso default
        case 3:
            $properties = 'style="width:50%;"';
            // DATETIME  - cria um datetime picker
            return '<input ' . $properties . ' class="datepick" type="text" readonly="readonly" name="parametro' . $paramDTO->id . '" value="' . $paramDTO->valor . '" />';
        case 4:
            $properties = 'style="width:50%;"';
            // BOOLEAN  - cria um combobox com opções sim e não
            $trueSelected = $paramDTO->valor == 'true' ? 'selected="selected"' : '';
            $falseSelected = $paramDTO->valor == 'false' ? 'selected="selected"' : '';
            return '<select ' . $properties . ' name="parametro' . $paramDTO->id . '" ><option ' . $trueSelected . ' value="true" >Sim</option><option ' . $falseSelected . ' value="false" >Não</option></select>';
        case 5:
            $properties = 'style="width:50%;"';
            // MÊS      - cria um combobox com os meses
            return '<select ' . $properties . ' name="parametro' . $paramDTO->id . '" >' . $calendar->GetMonthOptions($paramDTO->valor) . '</select>';
        default:
            $properties = 'style="width:50%;"';
            return '<input ' . $properties . ' type="text" name="parametro' . $paramDTO->id . '" value="' . $paramDTO->valor . '" />';
    }
}
开发者ID:renatosans,项目名称:contratos,代码行数:25,代码来源:gerenciar.php

示例2: calendar

	/**
	 * возвращает календарь. хтмл.
	 */
	public function calendar()
	{
		$this->__loadLib("calendar.php");
		$this->__implement("calendar");

		$year  = getRequest('year') ? (int) getRequest('year') : date('Y');
		$month = getRequest('month') ? (int) getRequest('month') : date('m');


		$calendar = new Calendar();

		$lang_id = cmsController::getInstance()->getCurrentLang()->getId();
		$lang = langsCollection::getInstance()->getLang($lang_id);

		if ($lang->getPrefix() == "ru")
		{
			$calendar->setMonthNames(array("Январь", "Февраль", "Март", "Апрель", "Май", "Июнь",
							"Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"));
			$calendar->setDayNames(array("Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"));
			$calendar->setStartDay(1);
		}

		$result = $calendar->getMonthView($month, $year);

		return $result;

	}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:30,代码来源:class.php

示例3: action_index

 public function action_index()
 {
     $calendar = new Calendar(Arr::get($_GET, 'month', date('m')), Arr::get($_GET, 'year', date('Y')));
     $calendar->attach($calendar->event()->condition('timestamp', time())->output(html::anchor('http://google.de', 'google')));
     $data = array('content' => $calendar->render());
     $this->request->response = new View('index', $data);
 }
开发者ID:antpaw,项目名称:kohana_calendar,代码行数:7,代码来源:usage-example.php

示例4: absensi

 public function absensi()
 {
     //ambil tahun ajaran utk absensinya
     $ta = TahunAjaran::ta();
     /*
      * Ambil kelas yang mau dicari absensinya
      */
     $id = isset($_GET['klsid']) ? addslashes($_GET['klsid']) : Kelas::getFirstKelasID();
     $kls = new Kelas();
     $kls->getByID($id);
     //amnbil murid dikelas
     $murid = new Murid();
     $arrOfMurid = $murid->getMuridDiKelas($kls, $ta);
     if (count($arrOfMurid) < 1) {
         die('Murid Belum ada yang dikelas ini');
     }
     //di get set bulan dantahun di getAbsensi
     $absensi = new Absensi();
     $return = $absensi->getAbsensi($arrOfMurid);
     //ambil kejadian dlm bulan
     $cal = new Calendar();
     $return['calendar'] = $cal->getCalinMonth(Absensi::getBulan());
     //pr($arrOfMurid);
     //ambil absensi untuk kelas
     //pr($kls);
     $return['webClass'] = __CLASS__;
     $return['method'] = __FUNCTION__;
     $return['ta'] = $ta;
     $return['kls'] = $kls;
     Mold::both("studentsetup/absensi", $return);
 }
开发者ID:CapsuleCorpIndonesia,项目名称:elang-combo,代码行数:31,代码来源:StudentSetup.php

示例5: print_calendars

/**
* Prints out the navigational calendars
* @param Calendar $prev previous month calendar
* @param Calendar $next next month calendar
* @param Calendar $curr current month calendar
*/
function print_calendars(&$prev, &$next, &$curr)
{
    ?>
<!-- Start calendars -->

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top"><?php 
    $prev->printCalendar();
    ?>
</td>
	<?php 
    if ($curr != null) {
        echo '<td align="center" valign="top">';
        $curr->printCalendar();
        echo '</td>';
    }
    ?>
	<td align="center" valign="top"><?php 
    $next->printCalendar();
    ?>
</td>
  </tr>
</table>
<!-- End calendars -->
<?php 
}
开发者ID:razagilani,项目名称:srrs,代码行数:33,代码来源:mycalendar.template.php

示例6: indexAction

 /** Index page showing calendrical interface to dates of recording
  */
 public function indexAction()
 {
     $date = $this->_getParam('date') ? $this->_getParam('date') : $this->getTimeForForms();
     $this->view->years = $this->years();
     $calendar = new Calendar($date);
     $cases = new Finds();
     $cases = $cases->getFindsByDay();
     $lists = array();
     foreach ($cases as $value) {
         $lists[] = $value['createdOn'];
     }
     $caseslisted = $lists;
     $calendar->highlighted_dates = $caseslisted;
     $calendar->formatted_link_to = $this->view->baseUrl() . '/database/search/results/created/%Y-%m-%d';
     print '<div id="calendar">';
     print "<ul id=\"year\">\n";
     for ($i = 1; $i <= 12; $i++) {
         print "<li>";
         if ($i == $calendar->month) {
             print $calendar->output_calendar();
         } else {
             print $calendar->output_calendar($calendar->year, $i);
         }
         print "</li>\n";
     }
     print "</ul></div>";
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:29,代码来源:StatisticsController.php

示例7: create

 public function create($data)
 {
     // setting defaults
     $data['PRO_UID'] = array_key_exists('PRO_UID', $data) ? $data['PRO_UID'] : Common::generateUID();
     $data['USR_UID'] = array_key_exists('PRO_CREATE_USER', $data) ? $data['PRO_CREATE_USER'] : null;
     $data['PRO_TITLE'] = array_key_exists('PRO_TITLE', $data) ? trim($data['PRO_TITLE']) : "";
     $data['PRO_CATEGORY'] = array_key_exists('PRO_CATEGORY', $data) ? $data['PRO_CATEGORY'] : "";
     try {
         self::log("Create Process with data:", $data);
         //validate if process with specified name already exists
         if (Process::existsByProTitle($data["PRO_TITLE"])) {
             throw new Exception\ProjectAlreadyExists($this, $data["PRO_TITLE"]);
         }
         // Create project
         $process = new Process();
         $this->proUid = $process->create($data, false);
         // Call Plugins
         $pluginData['PRO_UID'] = $this->proUid;
         $pluginData['PRO_TEMPLATE'] = empty($data["PRO_TEMPLATE"]) ? "" : $data["PRO_TEMPLATE"];
         $pluginData['PROCESSMAP'] = null;
         $pluginRegistry = \PMPluginRegistry::getSingleton();
         $pluginRegistry->executeTriggers(PM_NEW_PROCESS_SAVE, $pluginData);
         // Save Calendar ID for this process
         if (!empty($data["PRO_CALENDAR"])) {
             //G::LoadClass( "calendar" );
             $calendar = new \Calendar();
             $calendar->assignCalendarTo($this->proUid, $data["PRO_CALENDAR"], 'PROCESS');
         }
         self::log("Create Process Success!");
     } catch (\Exception $e) {
         self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
         throw $e;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:34,代码来源:Workflow.php

示例8: getcalendar

 protected function getcalendar()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) {
         $role = $student->getacctType();
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/calendar_class.php';
         $calendar = new Calendar();
         $month = $calendar->getmonth();
         $year = $calendar->getyear();
         if (isset($_GET['uid']) && isset($_GET['ref'])) {
             $month = $_GET['uid'];
             $year = $_GET['ref'];
             $calendar->setmonth($month);
             $calendar->setyear($year);
         }
         $calendar->create();
         $week = $calendar->getweek();
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/events_class.php';
         $event = new Events($objPDO);
         $datePattern = "-" . $calendar->getmonth() . "-" . $calendar->getyear();
         $events_array = $event->getByDateLike($datePattern);
         $day_events = array();
         foreach ($events_array as $key => $value) {
             $day_events[$value['date']][] = $key;
         }
         $events_type = array('1' => 'holiday.png', '2' => 'fees.png', '3' => 'function.png', '4' => 'test.png');
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/events_calendar.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:34,代码来源:noticeController.php

示例9: month

 private function month($page_name, $tool_id, $date)
 {
     valid::id_key($tool_id);
     if (empty($date)) {
         $year = date('Y');
         $month = date('m');
     } else {
         $date = explode('-', $date);
         # strictly need the formated date, else throw page not found.
         if (1 > count($date) or count($date) > 3) {
             Event::run('system.404');
         }
         list($year, $month) = $date;
         valid::year($year);
         valid::month($month);
     }
     $date_array = array();
     $dates = ORM::factory('calendar_item')->where(array('fk_site' => $this->site_id, 'calendar_id' => $tool_id, 'year' => $year, 'month' => $month))->find_all();
     /*
      * Create an array with key/value pairs = day/number of events on day
      * This lets the calendar know which dates to show links for.
      */
     for ($x = 0; $x <= 31; ++$x) {
         $date_array[$x] = 0;
     }
     foreach ($dates as $date) {
         (int) ++$date_array[$date->day];
     }
     $calendar = new Calendar();
     return $calendar->getPhpAjaxCalendar($page_name, $month, $year, $date_array, 'day_function');
 }
开发者ID:plusjade,项目名称:plusjade,代码行数:31,代码来源:calendar.php

示例10: display

 function display()
 {
     ob_start();
     if (isset($GLOBALS['cal_strings'])) {
         return parent::display() . "Only one Calendar dashlet is allowed.";
     }
     require_once 'modules/Calendar/Calendar.php';
     require_once 'modules/Calendar/CalendarDisplay.php';
     require_once "modules/Calendar/CalendarGrid.php";
     global $cal_strings, $current_language;
     $cal_strings = return_module_language($current_language, 'Calendar');
     if (!ACLController::checkAccess('Calendar', 'list', true)) {
         ACLController::displayNoAccess(true);
     }
     $cal = new Calendar($this->view);
     $cal->dashlet = true;
     $cal->add_activities($GLOBALS['current_user']);
     $cal->load_activities();
     $display = new CalendarDisplay($cal, $this->id);
     $display->display_calendar_header(false);
     $display->display();
     $str = ob_get_contents();
     ob_end_clean();
     return parent::display() . $str;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:25,代码来源:CalendarDashlet.php

示例11: home

 private function home()
 {
     if (!eval(Hooks::get('HOME'))) {
         return;
     }
     NewVersionCheck::getNews();
     $dashboard = new Dashboard($this->_siteID);
     $placedRS = $dashboard->getPlacements();
     $calendar = new Calendar($this->_siteID);
     $upcomingEventsHTML = $calendar->getUpcomingEventsHTML(7, UPCOMING_FOR_DASHBOARD);
     $calendar = new Calendar($this->_siteID);
     $upcomingEventsFupHTML = $calendar->getUpcomingEventsHTML(7, UPCOMING_FOR_DASHBOARD_FUP);
     /* Important cand datagrid */
     $dataGridProperties = array('rangeStart' => 0, 'maxResults' => 15, 'filterVisible' => false);
     $dataGrid = DataGrid::get("home:ImportantPipelineDashboard", $dataGridProperties);
     $this->_template->assign('dataGrid', $dataGrid);
     $dataGridProperties = array('rangeStart' => 0, 'maxResults' => 15, 'filterVisible' => false);
     /* Only show a month of activities. */
     $dataGridProperties['startDate'] = '';
     $dataGridProperties['endDate'] = '';
     $dataGridProperties['period'] = 'DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
     $dataGrid2 = DataGrid::get("home:CallsDataGrid", $dataGridProperties);
     $this->_template->assign('dataGrid2', $dataGrid2);
     $this->_template->assign('active', $this);
     $this->_template->assign('placedRS', $placedRS);
     $this->_template->assign('upcomingEventsHTML', $upcomingEventsHTML);
     $this->_template->assign('upcomingEventsFupHTML', $upcomingEventsFupHTML);
     $this->_template->assign('wildCardQuickSearch', '');
     $this->_template->display('./modules/home/Home.tpl');
 }
开发者ID:PublicityPort,项目名称:OpenCATS,代码行数:30,代码来源:HomeUI.php

示例12: onAfterWrite

 public function onAfterWrite()
 {
     parent::onAfterWrite();
     if ($this->isInsert) {
         $blog = new BlogHolder();
         $blog->ParentID = $this->ID;
         $blog->Title = "News";
         $blog->ShowInMenus = false;
         $blog->write();
         $blog->publish('Stage', 'Live');
         $calendar = new Calendar();
         $calendar->ParentID = $this->ID;
         $calendar->Title = "Calendar";
         $calendar->ShowInMenus = false;
         $calendar->write();
         $calendar->publish('Stage', 'Live');
         $leaders = new ScoutGroupLeaders();
         $leaders->ParentID = $this->ID;
         $leaders->Title = "Leaders";
         $leaders->ShowInMenus = false;
         $leaders->write();
         $leaders->publish('Stage', 'Live');
     }
     $this->isInsert = false;
 }
开发者ID:helpfulrobot,项目名称:phpboyscout-silverstripe-scouts,代码行数:25,代码来源:ScoutGroup.php

示例13: __calendar

 public function __calendar()
 {
     if ($this->month && $this->year) {
         $cal_year = $this->year;
         $cal_month = $this->month;
     } else {
         if (!($cal_month = Request::get('month'))) {
             $cal_month = date("m");
         } elseif ($cal_month < 10) {
             $cal_month = "0" . str_replace("0", "", $cal_month);
         }
         if (!($cal_year = Request::get('year'))) {
             $cal_year = date("Y");
         }
     }
     $model = new $this->cms_content_class();
     $model = $model->scope($this->cms_list_scope);
     $cal = new Calendar();
     if (($events = $cal->event_range_filter($model, $cal_year, $cal_month)->all()) && $events->count()) {
         foreach ($events as $event) {
             $index = date("Y-n-j", strtotime($event->event_date_start));
             $this->months_events[$index][$event->primval] = $event;
             $start = date("Ymd", strtotime($event->event_date_start));
             $end = date("Ymd", strtotime($event->event_date_end));
             if ($end > $start) {
                 foreach (range($start, $end) as $i) {
                     $ind = date("Y-n-j", strtotime($i));
                     $this->months_events[$ind][$event->primval] = $event;
                 }
             }
         }
     }
 }
开发者ID:phpwax,项目名称:wildfire.events,代码行数:33,代码来源:WildfireEventsController.php

示例14: mailos_followup

    function mailos_followup($id, $subject, $from, $days, $account)
    {
        $localtime = time();
        $followup = <<<EOF
\t\tCalendar alert to follow up via email:
\t\t
\t\tFrom: {$from}
\t\tSubject = {$subject}
\t\tMessageID = ({$id})
\t\t
\t\tAdded = {$localtime}
\t\tDays = {$days}
EOF;
        $title = "Follow up {$from} ({$subject})";
        // Starts today
        $start = time();
        // Due in X days from today
        $due = $start + $days * 86400;
        $end = $start + $days * 86400 + 3600;
        $startdate = strftime("%Y-%m-%d %R:00", time($due));
        $enddate = strftime("%Y-%m-%d %R:00", time($end));
        list($username, $pop3host) = explode('@', $account);
        $cal = new Calendar(array('username' => $username, 'pop3host' => $pop3host, 'userfrom' => $account));
        // Add to our own Personal calendar
        $cal->addrecord(array('UserTo' => $account, 'UserFrom' => $account, 'Title' => $title, 'CalMessage' => $followup, 'Type' => 'Pending', 'Importance' => '1', 'Alert' => '', 'DateStart' => "{$startdate}", 'DateEnd' => "{$enddate}", 'Permission' => '1'));
    }
开发者ID:huluwa,项目名称:zz_atmailopen,代码行数:26,代码来源:MailOS.php

示例15: index

 function index()
 {
     global $viewhelper;
     require CACHE_COMMON_PATH . "cache_type.php";
     $title = L("industry_info", "tpl");
     //cal
     require CLASS_PATH . "calendar.class.php";
     $cal = new Calendar();
     $cal->setMonthNames(explode(",", L("month_unit", "tpl")));
     $cal->setDayNames(explode(",", L("week_unit", "tpl")));
     $d = getdate(time());
     $day = $_GET['day'];
     if ($day == "") {
         $day = $d['mday'];
     }
     $month = $_GET['month'];
     if ($month == "") {
         $month = $d["mon"];
     }
     $year = $_GET['year'];
     if ($year == "") {
         $year = $d["year"];
     }
     if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) {
         $title .= L("journal", "tpl", $year . $month . $day);
         setvar("date_line", $year . "-" . $month . "-" . $day);
     }
     $viewhelper->setTitle($title);
     setvar("Calendar", $cal->getMonthView($month, $year));
     $cache_id = $year . $month . $day;
     //end cal
     render("news/index");
 }
开发者ID:reboxhost,项目名称:phpb2b,代码行数:33,代码来源:news_controller.php


注:本文中的Calendar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。