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


PHP getFormattedDate函数代码示例

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


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

示例1: getPsiData

function getPsiData(&$psi3hr, &$psi24hr, &$comments)
{
    $currPSI = 'XXX';
    $comments = '';
    $lastUpdated = '';
    $datasetName = 'psi_update';
    $keyref = '781CF461BB6606ADC4A6A6217F5F2AD6C5A6581D44B62228';
    $url = 'http://api.nea.gov.sg/api/WebAPI/?dataset=' . $datasetName . '&keyref=' . $keyref;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 15);
    $response = curl_exec($ch);
    if (curl_errno($ch)) {
        echo 'Curl error: ' . curl_error($ch);
        $comments = 'Error! Unable to connect to NEA server..';
    } else {
        $xmlResponse = simplexml_load_string($response);
        $psi3hr = array("north" => (string) $xmlResponse->item->region[0]->record->reading[1]['value'], "main" => (string) $xmlResponse->item->region[1]->record->reading[1]['value'], "central" => (string) $xmlResponse->item->region[2]->record->reading[1]['value'], "east" => (string) $xmlResponse->item->region[3]->record->reading[1]['value'], "west" => (string) $xmlResponse->item->region[4]->record->reading[1]['value'], "south" => (string) $xmlResponse->item->region[5]->record->reading[1]['value'], "raw_timestamp" => (string) $xmlResponse->item->region[1]->record['timestamp'], "timestamp" => getFormattedDate($xmlResponse->item->region[1]->record['timestamp']));
        $psi24hr = array("north" => (string) $xmlResponse->item->region[0]->record->reading[0]['value'], "main" => (string) $xmlResponse->item->region[1]->record->reading[0]['value'], "central" => (string) $xmlResponse->item->region[2]->record->reading[0]['value'], "east" => (string) $xmlResponse->item->region[3]->record->reading[0]['value'], "west" => (string) $xmlResponse->item->region[4]->record->reading[0]['value'], "south" => (string) $xmlResponse->item->region[5]->record->reading[0]['value'], "raw_timestamp" => (string) $xmlResponse->item->region[1]->record['timestamp'], "timestamp" => getFormattedDate($xmlResponse->item->region[1]->record['timestamp']));
    }
    curl_close($ch);
}
开发者ID:yulonglong,项目名称:YulonglongBot,代码行数:24,代码来源:psiHelper.php

示例2: getMiniCalEvents

