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


PHP calendar函数代码示例

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


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

示例1: testCalendar

 function testCalendar()
 {
     for ($year = 1998; $year <= 2010; $year++) {
         for ($month = 1; $month <= 12; $month++) {
             $this->info = "{$month}/{$year}";
             $this->assertEquals(5, count(calendar($month, $year)), '', 1);
         }
     }
 }
开发者ID:rbarrientos,项目名称:simple-php-framework,代码行数:9,代码来源:FunctionsTest.php

示例2: testCalendar

 function testCalendar()
 {
     for ($year = 1998; $year <= 2010; $year++) {
         for ($month = 1; $month <= 12; $month++) {
             $this->info = "{$month}/{$year}";
             $this->range(count(calendar($month, $year)), 4, 6);
         }
     }
 }
开发者ID:rahulSinha,项目名称:simple-php-framework,代码行数:9,代码来源:test.functions.inc.php

示例3: calendar_html

function calendar_html()
{
    $meses = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');
    //$fecha_fin=date('d-m-Y',time());
    $mes = date('m', time());
    $anio = date('Y', time());
    ?>
	<table style="width:200px;text-align:center;border:1px solid #808080;border-bottom:0px;" cellpadding="0" cellspacing="0">
	 <tr>
	  <td colspan="4">
	  	<select id="calendar_mes" onchange="update_calendar()">
		 <?php 
    $mes_numero = 1;
    while ($mes_numero <= 12) {
        if ($mes_numero == $mes) {
            echo "<option value=" . $mes_numero . " selected=\"selected\">" . $meses[$mes_numero - 1] . "</option> \n";
        } else {
            echo "<option value=" . $mes_numero . ">" . $meses[$mes_numero - 1] . "</option> \n";
        }
        $mes_numero++;
    }
    ?>
		</select>
	  </td>
	  <td colspan="3">
	  	<select style="width:70px;" id="calendar_anio" onchange="update_calendar()">
		 <?php 
    // años a mostrar
    $anio_min = $anio - 30;
    //hace 30 años
    $anio_max = $anio;
    //año actual
    while ($anio_min <= $anio_max) {
        echo "<option value=" . $anio_min . ">" . $anio_min . "</option> \n";
        $anio_min++;
    }
    ?>
		</select>
	  </td>
	 </tr>
	</table>
	<div id="calendario_dias">
	<?php 
    calendar($mes, $anio);
    ?>
	</div>
	<?php 
}
开发者ID:GabriMagic,项目名称:SinCoWick_web,代码行数:48,代码来源:functions.php

示例4: DreamCMS_plugins_calendar

function DreamCMS_plugins_calendar($arguments = "", $DreamCMS)
{
    $y = $_GET['y'];
    $m = $_GET['m'];
    list($nowy, $nowm) = explode('-', get_date('', 'Y-m'));
    $calendar = array();
    $calendar['year'] = !$y ? $nowy : $y;
    $calendar['month'] = !$m ? $nowm : $m;
    $calendar['days'] = calendar($calendar['month'], $calendar['year'], $DreamCMS);
    $calendar['nextmonth'] = $calendar['month'] + 1 > 12 ? 1 : $calendar['month'] + 1;
    $calendar['premonth'] = $calendar['month'] - 1 < 1 ? 12 : $calendar['month'] - 1;
    $calendar['nextyear'] = $calendar['year'] + 1;
    $calendar['preyear'] = $calendar['year'] - 1;
    $calendar['cur_date'] = get_date('', 'Y n.j D');
    _eval('file', $_SERVER['PHP_SELF']);
    _eval('calendar', $calendar);
    _print('calendar', 'plugins');
}
开发者ID:20000Hz,项目名称:bak-letvs,代码行数:18,代码来源:calendar.php

示例5: iCMS_plugins_calendar

