include APPLICATION_INCPATH . 'htmlheader.inc.php'; if (mysql_num_rows($result) > 0) { echo "<h2>{$title}</h2>"; echo "<p align='center'>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup>") . "</p>"; echo "<div style='width: 48%; float: left;'>"; echo "<form name='edittemplate' action='{$_SERVER['PHP_SELF']}?action=update' method='post' onsubmit=\"return confirm_action('{$strAreYouSureMakeTheseChanges}')\">"; echo "<table class='vertical' width='100%'>"; $tsql = "SELECT * FROM `{$dbTriggers}` WHERE action = '{$templateaction}' AND template = '{$id}' LIMIT 1"; $tresult = mysql_query($tsql); if (mysql_error()) { trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING); } if (mysql_num_rows($tresult) >= 1) { $trigaction = mysql_fetch_object($tresult); echo "<tr><th>{$strTrigger}</th><td>" . trigger_description($triggerarray[$trigaction->triggerid]) . "<br /><br />"; echo triggeraction_description($trigaction) . "</td></tr>"; } else { echo "<tr><th>{$strTrigger}</th><td>{$strNone}</td></tr>\n"; } // Set template type to the trigger type if no type is already specified if (empty($template->type)) { $template->type = $triggerarray[$trigaction->triggerid]['type']; } echo "<tr><th>{$strID}: <sup class='red'>*</sup></th><td>"; echo "<input maxlength='50' name='name' size='5' value='{$template->id} 'readonly='readonly' disabled='disabled' /></td></tr>\n"; echo "<tr><th>{$strTemplateType}:</th><td>"; if ($templatetype == 'notice') { echo icon('info', 32) . ' ' . $strNotice; } elseif ($templatetype == 'email') { echo icon('email', 32) . ' ' . $strEmail; } else {
echo "<td>"; $sql = "SELECT * FROM `{$dbTriggers}` WHERE triggerid = '{$trigger}' "; if ($selecteduser > -1) { $sql .= "AND userid = '{$selecteduser}' "; } $sql .= "ORDER BY action, template "; if (!$adminuser) { $sql .= "AND userid='{$sit[2]}'"; } $result = mysql_query($sql); if (mysql_error()) { trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING); } if (mysql_num_rows($result) >= 1) { while ($trigaction = mysql_fetch_object($result)) { echo triggeraction_description($trigaction, TRUE); echo " <a href='{$_SERVER['PHP_SELF']}?mode=delete&"; echo "id={$trigaction->id}' title=\"{$strDelete}\">"; echo icon('delete', 12) . "</a>"; if ($selecteduser == -1) { if ($trigaction->userid == 0) { echo " (<img src='{$CONFIG['application_webpath']}"; echo "images/sit_favicon.png' />)"; } else { echo " (" . icon('user', 16) . " "; echo user_realname($trigaction->userid) . ')'; } } echo "<br />\n"; } } else {