Пример #1
0
    if ($_SESSION['contact_source'] != 'sit' and !empty($CONFIG['ldap_fax'])) {
        echo "<input type='hidden' name='fax' value='{$user->fax}' />" . $user->fax;
    } else {
        echo "<input name='fax' value='{$user->fax}' />";
    }
    echo "<tr><th>{$strEmail}</th><td>";
    if ($_SESSION['contact_source'] != 'sit' and !empty($CONFIG['ldap_email'])) {
        echo "<input type='hidden' name='email' value='{$user->email}' />{$user->email}";
    } else {
        echo "<input class='required' name='email' value='{$user->email}' />";
        echo " <span class='required'><span>{$strRequired}</span>";
    }
    echo "</td></tr>\n";
    if ($_SESSION['contact_source'] != 'sit') {
        echo "<tr><th>{$strNewPassword}</th><td><input name='newpassword' value='' type='password' /></td></tr>\n";
        echo "<tr><th>{$strRepeat}</th><td><input name='newpassword2' value='' type='password' /></td></tr>\n";
    }
    echo "</table>";
    echo "<p align='center'>";
    echo "<input type='hidden' name='id' value='{$id}' />";
    echo "<input type='submit' value='{$strUpdate}' /></p></form>";
    echo "<br />" . user_contracts_table($id, 'external');
    if ($_SESSION['usertype'] == 'admin') {
        echo "<h4>{$strAssociateContactWithContract}</h4>";
        echo "<form method='post' action='{$_SERVER['PHP_SELF']}?id={$id}'>";
        $exclude = contact_contracts($id, $_SESSION['siteid'], FALSE);
        echo "<p align='center'>" . maintenance_drop_down('maintid', 0, $_SESSION['siteid'], $exclude, TRUE, FALSE, $sit[2]) . "<br />";
        echo "<input type='submit' name='add' value='{$strAdd}' /></form></p>";
    }
    include APPLICATION_INCPATH . 'htmlfooter.inc.php';
}
$action = $_REQUEST['action'];
$context = cleanvar($_REQUEST['context']);
$maintid = cleanvar($_REQUEST['maintid']);
$contactid = cleanvar($_REQUEST['contactid']);
$title = "{$strContract} - {$strRemoveASupportedContact}";
if (empty($action) or $action == "showform") {
    include APPLICATION_INCPATH . 'htmlheader.inc.php';
    echo "<h2>{$strRemoveLinkContractAndSupportContact}</h2>";
    echo "<p align='center'>{$strRemoveLinkContractAndSupportContactText}</p>";
    echo "<form action='{$_SERVER['PHP_SELF']}?action=delete' method='post' onsubmit='return confirm_action(\"{$strAreYouSureDeleteMaintenceContract}\")'>";
    echo "<input type='hidden' name='context' value='{$context}' />";
    echo "<table align='center' class='vertical'>";
    if (empty($maintid)) {
        echo "<tr><th>{$strContract} " . icon('contract', 16) . "</th>";
        echo "<td>";
        maintenance_drop_down("maintid", 0);
        echo "</td></tr>";
    } else {
        echo "<tr><th>{$strContract} " . icon('contract', 16) . "</th>";
        echo "<td>{$maintid} - " . contract_product($maintid) . " for " . contract_site($maintid);
        echo "<input name=\"maintid\" type=\"hidden\" value=\"{$maintid}\" /></td></tr>";
    }
    if (empty($contactid)) {
        echo "<tr><th>{$strSupport} {$strContact} " . icon('contact', 16) . "</th><td width='400'>";
        echo contact_drop_down("contactid", 0) . "</td></tr>";
    } else {
        echo "<tr><th>{$strContact} " . icon('contact', 16) . "</th><td>{$contactid} - " . contact_realname($contactid);
        echo "<input name='contactid' type='hidden' value='{$contactid}' /></td></tr>";
    }
    echo "</table>";
    echo "<p align='center'><input name='submit' type='submit' value='{$strContinue}' /></p>";
$maintid = cleanvar($_REQUEST['maintid']);
$contactid = cleanvar($_REQUEST['contactid']);
$context = cleanvar($_REQUEST['context']);
$action = $_REQUEST['action'];
$title = "{$strContract} - {$strAddContact}";
// Valid user, check permissions
if (empty($action) || $action == "showform") {
    include APPLICATION_INCPATH . 'htmlheader.inc.php';
    echo "<h2>{$strAssociateContactWithContract}</h2>";
    echo "<form action='{$_SERVER['PHP_SELF']}?action=add' method='post'>";
    echo "<input type='hidden' name='context' value='{$context}' />";
    echo "<table align='center' class='vertical'>";
    if (empty($maintid)) {
        echo "<tr><th>{$strContract} " . icon('contract', 16) . "</th>";
        echo "<td width='400'>";
        maintenance_drop_down("maintid", 0, '', '', FALSE, TRUE);
        echo "</td></tr>";
    } else {
        $sql = "SELECT s.name, p.name FROM `{$dbMaintenance}` m, `{$dbSites}` s, `{$dbProducts}` p WHERE m.site=s.id ";
        $sql .= "AND m.product=p.id AND m.id='{$maintid}'";
        $result = mysql_query($sql);
        if (mysql_error()) {
            trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING);
        }
        list($sitename, $product) = mysql_fetch_row($result);
        echo "<tr><th>{$strContract} " . icon('contract', 16) . "</th><td>{$maintid} - {$sitename}, {$product}</td></tr>";
        echo "<input name=\"maintid\" type=\"hidden\" value=\"{$maintid}\" />";
    }
    if (empty($contactid)) {
        echo "<tr><th>{$strContact} " . icon('contact', 16) . "</th>";
        echo "<td>" . contact_drop_down("contactid", 0, TRUE) . "</td></tr>";