Ejemplo n.º 1
0
include APPLICATION_INCPATH . 'portalheader.inc.php';
$id = intval($_GET['id']);
$contactid = intval($_GET['contactid']);
$action = cleanvar($_GET['action']);
if ($id != 0 and $contactid != 0 and $action == 'remove') {
    if (in_array($id, admin_contact_contracts($_SESSION['contactid'], $_SESSION['siteid']))) {
        $sql = "DELETE FROM `{$dbSupportContacts}`\n                WHERE maintenanceid='{$id}'\n                AND contactid='{$contactid}'\n                LIMIT 1";
        $result = mysql_query($sql);
        if (mysql_error()) {
            trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
        } else {
            html_redirect($_SERVER['PHP_SELF'] . "?id={$id}");
            exit;
        }
    } else {
        echo "<p class='error'>{$strPermissionDenied}</p>";
    }
} elseif ($id != 0 and $action == 'add' and intval($_POST['contactid'] != 0)) {
    $contactid = intval($_POST['contactid']);
    $sql = "INSERT INTO `{$dbSupportContacts}`\n            (maintenanceid, contactid)\n            VALUES('{$id}', '{$contactid}')";
    $result = mysql_query($sql);
    if (mysql_error()) {
        trigger_error("MySQL Query Error " . mysql_error(), E_USER_ERROR);
    } else {
        html_redirect($_SERVER['PHP_SELF'] . "?id={$id}");
        exit;
    }
}
echo "<h2>" . icon('contract', 32) . " {$GLOBALS['strContract']}</h2>";
echo contract_details($id, 'external');
include APPLICATION_INCPATH . 'htmlfooter.inc.php';
Ejemplo n.º 2
0
<?php

// maintenance_details.php - Show contract details
//
// SiT (Support Incident Tracker) - Support call tracking system
// Copyright (C) 2000-2009 Salford Software Ltd. and Contributors
//
// This software may be used and distributed according to the terms
// of the GNU General Public License, incorporated herein by reference.
//
// Author: Ivan Lucas <ivanlucas[at]users.sourceforge.net>
// Created: 20th August 2001
// Purpose: Show All Maintenance Contract Details
// This Page Is Valid XHTML 1.0 Transitional! 27Oct05
$permission = 19;
// view Maintenance contracts
require 'core.php';
require APPLICATION_LIBPATH . 'functions.inc.php';
// This page requires authentication
require APPLICATION_LIBPATH . 'auth.inc.php';
$id = cleanvar($_REQUEST['id']);
$title = "{$strContract} - {$strContractDetails}";
include APPLICATION_INCPATH . 'htmlheader.inc.php';
// Display Maintenance
echo contract_details($id);
include APPLICATION_INCPATH . 'htmlfooter.inc.php';