Ejemplo n.º 1
0
function feedback_between_dates()
{
    global $dates, $startdate, $enddate, $CONFIG;
    if (!empty($startdate)) {
        if (!empty($enddate)) {
            if ($dates == 'feedbackin') {
                $str = "<p>" . sprintf($GLOBALS['strFeedbackBetweenXandY'], ldate($CONFIG['dateformat_date'], $startdate), ldate($CONFIG['dateformat_date'], $enddate)) . "</p>";
            } elseif ($dates == 'closedin') {
                $str = "<p>Closed between " . ldate($CONFIG['dateformat_date'], $startdate) . " and " . ldate($CONFIG['dateformat_date'], $enddate) . "</p>";
            }
        } else {
            if ($dates == 'feedbackin') {
                $str = "<p>" . sprintf($GLOBALS['strFeedbackAfterX'], ldate($CONFIG['dateformat_date'], $startdate)) . "</p>";
            } elseif ($dates == 'closedin') {
                $str = "<p>" . sprintf($GLOBALS['strClosedAfterX'], ldate($CONFIG['dateformat_date'], $startdate)) . "</p>";
            }
        }
    } elseif (!empty($enddate)) {
        if ($dates == 'feedbackin') {
            $str = "<p>" . sprintf($GLOBALS['strFeedbackBeforeX'], ldate($CONFIG['dateformat_date'], $enddate)) . "</p>";
        } elseif ($dates == 'closedin') {
            $str = "<p>" . srintf($GLOBALS['strClosedBeforeX'], ldate($CONFIG['dateformat_date'], $enddate)) . "</p>";
        }
    }
    return $str;
}
Ejemplo n.º 2
0
function portal_incident_table($sql)
{
    global $CONFIG, $showclosed;
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error(mysql_error(), E_USER_WARNING);
    }
    $numincidents = mysql_num_rows($result);
    if ($numincidents >= 1) {
        $shade = 'shade1';
        $html .= "<table align='center' width='70%'>";
        $html .= "<tr>";
        $html .= colheader('id', $GLOBALS['strID']);
        $html .= colheader('title', $GLOBALS['strTitle']);
        $html .= colheader('owner', $GLOBALS['strOwner']);
        $html .= colheader('lastupdated', $GLOBALS['strLastUpdated']);
        $html .= colheader('contact', $GLOBALS['strContact']);
        $html .= colheader('status', $GLOBALS['strStatus']);
        if ($showclosed != "true") {
            $html .= colheader('actions', $GLOBALS['strOperation']);
        }
        $html .= "</tr>\n";
        while ($incident = mysql_fetch_object($result)) {
            $html .= "<tr class='{$shade}'><td align='center'>";
            $html .= "<a href='incident.php?id={$incident->id}'>{$incident->id}</a></td>";
            $html .= "<td>";
            if (!empty($incident->softwareid)) {
                $html .= software_name($incident->softwareid) . "<br />";
            }
            $html .= "<strong><a href='incident.php?id={$incident->id}'>{$incident->title}</a></strong></td>";
            $html .= "<td align='center'>" . user_realname($incident->owner) . "</td>";
            $html .= "<td align='center'>" . ldate($CONFIG['dateformat_datetime'], $incident->lastupdated) . "</td>";
            $html .= "<td align='center'><a href='contactdetails.php?id={$incident->contactid}'>";
            $html .= "{$incident->forenames} {$incident->surname}</a></td>";
            $html .= "<td align='center'>" . incidentstatus_name($incident->status, external) . "</td>";
            if ($showclosed != "true") {
                $html .= "<td align='center'><a href='update.php?id={$incident->id}'>{$GLOBALS['strUpdate']}</a> | ";
                //check if the customer has requested a closure
                $lastupdate = list($update_userid, $update_type, $update_currentowner, $update_currentstatus, $update_body, $update_timestamp, $update_nextaction, $update_id) = incident_lastupdate($incident->id);
                if ($lastupdate[1] == "customerclosurerequest") {
                    $html .= "{$GLOBALS['strClosureRequested']}</td>";
                } else {
                    $html .= "<a href='close.php?id={$incident->id}'>{$GLOBALS['strRequestClosure']}</a></td>";
                }
            }
            $html .= "</tr>";
            if ($shade == 'shade1') {
                $shade = 'shade2';
            } else {
                $shade = 'shade1';
            }
        }
        $html .= "</table>";
    } else {
        $html .= "<p class='info'>{$GLOBALS['strNoIncidents']}</p>";
    }
    return $html;
}
Ejemplo n.º 3
0
function to_row($contactrow)
{
    global $now, $updateid, $CONFIG, $dbg;
    $str = '';
    if (($contactrow['expirydate'] < $now or $contactrow['term'] == 'yes') and $contactrow['expirydate'] != -1) {
        $class = 'expired';
    } else {
        $class = "shade2";
    }
    $incidents_remaining = $contactrow['incident_quantity'] - $contactrow['incidents_used'];
    $str = "<tr class='{$class}'>";
    if ($contactrow['expirydate'] < $now and $contactrow['expirydate'] != '-1') {
        $str .= "<td>{$GLOBALS['strExpired']}</td>";
    } elseif ($contactrow['term'] == 'yes') {
        $str .= "<td>{$GLOBALS['strTerminated']}</td>";
    } elseif ($contactrow['incident_quantity'] >= 1 and $contactrow['incidents_used'] >= $contactrow['incident_quantity']) {
        $str .= "<td class='expired'>{$GLOBALS['strZeroRemaining']} ({$contactrow['incidents_used']}/{$contactrow['incident_quantity']} {$strUsed})</td>";
    } else {
        $str .= "<td><a href=\"{$_SERVER['PHP_SELF']}?action=incidentform&amp;type=support&amp;";
        $str .= "contactid=" . $contactrow['contactid'] . "&amp;maintid=" . $contactrow['maintid'];
        $str .= "&amp;producttext=" . urlencode($contactrow['productname']) . "&amp;productid=";
        $str .= $contactrow['productid'] . "&amp;updateid={$updateid}&amp;siteid=" . $contactrow['siteid'];
        $str .= "&amp;win={$win}\" onclick=\"return confirm_support();\">{$GLOBALS['strAddIncident']}</a> ";
        if ($contactrow['incident_quantity'] == 0) {
            $str .= "({$GLOBALS['strUnlimited']})";
        } else {
            $str .= "(" . sprintf($GLOBALS['strRemaining'], $incidents_remaining) . ")";
        }
    }
    $str .= "</td>";
    $str .= '<td>' . $contactrow['forenames'] . ' ' . $contactrow['surname'] . '</td>';
    $str .= '<td>' . $contactrow['name'] . '</td>';
    $str .= '<td>' . $contactrow['productname'] . '</td>';
    $str .= '<td>' . servicelevel_id2tag($contactrow['servicelevelid']) . '</td>';
    if ($contactrow['expirydate'] == '-1') {
        $str .= "<td>{$GLOBALS['strUnlimited']}</td>";
    } else {
        $str .= '<td>' . ldate($CONFIG['dateformat_date'], $contactrow['expirydate']) . '</td>';
    }
    $str .= "</tr>\n";
    return $str;
}
Ejemplo n.º 4
0
if (!empty($groupid)) {
    $gidurl = "&amp;gid={$groupid}";
}
// skip over weekends in day view
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Sat') {
    $day -= 1;
}
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Sun') {
    $day += 1;
}
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Mon') {
    $pdate = mktime(0, 0, 0, $month, $day - 3, $year);
} else {
    $pdate = mktime(0, 0, 0, $month, $day - 1, $year);
}
if (date('D', mktime(0, 0, 0, $month, $day, $year)) == 'Fri') {
    $ndate = mktime(0, 0, 0, $month, $day + 3, $year);
} else {
    $ndate = mktime(0, 0, 0, $month, $day + 1, $year);
}
echo "<h2>{$strDayView}</h2>";
echo "<p align='center'>";
echo "<a href='{$_SERVER['PHP_SELF']}?display=day&amp;year=" . date('Y', $pdate) . "&amp;month=" . date('m', $pdate) . "&amp;day=" . date('d', $pdate) . "{$gidurl}'>&lt;</a> ";
echo ldate('l dS F Y', mktime(0, 0, 0, $month, $day, $year));
echo " <a href='{$_SERVER['PHP_SELF']}?display=day&amp;year=" . date('Y', $ndate) . "&amp;month=" . date('m', $ndate) . "&amp;day=" . date('d', $ndate) . "{$gidurl}'>&gt;</a>";
echo "</p>";
$numgroups = group_selector($groupid, "display={$display}&amp;year={$year}&amp;month={$month}&amp;day={$day}");
if ($groupid == 'all') {
    $groupid = '';
}
echo draw_chart('day', $year, $month, $day, $groupid, $user);
Ejemplo n.º 5
0
 if (mysql_error()) {
     trigger_error(mysql_error(), E_USER_WARNING);
 }
 if (mysql_num_rows($result) < 1) {
     echo "<h2>{$strError}</h2>";
     echo "<p>{$strNoFeedBackFormToCompleteHere}</p>";
     echo "\n\n<!-- f: {$formid} r:{$respondent} rr:{$responseref} dh:{$decodehash}  hc:{$hashcode} -->\n\n";
 } else {
     $reqd = 0;
     while ($form = mysql_fetch_object($result)) {
         echo "<form action='feedback.php' method='post'>\n";
         echo "<h2>{$form->name}</h2>\n";
         echo "<p>{$strRelatingToIncident} <strong>#{$incidentid}</strong> &mdash; <strong>" . incident_title($incidentid) . "</strong><br />";
         echo sprintf($strOpenedbyXonY, contact_realname(incident_contact($incidentid)), ldate($CONFIG['dateformat_date'], db_read_column('opened', $dbIncidents, $incidentid)));
         echo ' &nbsp; ';
         echo sprintf($strClosedOnX, ldate($CONFIG['dateformat_date'], db_read_column('closed', $dbIncidents, $incidentid))) . ".</p>";
         if (!empty($_REQUEST['error'])) {
             echo "<p style='color: red'>{$strErrorRequiredQuestionsNotCompleted}</p>";
         }
         echo nl2br($form->introduction);
         $qsql = "SELECT * FROM `{$dbFeedbackQuestions}` ";
         $qsql .= "WHERE formid='{$form->id}' ";
         $qsql .= "ORDER BY taborder ASC";
         $qresult = mysql_query($qsql);
         if (mysql_error()) {
             trigger_error(mysql_error(), E_USER_WARNING);
         }
         while ($question = mysql_fetch_object($qresult)) {
             if (strlen(trim($question->sectiontext)) > 3) {
                 echo "<hr />{$question->sectiontext}\n";
             }
Ejemplo n.º 6
0
 echo colheader('incidentid', $strIncident, $sort, $order, $filter);
 echo "<th>{$strOperation}</th>";
 echo "</tr>\n";
 $shade = 'shade1';
 while ($resp = mysql_fetch_object($result)) {
     $respondentarr = explode('-', $resp->respondent);
     $responserefarr = explode('-', $resp->responseref);
     $hashtext = urlencode($resp->formid) . "&&" . urlencode($resp->contactid) . "&&" . urlencode($resp->incidentid);
     // $hashcode=urlencode(trim(base64_encode(gzcompress(str_rot13($hashtext)))));
     $hashcode4 = str_rot13($hashtext);
     $hashcode3 = gzcompress($hashcode4);
     $hashcode2 = base64_encode($hashcode3);
     $hashcode1 = trim($hashcode2);
     $hashcode = urlencode($hashcode1);
     echo "<tr class='{$shade}'>";
     echo "<td>" . ldate($CONFIG['dateformat_datetime'], mysqlts2date($resp->created)) . "</td>";
     echo "<td><a href='contact_details.php?id={$resp->contactid}' title='{$resp->email}'>" . contact_realname($resp->contactid) . "</a></td>";
     echo "<td><a href=\"javascript:incident_details_window('{$resp->incidentid}','incident{$resp->incidentid}')\">";
     echo "{$strIncident} [{$resp->incidentid}]</a> - ";
     echo incident_title($resp->incidentid) . "</td>";
     $url = "feedback.php?ax={$hashcode}";
     if ($resp->multi == 'yes') {
         $url .= "&amp;rr=1";
     }
     echo "<td>";
     if ($resp->completed == 'no') {
         echo "<a href='{$url}' title='{$url}' target='_blank'>URL</a>";
     }
     $eurl = urlencode($url);
     $eref = urlencode($resp->responseref);
     if ($resp->completed == 'no') {
$sql = "SELECT *,s.id AS siteid FROM `{$dbSites}` AS s, `{$dbMaintenance}` AS m, `{$dbSupportContacts}` AS sc, `{$dbIncidents}` AS i ";
$sql .= "WHERE s.id = m.site ";
$sql .= "AND m.id = sc.maintenanceid ";
$sql .= "AND sc.contactid = i.contact ";
$sql .= "AND i.opened > '{$monthago}' ";
$sql .= "ORDER BY s.id, i.id";
$result = mysql_query($sql);
if (mysql_error()) {
    trigger_error("MySQL Query Error: " . mysql_error(), E_USER_WARNING);
}
if (mysql_num_rows($result) > 0) {
    $prvincid = 0;
    while ($row = mysql_fetch_object($result)) {
        if ($prvincid != $row->id) {
            echo "<strong>[{$row->siteid}] {$row->name}</strong> {$strIncident}: <a href=\"javascript:incident_details_window_l('{$row->id}', 'incident{$row->id}')\">{$row->id}</a>  ";
            echo "{$strDate}: " . ldate('d M Y', $row->opened) . " ";
            echo "{$strProduct}: " . product_name($row->product);
            $site = $row->siteid;
            ${$site}++;
            $sites[] = $row->siteid;
            echo "<br />\n";
        }
        $prvincid = $row->id;
        // print_r($row);
    }
} else {
    echo "<p class='warning'>{$strNoRecords}</p>";
}
$sites = array_unique($sites);
/*
foreach ($sites AS $site => $val)
Ejemplo n.º 8
0
function display_holiday_table($result)
{
    global $CONFIG, $user, $approver, $mode, $sit;
    echo "<table align='center'>";
    echo "<tr>";
    if ($user == 'all' && $approver == TRUE) {
        echo "<th>{$GLOBALS['strName']}</th>";
    }
    echo "<th>{$GLOBALS['strDate']}</th><th>{$GLOBALS['strLength']}</th><th>{$GLOBALS['strType']}</th>";
    if ($approver and $mode == 'approval') {
        echo "<th>{$GLOBALS['strOperation']}</th><th>{$GLOBALS['strGroupMembersAway']}</th>";
    }
    //    else
    //    {
    //        echo "<th>{$GLOBALS['strStatus']}</th>";
    //    }
    echo "</tr>";
    while ($holiday = mysql_fetch_object($result)) {
        echo "<tr class='shade2'>";
        if ($user == 'all' && $approver == TRUE) {
            echo "<td><a href='{$_SERVER['PHP_SELF']}?user={$holiday->userid}&amp;mode=approval'>";
            echo user_realname($holiday->userid, TRUE);
            echo "</a></td>";
        }
        echo "<td>" . ldate($CONFIG['dateformat_longdate'], mysql2date($holiday->date, TRUE)) . "</td>";
        echo "<td>";
        if ($holiday->length == 'am') {
            echo $GLOBALS['strMorning'];
        }
        if ($holiday->length == 'pm') {
            echo $GLOBALS['strAfternoon'];
        }
        if ($holiday->length == 'day') {
            echo $GLOBALS['strFullDay'];
        }
        echo "</td>";
        echo "<td>" . holiday_type($holiday->type) . "</td>";
        if ($approver == TRUE) {
            if ($sit[2] != $holiday->userid and $mode == 'approval') {
                echo "<td>";
                $approvetext = $GLOBALS['strApprove'];
                if ($holiday->type == HOL_SICKNESS) {
                    $approvetext = $GLOBALS['strAcknowledge'];
                }
                echo "<a href=\"holiday_approve.php?approve=TRUE&amp;user={$holiday->userid}&amp;view={$user}&amp;startdate={$holiday->date}&amp;type={$holiday->type}&amp;length={$holiday->length}\">{$approvetext}</a> | ";
                echo "<a href=\"holiday_approve.php?approve=FALSE&amp;user={$holiday->userid}&amp;view={$user}&amp;startdate={$holiday->date}&amp;type={$holiday->type}&amp;length={$holiday->length}\">{$GLOBALS['strDecline']}</a>";
                if ($holiday->type == HOL_HOLIDAY) {
                    echo " | <a href=\"holiday_approve.php?approve=FREE&amp;user={$holiday->userid}&amp;view={$user}&amp;startdate={$holiday->date}&amp;type={$holiday->type}&amp;length={$holiday->length}\">{$GLOBALS['strApproveFree']}</a>";
                }
                echo "</td>";
            } else {
                echo "<td>";
                if ($holiday->approvedby > 0) {
                    echo sprintf($GLOBALS['strRequestSentToX'], user_realname($holiday->approvedby, TRUE));
                } else {
                    echo $GLOBALS['strRequestNotSent'];
                    $waiting = TRUE;
                }
                echo "</td>";
            }
            if ($approver == TRUE and $mode == 'approval') {
                echo "<td>";
                echo check_group_holiday($holiday->userid, $holiday->date, $holiday->length);
                echo "</td>";
            }
        }
        echo "</tr>\n";
    }
    echo "</table>\n";
}
switch ($mode) {
    case 'edit':
        $sql = "SELECT bodytext, duration FROM `{$dbUpdates}` WHERE id = {$updateid} AND duration IS NOT NULL AND duration != 0";
        $oldduration = cleanvar($_REQUEST['oldduration']);
        $reason = cleanvar($_REQUEST['reason']);
        $newduration = cleanvar($_REQUEST['newduration']);
        // In minutes
        $result = mysql_query($sql);
        if (mysql_error()) {
            trigger_error(mysql_error(), E_USER_WARNING);
        }
        if (mysql_num_rows($result) == 1) {
            $obj = mysql_fetch_object($result);
            if ($obj->duration == $oldduration) {
                // Double check the oldduration thats been passed is whats in the DB
                $text = "{$obj->bodytext}\n\n[b]Duration adjusted[/b] by " . user_realname($sit[2]) . " on " . ldate($CONFIG['dateformat_datetime'], $now) . " from " . ceil($obj->duration) . "minutes to {$newduration}minutes, reason given:\n---\n{$reason}\n---";
                // FIXME should this be i18n? If so which language
                // $newduration *= 60;
                $usql = "UPDATE `{$dbUpdates}` SET bodytext = '" . mysql_real_escape_string($text) . "', duration = '{$newduration}' WHERE id = '{$updateid}'";
                mysql_query($usql);
                if (mysql_error()) {
                    trigger_error(mysql_error(), E_USER_WARNING);
                }
                // Some error checking
                if (mysql_affected_rows() < 1) {
                    html_redirect("{$CONFIG['application_webpath']}incident_details.php?id={$incidentid}", FALSE, $strFailed);
                } else {
                    html_redirect("{$CONFIG['application_webpath']}incident_details.php?id={$incidentid}", TRUE, $strDurationUpdated);
                }
            } else {
                // The value we've been passed isn't whats in the DB
Ejemplo n.º 10
0
    exit;
}
// Display planner chart
echo "<h2>{$strMonthView}</h2>";
$nextyear = $year;
if ($month < 12) {
    $nextmonth = $month + 1;
} else {
    $nextmonth = 1;
    $nextyear = $year + 1;
}
$prevyear = $year;
if ($month > 1) {
    $prevmonth = $month - 1;
} else {
    $prevmonth = 12;
    $prevyear = $year - 1;
}
$plugin_calendar = plugin_do('holiday_chart_cal');
echo month_select($month, $year, $gidurl);
echo "<p align='center'><a href='{$_SERVER['PHP_SELF']}?month={$prevmonth}&amp;";
echo "year={$prevyear}{$gidurl}' title='Previous Month'>&lt;</a> ";
echo ldate('F Y', mktime(0, 0, 0, $month, 1, $year));
echo " <a href='{$_SERVER['PHP_SELF']}?month={$nextmonth}&amp;year={$nextyear}{$gidurl}' ";
echo "title='Next Month'>&gt;</a></p>";
// echo draw_chart('month', $year, $month, $day, '', $user);
$numgroups = group_selector($groupid, "display={$display}&amp;year={$year}&amp;month={$month}&amp;day={$day}");
if ($groupid == 'all') {
    $groupid = '';
}
echo draw_chart('month', $year, $month, $day, $groupid, $user);
Ejemplo n.º 11
0
 foreach ($contracts as $contract) {
     $sql = "SELECT *, m.id AS id ";
     $sql .= "FROM `{$dbMaintenance}` AS m, `{$dbProducts}` AS p ";
     $sql .= "WHERE m.id={$contract} ";
     $sql .= "AND (m.expirydate > UNIX_TIMESTAMP(NOW()) OR m.expirydate = -1) ";
     $sql .= "AND m.product=p.id ";
     $result = mysql_query($sql);
     if (mysql_error()) {
         trigger_error(mysql_error(), E_USER_WARNING);
     }
     $shade = 'shade1';
     if ($row = mysql_fetch_object($result)) {
         if ($row->expirydate == -1) {
             $row->expirydate = $strUnlimited;
         } else {
             $row->expirydate = ldate("jS F Y", $row->timestamp);
         }
         echo "<tr class='{$shade}'>";
         //echo "<td>{$row->id}</td>";
         echo "<td>{$row->name}</td><td>{$row->expirydate}</td>";
         echo "<td>";
         if ($row->allcontactssupported == 'yes') {
             echo "<select disabled='disabled'>";
             echo "<option>{$strAllSiteContactsSupported}</option>";
             echo "</select>";
             echo "</td>";
         } else {
             echo "<select name='visibility[{$row->id}]'>";
             echo "<option value='no-one'";
             if ($row->var_incident_visible_contacts == 'no' and $row->var_incident_visible_all == 'no') {
                 echo " selected='selected'";
Ejemplo n.º 12
0
     echo "</td><td>";
     if (empty($results['licence_type'])) {
         echo $strNoLicense;
     } else {
         if ($results['licence_quantity'] == 0) {
             echo "{$strUnlimited} ";
         } else {
             echo "{$results['licence_quantity']} ";
         }
         echo $results['licence_type'];
     }
     echo "</td><td>";
     if ($results["expirydate"] == '-1') {
         echo $strUnlimited;
     } else {
         echo ldate($CONFIG['dateformat_date'], $results["expirydate"]);
     }
     echo "</td>";
     echo "<td>";
     if ($results["notes"] == '') {
         echo "&nbsp;";
     } else {
         echo nl2br($results["notes"]);
     }
     echo "</td>";
     echo "<td><a href='contract_edit.php?action=edit&amp;maintid={$results['maintid']}'>{$strEdit}</a></td>";
     echo "</tr>";
 }
 echo "</table>";
 // free result and disconnect
 mysql_free_result($result);
Ejemplo n.º 13
0
            }
        } elseif ($rowcount >= 4) {
            echo "Various";
        }
        echo "<br /><a href='kb_view_article.php?id={$kbarticle->docid}' class='info'>{$kbarticle->title}";
        $asql = "SELECT LEFT(content,400) FROM `{$dbKBContent}` WHERE docid='{$kbarticle->docid}' ORDER BY id ASC LIMIT 1";
        $aresult = mysql_query($asql);
        if (mysql_error()) {
            trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
        }
        list($content) = mysql_fetch_row($aresult);
        $content = strip_tags(remove_slashes($content));
        echo "<span>{$content}</span>";
        echo "</a>";
        echo "</td>";
        echo "<td>" . ldate($CONFIG['dateformat_date'], mysql2date($kbarticle->published)) . "</td>";
        echo "<td>" . $kbarticle->author . "</td>";
        echo "<td>{$kbarticle->keywords}</td>";
        echo "</tr>\n";
        if ($shade == 'shade1') {
            $shade = 'shade2';
        } else {
            $shade = 'shade1';
        }
    }
    echo "</table>\n";
} else {
    echo "<p align='center'>{$strNoResults}</p>";
}
// echo "<!---SQL === $sql --->";
echo "<p align='center'><a href='kb_article.php'>{$strAddNew}</a></p>";
Ejemplo n.º 14
0
function dashboard_rss_display($dashletid)
{
    global $CONFIG, $dbInterfaceStyles, $dbDashboardRSS, $sit, $lib_path;
    if ($_SESSION['auth'] == TRUE) {
        $styleid = $_SESSION['style'];
    } else {
        $styleid = $CONFIG['default_interface_style'];
    }
    $csssql = "SELECT cssurl, iconset FROM `{$dbInterfaceStyles}` WHERE id='{$styleid}'";
    $cssresult = mysql_query($csssql);
    if (mysql_error()) {
        trigger_error(mysql_error(), E_USER_WARNING);
    } else {
        list($cssurl, $iconset) = mysql_fetch_row($cssresult);
    }
    /*
    Originally from dashboard/dashboard.inc.php
    */
    require_once APPLICATION_LIBPATH . 'magpierss/rss_fetch.inc';
    $sql = "SELECT url, items FROM `{$CONFIG['db_tableprefix']}dashboard_rss` WHERE owner = {$sit[2]} AND enabled = 'true'";
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error(mysql_error(), E_USER_WARNING);
    }
    define('MAGPIE_CACHE_ON', TRUE);
    define('MAGPIE_CACHE_DIR', $CONFIG['attachment_fspath'] . 'feeds');
    define('MAGPIE_OUTPUT_ENCODING', $i18ncharset);
    $feedallowedtags = '<img><strong><em><br><p>';
    if (mysql_num_rows($result) > 0) {
        while ($row = mysql_fetch_row($result)) {
            $url = $row[0];
            if ($rss = fetch_rss($url)) {
                //              if ($CONFIG['debug']) echo "<pre>".print_r($rss,true)."</pre>";
                echo "<table>";
                echo "<tr><th><span style='float: right;'><a href='" . htmlspecialchars($url) . "'>";
                echo "<img src='{$CONFIG['application_webpath']}images/icons/{$iconset}/12x12/feed-icon.png' alt='Feed Icon' />";
                echo "</a></span>";
                echo "<a href='{$rss->channel['link']}' class='direct info'>{$rss->channel['title']}";
                if (!empty($rss->image['url']) or !empty($rss->channel['description']) or !empty($rss->channel['icon'])) {
                    echo "<span>";
                    if (!empty($rss->image['url'])) {
                        echo "<img src='{$rss->image['url']}' alt='{$rss->image['title']}' style='float: right; margin-right: 2px; margin-left: 5px; margin-top: 2px;' />";
                    } elseif (!empty($rss->channel['icon'])) {
                        echo "<img src='{$rss->channel['icon']}' style='float: right; margin-right: 2px; margin-left: 5px; margin-top: 2px;' />";
                    }
                    echo "{$rss->channel['description']}</span>";
                }
                echo "</a>";
                echo "</th></tr>\n";
                $counter = 0;
                foreach ($rss->items as $item) {
                    //echo "<pre>".print_r($item,true)."</pre>";
                    echo "<tr><td>";
                    echo "<a href='{$item['link']}' class='info'>{$item['title']}";
                    if ($rss->feed_type == 'RSS') {
                        if (!empty($item['pubdate'])) {
                            $itemdate = strtotime($item['pubdate']);
                        } elseif (!empty($item['dc']['date'])) {
                            $itemdate = strtotime($item['dc']['date']);
                        } else {
                            $itemdate = '';
                        }
                        $d = strip_tags($item['description'], $feedallowedtags);
                    } elseif ($rss->feed_type == 'Atom') {
                        if (!empty($item['issued'])) {
                            $itemdate = strtotime($item['issued']);
                        } elseif (!empty($item['published'])) {
                            $itemdate = strtotime($item['published']);
                        }
                        $d = strip_tags($item['atom_content'], $feedallowedtags);
                    }
                    if ($itemdate > 10000) {
                        $itemdate = ldate($CONFIG['dateformat_datetime'], $itemdate);
                    }
                    echo "<span>";
                    if (!empty($itemdate)) {
                        echo "<strong>{$itemdate}</strong><br />";
                    }
                    echo "{$d}</span></a></td></tr>\n";
                    $counter++;
                    if ($row[1] > 0 and $counter > $row[1]) {
                        break;
                    }
                }
                echo "</table>\n";
            } else {
                echo "Error: It's not possible to get {$url}...";
            }
        }
    } else {
        echo "<p align='center'>{$GLOBALS['strNoRecords']}</p>";
    }
}
Ejemplo n.º 15
0
<?php 
        echo $Form->end();
    }
    ?>

<div class="comment">
<div class="author"><?php 
    echo h($comment->author);
    ?>
</div>
<div class="content">
<?php 
    echo h($comment->content);
    ?>
</div>
<div class="byline">
<?php 
    echo '<time datetime="' . date('c', $comment->created) . '" title="' . ldate($comment->created) . '">' . sdate($comment->created) . '</time>';
    ?>
</div>

</div>
</li>

<?php 
}
?>
</ul>

<?php 
echo $this->embed('comments/pagination.html');
Ejemplo n.º 16
0
echo "<img src='{$CONFIG['application_webpath']}images/sitting_man_logo16x16.png' width='16' height='16' border='0' alt='About {$CONFIG['application_shortname']}' />";
if ($_SESSION['auth'] == TRUE) {
    echo "</a>";
}
echo " <strong><a href='http://sitracker.org/'>Support Incident Tracker</a>";
if ($_SESSION['auth'] == TRUE) {
    echo " {$application_version_string}";
}
echo "</strong>";
if ($_SESSION['auth'] == TRUE) {
    echo " running ";
    if ($CONFIG['demo']) {
        echo "in DEMO mode ";
    }
    echo "on " . strip_tags($_SERVER["SERVER_SOFTWARE"]);
    echo " at " . ldate('H:i', $now, FALSE);
}
echo "</div>\n";
if ($_SESSION['auth'] == TRUE and (!empty($application_revision) and substr($application_revision, 0, 4) == 'beta' or substr($application_revision, 0, 5) == 'alpha' or substr($application_revision, 0, 3) == 'svn')) {
    echo "<p class='warning'>" . sprintf($strPreReleaseNotice, "v{$application_version} {$application_revision}");
    echo ". <a href=\"{$CONFIG['bugtracker_url']}\" target='_blank' >{$strReportBug}</a></p>";
}
if ($CONFIG['debug'] == TRUE) {
    echo "\n<div id='tail'><strong>DEBUG</strong><br />";
    $exec_time_end = getmicrotime();
    $exec_time = $exec_time_end - $exec_time_start;
    echo "<p>CPU Time: " . number_format($exec_time, 3) . " seconds</p>";
    if (isset($dbg)) {
        echo "<hr /><pre>" . print_r($dbg, true) . "</pre>";
    }
    echo $CONFIG['working_days'];
Ejemplo n.º 17
0
function month_select($month, $year, $params = '')
{
    $cyear = $year;
    $cmonth = $month - 3;
    if ($cmonth < 1) {
        $cmonth += 12;
        $cyear--;
    }
    $html = "<p align='center'>";
    $pmonth = $cmonth - 5;
    $pyear = $cyear - 1;
    $nyear = $cyear + 1;
    $html .= "<a href='{$SERVER['PHP_SELF']}?display=month&amp;month={$month}";
    $html .= "&amp;year={$pyear}{$params}' title='Back one year'>&lt;&lt;</a> ";
    for ($c = 1; $c <= 12; $c++) {
        if (gmmktime(0, 0, 0, $cmonth, 1, $cyear) == gmmktime(0, 0, 0, date('m'), 1, date('Y'))) {
            $html .= "<span class='calnavcurrent' style='background: #FF0;'>";
        }
        // Current month
        if (gmmktime(0, 0, 0, $cmonth, 1, $cyear) == gmmktime(0, 0, 0, $month, 1, $year)) {
            $html .= "<span class='calnavselected' style='font-size: 160%'>";
        }
        $html .= "<a href='{$SERVER['PHP_SELF']}?display=month&amp;month={$cmonth}&amp;year={$cyear}{$params}'>";
        $html .= ldate('M y', gmmktime(0, 0, 0, $cmonth, 1, $cyear)) . "</a>";
        if (gmmktime(0, 0, 0, $cmonth, 1, $cyear) == gmmktime(0, 0, 0, $month, 1, $year)) {
            $html .= "</span>";
        }
        if (gmmktime(0, 0, 0, $cmonth, 1, $cyear) == gmmktime(0, 0, 0, date('m'), 1, date('Y'))) {
            $html .= "</span>";
        }
        if ($c < 12) {
            $html .= " <span style='color: #666;'>|</span> ";
        }
        $cmonth++;
        if ($cmonth > 12) {
            $cmonth -= 12;
            $cyear++;
        }
    }
    $html .= " <a href='{$SERVER['PHP_SELF']}?month=display=month&amp;{$month}&amp;year={$nyear}{$params}' title='Forward one year'>&gt;&gt;</a>";
    $html .= "</p>";
    return $html;
}
Ejemplo n.º 18
0
             }
         }
     }
 }
 if ($moved_attachments) {
     // retrieve the update body so that we can insert time headers
     $sql = "SELECT incidentid, bodytext, timestamp FROM `{$dbUpdates}` WHERE id='{$updateid}'";
     $uresult = mysql_query($sql);
     if (mysql_error()) {
         trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
     }
     list($oldincidentid, $bodytext, $timestamp) = mysql_fetch_row($uresult);
     if ($oldincidentid == 0) {
         $oldincidentid = 'Inbox';
     }
     $prettydate = ldate('r', $timestamp);
     // prepend 'moved' header to bodytext
     $body = sprintf($SYSLANG['strMovedFromXtoXbyX'], "<b>{$oldincidentid}</b>", "<b>{$incidentid}</b>", "<b>" . user_realname($sit[2]) . "</b>") . "\n";
     $body .= sprintf($SYSLANG['strOriginalMessageReceivedAt'], "<b>{$prettydate}</b>") . "\n";
     $body .= $SYSLANG['strStatus'] . " -&gt; <b>{$SYSLANG['strActive']}</b>\n";
     $bodytext = $body . $bodytext;
     $bodytext = mysql_real_escape_string($bodytext);
     // move the update.
     $sql = "UPDATE `{$dbUpdates}` SET incidentid='{$incidentid}', userid='{$sit[2]}', bodytext='{$bodytext}', timestamp='{$now}' WHERE id='{$updateid}'";
     mysql_query($sql);
     if (mysql_error()) {
         trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
     }
     //remove from tempincoming to prevent build up
     $sql = "DELETE FROM `{$dbTempIncoming}` WHERE updateid='{$updateid}'";
     mysql_query($sql);
Ejemplo n.º 19
0
 if (mysql_num_rows($result) == 1) {
     echo " {$strResult}</h3>";
 } else {
     echo " {$strResults}</h3>";
 }
 echo "<table align='center'>\n                <tr>\n                <th>{$strContract}</th>\n                <th>{$strSite}</th>\n                <th>{$strProduct}</th>\n                <th>{$strReseller}</th>\n                <th>{$strLicense}</th>\n                <th>{$strExpiryDate}</th>\n                <th>{$strAdminContact}</th>\n                <th>{$strTelephone}</th>\n                <th>{$strEmail}</th>\n                <th>{$strNotes}</th>\n                </tr>\n";
 // FIXME check data protection fields for email and telephone
 $shade = 'shade1';
 while ($results = mysql_fetch_object($result)) {
     echo "<tr>";
     echo "<td align='center' class='{$shade}' width='50'><a href='contract_details.php?id={$results->maintid}'>{$results->maintid}</a></td>";
     echo "<td align='center' class='{$shade}' width='100'>{$results->site}</td>";
     echo "<td align='center' class='{$shade}' width='100'>{$results->product}</td>";
     echo "<td align='center' class='{$shade}' width='100'>{$results->reseller}</td>";
     echo "<td align='center' class='{$shade}' width='75'>{$results->licence_quantity} {$results->licence_type}</td>";
     echo "<td align='center' class='{$shade}' width='100'>" . ldate($CONFIG['dateformat_date'], $results->expirydate) . "</td>";
     echo "<td align='center' class='{$shade}' width='100'><a href=\"javascript: contact_details_window({$results->admincontact})\">{$results->admincontactforenames} {$results->admincontactsurname}</a></td>";
     echo "<td class='{$shade}'>{$results->admincontactphone}</td>";
     echo "<td class='{$shade}'>{$results->admincontactemail}</td>";
     echo "<td align='center' class='{$shade}' width='150'>";
     if ($results->notes == '') {
         echo "&nbsp;";
     } else {
         echo nl2br($results->notes);
     }
     echo "</td></tr>";
     // invert shade
     if ($shade == 'shade1;') {
         $shade = 'shade2';
     } else {
         $shade = 'shade1';
Ejemplo n.º 20
0
         echo icon('rightarrow', 16, $strNext) . "</a> ";
     } else {
         echo "{$strNext}";
     }
     echo "</p>";
     echo "<table align='center' width='80%'>";
     $filter['domain'] = 'incident';
     echo "<tr>" . colheader(id, $strID, $sort, $order, $filter);
     echo colheader(incident, $strIncident, $sort, $order, $filter);
     echo colheader(result, $strResult, $sort, $order, $filter);
     //echo colheader(score, $strScore, $sort, $order, $filter);
     echo colheader(date, $strDate, $sort, $order, $filter);
     $shade = 'shade1';
     while ($row = mysql_fetch_object($incidentresult)) {
         $url = "javascript:incident_details_window('{$row->id}', 'incident{$row->id}')";
         echo "<tr class='{$shade}'>\n                    <td><a href=\"incident_details.php?id={$row->id}\">{$row->id}</a></td>\n                    <td><a href=\"{$url}\">" . search_highlight($row->title, $search) . "</a></td>\n                    <td>" . search_highlight($row->bodytext, $search) . "</td>\n                    <td>" . ldate($CONFIG['dateformat_datetime'], $row->timestamp) . "</td></tr>";
         if ($shade == 'shade1') {
             $shade = 'shade2';
         } else {
             $shade = 'shade1';
         }
     }
     echo "</table>";
 }
 //SITE RESULTS
 $sitesql = "SELECT *,MATCH (name) AGAINST ('{$search}' IN BOOLEAN MODE) AS score ";
 $sitesql .= "FROM `{$dbSites}` as s ";
 $sitesql .= "WHERE MATCH (name) AGAINST ('{$search}' IN BOOLEAN MODE) ";
 if ($domain == 'sites' and !empty($sort)) {
     if ($sort == 'id') {
         $sitesql .= "ORDER BY k.title ";
Ejemplo n.º 21
0
foreach ($holidaytype as $htypeid => $htype) {
    $sql = "SELECT * FROM `{$dbHolidays}` ";
    $sql .= "WHERE userid='{$user}' AND type={$htypeid} ";
    $sql .= "AND (approved=" . HOL_APPROVAL_GRANTED . " OR (approved=" . HOL_APPROVAL_GRANTED_ARCHIVED . " AND date >= FROM_UNIXTIME({$now}))) ORDER BY date ASC ";
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
    }
    $numtaken = mysql_num_rows($result);
    $totaltaken += $numtaken;
    if ($numtaken > 0) {
        echo "<tr class='shade2'><td colspan='4'><strong>{$htype}</strong>:</td></tr>";
        while ($dates = mysql_fetch_object($result)) {
            $dates->date = mysql2date($dates->date, TRUE);
            echo "<tr class='shade1'>";
            echo "<td colspan='2'>" . ldate('l', $dates->date, TRUE) . " ";
            if ($dates->length == 'am') {
                echo "<u>{$strMorning}</u> ";
            }
            if ($dates->length == 'pm') {
                echo "<u>{$strAfternoon}</u> ";
            }
            echo date('jS F Y', $dates->date);
            echo "</td>";
            echo "<td";
            if ($dates->approved == HOL_APPROVAL_GRANTED_ARCHIVED or $dates->approved == HOL_APPROVAL_GRANTED and $dates->date < $today) {
                echo " colspan='2'";
            }
            echo ">";
            echo holiday_approval_status($dates->approved, $dates->approvedby);
            echo "</td>";
Ejemplo n.º 22
0
                } else {
                    echo $strNever;
                }
                echo "</td>";
                echo "</tr>";
                if ($shade == 'shade1') {
                    $shade = 'shade2';
                } else {
                    $shade = 'shade1';
                }
            }
            echo "</table>\n";
            // Debug time issues
            // Temporary debugging output, doesn't need i18n
            if ($CONFIG['debug']) {
                echo "<h2>Debug Time Issues</h2>";
                echo "<div style='width: 60%; border: 1px dashed red; margin: auto; padding: 5px;'>";
                echo "<p>Timezone: {$CONFIG['timezone']}<br />";
                echo "User UTC offset: {$_SESSION['utcoffset']}<br />";
                echo "Date: " . date('r') . "<br />";
                echo "Date now: " . date('r', $GLOBALS['now']) . "<br />";
                echo "LDate: " . ldate('r') . "<br />";
                echo "LDate now (system): " . ldate('r', $GLOBALS['now'], FALSE) . "<br />";
                echo "LDate now (utc): " . ldate('r', $GLOBALS['now'], TRUE) . "<br />";
                echo "</p></div>";
            }
            // TODO add a check to see if any of the above actions are long overdue, if they are
            // print a message explaining how to set up cron/scheduling
        }
        include APPLICATION_INCPATH . 'htmlfooter.inc.php';
}
Ejemplo n.º 23
0
?>
</td></tr>
<tr><th>Web Category:</th><td><?php 
echo $frow['webcategory'];
?>
</td></tr>
<tr><th>Description:</th><td><?php 
echo $frow['longdescription'];
?>
</td></tr>
<tr><th>File Version:</th><td><?php 
echo $frow['fileversion'];
?>
</td></tr>
<tr><th>File Date:</th><td><?php 
echo ldate($CONFIG['dateformat_filedatetime'], $frow['filedate']) . ' <strong>by</strong> ' . user_realname($frow['userid'], TRUE);
?>
</td></tr>
<?php 
if ($frow['expiry'] > 0) {
    ?>
<tr><th>Expiry:</th><td><?php 
    echo ldate($CONFIG['dateformat_filedatetime'], $frow['expiry']);
    ?>
</td></tr><?php 
}
echo "</table>\n";
echo "<p align='center'>";
echo "<a href='ftp_delete.php?id={$id}'>Delete this file</a> | ";
echo "<a href='ftp_edit_file.php?id={$id}'>Describe and Publish this file</a></p>";
include APPLICATION_INCPATH . 'htmlfooter.inc.php';
Ejemplo n.º 24
0
         $shade = 'shade1';
     }
 }
 $str .= "<tr class='{$shade}'>";
 if ($obj->site != $lastsite) {
     $str .= "<td>" . site_name($obj->site) . "</td>";
     $str .= "<td>" . product_name($obj->product) . "</td>";
 } else {
     $str .= "<td></td>";
     if ($obj->product != $lastproduct) {
         $str .= "<td>" . product_name($obj->product) . "</td>";
     } else {
         $str .= "<td></td>";
     }
 }
 $str .= "<td>" . ldate('Y-m-d', $obj->maintexpiry) . "</td>";
 $str .= "<td>{$obj->cust_ref}</td><td>{$obj->startdate}</td><td>{$obj->enddate}</td>";
 if ($obj->foc == 'yes') {
     $str .= "<td>{$strYes}</td>";
 } else {
     $str .= "<td>{$strNo}</td>";
 }
 $str .= "<td>{$CONFIG['currency_symbol']}" . number_format($obj->creditamount, 2) . "</td>";
 $str .= "<td>{$CONFIG['currency_symbol']}" . number_format($obj->balance, 2) . "</td>";
 $str .= "<td>{$CONFIG['currency_symbol']}" . number_format($awaitingapproval, 2) . "</td>";
 $str .= "<td>{$CONFIG['currency_symbol']}" . number_format($reserved, 2) . "</td>";
 $str .= "<td>{$CONFIG['currency_symbol']}" . number_format($actual, 2) . "</td>";
 $str .= "<td>{$CONFIG['currency_symbol']}{$obj->unitrate}</td>";
 $str .= "<td>{$unitsat1times}</td></tr>\n";
 $lastsite = $obj->site;
 $lastproduct = $obj->product;
