$today = $ctoday->format(FMT_TIMESTAMP_DATE); $date = w2PgetParam($_GET, 'date', $today); // establish the focus 'date' $this_day = new w2p_Utilities_Date($date); $dd = $this_day->getDay(); $mm = $this_day->getMonth(); $yy = $this_day->getYear(); // get current week $this_week = Date_calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY); // prepare time period for 'events' $first_time = clone $this_day; $first_time->setTime(0, 0, 0); $last_time = clone $this_day; $last_time->setTime(23, 59, 59); $prev_day = new w2p_Utilities_Date(Date_calc::prevDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE)); $next_day = new w2p_Utilities_Date(Date_calc::nextDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE)); // get the list of visible companies $company = new CCompany(); global $companies; $companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name'); $companies = arrayMerge(array('0' => $AppUI->_('All')), $companies); // setup the title block $titleBlock = new CTitleBlock('Day View', 'myevo-appointments.png', $m, $m . '.' . $a); $titleBlock->addCrumb('?m=calendar&a=year_view&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'year view'); $titleBlock->addCrumb('?m=calendar&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'month view'); $titleBlock->addCrumb('?m=calendar&a=week_view&date=' . $this_week, 'week view'); $titleBlock->addCrumb('?m=calendar&a=day_view&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'day view'); $titleBlock->addCell($AppUI->_('Company') . ':'); $titleBlock->addCell(arraySelect($companies, 'company_id', 'onChange="document.pickCompany.submit()" class="text"', $company_id), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany" accept-charset="utf-8">', '</form>'); $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new event') . '">', '', '<form action="?m=calendar&a=addedit&date=' . $this_day->format(FMT_TIMESTAMP_DATE) . '" method="post" accept-charset="utf-8">', '</form>'); $titleBlock->show();
$date = dPgetParam($_GET, 'date', $today); // establish the focus 'date' $this_day = new CDate($date); $dd = $this_day->getDay(); $mm = $this_day->getMonth(); $yy = $this_day->getYear(); // get current week $this_week = Date_calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY); // prepare time period for 'events' $first_time = php4_clone($this_day); $first_time->setTime(0, 0, 0); $first_time->subtractSeconds(1); $last_time = php4_clone($this_day); $last_time->setTime(23, 59, 59); $prev_day = new CDate(Date_calc::prevDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE)); $next_day = new CDate(Date_calc::nextDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE)); // setup the title block $titleBlock = new CTitleBlock('Day View'); $titleBlock->addButton('month view', 'index.php?m=calendar&date=' . $this_day->format(FMT_TIMESTAMP_DATE)); $titleBlock->addButton('week view', 'index.php?m=calendar&a=week_view&date=' . $this_week); $titleBlock->addButton('new event', 'index.php?m=calendar&a=addedit&date=' . $this_day->format(FMT_TIMESTAMP_DATE)); $titleBlock->addCell(); $titleBlock->show(); ?> <script language="javascript"> function clickDay( idate, fdate ) { window.location = './index.php?m=calendar&a=day_view&date='+idate; } </script> <table width="100%" cellspacing="0" cellpadding="4" border="0">