function getMiniCalEvents($mini_cal_auth)
{
    global $template, $db, $lang;
    // initialise some sql bits
    if ($mini_cal_auth['view']) {
        $days_ahead_sql = MINI_CAL_DAYS_AHEAD > 0 ? " AND (c.stamp <= DATE_ADD(CURDATE(), INTERVAL " . MINI_CAL_DAYS_AHEAD . " DAY)) " : '';
        // get the events
        $sql = "SELECT\n\t\t\t\t\tc.id, c.stamp, c.eventspan, c.subject,\n\t\t\t\t\tMONTH(c.stamp) as cal_month,\n\t\t\t\t\tDAYOFWEEK(DATE_SUB(c.stamp, INTERVAL " . MINI_CAL_FDOW . " DAY)) as cal_weekday,\n\t\t\t\t\tDAYOFMONTH(c.stamp) as cal_monthday,\n\t\t\t\t\tYEAR(c.stamp) as cal_year,\n\t\t\t\t\tHOUR(c.stamp) as cal_hour,\n\t\t\t\t\tMINUTE(c.stamp) as cal_min,\n\t\t\t\t\tSECOND(c.stamp) as cal_sec,\n\n\t\t\t\t\tMONTH(c.eventspan) as cal_month_end,\n\t\t\t\t\tDAYOFWEEK(DATE_SUB(c.eventspan, INTERVAL " . MINI_CAL_FDOW . " DAY)) as cal_weekday_end,\n\t\t\t\t\tDAYOFMONTH(c.eventspan) as cal_monthday_end,\n\t\t\t\t\tYEAR(c.eventspan) as cal_year_end\n\t\t\t\tFROM\n\t\t\t\t\t" . CAL_TABLE . " as c\n\t\t\t\tWHERE ((c.stamp >= CURDATE()) OR (CURDATE() <= c.eventspan))\n\t\t\t\t\t{$days_ahead_sql}\n\t\t\t\t\t{$mini_cal_auth_sql}\n\t\t\t\tORDER BY\n\t\t\t\t\tc.stamp ASC\n\t\t\t\tLIMIT\n\t\t\t\t\t0," . MINI_CAL_LIMIT;
        // did we get a result?
        // if not then the user does not have MyCalendar installed
        // so just die quielty don't bother to output an error message
        $db->sql_return_on_error(true);
        $result = $db->sql_query($sql);
        $db->sql_return_on_error(false);
        if ($result) {
            // ok we've got MyCalendar
            $template->assign_block_vars('switch_mini_cal_events', array());
            if ($db->sql_numrows($result) > 0) {
                // we've even got some events
                // initialise out date formatting patterns
                $cal_date_pattern = unserialize(MINI_CAL_DATE_PATTERNS);
                // output our events in the given date format for the current language
                while ($row = $db->sql_fetchrow($result)) {
                    $cal_date = getFormattedDate($row['cal_weekday'], $row['cal_month'], $row['cal_monthday'], $row['cal_year'], $row['cal_hour'], $row['cal_min'], $row['cal_sec'], $lang['Mini_Cal_date_format']);
                    if ($row['eventspan'] > $row['stamp']) {
                        $cal_date .= ' - ' . getFormattedDate($row['cal_weekday_end'], $row['cal_month_end'], $row['cal_monthday_end'], $row['cal_year_end'], '', '', '', $lang['Mini_Cal_date_format']);
                    }
                    $template->assign_block_vars('mini_cal_events', array('MINI_CAL_EVENT_DATE' => $cal_date, 'S_MINI_CAL_EVENT' => $row['subject'], 'U_MINI_CAL_EVENT' => append_sid(IP_ROOT_PATH . 'calendar.' . PHP_EXT . '?id=' . $row['id'] . '&mode=display')));
                }
            } else {
                // no events :(
                $template->assign_block_vars('mini_cal_no_events', array());
            }
            $db->sql_freeresult($result);
        }
    }
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:37,代码来源:mini_cal_SNAILLITE.php

示例3: getFormattedDate

<?
//register a globals variable for security
$GLOBALS['vlDC']=true;
include "conf.php";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table border="0" cellspacing="0" cellpadding="0" class="trailanalytics">
        <tr>
            <td class="tab_active">Changes&nbsp;by&nbsp;<?php 
echo $createdby;
?>
&nbsp;in&nbsp;<?php 
echo getFormattedDate($theDate);
?>
</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td style="border:1px solid #CCCCFF; padding:20px">
	<table width="100%" border="0" class="trailanalytics">
                <tr>
                  <td>
                  <div style="height: 270px; overflow: auto; padding:3px">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="vl_tdsub" width="90%"><strong>Post-Warning Submission Details</strong></td>
                        <td class="vl_tdsub" width="10%"><strong>Time</strong></td>
                    </tr>
                    <?
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.statistics.warnings.details.php

示例4: while

                    while($sq=mysqlfetcharray($squery)) {
                        if($scount%2) {
                            $scolor="#FFFFFF";
                        } else {
                            $scolor="#F4F4F4";
                        }
                ?>
                      <tr bgcolor="<?php 
echo $scolor;
?>
">
                        <td><a href="../admin/?act=statisticsremovals&nav=statistics&soption=removalsByUser&theDate=<?php 
echo $sq["datecreated"];
?>
"><?php 
echo getFormattedDate($sq["datecreated"]);
?>
</a></td>
                        <td><?php 
echo number_format((double) $sq["stat"]);
?>
</td>
                      </tr>
                <? 
                        $stotal+=$sq["stat"];
                        $scount++;
                    }
                } else { 
                ?>
                      <tr>
                        <td colspan="2">No statistics available for this query.</td>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.statistics.removals.php

示例5: getMiniCalEvents

function getMiniCalEvents($mini_cal_auth)
{
    global $db, $template, $lang;
    // initialise some sql bits
    $mini_cal_auth_sql = $mini_cal_auth['view'] != '' ? ' AND t.forum_id in (' . $mini_cal_auth['view'] . ') ' : '';
    $days_ahead_sql = MINI_CAL_DAYS_AHEAD > 0 ? " AND (c.cal_date <= DATE_ADD(CURDATE(), INTERVAL " . MINI_CAL_DAYS_AHEAD . " DAY)) " : '';
    // get the events
    $sql = "SELECT\n\t\t\t\tc.topic_id, c.cal_date, c.forum_id,\n\t\t\t\tMONTH(c.cal_date) as cal_month,\n\t\t\t\tDAYOFWEEK(DATE_SUB(c.cal_date, INTERVAL " . MINI_CAL_FDOW . " DAY)) as cal_weekday,\n\t\t\t\tDAYOFMONTH(c.cal_date) as cal_monthday,\n\t\t\t\tYEAR(c.cal_date) as cal_year,\n\t\t\t\tHOUR(c.cal_date) as cal_hour,\n\t\t\t\tMINUTE(c.cal_date) as cal_min,\n\t\t\t\tSECOND(c.cal_date) as cal_sec,\n\t\t\t\tt.topic_title\n\t\t\tFROM\n\t\t\t\t" . MYCALENDAR_TABLE . " as c,\n\t\t\t\t" . TOPICS_TABLE . " as t\n\t\t\tWHERE\n\t\t\t\tc.topic_id = t.topic_id\n\t\t\t\tAND (c.cal_date >= CURDATE())\n\t\t\t\t{$days_ahead_sql}\n\t\t\t\t{$mini_cal_auth_sql}\n\t\t\tORDER BY\n\t\t\t\tc.cal_date ASC\n\t\t\tLIMIT\n\t\t\t\t0," . MINI_CAL_LIMIT;
    // did we get a result?
    // if not then the user does not have MyCalendar installed
    // so just die quielty don't bother to output an error message
    $db->sql_return_on_error(true);
    $result = $db->sql_query($sql);
    $db->sql_return_on_error(false);
    if ($result) {
        // ok we've got MyCalendar
        $template->assign_block_vars('switch_mini_cal_events', array());
        if ($db->sql_numrows($result) > 0) {
            // we've even got some events
            // initialise out date formatting patterns
            $cal_date_pattern = unserialize(MINI_CAL_DATE_PATTERNS);
            // output our events in the given date format for the current language
            while ($row = $db->sql_fetchrow($result)) {
                $cal_date = getFormattedDate($row['cal_weekday'], $row['cal_month'], $row['cal_monthday'], $row['cal_year'], $row['cal_hour'], $row['cal_min'], $row['cal_sec'], $lang['Mini_Cal_date_format']);
                $template->assign_block_vars('mini_cal_events', array('MINI_CAL_EVENT_DATE' => $cal_date, 'S_MINI_CAL_EVENT' => $row['topic_title'], 'U_MINI_CAL_EVENT' => append_sid(IP_ROOT_PATH . CMS_PAGE_VIEWTOPIC . "?" . POST_TOPIC_URL . '=' . $row['topic_id'])));
            }
        } else {
            // no events :(
            $template->assign_block_vars('mini_cal_no_events', array());
        }
        $db->sql_freeresult($result);
    }
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:33,代码来源:mini_cal_PLUS.php

示例6: getGifts

echo $user->name;
?>
's Forest</div>
  <br>
    <center>
      <img class="empty-forest" src="img/empty_forest.png"/>
    </center>
    <?php 
$gifts = getGifts($user);
while ($gift = array_shift($gifts)) {
    ?>
        <img data-tooltip aria-haspopup="true"  title="Gift for <strong><?php 
    echo $gift->friendName;
    ?>
</strong> <br/> given on <?php 
    echo getFormattedDate($gift->giftDate);
    ?>
<br> (<?php 
    echo $gift->plantName;
    ?>
, <?php 
    echo $gift->points;
    ?>
 Points)" class="tree has-tip radius" src="img/tree.png" width="50px" style="display:none;">
    	<?php 
}
?>
    <div class="name floater">Plants gifted</div><div class="name" style="float:right"><?php 
echo sizeof(getGifts($user));
?>
</div>
开发者ID:skin,项目名称:planty,代码行数:31,代码来源:forest.php

示例7: switch

}
?>
<table width="100%" border="0" class="vl">
  <tr> 
    <td><span style='font-weight: bold'>Emails sent by the site</span></td>
  </tr>
  <tr>
    <td><img src="images/horizontal_400.gif" width="400" height="1" vspace="3"></td>
  </tr>
<?
switch($soption) {
	case details:
	?>
		  <tr>
			<td><span style='font-weight: bold'>Emails for the date: <font color="#FF0000"><?php 
echo getFormattedDate($xdetails);
?>
</font></span></td>
		  </tr>
		  <tr>
			<td><table width="95%" cellpadding="0" cellspacing="0" class="vl">
		<?
		$squery=0;
		$squery=mysqlquery("select * from vl_daemon_email where date(created)='$xdetails' order by created desc");
		if(mysqlnumrows($squery)) {
			$sq=array();
			while($sq=mysqlfetcharray($squery)) {
		?>
			  <tr>
				<td>&nbsp;</td>
			  </tr>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.statistics.mails.php

示例8:

								$count+=1;
								$status=0;
								$status=getDetailedTableInfo2("vl_samples_verify","sampleID='$q[id]'","outcome");
								if($count<$num) {
									echo "<tr>
												<td class=\"vl_tdstandard\">$q[formNumber]</td>
												<td class=\"vl_tdstandard\"><a href=\"/verify/find.and.edit/$q[id]/1/\">$q[vlSampleID]</a></td>
												<td class=\"vl_tdstandard\">".($status?$status:"Pending")."</td>
												<td class=\"vl_tdstandard\">".getFormattedDate($q["created"])."&nbsp;at&nbsp;".getFormattedTimeLessS($q["created"])."</td>
											</tr>";
								} else {
									echo "<tr>
												<td class=\"vl_tdnoborder\">$q[formNumber]</td>
												<td class=\"vl_tdnoborder\"><a href=\"/verify/find.and.edit/$q[id]/1/\">$q[vlSampleID]</a></td>
												<td class=\"vl_tdnoborder\">".($status?$status:"Pending")."</td>
												<td class=\"vl_tdnoborder\">".getFormattedDate($q["created"])."&nbsp;at&nbsp;".getFormattedTimeLessS($q["created"])."</td>
											</tr>";
								}
							}
							?>
                      </table>
                        </div>
                  </fieldset>
                </td>
            </tr>
                </table>
            </div>
        </td>
    </tr>
    <? } else { ?>
    <tr>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.preview.samples.php

示例9: ucfirst

         case 'm':
             $new_title = $titles['m'] . ' ' . $titles['y'];
             break;
         case 'd':
             $new_title = $titles['d'] . ' ' . $titles['m'] . ' ' . $titles['y'];
             break;
         default:
             $new_title = '';
             break;
     }
     $new_title = ucfirst($new_title);
     $newdoc['pagetitle'] = $new_title;
     $newdoc['longtitle'] = $new_title;
     $newdoc['menutitle'] = $new_title;
     $newdoc['alias'] = $aliases[$f];
     $newdoc['menuindex'] = getFormattedDate($dt, $f, 'menuindex');
     // Insert the new page
     $new_page = $modx->db->insert($newdoc, $modx->getFullTableName('site_content'));
     // If it's inserted correctly, remember the new page as the last parent
     $src_id = $last_parent;
     $last_parent = $new_page !== false ? $new_page : $last_parent;
     // Also duplicate any manager permissions
     $doc_group_table = $modx->getFullTableName('document_groups');
     $permissions = $modx->db->select("*", $doc_group_table, "document = {$src_id}");
     if ($new_page !== false && $modx->db->getRecordCount($permissions) >= 1) {
         while ($row = $modx->db->getRow($permissions)) {
             $dup_perms = array('document' => $new_page, 'document_group' => $row['document_group']);
             $modx->db->insert($dup_perms, $doc_group_table);
         }
     }
 }
开发者ID:ncrossland,项目名称:modx-autofolders-evo,代码行数:31,代码来源:autofolders.inc.php

示例10: getMiniCalEvents

    function getMiniCalEvents($mini_cal_auth)
    {
        global $template, $db, $phpEx, $lang, $mini_cal_today, 
               $mini_cal_this_month, $mini_cal_this_year, $mini_cal_this_day;
    
        // start and end date
        $start_date = mktime(0,0,0, intval(substr($mini_cal_today, 4, 2)), $mini_cal_this_day, $mini_cal_this_year);
		
        $w_month = $mini_cal_this_month;
        $days_ahead_sql = '';
        if (MINI_CAL_DAYS_AHEAD > 0)
        {
            $w_year = $mini_cal_this_year;
            if ($w_month > 12)
            {
                $w_month = 01;
                $w_year++;
            }
            $end_date = mktime(0,0,0, $w_month, $mini_cal_this_day + MINI_CAL_DAYS_AHEAD, $w_year);
            $days_ahead_sql = " AND topic_calendar_time < $end_date ";
        }
                
        // initialise some sql bits
        $mini_cal_auth_sql = ($mini_cal_auth['view']) ? ' AND t.forum_id in (' . $mini_cal_auth['view'] . ') ' : '';
        
        // get events
        $sql = "SELECT t.topic_id, t.topic_calendar_time, t.topic_title, t.forum_id, t.topic_calendar_duration  
        	FROM " . TOPICS_TABLE . " t
        		WHERE topic_calendar_time >= $start_date
        		$days_ahead_sql
        		AND topic_calendar_time IS NOT NULL
        		AND topic_calendar_time <> 0
        		$mini_cal_auth_sql
            ORDER BY 
                t.topic_calendar_time ASC
            LIMIT 
                0," . MINI_CAL_LIMIT;
    
        // did we get a result? 
    	if( $result = $db->sql_query($sql) )
    	{
           $template->assign_block_vars('switch_mini_cal_events', array());
           if ( $db->sql_numrows($result) > 0 )
           {
               // we've got some events
    
               // now let's output our events in the given date format for the current language
       	       while ($row = $db->sql_fetchrow($result))
               {
                    $cal_time = $row['topic_calendar_time'];
					$day_span = (date("Ymd", $cal_time) < date("Ymd", $cal_time+$row['topic_calendar_duration']));
					$include_time = date("His", $cal_time) > 0;
                    $cal_date = getFormattedDate(
                                    date('w', $cal_time), 
                                    date('n', $cal_time), 
                                    date('d', $cal_time),
                                    date('Y', $cal_time),
                                    date('H', $cal_time), 
                                    date('i', $cal_time),
                                    date('s', $cal_time),
									$lang['Mini_Cal_date_format'].((!$day_span && $include_time)?' '.$lang['Mini_Cal_date_format_Time']:'')
                                );
                                
                    if ($day_span || $row['topic_calendar_duration'] > 0)
                    {
                        $cal_time = $cal_time + $row['topic_calendar_duration'];
                        $cal_date .= ' - ' . getFormattedDate(
                                                date('w', $cal_time), 
                                                date('n', $cal_time), 
                                                date('d', $cal_time),
                                                date('Y', $cal_time),
                                                date('H', $cal_time), 
                                                date('i', $cal_time),
                                                date('s', $cal_time),
												((!$day_span)?$lang['Mini_Cal_date_format_Time']:$lang['Mini_Cal_date_format'])
                                            );
                    }
  
        			$template->assign_block_vars('mini_cal_events', array(
        					'MINI_CAL_EVENT_DATE' => $cal_date,
                            'S_MINI_CAL_EVENT' => $row['topic_title'], 
        					'U_MINI_CAL_EVENT' => append_sid( $phpbb_root_path . "viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $row['topic_id'] )
                            )
        			); 
               }
           }
           else
           {
                // no events :(
                $template->assign_block_vars('mini_cal_no_events', array());
           }
           $db->sql_freeresult($result);
    
    	}
    }    
开发者ID:sietf,项目名称:sietf.org,代码行数:95,代码来源:mini_cal_topic.php

示例11:

	//to be activated: ensure lrCategory, lrEnvelopeNumber and lrNumericID are supplied
	if(!$lrCategory && (!$lrEnvelopeNumber || $lrEnvelopeNumber==$default_envelopeNumber) && !$lrNumericID) {
		$error.="<br /><strong>".($lrCategory=="V"?"Location":"Rejection")." ID is Missing</strong><br />Kindly provide a ".($lrCategory=="V"?"Location or Rejection":"Rejection or Location")." ID<br />";
	}
	
	//to be edited: ensure envelope number is valid
	if($lrCategory && $lrEnvelopeNumber && $lrEnvelopeNumber!="Envelope #" && $lrNumericID) {
		if(!preg_match("/^[0-9]{4}[\-]{1}[0-9]{1,5}$/",$lrEnvelopeNumber)) {
			$error.="<br /><strong>Incorrect Envelope Number '$lrEnvelopeNumber'.</strong><br />Correct Envelope Number Format is ".getFormattedDateYearShort($datetime).getFormattedDateMonth($datetime)."-00001.<br /> Kindly resubmit with a Valid Envelope Number.<br />";
		}
	}

	//ensure form number is unique
	if(getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","id")) {
		$error.="<br /><strong>Duplicate Form Number '$formNumber'.</strong><br />The Form Number <strong>$formNumber</strong> was entered on <strong>".getFormattedDate(getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","created"))."</strong> by <strong>".getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","createdby")."</strong> <a href=\"#\" onclick=\"iDisplayMessage('/verify/preview/".getDetailedTableInfo2("vl_samples","formNumber='$formNumber' limit 1","id")."/1/noedit/')\">Click here to see the entry</a>.<br /> Kindly input this record with an alternative Form Number.<br />";
	}

	//ensure form number is numeric
	if(!is_numeric($formNumber)) {
		$error.="<br /><strong>Form Number '$formNumber' is Not Numeric.</strong><br />The Form Number should be Numeric i.e it should not contain alphanumeric characters e.g A-Z.<br />";
	}

	//ensure form number is valid
	if(!getDetailedTableInfo2("vl_forms_clinicalrequest","formNumber='$formNumber' or formNumber='".($formNumber/1)."' limit 1","id")) {
		$error.="<br /><strong>Invalid Form Number '$formNumber'.</strong><br />The Form Number <strong>$formNumber</strong> does not exist in the list of valid Form Numbers.<br /> Kindly input this record with a valid Form Number.<br />";
	}

	//ensure facility is valid
	if(!getDetailedTableInfo2("vl_facilities","id='$facilityID'","id")) {
		$error.="<br /><strong>Incorrect Facility '$facilityID'.</strong><br />Kindly select an existing Facility from the list or Request an Administrator to first add this Facility '$facilityID' to the System's Database before Proceeding.<br />";
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:30,代码来源:tpl.samples.capture.deprecated.php

示例12: isset

//24hr cache
$template = 'statistics_monthlyleader.tpl';
$cacheid = isset($_GET['month']);
if (!$smarty->is_cached($template, $cacheid)) {
    require_once 'geograph/gridimage.class.php';
    require_once 'geograph/gridsquare.class.php';
    require_once 'geograph/imagelist.class.php';
    $db = NewADOConnection($GLOBALS['DSN']);
    if (!$db) {
        die('Database connection failed');
    }
    $length = isset($_GET['month']) ? 10 : 7;
    $topusers = $db->GetAll("SELECT gridimage_id,SUBSTRING( submitted, 1, {$length} ) AS \nsubmitted_month , user_id, realname, COUNT(*) as imgcount\nFROM `gridimage_search` \nGROUP BY SUBSTRING( submitted, 1, {$length} ) , user_id \nORDER BY submitted_month DESC");
    $month = array();
    foreach ($topusers as $idx => $entry) {
        if (!isset($month[$topusers[$idx]['submitted_month']]) || $topusers[$idx]['imgcount'] > $month[$topusers[$idx]['submitted_month']]) {
            $month[$topusers[$idx]['submitted_month']] = $topusers[$idx]['imgcount'];
        }
    }
    foreach ($topusers as $idx => $entry) {
        if ($topusers[$idx]['imgcount'] < $month[$topusers[$idx]['submitted_month']]) {
            unset($topusers[$idx]);
        } else {
            $topusers[$idx]['month'] = getFormattedDate($topusers[$idx]['submitted_month']);
        }
    }
    $smarty->assign_by_ref('topusers', $topusers);
    //lets find some recent photos
    new RecentImageList($smarty);
}
$smarty->display($template, $cacheid);
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:monthlyleader.php

示例13: YEAR

    if ($timerel == 'during') {
        if (!empty($when) && !empty($when2)) {
            $timesqlrel = "BETWEEN YEAR('{$whenlow}')*12+MONTH('{$whenlow}') AND YEAR('{$whenhigh}')*12+MONTH('{$whenhigh}')-1";
            $timedescrel = sprintf($MESSAGES['leaderboard']['time_during'], getFormattedDate($when));
        }
    } else {
        if ($timerel == 'dbefore') {
            if (!empty($when2)) {
                $timesqlrel = "< YEAR('{$whenhigh}')*12+MONTH('{$whenhigh}')";
                $timedescrel = sprintf($MESSAGES['leaderboard']['time_until'], getFormattedDate($when2));
            }
        } else {
            if ($timerel == 'dafter') {
                if (!empty($when)) {
                    $timesqlrel = ">= YEAR('{$whenlow}')*12+MONTH('{$whenlow}')";
                    $timedescrel = sprintf($MESSAGES['leaderboard']['time_from'], getFormattedDate($when));
                }
            }
        }
    }
}
if ($timesqlrel !== '') {
    if ($date == 'both') {
        $timesql = " and year(imagetaken) != 0 and year(submitted) != 0 and month(imagetaken) != 0 and month(submitted) != 0 and year(imagetaken)*12+month(imagetaken) {$timesqlrel} and year(submitted)*12+month(submitted) {$timesqlrel}";
        $timedesc = sprintf($MESSAGES['leaderboard']['taken_submitted'], $timedescrel);
    } else {
        $column = $date == 'taken' ? 'imagetaken' : 'submitted';
        $timesql = " and year({$column}) != 0 and month({$column}) != 0 and year({$column})*12+month({$column}) {$timesqlrel}";
        $timedesc = sprintf($MESSAGES['leaderboard'][$date == 'taken' ? 'taken' : 'submitted'], $timedescrel);
    }
}
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:leaderboard.php

示例14: getDetailedTableInfo2

?>
</td>
                            </tr>
                        <? } ?>

                        <tr>
                          <td>Captured&nbsp;By</td>
                          <td><?php 
echo getDetailedTableInfo2("vl_samples", "id='{$id}' limit 1", "createdby");
?>
</td>
                        </tr>
                        <tr>
                          <td>On</td>
                          <td><?php 
echo getFormattedDate(getDetailedTableInfo2("vl_samples", "id='{$id}' limit 1", "created"));
?>
</td>
                        </tr>
                        <tr>
                          <td width="20%" valign="top">Received&nbsp;Status</td>
                          <td width="80%">
                          
                          </td>
                        </tr>
                        <tr>
                          <td>Lab&nbsp;Comments</td>
                          <td><textarea name="comments" id="comments" cols="40" rows="3" class="searchLarge"></textarea></td>
                        </tr>
                      </table>
                        </div>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.verify.approvereject.old.php

示例15: getDetailedTableInfo2

echo getDetailedTableInfo2("vl_forms_clinicalrequest", "refNumber='{$q['refNumber']}' order by formNumber desc limit 1", "formNumber");
?>
)</div>
                                </td>
                                <td class="<?php 
