Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
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);
        }
    }
}
<?
//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>
                    <?
                    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>
Exemplo n.º 5
0
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);
    }
}
Exemplo n.º 6
0
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>
Exemplo n.º 7
0
}
?>
<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>
Exemplo n.º 8
0
								$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>
         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);
         }
     }
 }
Exemplo n.º 10
0
    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);
    
    	}
    }    
	//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 />";
Exemplo n.º 12
0
//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);
Exemplo n.º 13
0
    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);
    }
}
?>
</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>
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>
Exemplo n.º 16
0
echo $artNumber ? "ART Number" : "";
echo $artNumber && $otherID ? "/" : "";
echo $otherID ? "OtherID" : "";
?>
:</strong> <?php 
echo $artNumber ? $artNumber : "";
echo $artNumber && $otherID ? "/" : "";
echo $otherID ? $otherID : "";
?>
</div>
                                    <div class="vls_grey" style="padding:3px 0px 0px 0px"><strong>SampleID:</strong> <?php 
echo $sampleID;
?>
</div>
                                    <div class="vls_grey" style="padding:3px 0px 0px 0px"><strong>Scheduled on:</strong> <?php 
echo getFormattedDate($created);
?>
 by <?php 
echo $createdby;
?>
</div>
                                </td>
                                <td class="<?php 
echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder";
?>
" align="center"><a href="javascript:if(confirm('Are you sure?')) { document.location.href='?act=repeatSamples&nav=datamanagement&option=remove&id=<?php 
echo $q["id"];
?>
'; }">delete</a></td>
                            </tr>
                        <? } ?>
