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); } } }
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); } } }
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 }
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'); }
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')); }
" 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
} 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
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 }
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; }
<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;">
<tr><td class="label-cell">Invoice Amount</td><td>$</td><td><input name="amount" value="<?php echo $invoice['amount']; ?> " maxlength="8" class="textual" /></td></tr> <tr><td class="label-cell">Already Paid</td><td> </td><td><?php echo checkbox('paid', $invoice['paid'], '', "checkboxToggleElementVisibility(this, 'paidDateToggle');"); ?> <small>Has the client already paid this invoice?</small></td></tr> <tr id="paidDateToggle"<?php if (!$invoice['paid']) { ?> style="visibility: hidden;"<?php } ?> ><td class="label-cell">Paid Date</td><td> </td><td><?php echo calendar('paiddate', $invoice['paiddate']); ?> <span class="required">Required (YYYY-MM-DD)</span></td></tr> <tr><td class="label-cell">Itemize Segments</td><td> </td><td><?php echo checkbox('itemize', $invoice['itemize']); ?> <small>Do you want to show the client the time segments?</small></td></tr> <tr><td class="label-cell">Already Sent</td><td> </td><td><?php echo checkbox('sent', $invoice['sent']); ?> <small>Have you already notified the client?</small></td></tr> <tr><td class="label-cell">Automatic Reminders</td><td> </td><td><?php echo checkbox('remind', $invoice['remind']); ?> <small>Should we email a reminder at 7 and 2 days?</small></td></tr> <tr><td class="label-cell"> </td><td> </td><td><input type="submit" value="Save Invoice" class="button" /></td></tr>
$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}¶m1={$param1}¶m2={$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">
function process($text, $wiki) { global $dataSource; global $_EXTRAS; global $_CONFIG; $text = $text . "\n\n"; if ($_CONFIG['oneWiki']) { $base = $_CONFIG['base']; } else { $base = $_CONFIG['base'] . "/" . $wiki; } function stripSpaces($text) { return ereg_replace("/[:space:]/", "", $text); } /*// Conditional includes preg_match_all("/\[\[IFEDIT\|(.*?)\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ $result = $matches[1][$index]; if (checkAuth("edit")){ $text = preg_replace("#".preg_quote($match,"#")."#",$result,$text); } else { $text = preg_replace("#".preg_quote($match,"#")."#","Can't Edit",$text); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\[\[IfLoggedIn\|(.*?)\|(.*?)\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ $result = $matches[1][$index]; if (isset($_EXTRAS['me'])){ $text = preg_replace("#".preg_quote($match,"#")."#",$matches[1][$index],$text); } else { $text = preg_replace("#".preg_quote($match,"#")."#",$matches[2][$index],$text); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\[\[IFEDIT\|(.*?)\|(.*?)\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ if (checkAuth("edit")){ $text = preg_replace("#".preg_quote($match,"#")."#", $matches[1][$index],$text); } else { $text = preg_replace("#".preg_quote($match,"#")."#", $matches[2][$index],$text); } #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; }*/ preg_match_all("/\\[\\[INCLUDE\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $include = $dataSource->getContent($matches[1][$index]); $text = preg_replace("#" . preg_quote($match, "#") . "#", $include, $text); } // Set Variables preg_match_all("/\\[\\[SETVAR\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); // [[CALC|var|value]] foreach ($matches[0] as $index => $match) { $text = preg_replace("#" . preg_quote($match, "#") . "#", "", $text); $_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } preg_match_all("/\\[\\[CALC\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); // [[CALC|var|opp]] foreach ($matches[0] as $index => $match) { $text = preg_replace("#" . preg_quote($match, "#") . "#", "<!-- Calculate functions removed -->", $text); #$eval = "\$_EXTRAS[".$matches[1][$index]."] = \$_EXTRAS[".$matches[1][$index]."] ".$matches[2][$index].";"; #eval($eval); #$_EXTRAS[$matches[1][$index]] = eval($eval); } preg_match_all("/\\[\\[RCALC\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); // [[RCALC|ropp|var]] foreach ($matches[0] as $index => $match) { $text = preg_replace("#" . preg_quote($match, "#") . "#", "<!-- Calculate functions removed -->", $text); #$eval = "\$_EXTRAS[".$matches[2][$index]."] = ".$matches[1][$index]." \$_EXTRAS[".$matches[2][$index]."];"; #eval($eval); #$_EXTRAS[$matches[1][$index]] = eval($eval); } preg_match_all("/\\[\\[VAR\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $var = $_EXTRAS[$matches[1][$index]]; $text = preg_replace("#" . preg_quote($match, "#") . "#", $var, $text); } #$text = preg_replace("/\[\[SEARCH\|(.*?)\]\]/",searchFor($wiki,'\1'), $text); #$text = preg_replace("/\[\[ALLBY\|(.*?)\]\]/",searchAuthor($wiki,'\1'), $text); if (preg_match("#\\[\\[RECENT\\]\\]#", $text)) { $text = str_replace("[[RECENT]]", recent($wiki), $text); } if (preg_match("/\\[\\[INDEX\\]\\]/", $text)) { $text = str_replace("[[INDEX]]", index(), $text); } preg_match_all("/\\[\\[LOCKED\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $users = $matches[1][$index]; doAuth($users, "view this"); $users_array = explode(',', $users); if (count($users_array) == 1) { $users_text = $users; } else { $last = array_pop($users_array); $users_text = implode(", ", $users_array) . ' & ' . $last; } $text = preg_replace("#" . preg_quote($match, "#") . "#", '<div class="locked">Page is locked to ' . $users_text . ' </div>', $text); } // Search for User preg_match_all("/\\[\\[ALLBY\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $result = author($matches[1][$index]); $text = preg_replace("#" . preg_quote($match, "#") . "#", $result, $text); #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } // Search for Arbitaty preg_match_all("/\\[\\[SEARCH\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $datum = $matches[1][$index]; $result = $dataSource->search($datum); $text = preg_replace("#" . preg_quote($match, "#") . "#", $result, $text); #$_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } /*// [[MACRO|macroname|arguments]] preg_match_all("/\[\[MACRO\|(.*?)\|(.*?)\\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ #print_r($matches); if (file_exists("macros/".$matches[1][$index].".inc")){ ob_start(); $var = $matches[2][$index]; include("macros/".$matches[1][$index].".inc"); $return = ob_get_contents(); ob_end_clean(); } else { $return = "Macro ".$matches[1][$index]." not defined"; } $text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text); $_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } // [[MACRO|macroname]] preg_match_all("/\[\[MACRO\|(.*?)\\]\]/", $text, $matches); foreach($matches[0] as $index => $match){ #print_r($matches); if (file_exists("macros/".$matches[1][$index].".inc")){ ob_start(); include("macros/".$matches[1][$index].".inc"); $return = ob_get_contents(); ob_end_clean(); } else { $return = "Macro ".$matches[1][$index]." not defined"; } $text = preg_replace("#".preg_quote($matches[0][$index],"#")."#",$return,$text); $_EXTRAS[$matches[1][$index]] = $matches[2][$index]; } */ //New Macros code $macros = array(); // [[MACRO|macroname|arguments]] preg_match_all("/\\[\\[MACRO\\|(.*?)\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { #print_r($matches); $return = ""; $macro = $matches[1][$index]; $command = $matches[2][$index]; $params = false; if ($pos = strpos($command, '|')) { $params = explode(',', substr($command, $pos + 1)); $command = substr($command, 0, $pos); } debug("Macro: {$macro}: {$command}"); if (!isset($macros[$macro])) { if (file_exists("macros/" . $matches[1][$index] . ".inc")) { include "macros/" . $matches[1][$index] . ".inc"; $macros[$macro] = new $macro($dataSource, $_EXTRAS); } } if (!isset($macros[$macro])) { // Macro load failed. $return = "*!!Macro " . $matches[1][$index] . " not defined!!*"; } elseif ($command == "INIT") { // Explicit INIT disabled //if (file_exists("macros/".$matches[1][$index].".inc")){ // 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])); $links[] = array($matches[0][$index], $link, $title); }*/ preg_match_all("/\\(\\((.*?)\\)\\)/", "\n" . $text . "\n", $matches); foreach ($matches[1] as $index => $title) { if (!strpos($matches[1][$index], "|")) { $link = preg_replace("/(\\W)/", "", $title); #$links[] = array($matches[0][$index],$link, $title); } else { $bang = explode("|", $matches[1][$index]); $link = preg_replace("/(\\W)/", "", $bang[1]); $title = $bang[0]; } if ($title[0] == '~') { $link = '~' . $link; } $links[] = array($matches[0][$index], $link, $title); } foreach ($links as $index => $matches) { $replace = preg_quote($matches[0], '/'); $stripped = $matches[1]; $title = $matches[2]; if ($title[0] == '~') { $title = substr($title, 1); #$link = "%(uncreated)".$title."\"?\":".$base."/".$stripped."?action=edit%"; #$link = "\"".$title."\":".$base."/".$stripped; $link = userLink($title); } elseif (!$dataSource->pageExists($stripped)) { #$link = "%(uncreated)".$title."\"?\":".$base."/".$stripped."?action=edit%"; #$link = "\"".$title."\":".$base."/".$stripped; $link = '<a href="' . $base . "/" . $stripped . '" class="uncreated wiki" title="Uncreated article ' . $title . '">' . $title . '</a>'; } else { #$link = "\"".$title."\":".$base."/".$stripped; $link = '<a href="' . $base . "/" . $stripped . '" class="wiki" title="Internal link to article ' . $title . '">' . $title . '</a>'; } #$link = "\"".$match."\":".$base."/".$stripped; #echo $replace; $text = preg_replace("/(\\W|^)" . $replace . "(\\W)/", "\$1{$link}\$2", $text); #$text = preg_replace("/(\W|^)".$replace."(\W)/","$1|$replace|$2", $text); } //preg_match_all("/<aqWikiNoProcess>(.*?)<\/aqwikiNoProcess>/m",$text, $matches); $text = str_replace("\n", '[[BR]]', $text); $text = str_replace("\r", '', $text); preg_match_all("/<aqWikiNoProcess>(.*?)<\\/aqWikiNoProcess>/", $text, $matches); foreach ($matches[0] as $index => $match) { $id = uniqid(); $EXTRAS['noProcess'][$id] = $matches[1][$index]; #$text = preg_replace("#".preg_quote($match,"#")."#",'[[NOPROCESS|'.$id.']]',$text); $text = str_replace($match, '[[NOPROCESS|' . $id . ']]', $text); } $text = str_replace("[[BR]]", "\n", $text); $text = textile($text); #$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]\"/]", "<a href=\"\\0\">\\0</a>", $text); #$text = preg_replace("#<a href=\"<a href=\"(.*)\">(.*)\"</a>>(.*)</a>#","<a href=\"$1\">$3</a>",$text); $text = preg_replace("/\\[CC\\](.*?)\\[CC\\]/", "((\$1))", $text); $text = preg_replace("/\\[CMD\\](.*?)\\[CMD\\]/", "[[\$1]]", $text); $text = str_replace('[[CAL]]', "<div class=\"calendar\">" . $caltext . "</div>", $text); if (!isset($_EXTRAS['textarea'])) { $_EXTRAS['textarea'] = ""; } $text = preg_replace("/\\[\\[TEXTAREA\\]\\]/", $_EXTRAS['textarea'], $text); $text = str_replace('[[TEXTAREA]]', $_EXTRAS['textarea'], $text); preg_match_all("/\\[\\[RAWVAR\\|(.*?)\\]\\]/", $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 = str_replace($match, $var, $text); } preg_match_all("/\\[\\[NOPROCESS\\|(.*?)\\]\\]/", $text, $matches); foreach ($matches[0] as $index => $match) { $id = $matches[1][$index]; $text = str_replace($match, $EXTRAS['noProcess'][$id], $text); } $text = str_replace("[[BR]]", "\n", $text); return $text; }
function htmlHeader($title) { $htmlCode = metaTags() . titleTag($title) . siteCSS() . jquery() . checkboxStyling() . styledFileUpload() . customJquery() . tooltips() . calendar() . pngFix() . tinyMceEditor() . treeMenu() . fancyBox(); return $htmlCode; }
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);
function build_mods($r) { //p($r); $ptit_css = 'txtcadr'; $pbdy_css = 'panel'; $smcss = 'small'; //mod,param,title,condition,command,option,(bloc),hide,template,nobr,div,ajxbtn list($m, $p, $t, $c, $d, $o, $ch, $hd, $tp, $nbr, $dv, $jbt) = $r; $t = stripslashes($t); switch ($m) { //main case 'LOAD': if ($_SESSION['read']) { $ret = art_read($tp); } else { $ret = api_arts($_SESSION['frm'], $o, $tp); } break; case 'Page_titles': $ret = page_titles($o); break; case 'All': $api = api_arts_rq($p, $o); $api['t'] = $t ? $t : nms(100); break; case 'category': if ($p == 1 && $_SESSION['frm'] == 'Home') { $p = 'All'; } $ret = api_arts($p, $o, $tp); break; case 'Board': $ret = collect_board($p); break; case 'plan': $ret = arts_plan($m, $p); break; case 'Hubs': $ret = arts_plan($m, $p); break; case 'gallery': $ret = arts_plan($m, $p); break; case 'tracks': $ret = trkarts($p, $t); break; //api_tracks($t) //api_tracks($t) case 'MenusJ': $ret = ajxlink($p, 'mjx', $o, $d); break; //case('Wall'): $ret=wall_arts($t,$p); break; //case('Wall'): $ret=wall_arts($t,$p); break; case 'api': $ret = plugin('apicom', str_replace(';', ',', $p), $o); break; case 'api_mod': $api = api_defaults_rq(explode_k(str_replace(';', ',', $p), ',', ':')); break; //:, //:, case 'api_arts': $api = api_mod_arts($p, $t, $tp); if ($d == 'panel') { $api['cmd'] = $d; } $api['cols'] = $o; break; //&= //&= case 'articles': $load = api_mod_arts_row($p); $obj = 1; break; //&= //case('articles'): $api=api_mod_rq($p.'&t=x'); break;//&= //&= //case('articles'): $api=api_mod_rq($p.'&t=x'); break;//&= case 'tab_mods': $ret = tab_mods($p); break; case 'last': $ret = art_read_b('last', $n, 3, ''); break; case 'player': $ret = flash_prep('', $p); break; case 'friend_art': $ret = friend_art($o); break; case 'friend_rub': $ret = friend_rub($o); break; case 'related_arts': $load = related_art(); break; case 'related_by': $load = related_art_by(); break; case 'prev_next': $ret = prevnext_art($d, $p, $o); break; case 'cat_arts': $p = $p != 1 ? $p : $_SESSION['frm']; $t = $t != $m ? $t : $p; $load = tri_rqt($p, 1, $_SESSION['dayx']); break; case 'priority_arts': $load = tri_rqt($p, 11); $t = $t != $m ? $t : $p; break; case 'recents': $load = recents_arts($p, $o); $obj = 1; break; case 'read': $ret = divc($o, read_msg($p, 3)); break; case 'popart': $ret = pop_art($p); break; case 'pub_art': $ret = pub_art_b($p, $o); break; case 'pub_arts': $load = array_flip(explode(' ', $p)); break; case 'pub_img': $ret = pub_img($p); break; case 'taxo_arts': $load = taxo_arts($p); if ($t > 1) { $t = suj_of_id($t); } break; case 'taxo_nav': $ret = plugin('taxonav', $p, $o); break; case 'read_art': $ret = read_art($p, $t); $t = ''; break; case 'short_arts': $load = short_arts($p); if ($o <= 3) { $prw = $o; } break; case 'most_read': $ret = most_read_mod($p, $t, $d, $o, $m, $tp); $t = ''; break; case 'same_title': $load = same_title(); break; case 'deja_vu': if ($_SESSION['mem']) { $load = $_SESSION['mem']; } break; //com //com case 'rss_input': if ($p) { $ret = rssin(ajx($p, 1)); } break; case 'disk': require_once 'ajxf.php'; $_SESSION['dlmod'] = $p; if ($p && $p != '/') { $pb = '/' . $p; } $ret = divd('dsnavds', ds_nav('dl', 'users/' . ses('qb') . $pb)); break; case 'finder': $ra = array('|', '-'); $p = str_replace($ra, '/', $p); $o = str_replace($ra, '/', $o); req('finder'); $ret = finder($p, $o, $d); break; case 'channel': $ret = plugin('channel', $p, $t, $d, $o); $t = ''; break; case 'hour': setlocale(LC_TIME, "fr_FR"); //%A%d%B%G%T if ($p) { $dat = strftime($p ? $p : '%y%m%d:%H%M', $_SESSION['dayx']); } else { $dat = mkday('', 1); } if (!$d) { $ret = btn($o, $dat); } else { $ret = divc($o, $dat); } break; case 'cart': $ret = lkc("txtcadr", "/?plug=cart", $p != 1 ? $p : "Cart"); $ret = divd('cart', m_pubart($_SESSION['cart'], 'scroll', 7)); break; case 'video': $ret = video_auto($p, '', '', 3); break; case 'video_playlist': $load = videoplaylist($p); $obj = 1; $prw = 'vd'; break; case 'video_viewer': $ret = videoboard($p, $c, $o); break; //txt //txt case 'text': $ret = stripslashes(urldecode($p)); if ($o) { $ret = divc($o, $ret); } break; case 'connector': if (substr($p, 0, 1) != "[" && substr($p, -1, 1) != "]") { $p = '[' . $p . ']'; } $ret = nl2br(format_txt_r($p, '', '')); if ($o == 'article') { $ret = balc('article', 'justy', format_txt($p, '', '')); } break; case 'codeline': if ($p) { $ret = correct_txt($p, "", 'codeline'); } break; case 'clear': $ret = divc("clear", ""); break; case 'hr': $ret = '<hr' . atc($p) . ' />'; break; case 'br': $ret = br(); break; //menus //case('ajax'): $ret=lj('',$p,$t); break; //menus //case('ajax'): $ret=lj('',$p,$t); break; case 'conn': $ret = connectors($p, $o, ''); break; case 'link': if ($d == 'noli') { $ret = special_link($p, $o); } else { if (strpos($p, '§')) { list($p, $t) = split_one('§', $p, 0); } $lin[] = mod_link_r($p, $t); } break; case 'user_menu': $ret = user_menu($p); break; //mod_link //mod_link case 'app_link': $ret = read_apps_link($p, $d, $o); break; case 'app_menu': $r = build_apps($p, $d); $ra = m_apps($r, 'menu', ''); if ($o == 'icons') { $ret = desktop_build_ico($ra, 'icones'); } else { $ret = app_list($ra, '', $o); } $ret .= divc('clear', ''); break; case 'app_popup': Head::add('jscode', sj(read_apps(explode(',', $p)))); break; case 'categories': $line = $_SESSION['line']; if ($line) { ksort($line); $d = $d ? $d : 'lines'; if ($d == 'cols' && !$o) { $o = 4; } if ($o == 'home') { $lin[] = array($_GET['module'], 'module', 'Home', 'Home'); } foreach ($line as $k => $va) { if ($o == 'nb') { $ka = $k . ' (' . $va . ')'; } else { $ka = $k; } $lin[] = array($_SESSION['frm'], 'cat', $k, $ka); } } break; case 'overcats': req('bubs'); return mkbub(bub_root('overcat', 'zero'), 'inline', '1'); break; case 'MenuBub': req('bubs'); return mkbub(bub_root('menubub', 'zero'), 'inline', '1'); break; case 'timetravel': return timetravel($p, $o); break; case 'submenus': return bubble_menus($p, $o); break; case 'taxonomy': $ret = taxonomy($p, $o); break; case 'rub_taxo': $ret = rub_taxo($p, $t); $t = ''; break; case 'folders': $load = supertriad_ask(); $prw = $o; $obj = 63; break; case 'desk': $ret = deskmod($p); break; case 'desktop_arts': $ret = title($t) . desktop_arts($p, $o, 'arts'); break; case 'desktop_varts': $ret = title($t) . desktop_arts($p, $o, 'varts'); break; case 'desktop_files': $ret = title($t) . desktop_arts($p, $o, 'files'); break; case 'hierarchics': $in = m_suj_hierarchic('active', ''); $ret = balc("ul", $pbdy_css, $in); break; //cacheable //cacheable case 'hubs': $mn = $_SESSION['mn']; if (count($mn) >= 2) { $t = $p != 1 ? $p : $t; if ($t) { $t = lkc('', htac('module') . 'hubs', $t); } $in = m_nodes_b($mn, $o); $ret = balc("ul", $pbdy_css, $in); } break; case 'tags': if ($t) { $t = lkc('', '/plugin/tags/' . $p . '/1', $t); } $lin = tag_mod($p, $o, $d); break; case 'tags_cloud': $p = $p ? $p : 'tag'; $ret = btn($ptit_css, lkc('', "/plug/tags", $p)); $line = tags_list($p, ses('nbj')); $in = tags_cloud($line, 10, 22, ' ', $p); $ret .= divc($pbdy_css, $in); break; case 'tag_arts': list($p, $o) = split_one(':', $p); $load = tag_arts($p, $o); break; case 'last_tags': $lin = last_tags($p, $o, $d); break; case 'classtag_arts': $load = classtag_arts($p); break; //class find id//$o=$p; //class find id//$o=$p; case 'see_also-tags': $r = see_also_tags($p ? $p : 'tag'); if ($r) { $ret = see_also($r, $p, $d, $o, $tp); } break; case 'see_also-rub': $t = $p != 1 ? $p : $_SESSION['frm']; if ($_GET['read']) { $load = see_also_rub($p); } break; case 'see_also-source': list($load, $t) = see_also_source($o); break; case 'siteclics': $ret = siteclics($p); break; case 'rub_tags': $ret = rub_tags($p); break; case 'sources': if ($t) { $t = lkc('', '/module/source', $t); } $lin = art_sources($p); break; case 'msql_links': if ($o == 'rss') { $l = '/?plug=rssin&rssurl='; } elseif ($o == 'mail') { $l = 'mailto:'; } else { $l = ''; } $ret = msql_links($p, $o, $l, $d, $t); $t = ''; break; case 'rss': $ret .= balc('ul', 'panel', divd('rssj', rssj($p ? $p : 'rssurl', $o))); break; case 'rssin': $ret .= rssj_m($p, $o); break; case 'chat': if ($t) { $t = ljb('', 'SaveD', 'cht' . $p . '_chat_' . $p, $t); } $p = $p != 1 ? $p : 'pub'; $in = plugin('chat', $p, $o ? $o : 10); if ($in) { $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; case 'login_popup': $ret = login_btn_p($p, $o); break; case 'log-out': if (ses('USE')) { $ret .= lkc($smcss, '/logout', picto('logout')) . ' '; } break; case 'search_form': $ret = search_btn($p, $o, '', $d); break; case 'search': $load = plugin_func('search', 'rech', $p, $o); break; case 'social': $ret = plugin('social', $p, $o); break; //banner //banner case 'Banner': $ret = make_ban($p, $t, $o); break; case 'ban_art': if ($p != 1) { $ret .= lka(subdom(ses('qb')), read_msg($p, '')); } break; //footer //footer case 'credits': $ret = lj('bevel', 'popup_about', picto('phi2')); break; case 'admin': $ret = lkc($smcss, '/admin/log/open', $t ? $t : picto('admin')) . ' '; $t = ''; break; case 'chrono': $ret = btn('txtsmall2', round(mtime() - $_SESSION['stime'], 2) . 's') . ' '; break; case 'contact': $ret = contact($p, $o ? $o : $smcss) . ' '; break; //plugs //plugs case 'taxonav': return plugin('taxonav', $p, $t); $t = ''; break; case 'iframe': $ret = plugin('ifram', '', ''); break; case 'suggest': $ret = pluginside(nms(126), 'suggest', $p, $o); break; case 'create_art': $ret = f_inp('', ''); break; case 'twitter': if ($p) { $ret = plugin('twitter', $p, $o); } break; case 'profil': $ret = plugin_func('profil', $p, $o); break; //special //special case 'BLOCK': $ret = build_modules($p, ''); break; case 'module': $ret = build_mod_r($p); break; case 'command': $ret = com_mod($p); break; case 'plug': list($pp, $po) = split('-', $o); $ret = plugin($p, $pp, $po); break; case 'pluf': list($pp, $po) = split('-', $p); list($op, $oo) = split('-', $o); $ret = plugin_func($pp, $po, $op, $oo); break; case 'plup': return lj('', 'popup_plupin___' . $p . '_' . $o . '_', $t ? $t : $p); break; case 'close': $ret = ''; default: if ($p && $m) { $reb = connectors($p . ($o ? '§' . $o : '') . ':' . $m, "", ""); } if ($reb && $reb != '[' . $p . ':' . $m . ']') { $ret = $reb; } else { $reb = plugin($m, $p, $o); if ($reb) { $ret = build_titl('', $t ? $t : $m, '') . $reb; } } break; } //menus if ($lin) { $ret = mod_lin($lin, $t, $d, $o); } //arts if ($load) { $ret = mod_load($load, $ret, $t, $d, $o, $obj, $prw, $tp, $id); } //api if ($api) { $ret = api_load($api); } //umods if (!$ret && !$lin && !$load && $p && $m) { //user_mods $func = msql_read('', $_SESSION['qb'] . '_modules', $m); if ($func && !is_array($func)) { $ret = cbasic($func, $p); } } if (!$nbr) { $br = br(); } if ($ret) { if ($dv) { return divc('mod', $ret) . $br; } else { return $ret . $br; } } }
<tr><td class="label-cell">Project</td><td><?php echo $project_dropdown; ?> </td></tr> <tr><td class="label-cell">Expense Type</td><td><?php echo $expensetype_dropdown; ?> </td></tr> <tr><td class="label-cell">Billable</td><td><?php echo checkbox('billable', $expense['billable']); ?> </td></tr> <tr><td class="label-cell">Expense Amount</td><td>$<input name="amount" value="<?php echo $expense['amount']; ?> " class="textual" /></td></tr> <tr><td class="label-cell">Date</td><td><?php echo calendar('date', $expense['date']); ?> </td></tr> <tr><td class="label-cell" valign="top">Notes</td><td><textarea name="content" cols="50" rows="6" class="textual"><?php echo $expense['content']; ?> </textarea></td></tr> <tr><td class="label-cell"> </td><td><input type="submit" value="Save Expense" class="button" /></td></tr> </table> </form> <script type="text/javascript"> createAjaxForm('expense_edit', 'detailPanel'); </script>
<?php if(isset($_GET["verbose"])){echo __LINE__." verbose OK<br>\n";$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);} include_once('ressources/class.templates.inc'); include_once('ressources/class.users.menus.inc'); include_once('ressources/class.squid.inc'); include_once('ressources/class.status.inc'); include_once('ressources/class.artica.graphs.inc'); include_once('ressources/class.calendar.inc'); include_once('ressources/class.tcpip.inc'); $users=new usersMenus(); if(!$users->AsDansGuardianAdministrator){die();} if(isset($_GET["events"])){popup_list();exit;} if(isset($_POST["unlock"])){unlock();exit;} if(isset($_POST["biglock"])){biglock();exit;} if(isset($_GET["js"])){FULL_JS();exit;} if(isset($_GET["calendar"])){calendar();exit;} if(isset($_GET["title-zday"])){calendar_title();exit;} if(isset($_GET["build-calendar"])){calendar_build();exit;} if(isset($_POST["reload-unlock"])){reload_unlock();exit;} if(isset($_GET["full-js"])){FULL_JS();exit;} if(isset($_GET["tabs"])){tabs();exit;} if(isset($_GET["week"])){week_table();exit;} if(isset($_GET["week-events"])){week_events();exit;} BlockedSites2(); function FULL_JS(){ header("content-type: application/x-javascript"); $t=$_GET["t"]; $page=CurrentPageName();
exit("error in query"); } $defaultArea = $areaQuery->fetch()->area; $result = $wageQuery->fetch(PDO::FETCH_ASSOC); if ($defaultArea == $area) { echo "\$" . $result['wage']; } ?> </td> </tr> <tr> <td>Date:</td> <!----------------If left blank the calendar will default to the current time stamp----------------> <td><input type="text" id='date' name="date" placeholder="MM-DD-YYYY" size="8"><?php calendar('wageForm', 'date'); ?> </td> <td>Raise: </td> <td> $ <input type="text" name="raise" id="raise" value="" size="3"> </td> </tr> <tr> <td id="other">Reason:</td> <td colspan=2> <select style='width:195px' name="comments" id="comments" onClick="toggleField(this.value);">
<body> <?php // count the number of events (images) on screen $event_count = 0; $row_count = 2; // prepare the form that will allow us to delete events echo "<form name=iform action=" . $_SERVER['PHP_SELF'] . " method=get onSubmit=\"javascript:return validateForm(this);\">"; echo "<input type=hidden name=view_date value=" . $view_date . ">"; echo "<input type=hidden name=what value=delete>\n"; echo "<input type=hidden name=todelete value=>\n"; echo '<table border=0> <tr><td valign=top>'; echo "<span class=title><b>{$config_title}</b></class>\n"; echo "<br><br>\n"; // draw calendar echo calendar($view_date); echo "<center><br>\n"; echo "<a href=\"javascript:select_all();\">" . $all . "</a> | <a href=\"javascript:select_none();\">" . $nothing . "</a><br>\n"; echo "<input type=submit value=\"{$erase_selection}\">\n"; echo "<br><br>\n"; echo "<p><a href=\"http://{$server_addr}:{$setup_port}\" target=_blank>{$config_motion}</a></p>\n"; echo "<p> </p>\n"; // echo "<span class=credits>Motion Browser original idea by Carlos Ladeira (c) 2006<br>"; // echo "<br><br><br>\n"; // echo "<span class=credits>Modification by Muhamad Adam Ali (c) 2015<br>"; echo "<a href=\"mailto:adam@ce.undip.ac.id\">adam@ce.undip.ac.id</a></class>\n"; echo "<br><br><br>\n"; echo '</td><td> </td><td valign=top>'; // if there are any events on the present day if ($numofrows != 0) { echo "<TABLE id=idtable border=1 cellspacing=0 cellpadding=4 class=timeline>\n";
<?php require_once 'quickmysql.php'; connect(); // Display the calendar //$getm = date("m"); // month 01 to 12 //$getyear = date("Y"); // Returns the year xxxx $getmonth = $_POST[getmonth]; $getyear = $_POST[getyear]; calendar($getmonth, $getyear); // recur = 0 not recurring, recur = 1 daily, recur = 2 weekly, recur = 3 monthly, function calendar($m, $year) { // STEP 1. create a temporary table to hold date ranges nd recurring events $createTbl = "create temporary table allDates (\t\n sd DATE not null,\n _eid INT,\n _title TEXT\n );"; mysql_query($createTbl) or die(mysql_error()); $query = "SELECT * FROM `downtoz0_cms`.`events` WHERE `hide` = FALSE"; $result = mysql_query($query) or die(mysql_error()); $rows = mysql_num_rows($result); if ($rows > 0) { // show data while ($data = mysql_fetch_assoc($result)) { $id = $data['id']; $title = $data['title']; $recur = $data['recur']; $date = $data['date']; $end_date = $data['end_date']; if ($recur == 0) { //if($date != $end_date && $recur == 0){ $sql = "call InsertDatesInRange(\"{$date}\", \"{$end_date}\", {$id}, \"{$title}\")"; mysql_query($sql) or die(mysql_error());
<?php header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers:Origin,X-Requested-With, Content-Type, Accept"); require 'functions.php'; $mes = $_GET['month']; $anio = $_GET['year']; $dia = 1; //primer dia del mes calendar($mes, $anio); ?>
>суббота</option> <option value="0" <?php if ($_GET['week'] == 0) { echo "selected"; } ?> >воскресенье</option> </select><br> <input type="submit" name="submitted" value="submit"/> </form> <?php if ($_GET["calendar_from"]) { calendar('fields', 'from'); } if ($_GET["calendar_to"]) { calendar('fields', 'to'); } if ($_GET["submitted"]) { $range = new Range($_GET['from'], $_GET['to']); if (!$range->get_validation_logs()) { echo "\n\t\t<table class='table table-hover'><thead><td><div>Список дат:</div></td></thead>"; $list = $range->create_list($_GET['week']); for ($i = 0; $i < count($list); $i++) { $list[$i] = explode("-", $list[$i]); $newlist[$i] = $list[$i][0] . "." . $list[$i][1] . "." . $list[$i][2] . ' ' . $list[$i][3]; echo "<tr><td>{$newlist[$i]}</td></tr>"; } echo "</table>"; } } ?>
if (!$info['name']) { $info['name'] = NONAME; } $info['edit_link'] = ADMIN_URL . "?p={$part}&event_id={$info['event_id']}{$date_ref}"; $info['del_link'] = ""; $info['icount'] = 0; if ($info['public'] && !$admin_config['innernews']) { $info['icount'] = '-'; } else { $info['del_link'] = ADMIN_URL . "?p={$part}&del_event={$info['event_id']}{$date_ref}"; } $events[] = $info; } $replace['events'] = $events; $replace['event_id'] = $event_id; $replace['calendar'] = calendar($sy, $sm, 'templ/calendar.htm', "?p={$part}", 0, TABLE_EVENT, -1); $left_menu = get_template('templ/event_list.htm', $replace); if ($event_id) { $sql = mysql_query("SELECT * FROM " . TABLE_EVENT . " WHERE event_id='{$event_id}'") or Error(1, __FILE__, __LINE__); if ($event = @mysql_fetch_array($sql)) { $event['admin_edit'] = $event['user_id'] == $_SESSION['admin_id'] ? 1 : 0; $event['edit'] = preg_match("/ДР клиента/", $event['name']) ? 0 : 1; if ($event['admin_edit']) { $event['name'] = htmlspecialchars($event['name'], ENT_COMPAT, 'cp1251'); $event['public_select'] = array_select('public', array(0 => 'Нет', 1 => 'Да'), $event['public'], 0); $event['date_select'] = date_select($event['date'], 'd', 'm', 'y', 2, 2); list($event['hour'], $event['minute']) = explode(":", $event['time']); $event['date'] = $date; $event['sy'] = $sy; $event['sm'] = $sm; if ($event['edit']) {
if (isset($_GET["display_calendar"])) { // We display the calendar in the JavaScript format require_once $_SERVER["DOCUMENT_ROOT"] . str_replace("_js.", ".", $_SERVER["PHP_SELF"]); // We get all the calendar parameters from the URL // We replace all "true"/"false" by real booleans foreach ($_GET as $key => $value) { if ($value == "true") { $params[$key] = true; } elseif ($value == "false") { $params[$key] = false; } else { $params[$key] = $value; } } $params["JS"] = true; calendar($params); } else { $prefix = isset($_GET["PREFIX"]) ? $_GET["PREFIX"] : "calendar_"; // If sessions are used, we do a session_start() in order to get the SID // if required if (isset($_GET["USE_SESSION"]) && ($_GET["USE_SESSION"] = "true")) { session_start(); $SID = "&" . SID; } else { $SID = ""; } // URL to call the calendar $calendar_URL = str_replace("&", "&", $_SERVER["REQUEST_URI"]); $URL_items = parse_url($calendar_URL); if (isset($URL_items["query"])) { $calendar_URL .= "&";
?> </td></tr> <tr><td class="label-cell">Assigned Usergroup</td><td><?php echo $usergroup_dropdown; ?> </td></tr> <tr><td class="label-cell">Ticket Category</td><td><?php echo $ticket_category_dropdown; ?> </td></tr> <tr><td class="label-cell">Ticket Stage</td><td><span id="ticket_stage_container"><?php echo $ticket_stage_dropdown; ?> </span></td></tr> <tr><td class="label-cell">Deadline</td><td><?php echo calendar('due', $ticket['due']); ?> </td></tr> <tr><td class="label-cell" valign="top">Notes</td><td><textarea name="description" class="textual" rows="6" cols="40"><?php echo $ticket['description']; ?> </textarea></td></tr> <tr><td> </td><td><input type="submit" value="Save Ticket" class="button" /></td></tr> </table> </form> <script type="text/javascript"> createAjaxForm('ticket_edit', 'mainPanel'); document.ticket_edit.name.focus(); $('dropdown_ticket_category_id').addEvent('change',function(event) { var selected_category = this.value;
$r = new archiRecherche(); echo $r->afficheCarteRecherche(array('centrerSurVilleGeneral' => true)); break; case 'rechercheAvEvenementPopup': $r = new archiRecherche(); if (isset($_GET['modeAffichage'])) { $criteres['modeAffichage'] = $_GET['modeAffichage']; } else { $criteres['modeAffichage'] = 'calqueEvenement'; } echo $r->rechercheAvanceeEvenement($criteres); break; case 'afficheCalendrier': print '<div class="calendar">'; include 'includes/calendar/calendar.php'; calendar(array("DATE_URL" => "perso", "URL_DAY_DATE_FORMAT" => "d/m/Y", "LANGUAGE_CODE" => "fr")); print '</div>'; break; // Liste d'adresses regroupee, pseudo dossier par rue // Liste d'adresses regroupee, pseudo dossier par rue case 'listeDossiers': $a = new archiAdresse(); echo $a->afficheListeRegroupee(); break; // Parties statiques // Parties statiques case 'faq': $s = new archiStatic(); echo $s->afficheFaq(); break; case 'edito':
function getCalendarSourceBackend($product_id, $flagBackend = false) { global $objDatabase, $_ARRAYLANG; $last_y = date('Y') - 1; $query = "\n SELECT calendar_product, calendar_order, calendar_day,\n calendar_month, calendar_year\n FROM " . DBPREFIX . "module_egov_product_calendar\n WHERE calendar_product={$product_id}\n AND calendar_act=1\n AND calendar_year>{$last_y}\n "; $objResult = $objDatabase->Execute($query); $ArrayRD = array(); if ($objResult) { while (!$objResult->EOF) { if (!isset($ArrayRD[$objResult->fields['calendar_year']][$objResult->fields['calendar_month']][$objResult->fields['calendar_day']])) { $ArrayRD[$objResult->fields['calendar_year']][$objResult->fields['calendar_month']][$objResult->fields['calendar_day']] = 0; } ++$ArrayRD[$objResult->fields['calendar_year']][$objResult->fields['calendar_month']][$objResult->fields['calendar_day']]; $objResult->MoveNext(); } } \Env::get('ClassLoader')->loadFile(ASCMS_MODULE_PATH . '/Egov/Controller/Cal/Calendrier.php'); $AnzahlTxT = $_ARRAYLANG['TXT_EGOV_QUANTITY']; $AnzahlDropdown = $this->_QuantityDropdown(); $Datum4JS = isset($_REQUEST['date']) ? $_REQUEST['date'] : ''; $QuantArray = $this->_GetOrdersQuantityArray($product_id, $Datum4JS); return calendar($QuantArray, $AnzahlDropdown, $AnzahlTxT, EgovLibrary::GetSettings('set_calendar_date_desc'), EgovLibrary::GetSettings('set_calendar_date_label'), $ArrayRD, EgovLibrary::GetProduktValue('product_quantity', $product_id), EgovLibrary::GetProduktValue('product_quantity_limit', $product_id), $Datum4JS, EgovLibrary::GetSettings('set_calendar_background'), EgovLibrary::GetSettings('set_calendar_legende_1'), EgovLibrary::GetSettings('set_calendar_legende_2'), EgovLibrary::GetSettings('set_calendar_legende_3'), EgovLibrary::GetSettings('set_calendar_color_1'), EgovLibrary::GetSettings('set_calendar_color_2'), EgovLibrary::GetSettings('set_calendar_color_3'), EgovLibrary::GetSettings('set_calendar_border'), $flagBackend); }
// create the archive display // -------------------------- $newline = 0; $archive = "<div style='text-align:center'>\n\t\t<table class='table' border='0' cellspacing='7'>\n\t\t<tr>"; $archive .= "<td colspan='{$months_per_row}'>{$year_selector}</td></tr><tr>"; for ($i = 1; $i <= 12; $i++) { if (++$newline == $months_per_row + 1) { $archive .= "</tr><tr>"; $newline = 1; } $archive .= "<td style='vertical-align:top'>"; if (!deftrue('BOOTSTRAP')) { $archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>"; // href the current month regardless of newsposts or any month with news if ($req_year == $cur_year && $i == $cur_month || $day_links[$i]) { $archive .= "<a class='forumlink' href='" . e107::getUrl()->create('news/list/month', 'id=' . formatDate($req_year, $i)) . "'>" . $marray[$i - 1] . "</a>"; } else { $archive .= $marray[$i - 1]; } $archive .= "</div>"; } if ($req_year == $cur_year && $i == $cur_month) { $req_day = $cur_day; } else { $req_day = ""; } $archive .= "<div>" . calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws']) . "</div></td>\n"; } $archive .= "</tr></table></div>"; $ns->tablerender(BLOGCAL_L2 . " {$req_year}", $archive); require_once FOOTERF;
<? setlocale(LC_ALL,'ru-RU'); /*=============*/ function calendar(){ // $days= cal_days_in_month(CAL_GREGORIAN , 6 , 2015); $days = strftime('%A'); $x=date('D',mktime(0,0,0,6,1,2015)); echo $days; if ($x=="Mon") echo "<table><tr>"; for($i=1;$i<=7;$i++){ echo "<td>$i</td>>"; } } calendar(); echo iconv('windows-1251', 'UTF-8', strftime("%A"));