Ejemplo n.º 25
0
     }
     echo "</td>";
     echo "<td>{$contract->name}</td>";
     echo "<td>";
     if ($contract->incident_quantity == 0) {
         echo "&#8734; {$strUnlimited}";
     } else {
         echo "{$contract->availableincidents}";
     }
     echo "</td>";
     echo "<td>{$contract->incidents_used}</td>";
     echo "<td>";
     if ($contract->expirydate == -1) {
         echo $strUnlimited;
     } else {
         echo ldate($CONFIG['dateformat_date'], $contract->expirydate);
     }
     echo "</td>";
     echo "<td>";
     if ($contract->expirydate > $now or $contract->expirydate == -1) {
         echo "<a href='add.php?contractid={$contract->id}&amp;product={$contract->product}'>{$strAddIncident}</a>";
     } else {
         echo $strExpired;
     }
     echo "</td></tr>\n";
     if ($shade == 'shade1') {
         $shade = 'shade2';
     } else {
         $shade = 'shade1';
     }
 }
Ejemplo n.º 26
0
         $duration += $billing[-1]['customerperiod'] - $a;
         echo "<td>" . format_date_friendly($enddate) . "</td>";
         echo "<td>" . format_seconds($duration) . "</td>";
         $closedduration += $duration;
         $temparray['owner'] = $task->owner;
         $temparray['starttime'] = $startdate;
         $temparray['duration'] = $duration;
         $billing[$task->owner][] = $temparray;
     }
     $totalduration += $duration;
     echo "<td>" . format_date_friendly($lastupdated) . "</td>";
 }
 if ($show == 'completed') {
     echo "<td>";
     if ($enddate > 0) {
         echo ldate($CONFIG['dateformat_date'], $enddate);
     }
     echo "</td>";
 }
 if ($mode == 'incident' or $show == 'incidents') {
     echo "<td>" . user_realname($task->owner) . "</td>";
     if ($task->owner == $sit[2] and $enddate == '0') {
         $engineerhasrunnintask = TRUE;
     }
 }
 if ($mode == 'incident' and $enddate == '0') {
     echo "<td><a href='view_task.php?id={$task->id}&amp;mode=incident&amp;incident={$id}' class='info'>";
     echo "{$strViewActivity}</a></td>";
 } elseif ($mode == 'incident') {
     echo "<td></td>";
 }
                ?>