function iCMS_plugins_calendar($vars, &$iCMS)
{
    $y = $_GET['y'];
    $m = $_GET['m'];
    list($nowy, $nowm) = explode('-', get_date('', 'Y-m'));
    $calendar = array();
    $calendar['year'] = $y ? $y : $nowy;
    $calendar['month'] = $m ? $m : $nowm;
    $calendar['days'] = calendar($calendar['month'], $calendar['year']);
    $calendar['nextmonth'] = $calendar['month'] + 1 > 12 ? 1 : $calendar['month'] + 1;
    $calendar['premonth'] = $calendar['month'] - 1 < 1 ? 12 : $calendar['month'] - 1;
    $calendar['nextyear'] = $calendar['year'] + 1;
    $calendar['preyear'] = $calendar['year'] - 1;
    $calendar['cur_date'] = get_date('', 'Y n.j D');
    $iCMS->value('SELF', __SELF__);
    $iCMS->value('calendar', $calendar);
    $iCMS->output('calendar', plugin::tpl('calendar'));
}
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:18,代码来源:function.php

示例6: checkbox

" name="segment_edit" id="segment_edit">
	<table cellpadding="0" cellspacing="0" class="data-input-table">
		<tr><td class="label-cell">Project</td><td><?php 
echo $project_dropdown;
?>
</td></tr>
		<tr><td class="label-cell">Worktype</td><td><?php 
echo $worktype_dropdown;
?>
</td></tr>
		<tr><td class="label-cell">Billable</td><td><?php 
echo checkbox('billable', $segment['billable']);
?>
</td></tr>
		<tr><td class="label-cell">Date</td><td><?php 
echo calendar('date', $segment['date']);
?>
</td></tr>
		<tr><td class="label-cell">Start Time</td><td><?php 
echo $time_start_dropdown;
?>
</td></tr>
		<tr><td class="label-cell">End Time</td><td><?php 
echo $time_end_dropdown;
?>
</td></tr>
<?php 
if ($tickets) {
    ?>
		<tr><td class="label-cell">Related Ticket</td><td><select name="ticket_id"><option value=""></option>
<?php 
开发者ID:priestd09,项目名称:neoinvoice,代码行数:31,代码来源:xhr_edit.php

示例7: calendar

} else {
    ?>
		<tr><td class="label-cell">Project</td><td><?php 
    echo $project_dropdown;
    ?>
 <span class="required">Required</span></td></tr>
		<?php 
}
?>
		<tr><td class="label-cell">Worktype</td><td><?php 
echo $worktype_dropdown;
?>
 <span class="required">Required</span></td></tr>
		<tr><td class="label-cell">Billable</td><td><input name="billable" type="checkbox" checked="checked" /></td></tr>
		<tr><td class="label-cell">Date</td><td><?php 
echo calendar();
?>
 <span class="required">Required</span></td></tr>
		<tr><td class="label-cell">Start Time</td><td><?php 
echo $time_start_dropdown;
?>
 <span class="required">Required</span></td></tr>
		<tr><td class="label-cell">End Time</td><td><?php 
echo $time_end_dropdown;
?>
 <span class="required">Required</span></td></tr>