echo $count < mysqlnumrows($xquery) ? "vl_tdstandard" : "vl_tdnoborder";
?>
">
                               	<? if(!getDetailedTableInfo2("vl_forms_clinicalrequest_dispatch","refNumber='$q[refNumber]' limit 1","id")) { ?>
                                	<div class="vls_grey" style="padding:3px 0px 0px 0px"><a href="/generateforms/dispatch/<?php 
echo $q["refNumber"];
?>
/">Input&nbsp;Dispatch&nbsp;Date</a></div>
                                <? } else { ?>
                                	<div class="vls_grey" style="padding:3px 0px 0px 0px">Dispatched on <?php 
echo getFormattedDate(getDetailedTableInfo2("vl_forms_clinicalrequest_dispatch", "refNumber='{$q['refNumber']}' limit 1", "dispatchDate"));
?>
 (<a href="/generateforms/dispatch/<?php 
echo $q["refNumber"];
?>
/">edit</a>)</div>
                                <? } ?>
								</td>
                            </tr>
                        <? } ?>
 	               </table>
				  </div>
              </td>
            </tr>
            <tr>
	            <td style="padding:20px 0px 0px 0px"><a href="/generateforms/">Return to Generate Forms</a> :: <a href="/dashboard/">Return to Dashboard</a></td>
开发者ID:CHAIUganda,项目名称:ViralLoad,代码行数:31,代码来源:tpl.generateforms.dispatch.php


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