コード例 #1
0
ファイル: all.blade.php プロジェクト: RExLab/relle
    </thead>
    <tbody>

        @foreach($logs as $log)
        <tr>

            <?php 
$idExp = $log->lab_id;
$lab = Labs::find($idExp);
if ($log->user_id) {
    $idUser = $log->user_id;
    $user = User::find($idUser);
} else {
    $user['username'] = '******';
}
$locale = 'name_' . App::getlocale();
$name = "";
if ($log->mobile == "1") {
    $name = trans('log.true');
} else {
    $name = trans('log.false');
}
?>

            <td>{{$lab[$locale]}}</td>
            <td>{{ $user['username'] }}</td>
            <td>{{$log->start}}</td>
            <td>{{$log->end}}</td>
            <td>{{$log->ip}}</td>
            <td>{{$log->os}}</td>
            <td>{{$log->browser}}</td>
コード例 #2
0
ファイル: main.blade.php プロジェクト: ruslankus/lavcms
<?php

$locale = App::getlocale();
?>
@extends('common_layout')

@section('content')
  @foreach($blocksResArr as $block)
  <div>

    {!! $block !!}

  </div>

  @endforeach
@stop
コード例 #3
0
 /**
  * Generate the calendar
  *
  * @access	public
  * @param	integer	the year
  * @param	integer	the month
  * @param	array	the data to be shown in the calendar cells
  * @return	string
  */
 public function generate($year = '', $month = '', $data = array())
 {
     // if lang is not supplied in initilize, set it to app default :
     if ($this->lang == "") {
         $this->lang = \App::getlocale();
     }
     // Set and validate the supplied month/year
     if ($year == '') {
         $year = date('Y', $this->local_time);
     }
     if ($month == '') {
         $month = date('m', $this->local_time);
     }
     if (strlen($year) == 1) {
         $year = '200' . $year;
     }
     if (strlen($year) == 2) {
         $year = '20' . $year;
     }
     if (strlen($month) == 1) {
         $month = '0' . $month;
     }
     $adjusted_date = $this->adjust_date($month, $year);
     $month = $adjusted_date['month'];
     $year = $adjusted_date['year'];
     // Determine the total days in the month
     $total_days = $this->get_total_days($month, $year);
     // Set the starting day of the week
     $start_days = array('sunday' => 0, 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6);
     $start_day = !isset($start_days[$this->start_day]) ? 0 : $start_days[$this->start_day];
     // Set the starting day number
     $local_date = mktime(12, 0, 0, $month, 1, $year);
     $date = getdate($local_date);
     $day = $start_day + 1 - $date["wday"];
     while ($day > 1) {
         $day -= 7;
     }
     // Set the current month/year/day
     // We use this to determine the "today" date
     $cur_year = date('Y', $this->local_time);
     $cur_month = date('m', $this->local_time);
     $cur_day = date('j', $this->local_time);
     $is_current_month = ($cur_year == $year and $cur_month == $month) ? TRUE : FALSE;
     // Generate the template data array
     $this->parse_template();
     // Begin building the calendar output
     $out = $this->temp['table_open'];
     $out .= $this->temp['heading_row_start'];
     // "previous" month link
     if ($this->show_next_prev == TRUE) {
         // Add a trailing slash to the  URL if needed
         $this->next_prev_url = preg_replace("/(.+?)\\/*\$/", "\\1/", $this->next_prev_url);
         $adjusted_date = $this->adjust_date($month - 1, $year);
         $url = $this->segments ? $this->next_prev_url . $adjusted_date['year'] . '/' . $adjusted_date['month'] : $this->next_prev_url . '?year=' . $adjusted_date['year'] . '&month=' . $adjusted_date['month'];
         $out .= str_replace('{previous_url}', $url, $this->temp['heading_previous_cell']);
     }
     // Heading containing the month/year
     $colspan = $this->show_next_prev == TRUE ? 5 : 7;
     $this->temp['heading_title_cell'] = str_replace('{colspan}', $colspan, $this->temp['heading_title_cell']);
     $this->temp['heading_title_cell'] = str_replace('{heading}', $this->get_month_name($month) . "&nbsp;" . $year, $this->temp['heading_title_cell']);
     $out .= $this->temp['heading_title_cell'];
     // "next" month link
     if ($this->show_next_prev == TRUE) {
         $adjusted_date = $this->adjust_date($month + 1, $year);
         $url = $this->segments ? $this->next_prev_url . $adjusted_date['year'] . '/' . $adjusted_date['month'] : $this->next_prev_url . '?year=' . $adjusted_date['year'] . '&month=' . $adjusted_date['month'];
         $out .= str_replace('{next_url}', $url, $this->temp['heading_next_cell']);
     }
     $out .= $this->temp['heading_row_end'];
     // Write the cells containing the days of the week
     $out .= $this->temp['week_row_start'];
     $day_names = $this->get_day_names();
     for ($i = 0; $i < 7; $i++) {
         $out .= str_replace('{week_day}', $day_names[($start_day + $i) % 7], $this->temp['week_day_cell']);
     }
     $out .= $this->temp['week_row_end'];
     // Build the main body of the calendar
     while ($day <= $total_days) {
         $out .= $this->temp['cal_row_start'];
         for ($i = 0; $i < 7; $i++) {
             if ($day > 0 and $day <= $total_days) {
                 if (isset($data[$day])) {
                     $out .= ($is_current_month == TRUE and $day == $cur_day) ? $this->temp['cal_cell_start_content_today'] : $this->temp['cal_cell_start_content'];
                 } else {
                     $out .= ($is_current_month == TRUE and $day == $cur_day) ? $this->temp['cal_cell_start_today'] : $this->temp['cal_cell_start'];
                 }
                 $day_print = $this->day_month_format == 'long' ? str_repeat('0', 2 - strlen($day)) . $day : $day;
             } else {
                 $out .= $day == $cur_day ? $this->temp['cal_cell_start_other_today'] : $this->temp['cal_cell_start_other'];
                 if (!$this->next_prev_days) {
                     $day_print = '';
                     $data[$day] = '';
                 } elseif ($day < 1) {
                     $previous_date = $this->adjust_date($month - 1, $year);
                     $previous_month = $previous_date['month'];
                     $previous_year = $previous_date['year'];
                     // Determine the total days in the month
                     $total_previous_days = $this->get_total_days($previous_month, $previous_year);
                     $tmp_day = $total_previous_days + $day;
                     $day_print = $this->day_month_format == 'long' ? str_repeat('0', 2 - strlen($tmp_day)) . $tmp_day : $tmp_day;
                 } else {
                     $day_print = $this->day_month_format == 'long' ? str_repeat('0', 2 - strlen($day - $total_days)) . ($day - $total_days) : $day - $total_days;
                 }
             }
             if (isset($data[$day])) {
                 // Cells with content
                 $temp = ($is_current_month == TRUE and $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
                 $out .= str_replace('{day}', $day_print, str_replace('{content}', $data[$day], $temp));
             } else {
                 // Cells with no content
                 $temp = ($is_current_month == TRUE and $day == $cur_day) ? $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
                 $out .= str_replace('{day}', $day_print, $temp);
             }
             $out .= ($is_current_month == TRUE and $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end'];
             // replace pseudo variables day, month, year with their value for the day processed
             $out = str_replace('{day}', $day_print, $out);
             if ($day < 1) {
                 $out = str_replace('{month}', $previous_month, $out);
                 $out = str_replace('{year}', $previous_year, $out);
             } elseif ($day > $total_days) {
                 $next_date = $this->adjust_date($month + 1, $year);
                 $out = str_replace('{month}', $next_date['month'], $out);
                 $out = str_replace('{year}', $next_date['year'], $out);
             } else {
                 $out = str_replace('{month}', $month, $out);
                 $out = str_replace('{year}', $year, $out);
             }
             $day++;
         }
         $out .= $this->temp['cal_row_end'];
     }
     if ($this->bottom_days) {
         $out .= $this->temp['week_row_start'];
         $day_names = $this->get_day_names();
         for ($i = 0; $i < 7; $i++) {
             $out .= str_replace('{week_day}', $day_names[($start_day + $i) % 7], $this->temp['week_day_cell']);
         }
         $out .= $this->temp['week_row_end'];
     }
     $out .= $this->temp['table_close'];
     return $out;
 }