<?php 
if ($tickets) {
    ?>
		<tr><td class="label-cell">Related Ticket</td><td><select name="ticket_id"><option value=""></option>
<?php 
开发者ID:priestd09,项目名称:neoinvoice,代码行数:31,代码来源:xhr_add.php

示例8: calendar_html

function calendar_html($meses, $dias)
{
    $dias_calendario = $dias;
    $meses = array($meses[0], $meses[1], $meses[2], $meses[3], $meses[4], $meses[5], $meses[6], $meses[7], $meses[8], $meses[9], $meses[10], $meses[11]);
    date_default_timezone_set('America/Santiago');
    $mes = date('m', time());
    $anio = date('Y', time());
    ?>
    <table style="width:200px;text-align:center;border:1px solid #808080;border-bottom:0px;margin-bottom: 0;" cellpadding="0" cellspacing="0">
        <tr>
            <td colspan="4">
                <select id="calendar_mes" onchange="update_calendar()">
<?php 
    $mes_numero = 1;
    while ($mes_numero <= 12) {
        if ($mes_numero == $mes) {
            echo "<option value=" . $mes_numero . " selected=\"selected\">" . $meses[$mes_numero - 1] . "</option> \n";
        } else {
            echo "<option value=" . $mes_numero . ">" . $meses[$mes_numero - 1] . "</option> \n";
        }
        $mes_numero++;
    }
    ?>
            </select>
        </td>
        <td colspan="3">
            <select style="width:70px;" id="calendar_anio" onchange="update_calendar()">
<?php 
    // años a mostrar
    $anio_min = $anio - 60;
    //hace 60 años
    $anio_max = $anio;
    //año actual
    while ($anio_max >= $anio_min) {
        echo "<option value=" . $anio_max . ">" . $anio_max . "</option> \n";
        $anio_max--;
    }
    ?>
            </select>
        </td>
    </tr>
</table>
<div id="calendario_dias">
<?php 
    calendar($mes, $anio, $dias_calendario);
    ?>
</div>
    <?php 
}
开发者ID:jordanbarriap,项目名称:app,代码行数:49,代码来源:functions.inc.php

示例9: calendar_insert

function calendar_insert($content)
{
    if (preg_match('/\\{CALENDAR*.+\\}/', $content)) {
        $cat_list = preg_split('/\\{CALENDAR\\;/', $content);
        if (sizeof($cat_list) > 1) {
            $cat_list = preg_split('/\\}/', $cat_list[1]);
            $cat_list = $cat_list[0];
            $cal_output = calendar($cat_list);
        } else {
            $cal_output = calendar();
        }
        $content = preg_replace('/\\{CALENDAR*.+\\}/', $cal_output, $content);
    }
    return $content;
}
开发者ID:NerdyDillinger,项目名称:ovrride,代码行数:15,代码来源:calendar.php

示例10: calendar

<input type="text" name="lang[states]" value="<?php 
    print $lang['states'];
    ?>
" class="text" /><br />
<input type="submit" value="Update" name="lang[submit]" class="submit" />
</form>


<?php 
} else {
    ?>

<p>To edit please click on a date cells, choose state and submit your changes.</p>
<form name="myform" method="post">
<?php 
    calendar($cyear, 1);
    ?>
</form>


<?php 
}
?>

<div id="footer" style="padding: 15px 7px;">
<div id="feedcontainer" style="float: left; width: 250px;">
  <?php 
getFeed("http://feeds.kreci.net/KreCiBlogger");
?>
</div>
<div id="foot" style="float: left; width: 500px;">
开发者ID:AppacusInc,项目名称:razanj,代码行数:31,代码来源:admin.php