Exemplo n.º 17
0
     $smarty->assign('tendown', range(9, 0));
 } else {
     //must be a date (unless something has gone wrong!)
     $year = preg_match('/year$/', $_GET['by']) === 1;
     $taken = preg_match('/^taken/', $_GET['by']) === 1;
     $length = $year ? 4 : 7;
     $column = $taken ? 'imagetaken' : 'submitted';
     $msgid = ($year ? 'year' : 'month') . '_' . ($taken ? 'taken' : 'submitted');
     $breakdown_title = $MESSAGES['browse']['bdtitle_' . $msgid];
     $title = $MESSAGES['browse']['title_' . $msgid];
     $all = $db->cacheGetAll($cacheseconds, "SELECT SUBSTRING({$column},1,{$length}) as date,count(*),\n\t\t\t\tgridimage_id,title,user_id,gi.realname as credit_realname,if(gi.realname!='',gi.realname,user.realname) as realname\n\t\t\t\tFROM gridimage gi inner join user using(user_id)\n\t\t\t\tWHERE gridsquare_id = '{$square->gridsquare_id}'\n\t\t\t\tAND {$user_crit} {$custom_where}\n\t\t\t\tGROUP BY SUBSTRING({$column},1,{$length})");
     $column = $taken ? 'taken' : 'submitted';
     $start = rand(0, max(0, count($all) - 20));
     $end = $start + 20;
     foreach ($all as $row) {
         $date = getFormattedDate($row[0]);
         $breakdown[$i] = array('name' => "{$title} <b>{$date}</b>", 'count' => $row[1]);
         if (empty($_GET['ht']) && $i >= $start && $i < $end) {
             $breakdown[$i]['image'] = new GridImage();
             $row['grid_reference'] = $square->grid_reference;
             $breakdown[$i]['image']->fastInit($row);
         }
         if ($row[1] > 20) {
             $datel = $row[0] . substr('-00-00', 0, 10 - $length);
             $breakdown[$i]['link'] = "/search.php?gridref={$square->grid_reference}&amp;distance=1&amp;orderby=submitted&amp;{$column}_start={$datel}&amp;{$column}_end={$datel}&amp;do=1";
         } elseif ($row[1] == 1) {
             $breakdown[$i]['link'] = "/photo/{$row[2]}";
         } else {
             $breakdown[$i]['link'] = "/gridref/{$square->grid_reference}?{$_GET['by']}={$row[0]}" . $extra;
         }
         $i++;
Exemplo n.º 18
0
        $smarty->assign_by_ref('profile', $profile);
        $title .= " for " . $profile->realname;
    }
    if ($ri) {
        $where[] = "reference_index = {$ri}";
        $smarty->assign('ri', $ri);
        $title .= " in " . $CONF['references_all'][$ri];
    }
    if (count($where)) {
        $where_sql = " WHERE " . join(' AND ', $where);
    }
    $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
    $table = $db->GetAll("\nselect substring(submitted,1,7) as `Month`,\ncount(*) as `Submitted`,\nsum(imagetaken LIKE CONCAT(substring(submitted,1,7),'%')) as `Submitted and Taken` \nfrom gridimage_search {$where_sql} \ngroup by substring(submitted,1,7); ");
    foreach ($table as $idx => $entry) {
        if ($entry['Month'] . '-00') {
            $table[$idx]['Month'] = getFormattedDate($entry['Month'] . '-00');
        }
        $table[$idx]['Percentage'] = number_format($entry['Submitted and Taken'] / $entry['Submitted'] * 100);
    }
    $smarty->assign_by_ref('table', $table);
    $smarty->assign("h2title", $title);
    $smarty->assign("total", count($table));
    $smarty->assign_by_ref('references', $CONF['references_all']);
    $extra = array();
    foreach (array('users', 'date') as $key) {
        if (isset($_GET[$key])) {
            $extra[$key] = $_GET[$key];
        }
    }
    $smarty->assign_by_ref('extra', $extra);
} else {
                        </tr>
                      </table>
                        </div>
                  </fieldset>
                </td>
            </tr>
            <tr>
                <td>
                  <fieldset style="width: 100%">
            <legend><strong>REPEAT SCHEDULE DETAILS</strong></legend>
                        <div style="padding:5px 0px 0px 0px">
						<table width="100%" border="0" class="vl">
                            <tr>
							<td width="30%" style="padding:4px 0px; border-bottom: 1px dashed #dfe6e6">Scheduled&nbsp;on</td>
                              <td width="70%" style="padding:4px 0px; border-bottom: 1px dashed #dfe6e6"><?php 
echo getFormattedDate($scheduledDate);
?>
</td>
                            </tr>
                            <tr>
							<td style="padding:4px 0px">By</td>
                              <td style="padding:4px 0px"><?php 
echo $by;
?>
</td>
                            </tr>
                      </table>
                        </div>
                  </fieldset>
                </td>
            </tr>
        $analytics = PincodeAnalytics::getTodayAnalytics($connection, $city);
    } elseif ($period === "weekly") {
        $analytics = PincodeAnalytics::getWeeklyAnalytics($connection, $city);
    } elseif ($period === "monthly") {
        $analytics = PincodeAnalytics::getMonthlyAnalytics($connection, $city);
    } elseif ($period === "tilldate") {
        $analytics = PincodeAnalytics::getTillDateAnalytics($connection, $city);
    }
    //No pincodes collected
    if (empty($analytics) === TRUE) {
        $output_json = array("status" => "success", "count" => 0, "date" => getFormattedDate($period), "total_business_collected" => 0);
        echo json_encode($output_json);
        return;
    }
    $total_business_collected = calculateTotalBusinessCollected($analytics);
    echo json_encode(array("status" => "success", "date" => getFormattedDate($period), "count" => count($analytics), "analytics" => $analytics, "total_business_collected" => $total_business_collected));
} catch (DatabaseConnectionException $e) {
    $failure_json = array("status" => "error", "error" => "Database Unavailable");
    echo json_encode($failure_json);
    return;
} catch (QueryFailedException $e) {
    error_log(mysqli_error($connection));
    $failure_json = array("status" => "error", "error" => "Query Failed");
    echo json_encode($failure_json);
    return;
}
mysqli_close($connection);
function calculateTotalBusinessCollected($analytics)
{
    $total = 0;
    foreach ($analytics as $index => $data) {
     $noDaysInPeriod = isset($_POST['noDays']) ? $_POST['noDays'] : 0;
     if ($absolute) {
         $startDate = isset($_POST['startDate']) ? $_POST['startDate'] : null;
         $daysToRelStart = null;
     } else {
         $daysToRelStart = isset($_POST['daysToRelStart']) ? $_POST['daysToRelStart'] : 0;
     }
     $policy = array('id' => $id, 'name' => $name, 'description' => $description, 'policyType' => $type, 'absolute' => $absolute, 'startDate' => $startDate, 'daysToRelStart' => $daysToRelStart, 'daysInPeriod' => $noDaysInPeriod, 'numberOfPeriods' => 1, 'active' => $active, 'assignable' => $assignable, 'quotaInPeriod' => $quotaInPeriod);
 } else {
     if ($type == "GRADUAL") {
         $maxQuota = isset($_POST['maxQuota']) ? $_POST['maxQuota'] : 0;
         $noPeriods = isset($_POST['noPeriods']) ? $_POST['noPeriods'] : 0;
         $noDaysInPeriod = isset($_POST['noDaysInPeriod']) ? $_POST['noDaysInPeriod'] : 0;
         if ($absolute) {
             $startDate = isset($_POST['startDate']) ? $_POST['startDate'] : null;
             $startDate = getFormattedDate("/", $startDate);
             $daysToRelStart = null;
         } else {
             $startDate = null;
             $daysToRelStart = isset($_POST['daysToRelStart']) ? $_POST['daysToRelStart'] : 0;
         }
         $policy = array('id' => $id, 'name' => $name, 'description' => $description, 'policyType' => $type, 'absolute' => $absolute, 'startDate' => $startDate, 'daysToRelStart' => $daysToRelStart, 'daysInPeriod' => $noDaysInPeriod, 'numberOfPeriods' => $noPeriods, 'active' => $active, 'assignable' => $assignable, 'maximum' => $maxQuota, 'quotaInPeriod' => $quotaInPeriod);
     } else {
         if ($type == "MINMAX") {
             $maxQuota = isset($_POST['maxQuota']) ? $_POST['maxQuota'] : 0;
             $minQuota = isset($_POST['minQuota']) ? $_POST['minQuota'] : 0;
             $noPeriods = isset($_POST['noPeriods']) ? $_POST['noPeriods'] : 0;
             $noDaysInPeriod = isset($_POST['noDaysInPeriod']) ? $_POST['noDaysInPeriod'] : 0;
             if ($absolute) {
                 $startDate = isset($_POST['startDate']) ? $_POST['startDate'] : null;
                 //$startDate = getFormattedDate("/",$startDate);
Exemplo n.º 22
0
                <td>
                  <fieldset style="width: 100%">
            <legend><strong>ENTRANT'S DETAILS</strong></legend>
                        <div style="padding:5px 0px 0px 0px">
						<table width="100%" border="0" class="vl">
                            <tr>
							<td width="30%" style="padding:4px 0px; border-bottom: 1px dashed #dfe6e6">Captured&nbsp;By</td>
                              <td width="70%" style="padding:4px 0px; border-bottom: 1px dashed #dfe6e6"><?php 
echo $createdby;
?>
</td>
                            </tr>
                            <tr>
                              <td style="padding:4px 0px">On</td>
                              <td style="padding:4px 0px"><?php 
echo getFormattedDate($created) . " at " . getFormattedTimeLessS($created);
?>
</td>
                        </tr>
                      </table>
                        </div>
                  </fieldset>
                </td>
            </tr>
                </table>
            </div>
        </td>
    </tr>
    <tr>
    	<td><img src="/images/spacer.gif" width="10" height="10" /></td>
    </tr>
Exemplo n.º 23
0
" width="20%"><?php 
echo $q["username"];
?>
</td>
                                <td class="<?php 
echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder";
?>
" width="40%"><?php 
echo $q["email"];
?>
</td>
                                <td class="<?php 
echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder";
?>
" width="20%"><?php 
echo getFormattedDate($q["login"]) ? getFormattedDateLessDay($q["login"]) : "Unavailable";
?>
</td>
                                <td class="<?php 
echo $count < $num ? "vl_tdstandard" : "vl_tdnoborder";
?>
" width="20%"><a href="?act=admins&nav=configuration&modify=modify&id=<?php 
echo $q["id"];
?>
">edit</a> :: <a href="javascript:if(confirm('Are you sure?')) { document.location.href='?act=admins&nav=configuration&option=remove&id=<?php 
echo $q["id"];
?>
'; }">delete</a></td>
                            </tr>
                        <? } ?>
                    </table>
Exemplo n.º 24
0
		$error.="<br /><strong>Incorrect Envelope Number $lrEnvelopeNumber for a DBS Type Sample.</strong><br />The valid range for DBS type samples is $lrEnvelopeNumberArray[0]-0501 and above.<br />";
	}

	//possible contradicting gender
	$mostRecentGender=0;
	$mostRecentGender=getDetailedTableInfo2("vl_patients","id='$patientID' limit 1","gender");
	$mostRecentGenderCreated=0;
	$mostRecentGenderCreated=getDetailedTableInfo2("vl_patients","id='$patientID' limit 1","created");
	$mostRecentGenderCreatedBy=0;
	$mostRecentGenderCreatedBy=getDetailedTableInfo2("vl_patients","id='$patientID' limit 1","createdby");
	if($mostRecentGender && 
		(($mostRecentGender=="Female" && $gender=="Male") || 
			($mostRecentGender=="Male" && $gender=="Female")) && 
				!$proceedWithWarningGender) {
		$warnings.="<div style=\"padding: 10px 0px 0px 0px\">Possible Data Contradiction!</div>
					<div style=\"padding: 5px 0px 0px 0px\" class=\"vls_grey\">The patient with ".($artNumber?"ART <strong>$artNumber</strong>":"").($artNumber && $otherID?", ":"").($otherID?"Other ID <strong>$otherID</strong>":"")." created on <strong>".getFormattedDate($mostRecentGenderCreated)."</strong> by <strong>$mostRecentGenderCreatedBy</strong> was last created with the gender <strong>$mostRecentGender</strong>.</div>
					<div style=\"padding: 5px 0px 0px 0px\" class=\"vls_grey\">You are however currently submitting this patient with the gender <strong>$gender</strong>. If the gender you have supplied is accurate, click \"Proceed Anyway\" otherwise, change the gender to <strong>$mostRecentGender</strong> then click \"Save Samples\" to proceed.</div>
					<div style=\"padding: 10px 0px 10px 0px\" class=\"trailanalyticss_grey\"><input type=\"submit\" name=\"proceedWithWarningGender\" class=\"button\" value=\"   Proceed Anyway   \" /></div>";
	}

	//If the facilityID is different from that of the facility this form was dispatched to, inform the user
	//reference number based on form number
	$refNumberByFormNumber=0;
	$refNumberByFormNumber=getDetailedTableInfo2("vl_forms_clinicalrequest","formNumber='$formNumber' limit 1","refNumber");
	//facility ID based on form number
	$facilityIDByFormNumber=0;
	$facilityIDByFormNumber=getDetailedTableInfo2("vl_forms_clinicalrequest_dispatch","refNumber='$refNumberByFormNumber' limit 1","facilityID");
	if($facilityIDByFormNumber && $facilityIDByFormNumber!=$facilityID && !$proceedWithWarningAlternativeFacilities) {
		$warnings.="<div style=\"padding: 10px 0px 0px 0px\">Possible incorrect Facility!</div>
					<div style=\"padding: 5px 0px 0px 0px\" class=\"vls_grey\">The form with number <strong>$formNumber</strong> was originally dispatched to facility <strong>".getDetailedTableInfo2("vl_facilities","id='$facilityIDByFormNumber' limit 1","facility")."</strong></div>
					<div style=\"padding: 5px 0px 0px 0px\" class=\"vls_grey\">Your submission indicates it's being returned from another facility <strong>".getDetailedTableInfo2("vl_facilities","id='$facilityID' limit 1","facility")."</strong>. If this is the case, then click \"Proceed Anyway\" otherwise, input amend the facility then click \"Save Samples\" to proceed.</div>
Exemplo n.º 25
0
     $db = NewADOConnection($GLOBALS['DSN']);
     if (!$db) {
         die('Database connection failed');
     }
 }
 $andwhere = '';
 if ($when) {
     if (strlen($when) == 7) {
         $andwhere = " and submitted < DATE_ADD('{$when}-01',interval 1 month)";
     } elseif (strlen($when) == 4) {
         $andwhere = " and submitted < DATE_ADD('{$when}-01-01',interval 1 year)";
     } else {
         $andwhere = " and submitted < '{$when}'";
     }
     $smarty->assign_by_ref('when', $when);
     $smarty->assign('whenname', getFormattedDate($when));
 }
 if ($where) {
     $andwhere .= " and grid_reference like '{$where}%'";
     $smarty->assign_by_ref('where', $where);
 }
 $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
 if (isset($_GET['cloud'])) {
     if ($andwhere) {
         $users = $db->CacheGetAssoc(3600 * 6, "select\r\n\t\t\t\tnickname,user.user_id,user.realname,user.user_id,count(*) as images\r\n\t\t\t\tfrom user\r\n\t\t\t\t\tinner join gridimage_search gi using (user_id)\r\n\t\t\t\twhere nickname != '' and rights IS NOT NULL {$andwhere}\r\n\t\t\t\tgroup by gi.user_id\r\n\t\t\t\torder by images desc");
         $smarty->assign('what', 'Contributors');
     } else {
         $users = $db->CacheGetAssoc(3600 * 6, "select\r\n\t\t\t\tnickname,user.user_id,user.realname,user.user_id,`us`.images\r\n\t\t\t\tfrom user\r\n\t\t\t\t\tinner join user_stat `us` using (user_id)\r\n\t\t\t\twhere nickname != '' and rights IS NOT NULL \r\n\t\t\t\torder by images desc");
         $smarty->assign('what', 'Contributors');
     }
     $size = $startsize = 30;
Exemplo n.º 26
0
function renderAchievement($id, &$a, $guid)
{
    // Skip show if not completed parent present or no_points not completed
    if ($a['parentAchievement'] || !$a['date'] && !$a['points'] && $guid) {
        return;
    }
    echo '<div class="ach_show' . ($a['date'] ? '' : ' locked') . '" onclick="showAchReq(this);">';
    // Render icon
    echo '<img class=ach_icon  src="' . getSpellIcon($a['iconId']) . '">';
    echo '<div class=ach_frame></div>';
    // Render points
    if ($a['points']) {
        echo '<div class=ach_point>' . $a['points'] . '</div>';
    }
    echo '<div class=ach_title>' . $a['name'] . '</div>';
    echo '<div class=ach_desc>' . $a['description'] . '</div>';
    //  echo '<div class=ach_desc>Flags - 0x'.dechex($a['flags']).' - '.$a['count'].'</div>';
    // Render requirements
    echo '<div class=ach_req id=' . $id . '>';
    if ($a['flags'] & CUSTOM_ACHIEVEMENT_SHOW) {
        getAchievementValue(&$a, &$value, &$maxvalue);
        if ($a['flags'] & ACHIEVEMENT_FLAG_BAR) {
            echo '<div class="sub bar">' . renderProgress($value, $maxvalue) . '</div>';
        } else {
            if ($a['flags'] & ACHIEVEMENT_FLAG_MAX_USED) {
                echo '<div class="sub bar">' . renderProgress($value, $maxvalue) . '</div>';
            } else {
                echo '<div class="sub ' . ($value >= $maxvalue ? 'compl' : '') . '">' . $value . '</div>';
            }
        }
    }
    foreach ($a['requirement'] as $r) {
        if ($r['completionFlag'] & ACHIEVEMENT_CRITERIA_FLAG_HIDE_CRITERIA) {
            continue;
        }
        if ($r['completionFlag'] & ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR) {
            echo '<div class=sub_bar>' . renderProgress(@$r['counter'], $r['value'], $r['completionFlag'] & ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER) . '</div>';
        } else {
            $text = $r['name'] ? $r['name'] : $a['name'];
            $completed = $r['counter'] ? $r['counter'] >= $r['value'] ? 'compl' : '' : '';
            //      $text.="-> $r[id] - f=$r[completionFlag], c=$r[counter], d=$r[data], v=$r[value]";
            echo '<div class="sub ' . $completed . '">' . $text . '</div>';
        }
    }
    echo '<br clear="all"/></div>' . "\n";
    // render date
    if ($a['date']) {
        echo '<div class=ach_date>' . getFormattedDate($a['date']) . '</div>';
    }
    if ($a['titleReward']) {
        echo '<div class=ach_reward>' . $a['titleReward'] . '</div>';
    }
    echo '</div>';
}
Exemplo n.º 27
0
        $where[] = "poster_id=" . $u;
        $smarty->assign('u', $u);
        $profile = new GeographUser($u);
        $smarty->assign_by_ref('profile', $profile);
        $title .= " for " . $profile->realname;
    } else {
        $columns_sql = ", count( DISTINCT poster_id ) AS `Different Posters`";
    }
    if (count($where)) {
        $where_sql = " WHERE " . join(' AND ', $where);
    }
    $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
    $table = $db->GetAll("SELECT \n\tsubstring( post_time, 1, {$length} ) AS `Date`, \n\tcount( * ) AS `Posts`, \n\tcount( DISTINCT forum_id ) AS `Different Forums`, \n\tcount( DISTINCT topic_id ) AS `Different Topics`\n\t{$columns_sql}\nFROM `geobb_posts` {$where_sql}\nGROUP BY substring( post_time, 1, {$length} )");
    if (!isset($_GET['output']) || $_GET['output'] != 'csv') {
        foreach ($table as $idx => $entry) {
            $table[$idx]['Date'] = getFormattedDate($table[$idx]['Date']);
        }
    }
    $smarty->assign_by_ref('table', $table);
    $smarty->assign("h2title", $title);
    $smarty->assign("total", count($table));
    $extra = array();
    foreach (array('month') as $key) {
        if (isset($_GET[$key])) {
            $extra[$key] = $_GET[$key];
        }
    }
    $smarty->assign_by_ref('extra', $extra);
} else {
    if ($u) {
        $profile = new GeographUser($u);
Exemplo n.º 28
0
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><?php 
echo getDetailedTableInfo2("vl_appendix_viralloadtesting", "id='{$viralLoadTesting}' limit 1", "appendix");
?>
</td>
                                </tr>
                                <tr>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><strong>Current&nbsp;Regimen</strong></td>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><?php 
echo $currentRegimen;
?>
</td>
                                </tr>
                                <tr>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><strong>Treatment&nbsp;Initiation&nbsp;Date&nbsp;<font class="vl_red">*</font></strong></td>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><?php 
echo getFormattedDate($treatmentInitiationDate);
?>
</td>
                                </tr>
                                <tr>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><strong>Treatment&nbsp;Initiation&nbsp;<font class="vl_red">*</font></strong></td>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><?php 
echo getDetailedTableInfo2("vl_appendix_treatmentinitiation", "id='{$treatmentInitiation}' limit 1", "appendix");
?>
</td>
                                </tr>
                                <tr>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><strong>Treatment&nbsp;Status&nbsp;<font class="vl_red">*</font></strong></td>
                                  <td style="padding:5px 0px; border-bottom: 1px solid #efefef"><?php 
echo getDetailedTableInfo2("vl_appendix_treatmentstatus", "id='{$treatmentStatus}' limit 1", "appendix");
?>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <? } ?>
            <tr>
              <td class="toplinks" style="padding:0px 0px 10px 0px"><a class="toplinks" href="/dashboard/">HOME</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="toplinks" href="/samples/">SAMPLES</a></td>
            </tr>
            <? //if(getDetailedTableInfo2("vl_samples_verify","sampleID='$modify'","outcome")) { ?>
            <!--
            <tr>
              <td class="vl_error">
              	<div>This Sample's Status was changed to <strong><?php 
echo getDetailedTableInfo2("vl_samples_verify", "sampleID='{$modify}'", "outcome");
?>
</strong> on <strong><?php 
echo getFormattedDate(getDetailedTableInfo2("vl_samples_verify", "sampleID='{$modify}'", "created"));
?>
</strong> by <strong><?php 
echo getDetailedTableInfo2("vl_samples_verify", "sampleID='{$modify}'", "createdby");
?>
</strong></div>
                <div style="padding:3px 0px 0px 0px" class="vls_grey">This sample can therefore no longer be modified!</div>
                <div style="padding:1px 0px 0px 0px" class="vls_grey"><a href="#" onclick="iDisplayMessage('/verify/status/<?php 
echo $modify;
?>
/<?php 
echo getDetailedTableInfo2("vl_samples_verify", "sampleID='{$modify}'", "outcome");
?>
/')">Click to View <?php 
echo getDetailedTableInfo2("vl_samples_verify", "sampleID='{$modify}'", "outcome");
?>
 function builddate(&$dataarray, $which)
 {
     if (isset($dataarray[$which . 'Year'])) {
         $dataarray[$which] = sprintf("%04d-%02d-%02d", $dataarray[$which . 'Year'], $dataarray[$which . 'Month'], $dataarray[$which . 'Day']);
         if ($dataarray[$which] == '0000-00-00') {
             $dataarray[$which] = '';
         }
     }
     if (!empty($dataarray[$which])) {
         $dataarray[$which . 'String'] = getFormattedDate($dataarray[$which]);
     }
 }