} 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;
$shade = 'shade1'; foreach ($triggerarray as $trigger => $triggervar) { $perm = TRUE; //echo $trigger; if (isset($triggervar['permission'])) { //$triggervar['permission'] = trigger_replace_specials($trigger, $triggervar['permission'], array()); eval("\$res = {$triggervar['permission']}"); if (!$res) { $perm = FALSE; } } if ($perm) { if ($triggervar['type'] != 'system' and !$adminuser or $adminuser) { echo "<tr class='{$shade}'>"; echo "<td style='vertical-align: top; width: 25%;'>"; echo trigger_description($triggervar); echo "</td>"; // List actions for this trigger 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); }