</td>
                <td align='center' width='50'><?php 
                echo $results['servicelevel'] . "<br />" . priority_name($results["priority"]);
                ?>
</td>
                <td align='center' width='100'><?php 
                echo user_realname($results['owner'], TRUE);
                ?>
</td>
                <td align='center' width='150'><?php 
                echo ldate($CONFIG['dateformat_datetime'], $results["opened"]);
                ?>
</td>
                <td align='center' width='150'><?php 
                echo ldate($CONFIG['dateformat_datetime'], $results["lastupdated"]);
                ?>
</td>
                <td align='center' width='50'><?php 
                echo $results["type"];
                ?>
</td>
                <td align='center' width='50'><?php 
                echo incidentstatus_name($results["status"]);
                ?>
</td>
                </tr>
                <?php 
                // invert shade
                if ($shade == 1) {
                    $shade = 0;
Ejemplo n.º 28
0
/**
    * HTML table showing a summary of current contract service periods
    * @author Ivan Lucas
    * @param int $contractid. Contract ID of the contract to show service for
    * @param bool $billing. Show billing info when TRUE, hide it when FALSE
    * @returns string. HTML table
*/
function contract_service_table($contractid, $billing)
{
    global $CONFIG, $dbService;
    $sql = "SELECT * FROM `{$dbService}` WHERE contractid = {$contractid} ORDER BY enddate DESC";
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
    }
    if (mysql_num_rows($result) > 0) {
        $shade = '';
        $html = "\n<table align='center'>";
        $html .= "<tr>";
        if ($billing) {
            $html .= "<th></th>";
        }
        $html .= "<th>{$GLOBALS['strStartDate']}</th><th>{$GLOBALS['strEndDate']}</th>";
        if ($billing) {
            $html .= "<th>{$GLOBALS['strAvailableBalance']}</th>";
        }
        $html .= "<th>{$GLOBALS['strOperation']}</th>";
        $html .= "</tr>\n";
        while ($service = mysql_fetch_object($result)) {
            $service->startdate = mysql2date($service->startdate . '09:00');
            $service->enddate = mysql2date($service->enddate . '17:00');
            $service->lastbilled = mysql2date($service->lastbilled);
            $html .= "<tr class='{$shade}'>";
            if ($billing) {
                $balance = get_service_balance($service->serviceid);
                $awaitingapproval = service_transaction_total($service->serviceid, BILLING_AWAITINGAPPROVAL) * -1;
                $reserved = service_transaction_total($service->serviceid, BILLING_RESERVED) * -1;
                $span = "<strong>{$GLOBALS['strServiceID']}:</strong> {$service->serviceid}<br />";
                if (!empty($service->title)) {
                    $span .= "<strong>{$GLOBALS['strTitle']}</strong>: {$service->title}<br />";
                }
                if (!empty($service->notes)) {
                    $span .= "<strong>{$GLOBALS['strNotes']}</strong>: {$service->notes}<br />";
                }
                if (!empty($service->cust_ref)) {
                    $span .= "<strong>{$GLOBALS['strCustomerReference']}</strong>: {$service->cust_ref}";
                    if ($service->cust_ref_date != "1970-01-01") {
                        $span .= " - <strong>{$GLOBALS['strCustomerReferenceDate']}</strong>: {$service->cust_ref_date}";
                    }
                    $span .= "<br />";
                }
                if ($service->creditamount != 0) {
                    $span .= "<strong>{$GLOBALS['strCreditAmount']}</strong>: {$CONFIG['currency_symbol']}" . number_format($service->creditamount, 2) . "<br />";
                }
                if ($service->unitrate != 0) {
                    $span .= "<strong>{$GLOBALS['strUnitRate']}</strong>: {$CONFIG['currency_symbol']}{$service->unitrate}<br />";
                }
                if ($balance != $service->balance) {
                    $span .= "<strong>{$GLOBALS['strBalance']}</strong>: {$CONFIG['currency_symbol']}" . number_format($service->balance, 2) . "<br />";
                    if ($awaitingapproval != FALSE) {
                        $span .= "<strong>{$GLOBALS['strAwaitingApproval']}</strong>: {$CONFIG['currency_symbol']}" . number_format($awaitingapproval, 2) . "<br />";
                    }
                    if ($reserved != FALSE) {
                        $span .= "<strong>{$GLOBALS['strReserved']}</strong>: {$CONFIG['currency_symbol']}" . number_format($reserved, 2) . "<br />";
                    }
                    $span .= "<strong>{$GLOBALS['strAvailableBalance']}</strong>: {$CONFIG['currency_symbol']}" . number_format($balance, 2) . "<br />";
                }
                if ($service->lastbilled > 0) {
                    $span .= "<strong>{$GLOBALS['strLastBilled']}</strong>: " . ldate($CONFIG['dateformat_date'], $service->lastbilled) . "<br />";
                }
                if ($service->foc == 'yes') {
                    $span .= "<strong>{$GLOBALS['strFreeOfCharge']}</strong>";
                }
                $html .= "<td><a href='transactions.php?serviceid={$service->serviceid}' class='info'>" . icon('billing', 16);
                if (!empty($span)) {
                    $html .= "<span>{$span}</span>";
                }
                $html .= "</a></td>";
                $html .= "<td><a href='transactions.php?serviceid={$service->serviceid}' class='info'>" . ldate($CONFIG['dateformat_date'], $service->startdate);
                if (!empty($span)) {
                    $html .= "<span>{$span}</span>";
                }
                $html .= "</a></td>";
            } else {
                $html .= "<td>" . ldate($CONFIG['dateformat_date'], $service->startdate);
                $html .= "</td>";
            }
            $html .= "<td>";
            $html .= ldate($CONFIG['dateformat_date'], $service->enddate) . "</td>";
            if ($billing) {
                $html .= "<td>{$CONFIG['currency_symbol']}" . number_format($balance, 2) . "</td>";
            }
            $html .= "<td><a href='contract_edit_service.php?mode=editservice&amp;serviceid={$service->serviceid}&amp;contractid={$contractid}'>{$GLOBALS['strEditService']}</a>";
            if ($billing) {
                $html .= " | <a href='contract_edit_service.php?mode=showform&amp;sourceservice={$service->serviceid}&amp;contractid={$contractid}'>{$GLOBALS['strEditBalance']}</a>";
            }
            $html .= "</td></tr>\n";
        }
        $html .= "</table>\n";
        if ($shade == 'shade1') {
            $shade = 'shade2';
        } else {
            $shade = 'shade1';
        }
    }
    return $html;
}
Ejemplo n.º 29
0
 echo colheader('timestamp', "{$strTime}/{$strDate}", $sort, $order, $filter);
 echo colheader('event', $strEvent);
 echo colheader('action', $strOperation);
 echo colheader('type', $strType);
 echo "</tr>\n";
 $shade = 0;
 while ($journal = mysql_fetch_object($result)) {
     // define class for table row shading
     if ($shade) {
         $class = "shade1";
     } else {
         $class = "shade2";
     }
     echo "<tr class='{$class}'>";
     echo "<td>" . user_realname($journal->userid, TRUE) . "</td>";
     echo "<td>" . ldate($CONFIG['dateformat_datetime'], mysqlts2date($journal->timestamp)) . "</td>";
     echo "<td>{$journal->event}</td>";
     echo "<td>";
     switch ($journal->journaltype) {
         case 2:
             echo "<a href='incident_details.php?id={$journal->refid}' target='_blank'>{$journal->bodytext}</a>";
             break;
         case 5:
             echo "<a href='contact_details.php?id={$journal->refid}' target='_blank'>{$journal->bodytext}</a>";
             break;
         default:
             echo "{$journal->bodytext}";
             if (!empty($journal->refid)) {
                 echo "(Ref: {$journal->refid})";
             }
             break;
Ejemplo n.º 30
0
        } else {
            echo "<strong>" . holiday_approval_status($dates['approved']) . "</strong>";
        }
        if ($dates['approvedby'] > 0 and $dates['approved'] >= 1) {
            echo " by " . user_realname($dates['approvedby']);
        } elseif ($dates['approvedby'] > 0 and empty($dates['approved'])) {
            echo " of " . user_realname($dates['approvedby']);
        }
        echo "</td>";
        echo "<td>";
        if ($approver == TRUE) {
            echo "<a href='holiday_add.php?hid={$dates['holidayid']}&amp;year=";
            echo substr($dates['date'], 0, 4) . "&amp;month=" . substr($dates['date'], 5, 2);
            echo "&amp;day=" . substr($dates['date'], 8, 2) . "&amp;user={$dates['userid']}";
            echo "&amp;type={$dates['type']}&amp;length=0&amp;return=list' ";
            echo "onclick=\"return window.confirm('{$dates['realname']}: " . ldate('l jS F Y', mysql2date($dates['date']));
            echo ": {$strAreYouSureDelete}');\">{$strDelete}</a>";
        }
        echo "</td></tr>\n";
        if ($shade == 'shade1') {
            $shade = 'shade2';
        } else {
            $shade = 'shade1';
        }
    }
    echo "</table>";
    if ($approver) {
        echo "<p align='center'><a href='{$_SERVER['PHP_SELF']}?display=list&amp;type={$type}&amp;user=all'>{$GLOBALS['strShowAll']}</a></p>";
    }
} else {
    echo "<p>{$GLOBALS['strNoResults']}</p>";