Example #1
0
for ($i = 1; $i < 32; $i++) {
    ?>
<option value="<?php 
    echo sprintf('%02d', $i);
    ?>
"<?php 
    if ($day2 == $i) {
        ?>
 selected="selected"<?php 
    }
    ?>
><?php 
    echo sprintf('%02d', $i);
    ?>
일(<?php 
    echo getWeekday(date('w', mktime(0, 0, 0, $month2, $i, $year2)));
    ?>
)</option><?php 
}
?>
			</select>

			<input type="button" class="btngray" value="기간적용" onclick="this.form.submit();" />


		</div>
		<div class="clear"></div>
	</div>

	<table summary="접속기록 리스트입니다.">
	<caption>접속기록</caption> 
									<a href="javascript:void(0);" class="remove_availability" title="Remove availability">
									X
									</a>
									</label>
									</div>
                                </div>
								<?php 
    }
} else {
    ?>
								<div class="row availability_inner">
                                    <div class="col-xs-12 col-md-4">
                                        <label class="lbl">On</label>
										<Select name="date_avail[]" class="form-control">
									<?php 
    getWeekday();
    ?>
										</select>
									</div>
                                    <div class="col-xs-12 col-md-3">
                                        <label class="lbl">Time from</label>
                                        
										<select name="timefrom[]" class="time_from form-control">
										<?php 
    $availability = default_availability();
    foreach ($availability as $avail) {
        echo "<option value='" . $avail . "' ";
        if ($avail == '09:00:00') {
            echo " selected='selected' ";
        }
        echo " >" . date('h:i a', strtotime($avail)) . "</option>";
Example #3
0
echo MessageBox::error(_('Wenn Sie die regelmäßige Zeit auf %s ändern, verlieren Sie die Raumbuchungen für alle in der Zukunft liegenden Termine!'), array(_('Sind Sie sicher, dass Sie die regelmäßige Zeit ändern möchten?')));
?>
<? endif; ?>

    <label>
        <?php 
echo _('Starttag');
?>
        <select name="day">
        <? foreach (array(1, 2, 3, 4, 5, 6, 0) as $d): ?>
            <option value="<?php 
echo $d;
?>
" <? if (Request::int('day', $cycle->weekday) === $d) echo 'selected'; ?>>
                <?php 
echo getWeekday($d, false);
?>
            </option>
        <? endforeach; ?>
        </select>
    </label>

    <label>
        <?php 
echo _('Startzeit');
?>
        <input class="has-time-picker" type="text" name="start_time"
               value="<?php 
echo htmlReady(Request::get('start_time', $cycle->start_time));
?>
"
//$tomorrow = date('Y-m-d', strtotime("tomorrow"));
include "return_hw_info_by_id.php";
include "SettingButtonTT.php";
include dirname("../") . "/css/progressbar.php";
include "return_percents_of_schoolyear.php";
//include "checkIfHaveToShowOtherWeek.php";
//include "ReturnUserIDByUserName.php";
//echo '<div class = "todayandtomorrow" style = ""margin:100px;">';
$date = new DateTime($today_date);
$week = $date->format("W");
function getWeekday($date)
{
    return date('w', strtotime($date));
}
$today = getWeekday($today_date);
$tomorrow = getWeekday($today_date) + 1;
if ($week & 1) {
    $eoweek = "OddWeekID";
    $Label = "<h1>Седмицата е нечетна</h1>";
} else {
    $eoweek = "EvenWeekID";
    $Label = "<h1>Седмицата е четна</h1>";
}
if (CheckIfHaveToShowOtherWeek(ReturnUserIdByUserName($username)) == 1) {
    $eoweek = "OtherWeekID";
    $Label = "<h1>Седмицата е извънредна</h1>";
}
//$eoweek = "OtherWeekID";
if ($EditMode == 1) {
    echo $button_to_render2;
}
Example #5
0
    /**
     * Change a regular timeslot of the seminar. The data is passed as an array
     * conatining the following fields:
     *   start_stunde, start_minute, end_stunde, end_minute
     *   description, turnus, startWeek, day, sws
     *
     * @param array $data the cycle-data
     *
     * @return void
     */
    public function editCycle($data = array())
    {
        $cycle = $this->metadate->cycles[$data['cycle_id']];
        $new_start = mktime($data['start_stunde'], $data['start_minute']);
        $new_end = mktime($data['end_stunde'], $data['end_minute']);
        $old_start = mktime($cycle->getStartStunde(),$cycle->getStartMinute());
        $old_end = mktime($cycle->getEndStunde(), $cycle->getEndMinute());
        $do_changes = false;

        // check, if the new timeslot exceeds the old one
        if (($new_start < $old_start) || ($new_end > $old_end) || ($data['day'] != $cycle->day) ) {
            $has_bookings = false;

            // check, if there are any booked rooms
            foreach($cycle->getSingleDates() as $singleDate) {
                if ($singleDate->getStarttime() > (time() - 3600) && $singleDate->hasRoom()) {
                    $has_bookings = true;
                    break;
                }
            }

            // if the timeslot exceeds the previous one and has some booked rooms
            // they would be lost, so ask the user for permission to do so.
            if (!$data['really_change'] && $has_bookings) {
                $link_params = array(
                    'editCycle_x' => '1',
                    'editCycle_y' => '1',
                    'cycle_id' => $data['cycle_id'],
                    'start_stunde' => $data['start_stunde'],
                    'start_minute' => $data['start_minute'],
                    'end_stunde' => $data['end_stunde'],
                    'end_minute' => $data['end_minute'],
                    'day' => $data['day'],
                    'really_change' => 'true'
                );
                $question = _("Wenn Sie die regelmäßige Zeit auf %s ändern, verlieren Sie die Raumbuchungen für alle in der Zukunft liegenden Termine!")
                    ."\n". _("Sind Sie sicher, dass Sie die regelmäßige Zeit ändern möchten?");
                $question_time = '**'. strftime('%A', $data['day']) .', '. $data['start_stunde'] .':'. $data['start_minute']
                    .' - '. $data['end_stunde'] .':'. $data['end_minute'] .'**';

                echo createQuestion(sprintf($question, $question_time), $link_params);

            } else {
                $do_changes = true;
            }
        } else {
            $do_changes = true;
        }

        $messages = false;
        $same_time = false;

        // only apply changes, if the user approved the change or
        // the change does not need any approval
        if ($do_changes) {
            if ($data['description'] != $cycle->getDescription()) {
                $this->createMessage(_("Die Beschreibung des regelmäßigen Eintrags wurde geändert."));
                $message = true;
                $do_changes = true;
            }

            if ($old_start == $new_start && $old_end == $new_end) {
                $same_time = true;
            }
            if ($data['startWeek'] != $cycle->week_offset) {
                $this->setStartWeek($data['startWeek'], $cycle->metadate_id);
                $message = true;
                $do_changes = true;
            }
            if ($data['turnus'] != $cycle->cycle) {
                $this->setTurnus($data['turnus'], $cycle->metadate_id);
                $message = true;
                $do_changes = true;
            }
            if ($data['day'] != $cycle->day) {
                $message = true;
                $same_time = false;
                $do_changes = true;
            }
            if (round(str_replace(',','.', $data['sws']),1) != $cycle->sws) {
                $cycle->sws = $data['sws'];
                $this->createMessage(_("Die Semesterwochenstunden für Dozenten des regelmäßigen Eintrags wurden geändert."));
                $message = true;
                $do_changes = true;
            }

            $change_from = $cycle->toString();
            if ($this->metadate->editCycle($data)) {
                if (!$same_time) {
                    // logging >>>>>>
                    StudipLog::log("SEM_CHANGE_CYCLE", $this->getId(), NULL, $change_from .' -> '. $cycle->toString());
                    NotificationCenter::postNotification("CourseDidChangeSchedule", $this);
                    // logging <<<<<<
                    $this->createMessage(sprintf(_("Die regelmäßige Veranstaltungszeit wurde auf \"%s\" für alle in der Zukunft liegenden Termine geändert!"),
                        '<b>'.getWeekday($data['day']) . ', ' . $data['start_stunde'] . ':' . $data['start_minute'].' - '.
                        $data['end_stunde'] . ':' . $data['end_minute'] . '</b>'));
                    $message = true;
                }
            } else {
                if (!$same_time) {
                    $this->createInfo(sprintf(_("Die regelmäßige Veranstaltungszeit wurde auf \"%s\" geändert, jedoch gab es keine Termine die davon betroffen waren."),
                        '<b>'.getWeekday($data['day']) . ', ' . $data['start_stunde'] . ':' . $data['start_minute'].' - '.
                        $data['end_stunde'] . ':' . $data['end_minute'] . '</b>'));
                    $message = true;
                }
            }
            $this->metadate->sortCycleData();

            if (!$message) {
                $this->createInfo("Sie haben keine Änderungen vorgenommen!");
            }
        }
    }
 /**
  * returns the short week name of a date.
  *
  * checks on what day of the week a date is and returns that day's name.
  *
  * @ignore
  * @param int $mday
  * @param int $month
  * @param int $myear
  * @return string
 */
 function getWeekdayS($mday, $month, $year)
 {
     return getWeekday($mday, $month, $year, false);
 }