示例11: calendar

        $params['link_before_date'] = 0;
    }
    $params['link_on_day'] = $base_url;
    $params['font_face'] = "Verdana, Arial, Helvetica";
    $params['font_size'] = 10;
    $params['bg_color'] = "#FFFFFF";
    $params['today_bg_color'] = "#FF0000";
    $params['font_today_color'] = "#000000";
    $params['font_color'] = "#000000";
    $params['font_nav_bg_color'] = "#AAAAAA";
    $params['font_nav_color'] = "#000000";
    $params['font_header_color'] = "#00FF00";
    $params['border_color'] = "#000000";
    $params['use_img'] = 1;
    echo "<div class='row'>";
    echo calendar($date);
    $form_action = "./select.php?what=calendrier&caller={$caller}&date_caller={$date_caller}&param1={$param1}&param2={$param2}&after={$after}&date_anterieure={$date_anterieure}&format_return={$format_return}&auto_submit={$auto_submit}";
    $date = formatdate_input($date_caller);
    $form_directe_date = date_directe($date, $form_action, $format_return);
    echo "{$form_directe_date}";
    echo "</div>";
}
function date_directe($date, $post_url, $format_return = "OUT")
{
    global $link_on_day, $params, $base_url, $caller, $msg, $date_caller;
    global $dbh;
    global $msg;
    $calend = <<<ENDOFTEXT
\t<script type='text/javascript' src='./includes/javascript/http_request.js'></script>
\t<script language="JavaScript">
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:30,代码来源:calendrier.inc.php

示例12: process


//.........这里部分代码省略.........
            //	include("macros/".$matches[1][$index].".inc");
            //	$macros[$macro] = new $macro($dataSource, $_EXTRAS);
            //} else {
            //	$return = "Macro ".$matches[1][$index]." not defined";
            //}
        } elseif ($command == "LIST") {
            $dir = opendir("macros");
            while ($line = readdir($dir)) {
                if (substr($line, -4) != ".inc") {
                    continue;
                }
                $return .= "* {$line}\n";
            }
        } elseif (!isset($macros[$macro])) {
            $return = "Macro {$macro} used before defined!";
        } elseif (!in_array($command, get_class_methods($macro))) {
            $return = "Macro {$macro} cannot execute {$command}";
        } else {
            #$return = call_user_func(array($macro, $command));
            if ($params) {
                $return = $macros[$macro]->{$command}($params);
            } else {
                $return = $macros[$macro]->{$command}();
            }
        }
        #$text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text);
        $text = str_replace($matches[0][$index], $return, $text);
        $_EXTRAS[$matches[1][$index]] = $matches[2][$index];
    }
    // [[MACRO|macroname]]
    // [[CAL|year-mm-dd|Event]]
    preg_match_all("/\\[\\[CAL\\|(....)\\-(..)\\-(..)\\|(.*?)\\]\\]/", $text, $matches);
    $i = 0;
    $calendar = array();
    $caltext = "";
    foreach ($matches[0] as $index => $match) {
        $link = preg_replace("/(\\W)/", "", $matches[4][$index]);
        $text = str_replace($matches[0][$index], "<a name=\"" . $link . "\"></a>", $text);
        $calendar[$matches[1][$index]][$matches[2][$index]][$matches[3][$index]] = $matches[4][$index];
    }
    preg_match_all("/\\[\\[VAR\\|(.*?)\\]\\]/", $text, $matches);
    foreach ($matches[0] as $index => $match) {
        if (isset($_EXTRAS[$matches[1][$index]])) {
            $var = $_EXTRAS[$matches[1][$index]];
        } else {
            $var = '[ERR: ' . $matches[1][$index] . ' Undefined]';
        }
        #$text = preg_replace("#".preg_quote($match,"#")."#",$var, $text);
        $text = str_replace($match, $var, $text);
    }
    foreach ($calendar as $year => $ydata) {
        #ksort($ydata);
        $months = array_keys($ydata);
        foreach (range(min($months), max($months)) as $month) {
            if ($month < 10) {
                $month = "0" . $month;
            }
            #foreach($ydata as $month => $mdata){
            $mdata = $ydata[$month];
            $caltext .= calendar($mdata, $month, $year);
        }
    }
    $links = array();
    /*preg_match_all("/\(\(([.|\|]*?)\)\)/", $text, $matches);
    	foreach($matches[1] as $index => $title){
    		$link = preg_replace("/(\W)/", "", ucwords($matches[2][$index]));
开发者ID:aquarion,项目名称:AqWiki,代码行数:67,代码来源:wiki.inc.php

示例13: htmlHeader

 function htmlHeader($title)
 {
     $htmlCode = metaTags() . titleTag($title) . siteCSS() . jquery() . checkboxStyling() . styledFileUpload() . customJquery() . tooltips() . calendar() . pngFix() . tinyMceEditor() . treeMenu() . fancyBox();
     return $htmlCode;
 }
开发者ID:carloshrbezerra,项目名称:a-ton-tour,代码行数:5,代码来源:template_helper.php

示例14: calendar

    if (!$info['name']) {
        $info['name'] = NONAME;
    }
    $info['edit_link'] = ADMIN_URL . "?p={$part}&news_id={$info['news_id']}{$date_ref}";
    $info['del_link'] = "";
    $info['icount'] = 0;
    if ($i = check_news($info['news_id'])) {
        $info['icount'] = $i;
    } else {
        $info['del_link'] = ADMIN_URL . "?p={$part}&del_news={$info['news_id']}{$date_ref}";
    }
    $newss[] = $info;
}
$replace['newss'] = $newss;
$replace['news_id'] = $news_id;
$replace['calendar'] = calendar($sy, $sm, 'templ/calendar.htm', "?p={$part}", 0);
$left_menu = get_template('templ/news_list.htm', $replace);
if ($news_id) {
    $sql = mysql_query("SELECT * FROM " . TABLE_NEWS . " WHERE news_id='{$news_id}'") or Error(1, __FILE__, __LINE__);
    if ($news = @mysql_fetch_array($sql)) {
        $news['name'] = htmlspecialchars($news['name'], ENT_COMPAT, 'cp1251');
        $news['public_select'] = array_select('public', array(0 => 'Нет', 1 => 'Да'), $news['public'], 0);
        $news['date_select'] = date_select($news['date'], 'd', 'm', 'y', 2, 2);
        $news['date'] = $date;
        $news['sy'] = $sy;
        $news['sm'] = $sm;
        $tinymce_elements = 'description,descr';
        $tinymce_head = get_template('templ/tinymce_head.htm', array('tinymce_elements' => $tinymce_elements));
        $news['description'] = htmlspecialchars($news['description'], ENT_COMPAT, 'cp1251');
        $news['descr'] = htmlspecialchars($news['descr'], ENT_COMPAT, 'cp1251');
        $content = get_template('templ/news.htm', $news);
开发者ID:nikuha,项目名称:rs,代码行数:31,代码来源:news.php

示例15: build_mods


//.........这里部分代码省略.........
                $ret = divc($pbdy_css, $in);
            }
            break;
        case 'stats':
            $ret = plugin('stats', '', '');
            break;
        case 'archives':
            if ($p == 1) {
                $p = $m;
            }
            if ($p) {
                $ret = btn($ptit_css, $p);
            }
            $in = divd("archives", m_archives(""));
            $ret .= balc('ul', $pbdy_css, $in);
            break;
        case 'agenda':
            $load = sql('ib,msg', 'qdd', 'kv', 'val="agenda"');
            $tim = time();
            if ($load) {
                foreach ($load as $k => $v) {
                    if (strtotime($v) < $tim) {
                        unset($load[$k]);
                    }
                }
            }
            break;
        case 'folders_varts':
            $load = mod_varts($p);
            break;
        case 'panel_arts':
            $ret = plugin_func('panart', 'panart_build', $p);
            break;
        case 'calendar':
            $in = calendar(ses('daya'));
            if ($p == 1) {
                $p = $m;
            }
            if ($p) {
                $ret = btn($ptit_css, $p);
            }
            $ret .= divc($pbdy_css, $in);
            break;
        case 'newsletter':
            if ($o) {
                $ret = call_plug($ptit_css, 'popup', 'mailist', $p, $p) . ' ';
            } else {
                $ret = plugin('mailist', '', $p);
            }
            break;
        case 'bridge':
            $_GET['urlsrc'] = $p = 'http://' . $p . '/' . ajx($t, 1);
            $rea = vacuum($p, '');
            $po['suj'] = $rea[0];
            $po['msg'] = format_txt($rea[1], 3, $id);
            $po['source'] = picto('link') . ' ' . pub_link($p);
            $ret = template($po, '');
            break;
        case 'columns':
            $ret = mod_columns($p, $o);
            break;
            //users
        //users
        case 'login':
            $ret = login_btn($p, $o);
            break;
开发者ID:philum,项目名称:cms,代码行数:67,代码来源:mod.php


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