// // Author: Ivan Lucas <ivanlucas[at]users.sourceforge.net> $permission = 22; // Administrate require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; // External variables $tag = mysql_real_escape_string($_REQUEST['tag']); $priority = mysql_real_escape_string($_REQUEST['priority']); $action = $_REQUEST['action']; if (empty($action) or $action == "showform") { $title = $strAddServiceLevel; include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_servicelevel'); clear_form_errors('add_servicelevel'); if (empty($_SESSION['formdata']['add_servicelevel']['low_initial_response_mins'])) { $_SESSION['formdata']['add_servicelevel']['low_initial_response_mins'] = 320; } if (empty($_SESSION['formdata']['add_servicelevel']['low_prob_determ_mins'])) { $_SESSION['formdata']['add_servicelevel']['low_prob_determ_mins'] = 380; } if (empty($_SESSION['formdata']['add_servicelevel']['low_action_plan_mins'])) { $_SESSION['formdata']['add_servicelevel']['low_action_plan_mins'] = 960; } if (empty($_SESSION['formdata']['add_servicelevel']['low_resolution_days'])) { $_SESSION['formdata']['add_servicelevel']['low_resolution_days'] = 14; } if (empty($_SESSION['formdata']['add_servicelevel']['low_review_days'])) { $_SESSION['formdata']['add_servicelevel']['low_review_days'] = 28;
// // This Page Is Valid XHTML 1.0 Transitional! 24May2009 $permission = 39; // Add Maintenance Contract require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; $title = $strAddContract; // External variables $action = $_REQUEST['action']; $siteid = cleanvar($_REQUEST['siteid']); // Show add maintenance form if ($action == "showform" or $action == '') { include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_contract'); clear_form_errors('add_contract'); echo "<h2>" . icon('contract', 32) . " "; echo "{$strAddContract}</h2>"; echo "<form id='add_contract' name='add_contract' action='{$_SERVER['PHP_SELF']}?action=add' method='post' onsubmit='return confirm_action(\"{$strAreYouSureAdd}\");'>"; echo "<table align='center' class='vertical'>"; echo "<thead>"; echo "<tr><th>{$strSite}</th><td>"; if ($_SESSION['formdata']['add_contract']['site'] != '') { echo site_drop_down("site", $_SESSION['formdata']['add_contract']['site'], TRUE); } else { echo site_drop_down("site", $siteid, TRUE); } echo " <span class='required'>{$strRequired}</span></td></tr>\n"; echo "<tr><th>{$strContacts}</th><td>"; echo "<input value='amount' type='radio' name='contacts' checked='checked' />";
// of the GNU General Public License, incorporated herein by reference. // // Author: Ivan Lucas <ivanlucas[at]users.sourceforge.net> $permission = 24; // Add Product require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; $title = $strAddProduct; // External variables $submit = $_REQUEST['submit']; if (empty($submit)) { // Show add product form include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_product'); clear_form_errors('add_product'); echo "<h2>" . icon('product', 32) . " "; echo "{$strNewProduct}</h2>"; echo "<h5>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup>") . "</h5>"; echo "<form action='{$_SERVER['PHP_SELF']}' method='post' onsubmit='return confirm_action(\"{$strAreYouSureAdd}\");'>"; echo "<table align='center'>"; echo "<tr><th>{$strVendor}<sup class='red'>*</sup></th><td>"; if ($_SESSION['formdata']['add_product']['vendor'] != '') { echo vendor_drop_down('vendor', $_SESSION['formdata']['add_product']['vendor']) . "</td></tr>\n"; } else { echo vendor_drop_down('vendor', 0) . "</td></tr>\n"; } echo "<tr><th>{$strProduct}<sup class='red'>*</sup></th><td><input maxlength='50' name='name' size='40' "; if ($_SESSION['formdata']['add_product']['name'] != '') { echo "value=" . $_SESSION['formdata']['add_product']['name'];
// This software may be used and distributed according to the terms // of the GNU General Public License, incorporated herein by reference. // // Author: Paul Heaney <*****@*****.**> $permission = 9; // Edit User Permissions require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; $roleid = cleanvar($_REQUEST['roleid']); $submit = cleanvar($_REQUEST['submit']); if (empty($submit)) { $title = $strEditRole; include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('role_edit'); clear_form_errors('role_edit'); $sql = "SELECT * FROM `{$dbRoles}` WHERE id = {$roleid}"; $result = mysql_query($sql); if (mysql_error()) { trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING); } echo "<h2>{$strEditRole}</h2>"; if (mysql_num_rows($result) > 0) { $obj = mysql_fetch_object($result); echo "<form action'{$_SERVER['PHP_SELF']}' name='role_edit' method='post' >"; echo "<table class='vertical' align='center'>"; echo "<tr><th>{$strRole}</th><td>{$obj->id}</td></tr>"; echo "<tr><th>{$strName}</th><td><input type='text' name='rolename' id='rolename' value='{$obj->rolename}' /></td></tr>"; echo "<tr><th>{$strDescription}</th><td><textarea name='description' id='description' rows='5' cols='30'>{$obj->description}</textarea></td></tr>"; echo "</table>";
// // Author: Ivan Lucas <ivanlucas[at]users.sourceforge.net> // This Page Is Valid XHTML 1.0 Transitional! 27Oct05 $permission = 2; // Add new site require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; $title = $strNewSite; // External variables $action = $_REQUEST['action']; if ($action == "showform" or $action == '') { // Show add site form include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_site'); clear_form_errors('add_site'); echo "<h2>" . icon('site', 32) . " "; echo "{$strNewSite}</h2>"; echo "<form action='{$_SERVER['PHP_SELF']}?action=add' method='post' "; echo "onsubmit='return confirm_action(\"{$strAreYouSureAdd}\");'>"; echo "<table align='center' class='vertical'>"; echo "<tr><th>{$strName}</th><td><input maxlength='255' class='required' "; echo "name='name' size='30' "; echo "value='{$_SESSION['formdata']['add_site']['name']}'"; echo " /> <span class='required'>{$strRequired}</span></td></tr>\n"; echo "<tr><th>{$strDepartment}</th><td><input maxlength='255' name='department' size='30'"; echo "value='{$_SESSION['formdata']['add_site']['department']}' /></td></tr>\n"; echo "<tr><th>{$strAddress1}</th><td>"; echo "<input class='required' maxlength='255' name='address1' size='30'"; echo "value='{$_SESSION['formdata']['add_site']['address1']}' />";
/** * Update page */ function display_update_page($draftid = -1) { global $id; global $incidentid; global $action; global $CONFIG; global $iconset; global $now; global $dbDrafts; global $sit; if ($draftid != -1) { $draftsql = "SELECT * FROM `{$dbDrafts}` WHERE id = {$draftid}"; $draftresult = mysql_query($draftsql); if (mysql_error()) { trigger_error(mysql_error(), E_USER_WARNING); } $draftobj = mysql_fetch_object($draftresult); $metadata = explode("|", $draftobj->meta); } // No update body text detected show update form ?> <script type="text/javascript"> <!-- function deleteOption(object) { var Current = object.updatetype.selectedIndex; object.updatetype.options[Current] = null; } function notarget(object) { // remove last option var length = object.updatetype.length; if (length > 6) { object.updatetype.selectedIndex=6; var Current = object.updatetype.selectedIndex; object.updatetype.options[Current] = null; } object.priority.value=object.storepriority.value; //object.priority.disabled=true; object.priority.disabled=false; object.updatetype.selectedIndex=0; object.updatetype.disabled=false; } function initialresponse(object) { // remove last option var length = object.updatetype.length; if (length > 6) { object.updatetype.selectedIndex=6; var Current = object.updatetype.selectedIndex; object.updatetype.options[Current] = null; } object.priority.value=object.storepriority.value; object.priority.disabled=true; object.updatetype.selectedIndex=0; object.updatetype.disabled=false; } function actionplan(object) { // remove last option var length = object.updatetype.length; if (length > 6) { object.updatetype.selectedIndex=6; var Current = object.updatetype.selectedIndex; object.updatetype.options[Current] = null; } var defaultSelected = true; var selected = true; var optionName = new Option('Action Plan', 'actionplan', defaultSelected, selected) var length = object.updatetype.length; object.updatetype.options[length] = optionName; object.priority.value=object.storepriority.value; object.priority.disabled=true; object.updatetype.disabled=true; } function reprioritise(object) { // remove last option var length = object.updatetype.length; if (length > 6) { object.updatetype.selectedIndex=6; var Current = object.updatetype.selectedIndex; object.updatetype.options[Current] = null; } // add new option var defaultSelected = true; var selected = true; var optionName = new Option('Reprioritise', 'solution', defaultSelected, selected) var length = object.updatetype.length; object.updatetype.options[length] = optionName; object.priority.disabled=false; document.updateform.priority.disabled=false; object.updatetype.disabled=true; } function probdef(object) { // remove last option var length = object.updatetype.length; if (length > 6) { object.updatetype.selectedIndex=6; var Current = object.updatetype.selectedIndex; object.updatetype.options[Current] = null; } var defaultSelected = true; var selected = true; var optionName = new Option('Problem Definition', 'probdef', defaultSelected, selected) var length = object.updatetype.length; object.updatetype.options[length] = optionName; object.priority.value=object.storepriority.value; object.priority.disabled=true; object.updatetype.disabled=true; } function replaceOption(object) { var Current = object.updatetype.selectedIndex; object.updatetype.options[Current].text = object.currentText.value; object.updatetype.options[Current].value = object.currentText.value; } <?php echo "var draftid = {$draftid}"; ?> // Auto save function save_content(){ var xmlhttp=false; if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } var toPass = $('updatelog').value; //alert(toPass.value); var meta = $('target').value+"|"+$('updatetype').value+"|"+$('cust_vis').checked+"|"; meta += $('priority').value+"|"+$('newstatus').value+"|"+$('nextaction').value+"|"; if (toPass != '') { // xmlhttp.open("GET", "ajaxdata.php?action=auto_save&userid="+<?php echo $_SESSION['userid']; ?> +"&type=update&incidentid="+<?php echo $id; ?> +"&draftid="+draftid+"&meta="+meta+"&content="+escape(toPass), true); var url = "ajaxdata.php"; var params = "action=auto_save&userid="+<?php echo $_SESSION['userid']; ?> +"&type=update&incidentid="+<?php echo $id; ?> +"&draftid="+draftid+"&meta="+meta+"&content="+escape(toPass); xmlhttp.open("POST", url, true) xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.onreadystatechange=function() { //remove this in the future after testing if (xmlhttp.readyState==4) { if (xmlhttp.responseText != ''){ //alert(xmlhttp.responseText); if (draftid == -1) { draftid = xmlhttp.responseText; $('draftid').value = draftid; } var currentTime = new Date(); var hours = currentTime.getHours(); var minutes = currentTime.getMinutes(); if (minutes < 10) { minutes = "0"+minutes; } var seconds = currentTime.getSeconds(); if (seconds < 10) { seconds = "0"+seconds; } $('updatestr').innerHTML = '<?php echo "<a href=\"javascript:save_content();\">" . icon('save', 16, $GLOBALS['strSaveDraft']) . "</a> " . icon('info', 16, $GLOBALS['strDraftLastSaved']) . " "; ?> ' + hours + ':' + minutes + ':' + seconds; } } } xmlhttp.send(params); } } setInterval("save_content()", 10000); //every 10 seconds //--> </script> <?php echo show_form_errors('update'); clear_form_errors('update'); //echo "<form action='".$_SERVER['PHP_SELF']."?id={$id}&draftid={$draftid}' method='post' name='updateform' id='updateform' enctype='multipart/form-data'>"; echo "<form action='" . $_SERVER['PHP_SELF'] . "?id={$id}' method='post' name='updateform' id='updateform' enctype='multipart/form-data'>"; echo "<table class='vertical'>"; echo "<tr>"; echo "<th align='right' width='20%;'>{$GLOBALS['strSLATarget']}"; echo icon('sla', 16) . "</th>"; echo "<td class='shade2'>"; $target = incident_get_next_target($id); $targetNone = ''; $targetInitialresponse = ''; $targetProbdef = ''; $targetActionplan = ''; $targetSolution = ''; $typeResearch = ''; $typeEmailin = ''; $typeEmailout = ''; $typePhonecallin = ''; $typePhonecallout = ''; $typeExternalinfo = ''; $typeReviewmet = ''; if (!empty($metadata)) { switch ($metadata[0]) { case 'none': $targetNone = " SELECTED "; break; case 'initialresponse': $targetInitialresponse = " SELECTED "; break; case 'probdef': $targetProbdef = " SELECTED "; break; case 'actionplan': $targetActionplan = " SELECTED "; break; case 'solution': $targetSolution = " SELECTED "; break; } switch ($metadata[1]) { case 'research': $typeResearch = " SELECTED "; break; case 'emailin': $typeEmailin = " SELECTED "; break; case 'emailout': $typeEmailout = " SELECTED "; break; case 'phonecallin': $typePhonecallin = " SELECTED "; break; case 'phonecallout': $typePhonecallout = " SELECTED "; break; case 'externalinfo': $typeExternalinfo = " SELECTED "; break; case 'reviewmet': $typeReviewmet = " SELECTED "; break; } } echo "<select name='target' id='target' class='dropdown'>\n"; echo "<option value='none' {$targetNone} onclick='notarget(this.form)'>{$GLOBALS['strNone']}</option>\n"; switch ($target->type) { case 'initialresponse': echo "<option value='initialresponse' {$targetInitialresponse} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/initialresponse.png); background-repeat: no-repeat;' onclick='initialresponse(this.form)' >{$GLOBALS['strInitialResponse']}</option>\n"; echo "<option value='probdef' {$targetProbdef} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/probdef.png); background-repeat: no-repeat;' onclick='probdef(this.form)'>{$GLOBALS['strProblemDefinition']}</option>\n"; echo "<option value='actionplan' {$targetActionplan} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/actionplan.png); background-repeat: no-repeat;' onclick='actionplan(this.form)'>{$GLOBALS['strActionPlan']}</option>\n"; echo "<option value='solution' {$targetSolution} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/solution.png); background-repeat: no-repeat;' onclick='reprioritise(this.form)'>{$GLOBALS['strResolutionReprioritisation']}</option>\n"; break; case 'probdef': echo "<option value='probdef' {$targetProbdef} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/probdef.png); background-repeat: no-repeat;' onclick='probdef(this.form)'>{$GLOBALS['strProblemDefinition']}</option>\n"; echo "<option value='actionplan' {$targetActionplan} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/actionplan.png); background-repeat: no-repeat;' onclick='actionplan(this.form)'>{$GLOBALS['strActionPlan']}</option>\n"; echo "<option value='solution' {$targetSolution} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/solution.png); background-repeat: no-repeat;' onclick='reprioritise(this.form)'>{$GLOBALS['strResolutionReprioritisation']}</option>\n"; break; case 'actionplan': echo "<option value='actionplan' {$targetActionplan} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/actionplan.png); background-repeat: no-repeat;' onclick='actionplan(this.form)'>{$GLOBALS['strActionPlan']}</option>\n"; echo "<option value='solution' {$targetSolution} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/solution.png); background-repeat: no-repeat;' onclick='reprioritise(this.form)'>{$GLOBALS['strResolutionReprioritisation']}</option>\n"; break; case 'solution': echo "<option value='solution' {$targetSolution} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/solution.png); background-repeat: no-repeat;' onclick='reprioritise(this.form)'>{$GLOBALS['strResolutionReprioritisation']}</option>\n"; break; } echo "</select>\n"; echo "</td></tr>\n"; echo "<tr><th align='right'>{$GLOBALS['strUpdateType']}</th>"; echo "<td class='shade1'>"; echo "<select name='updatetype' id='updatetype' class='dropdown'>"; /* if ($target->type!='actionplan' && $target->type!='solution') echo "<option value='probdef'>Problem Definition</option>\n"; if ($target->type!='solution') echo "<option value='actionplan'>Action Plan</option>\n"; */ echo "<option value='research' {$typeResearch} selected='selected' style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/research.png); background-repeat: no-repeat;'>{$GLOBALS['strResearchNotes']}</option>\n"; echo "<option value='emailin' {$typeEmailin} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/emailin.png); background-repeat: no-repeat;'>{$GLOBALS['strEmailFromCustomer']}</option>\n"; echo "<option value='emailout' {$typeEmailout} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/emailout.png); background-repeat: no-repeat;'>{$GLOBALS['strEmailToCustomer']}</option>\n"; echo "<option value='phonecallin' {$typePhonecallin} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/callin.png); background-repeat: no-repeat;'>{$GLOBALS['strCallFromCustomer']}</option>\n"; echo "<option value='phonecallout' {$typePhonecallout} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/callout.png); background-repeat: no-repeat;'>{$GLOBALS['strCallToCustomer']}</option>\n"; echo "<option value='externalinfo' {$typeExternalinfo} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/externalinfo.png); background-repeat: no-repeat;'>{$GLOBALS['strExternalInfo']}</option>\n"; echo "<option value='reviewmet' {$typeReviewmet} style='text-indent: 15px; height: 17px; background-image: url({$CONFIG['application_webpath']}images/icons/{$iconset}/16x16/review.png); background-repeat: no-repeat;'>{$GLOBALS['strReview']}</option>\n"; echo "</select>"; echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<th align='right'>{$GLOBALS['strUpdate']}<br />"; echo "<span class='required'>{$GLOBALS['strRequired']}</span></th>"; echo "<td class='shade1'>"; $checkbox = ''; if (!empty($metadata)) { if ($metadata[2] == "true") { $checkbox = "checked='checked'"; } } else { $checkbox = "checked='checked'"; } echo "<label><input type='checkbox' name='cust_vis' id='cust_vis' "; echo "{$checkbox} value='yes' /> {$GLOBALS['strMakeVisibleInPortal']}<label><br />"; echo bbcode_toolbar('updatelog'); echo "<textarea name='bodytext' id='updatelog' rows='13' cols='50'>"; if ($draftid != -1) { echo $draftobj->content; } echo "</textarea>"; echo "<div id='updatestr'><a href='javascript:save_content();'>" . icon('save', 16, $GLOBALS['strSaveDraft']) . "</a></div>"; echo "</td></tr>"; if ($target->type == 'initialresponse') { $disable_priority = TRUE; } else { $disable_priority = FALSE; } echo "<tr><th align='right'>{$GLOBALS['strNewPriority']}</th>"; echo "<td class='shade1'>"; // // FIXME fix maximum priority // $servicelevel=maintenance_servicelevel(incident_maintid($id)); // if ($servicelevel == 2 || $servicelevel == 5) $maxpriority = 4; // else $maxpriority = 3; $maxpriority = 4; $setPriorityTo = incident_priority($id); if (!empty($metadata)) { $setPriorityTo = $metadata[3]; } echo priority_drop_down("newpriority", $setPriorityTo, $maxpriority, $disable_priority); //id='priority echo "</td></tr>\n"; echo "<tr>"; echo "<th align='right'>{$GLOBALS['strNewStatus']}</th>"; $setStatusTo = incident_status($id); $disabled = FALSE; //we do this so if you update another user's incident, it defaults to active if ($sit[2] != incident_owner($incidentid)) { $setStatusTo = '0'; } elseif (!empty($metadata)) { $setStatusTo = $metadata[4]; } echo "<td class='shade1'>" . incidentstatus_drop_down("newstatus", $setStatusTo) . "</td>"; echo "</tr>"; echo "<tr>"; echo "<th align='right'>{$GLOBALS['strNextAction']}</th>"; $nextAction = ''; if (!empty($metadata)) { $nextAction = $metadata[5]; } echo "<td class='shade2'><input type='text' name='nextaction' "; echo "id='nextaction' maxlength='50' size='30' value='{$nextAction}' /></td></tr>"; echo "<tr>"; echo "<th align='right'>"; echo "<strong>{$GLOBALS['strTimeToNextAction']}</strong></th>"; echo "<td class='shade2'>"; echo show_next_action(); echo "</td></tr>"; echo "<tr>"; // calculate upload filesize $att_file_size = readable_file_size($CONFIG['upload_max_filesize']); echo "<th align='right'>{$GLOBALS['strAttachFile']}"; echo " (<{$att_file_size})</th>"; echo "<td class='shade1'><input type='hidden' name='MAX_FILE_SIZE' value='{$CONFIG['upload_max_filesize']}' />"; echo "<input type='file' name='attachment' size='40' maxfilesize='{$CONFIG['upload_max_filesize']}' /></td>"; echo "</tr>"; echo "</table>"; echo "<p class='center'>"; echo "<input type='hidden' name='action' value='update' />"; if ($draftid == -1) { $localdraft = ''; } else { $localdraft = $draftid; } echo "<input type='hidden' name='draftid' id='draftid' value='{$localdraft}' />"; echo "<input type='hidden' name='storepriority' value='" . incident_priority($id) . "' />"; echo "<input type='submit' name='submit' value='{$GLOBALS['strUpdateIncident']}' /></p>"; echo "</form>"; }
mysql_query($sql); if (mysql_error()) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_affected_rows() < 1) { trigger_error("Task insert failed", E_USER_ERROR); } unset($_SESSION['formdata']['add_task']); unset($_SESSION['formerrors']['add_task']); html_redirect("tasks.php"); } break; case '': default: include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_task'); clear_form_errors('add_task'); echo "<h2>" . icon('task', 32) . " "; echo "{$title}</h2>"; echo "<form id='addtask' action='{$_SERVER['PHP_SELF']}' method='post'>"; echo "<table class='vertical'>"; echo "<tr><th>{$strTitle}</th>"; echo "<td><input class='required' type='text' name='name' "; echo "size='35' maxlength='255'"; if ($_SESSION['formdata']['add_task']['name'] != '') { echo "value='{$_SESSION['formdata']['add_task']['name']}'"; } echo "/> <span class='required'>{$GLOBALS['strRequired']}</span></td></tr>"; echo "<tr><th>{$strDescription}</th>"; echo "<td><textarea name='description' rows='4' cols='30'>"; if ($_SESSION['formdata']['add_task']['description'] != '') {
$title = $strAddUser; // External variables $submit = $_REQUEST['submit']; include APPLICATION_INCPATH . 'htmlheader.inc.php'; if (empty($submit)) { // Show add user form $gsql = "SELECT * FROM `{$dbGroups}` ORDER BY name"; $gresult = mysql_query($gsql); if (mysql_error()) { trigger_error(mysql_error(), E_USER_WARNING); } while ($group = mysql_fetch_object($gresult)) { $grouparr[$group->id] = $group->name; } $numgroups = count($grouparr); echo show_form_errors('add_user'); clear_form_errors('add_user'); echo "<h2>" . icon('user', 32) . " "; echo "{$strNewUser}</h2>"; echo "<h5>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup>") . "</h5>"; echo "<form id='adduser' action='{$_SERVER['PHP_SELF']}' method='post' "; echo "onsubmit='return confirm_action(\"{$strAreYouSureAdd}\");'>"; echo "<table align='center' class='vertical'>\n"; echo "<tr><th>{$strRealName} <sup class='red'>*</sup></th>"; echo "<td><input maxlength='50' name='realname' size='30'"; if ($_SESSION['formdata']['add_user']['realname'] != '') { echo "value='{$_SESSION['formdata']['add_user']['realname']}'"; } echo "/></td></tr>\n"; echo "<tr><th>{$strUsername} <sup class='red'>*</sup></th>"; echo "<td><input maxlength='50' name='username' size='30'";
// of the GNU General Public License, incorporated herein by reference. // // Author: Ivan Lucas <ivanlucas[at]users.sourceforge.net> $permission = 56; // Add Software require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; $title = $strAddVendor; // External variables $submit = $_REQUEST['submit']; if (empty($submit)) { // Show form include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_vendor'); clear_form_errors('add_vendor'); echo "<h2>{$strAddVendor}</h2>"; echo "<h5>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup>") . "</h5>"; echo "<form action='{$_SERVER['PHP_SELF']}' method='post' onsubmit='return confirm_action(\"{$strAreYouSureAdd}\")'>"; echo "<table align='center' class='vertical'>"; echo "<tr><th>{$strVendorName}<sup class='red'>*</sup></th><td><input maxlength='50' name='name' size='30' /></td></tr>\n"; echo "</table>"; echo "<p align='center'><input name='submit' type='submit' value='{$strSave}' /></p>"; echo "<p class='warning'>{$strAvoidDupes}</p>"; echo "</form>\n"; echo "<p align='center'><a href='products.php'>{$strReturnWithoutSaving}</a></p>"; include APPLICATION_INCPATH . 'htmlfooter.inc.php'; } else { // External variables $name = cleanvar($_REQUEST['name']);
$sql = "SELECT enddate FROM `{$dbService}` WHERE contractid = {$contractid} ORDER BY enddate DESC LIMIT 1"; $result = mysql_query($sql); if (mysql_error()) { trigger_error("MySQL Query Error " . mysql_error(), E_USER_WARNING); } if (mysql_num_rows($result) > 0) { list($prev_enddate) = mysql_fetch_row($result); $suggested_startdate = mysql2date($prev_enddate) + 86400; // the next day } else { $suggested_startdate = $now; // Today } if (empty($submit) or !empty($_SESSION['formerrors']['add_service'])) { include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_service'); clear_form_errors('add_service'); echo "<h2>{$strNewService}</h2>\n"; $timed = is_contract_timed($contractid); echo "<form id='serviceform' name='serviceform' action='{$_SERVER['PHP_SELF']}' method='post' onsubmit='return confirm_submit(\"{$strAreYouSureMakeTheseChanges}\");'>"; echo "<table align='center' class='vertical'>"; if ($timed) { echo "<thead>\n"; } echo "<tr><th>{$strStartDate}</th>"; echo "<td><input class='required' type='text' name='startdate' id='startdate' size='10' "; if ($_SESSION['formdata']['add_service']['startdate'] != '') { echo "value='{$_SESSION['formdata']['add_service']['startdate']}'"; } else { echo "value='" . date('Y-m-d', $suggested_startdate) . "'"; }
// This software may be used and distributed according to the terms // of the GNU General Public License, incorporated herein by reference. // // Author: Paul Heaney <paulheaney[at]users.sourceforge.net> //// This Page Is Valid XHTML 1.0 Transitional! (1 Oct 2006) $permission = 64; // Manage escalation paths require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; $submit = $_REQUEST['submit']; $title = $strNewEscalationPath; if (empty($submit)) { include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_escalation_path'); clear_form_errors('add_escalation_path'); echo "<h2>{$title}</h2>"; echo "<form action='" . $_SERVER['PHP_SELF'] . "' method='post' onsubmit='return confirm_action(\"{$strAreYouSureAdd}\")'>"; echo "<table class='vertical'>"; echo "<tr><th>{$strName}</th><td><input name='name' class='required' "; if ($_SESSION['formdata']['add_escalation_path']['name'] != '') { echo "value='{$_SESSION['formdata']['add_escalation_path']['name']}'"; } echo "/> <span class='required'>{$strRequired}</span></td></tr>"; echo "<tr><th>{$strType}</th><td>"; $type = array('internal' => 'Internal', 'external' => 'External'); echo array_drop_down($type, 'type', $_SESSION['formdata']['add_escalation_path']['type']); echo "</td></tr>"; echo "<tr><th>{$strTrackURL}<br /></th><td><input name='trackurl'"; if ($_SESSION['formdata']['add_escalation_path']['trackurl'] != '') {
/** * Output the html for an add contact form * * @param int $siteid - the site you want to add the contact to * @param string $mode - whether this is internal or external facing, defaults to internal * @return string $html add contact form html * @author Kieran Hogg */ function show_add_contact($siteid = 0, $mode = 'internal') { global $CONFIG; $returnpage = cleanvar($_REQUEST['return']); if (!empty($_REQUEST['name'])) { $name = explode(' ', cleanvar(urldecode($_REQUEST['name'])), 2); $_SESSION['formdata']['add_contact']['forenames'] = ucfirst($name[0]); $_SESSION['formdata']['add_contact']['surname'] = ucfirst($name[1]); } $html = show_form_errors('add_contact'); clear_form_errors('add_contact'); $html .= "<h2>" . icon('contact', 32) . " "; $html .= "{$GLOBALS['strNewContact']}</h2>"; if ($mode == 'internal') { $html .= "<h5 class='warning'>{$GLOBALS['strAvoidDupes']}</h5>"; } $html .= "<form name='contactform' action='{$_SERVER['PHP_SELF']}' "; $html .= "method='post' onsubmit=\"return confirm_action('{$GLOBALS['strAreYouSureAdd']}')\">"; $html .= "<table align='center' class='vertical'>"; $html .= "<tr><th>{$GLOBALS['strName']}</th>\n"; $html .= "<td>"; $html .= "\n<table><tr><td align='center'>{$GLOBALS['strTitle']}<br />"; $html .= "<input maxlength='50' name='courtesytitle' title=\""; $html .= "{$GLOBALS['strCourtesyTitle']}\" size='7'"; if ($_SESSION['formdata']['add_contact']['courtesytitle'] != '') { $html .= "value='{$_SESSION['formdata']['add_contact']['courtesytitle']}'"; } $html .= "/></td>\n"; $html .= "<td align='center'>{$GLOBALS['strForenames']}<br />"; $html .= "<input class='required' maxlength='100' name='forenames' "; $html .= "size='15' title=\"{$GLOBALS['strForenames']}\""; if ($_SESSION['formdata']['add_contact']['forenames'] != '') { $html .= "value='{$_SESSION['formdata']['add_contact']['forenames']}'"; } $html .= "/></td>\n"; $html .= "<td align='center'>{$GLOBALS['strSurname']}<br />"; $html .= "<input class='required' maxlength='100' name='surname' "; $html .= "size='20' title=\"{$GLOBALS['strSurname']}\""; if ($_SESSION['formdata']['add_contact']['surname'] != '') { $html .= "value='{$_SESSION['formdata']['add_contact']['surname']}'"; } $html .= " /> <span class='required'>{$GLOBALS['strRequired']}</span></td></tr>\n"; $html .= "</table>\n</td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strJobTitle']}</th><td><input maxlength='255'"; $html .= " name='jobtitle' size='35' title=\"{$GLOBALS['strJobTitle']}\""; if ($_SESSION['formdata']['add_contact']['jobtitle'] != '') { $html .= "value='{$_SESSION['formdata']['add_contact']['jobtitle']}'"; } $html .= " /></td></tr>\n"; if ($mode == 'internal') { $html .= "<tr><th>{$GLOBALS['strSite']}</th><td>"; $html .= site_drop_down('siteid', $siteid, TRUE) . "<span class='required'>{$GLOBALS['strRequired']}</span></td></tr>\n"; } else { // For external always force the site to be the session site $html .= "<input type='hidden' name='siteid' value='{$_SESSION['siteid']}' />"; } $html .= "<tr><th>{$GLOBALS['strDepartment']}</th><td><input maxlength='255' name='department' size='35'"; if ($_SESSION['formdata']['add_contact']['department'] != '') { $html .= "value='{$_SESSION['formdata']['add_contact']['department']}'"; } $html .= "/></td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strEmail']}</th><td>"; $html .= "<input class='required' maxlength='100' name='email' size='35'"; if ($_SESSION['formdata']['add_contact']['email']) { $html .= "value='{$_SESSION['formdata']['add_contact']['email']}'"; } $html .= "/><span class='required'>{$GLOBALS['strRequired']}</span> "; $html .= "<label>"; $html .= html_checkbox('dataprotection_email', 'No'); $html .= "{$GLOBALS['strEmail']} {$GLOBALS['strDataProtection']}</label>" . help_link("EmailDataProtection"); $html .= "</td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strTelephone']}</th><td><input maxlength='50' name='phone' size='35'"; if ($_SESSION['formdata']['add_contact']['phone'] != '') { $html .= "value='{$_SESSION['formdata']['add_contact']['phone']}'"; } $html .= "/> "; $html .= "<label>"; $html .= html_checkbox('dataprotection_phone', 'No'); $html .= "{$GLOBALS['strTelephone']} {$GLOBALS['strDataProtection']}</label>" . help_link("TelephoneDataProtection"); $html .= "</td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strMobile']}</th><td><input maxlength='100' name='mobile' size='35'"; if ($_SESSION['formdata']['add_contact']['mobile'] != '') { $html .= "value='{$_SESSION['formdata']['add_contact']['mobile']}'"; } $html .= "/></td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strFax']}</th><td><input maxlength='50' name='fax' size='35'"; if ($_SESSION['formdata']['add_contact']['fax']) { $html .= "value='{$_SESSION['formdata']['add_contact']['fax']}'"; } $html .= "/></td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strAddress']}</th><td><label>"; $html .= html_checkbox('dataprotection_address', 'No'); $html .= " {$GLOBALS['strAddress']} {$GLOBALS['strDataProtection']}</label>"; $html .= help_link("AddressDataProtection") . "</td></tr>\n"; $html .= "<tr><th></th><td><label><input type='checkbox' name='usesiteaddress' value='yes' onclick=\"\$('hidden').toggle();\" /> {$GLOBALS['strSpecifyAddress']}</label></td></tr>\n"; $html .= "<tbody id='hidden' style='display:none'>"; $html .= "<tr><th>{$GLOBALS['strAddress1']}</th>"; $html .= "<td><input maxlength='255' name='address1' size='35' /></td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strAddress2']}</th>"; $html .= "<td><input maxlength='255' name='address2' size='35' /></td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strCity']}</th><td><input maxlength='255' name='city' size='35' /></td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strCounty']}</th><td><input maxlength='255' name='county' size='35' /></td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strCountry']}</th><td>"; $html .= country_drop_down('country', $CONFIG['home_country']) . "</td></tr>\n"; $html .= "<tr><th>{$GLOBALS['strPostcode']}</th><td><input maxlength='255' name='postcode' size='35' /></td></tr>\n"; $html .= "</tbody>"; if ($mode == 'internal') { $html .= "<tr><th>{$GLOBALS['strNotes']}</th><td><textarea cols='60' rows='5' name='notes'>"; if ($_SESSION['formdata']['add_contact']['notes'] != '') { $html .= $_SESSION['formdata']['add_contact']['notes']; } $html .= "</textarea></td></tr>\n"; } $html .= "<tr><th>{$GLOBALS['strEmailDetails']}</th>"; // Check the box to send portal details, only if portal is enabled $html .= "<td><input type='checkbox' name='emaildetails'"; if ($CONFIG['portal'] == TRUE) { $html .= " checked='checked'"; } else { $html .= " disabled='disabled'"; } $html .= ">"; $html .= "<label for='emaildetails'>{$GLOBALS['strEmailContactLoginDetails']}</td></tr>"; $html .= "</table>\n\n"; if (!empty($returnpage)) { $html .= "<input type='hidden' name='return' value='{$returnpage}' />"; } $html .= "<p><input name='submit' type='submit' value=\"{$GLOBALS['strAddContact']}\" /></p>"; $html .= "</form>\n"; //cleanup form vars clear_form_data('add_contact'); return $html; }
// // This software may be used and distributed according to the terms // of the GNU General Public License, incorporated herein by reference. // // Author: Paul Heaney <*****@*****.**> $permission = 9; // Edit User Permissions require 'core.php'; require APPLICATION_LIBPATH . 'functions.inc.php'; // This page requires authentication require APPLICATION_LIBPATH . 'auth.inc.php'; $submit = cleanvar($_REQUEST['submit']); if (empty($submit)) { $title = $strAddRole; include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('role_add'); clear_form_errors('role_add'); echo "<h2>{$strAddRole}</h2>"; echo "<form method='post' action='{$_SERVER['PHP_SELF']}'>"; echo "<table class='vertical'>"; echo "<tr><th>{$strName}</th>"; echo "<td><input class='required' size='30' name='rolename' /><span class='required'>{$strRequired}</span></td></tr>"; echo "<tr><th>{$strDescription}</th><td><textarea name='description' id='description' rows='5' cols='30'>{$_SESSION['formdata']['role_add']['description']}</textarea></td></tr>"; echo "<tr><th>{$strCopyFrom}</th><td>"; if ($_SESSION['formdata']['role_add']['roleid'] != '') { echo role_drop_down('copyfrom', $_SESSION['formdata']['role_add']['roleid']); } else { echo role_drop_down('copyfrom', 0); } echo "</td></tr>"; echo "</table>";
} if ($addition_errors == 1) { // show addition error message include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo $addition_errors_string; include APPLICATION_INCPATH . 'htmlfooter.inc.php'; } else { // show success message $id = mysql_insert_id(); journal(CFG_LOGGING_NORMAL, 'Reseller Added', "Reseller {$id} Added", CFG_JOURNAL_MAINTENANCE, $id); clear_form_errors('formerrors'); html_redirect("main.php"); } } break; default: $title = $strAddReseller; include APPLICATION_INCPATH . 'htmlheader.inc.php'; echo show_form_errors('add_reseller'); clear_form_errors('formerrors'); echo "<h2>{$strAddReseller}</h2>"; echo "<p align='center'>" . sprintf($strMandatoryMarked, "<sup class='red'>*</sup>") . "</p>"; echo "<form action='{$_SERVER['PHP_SELF']}?action=add' method='post' onsubmit=\"return confirm_action('{$strAreYouSureAdd}')\">"; echo "<table align='center' class='vertical'>"; echo "<tr><th>{$strName}: <sup class='red'>*</sup></th><td><input type='text' name='reseller_name' /></td></tr>"; echo "</table>"; echo "<p align='center'><input name='submit' type='submit' value='{$strAddReseller}' /></p>"; echo "</form>"; include APPLICATION_INCPATH . 'htmlfooter.inc.php'; break; }
</div> </div> </header> <main id="main"> <div class="container"> <div class="row"> <div class="col-lg-10 col-lg-offset-1"> <h2 class="page-title">booking</h2> <div class="row"> <div class="col-sm-8"> <article class="entry"> <?php show_form_errors($form); ?> <?php show_email_result($form); ?> <?php if (!isset($form['send_booking']) or isset($form['send_booking']) and !empty($form['errorString'])) { ?> <form class="booking" action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <div class="row"> <div class="col-md-6">