CORE Revision 1.1.45

The links you see here are partly for instructional examples, but mostly for object debugging.

HOME | Coredoc | accordian | single | tile | form | expandytable | gantt | tickets-xml | nest | chart | tabs | prefs | misc | data | table | bandwidth | css | state | database | csv | free | texttable | tickets | multicell | refresh | gauge | cypher | jquery | tableform
Click to drag Click to collapse Resize Pop Tickets
http://66.129.64.42/em7/api.em7?username=portal&password=potato&xname=DEMOX001+-+Peak+10+EM7+Demo+Customer

A New Ticket

Click to drag Click to collapse New Ticket
Use the form below to describe an issue you're having. This information will be passed along to a technician, and any resulting activity may be monitored from the Ticketing section.
Description
Note




Click to drag Click to collapse Resize Source code
/home/bartniedner_com/core.bartniedner.com/htdocs/examples/tickets-xml.php
<?
/**
 * Core Example File
 *
 * @author Mark Young
 * @version $Id$
 * @copyright MarkYoung, 19 February, 2007
 * @package examples
 **/
include_once ($_SERVER['DOCUMENT_ROOT'] . "/core.inc.php");
include_once("ticket_functions.php");
include_once("xml_functions.php");

$ROA_ID=181; // this is the EM7 equivalent of the customer ID.

if ($_POST['_action']=="note")
{
	if ($tid = SubmitTicketNote($_POST, $return))
		header("location:?tid=$tid&note=".urlencode($return));
	else
		header("location:?error=".urlencode($return));
	
}
if ($_REQUEST['_action']=="save")
{
	if ($tid = SubmitTicket($_REQUEST, $return))
		header("location:?tid=$tid&note=".urlencode($return));
	else
		header("location:?error=".urlencode($return));
}

include_once("head.php");


$url = TICKET_URL."&roa_id=$ROA_ID"; // by ROA_ID
$url = TICKET_URL."&xname=".urlencode("DEMOX001 - Peak 10 EM7 Demo Customer"); // by BILLING_ID - COMPANY_NAME
//$url .= "&fields[]=date_create&fields[]=severity&fields[]=status&fields[]=descr";
$d = new dataXML($url); 
$o = new outputTable($d);
 $o->Title="Tickets";
 $o->Class="compass"; $o->ExtendedBorder=true;
 $o->Description=$url;
 $o->Types['tid']="header";
 $o->AJAX=true;
 $o->hyperlinks['tid']='?tid=$tid';
 $o->Sorting=true; // sorting on XML isn't quite working (may4,07)
 $o->Filter=true;
 $o->perpage=10;
 $o->Display();



if ($_GET['tid']>0)
{
	$tid = $_GET['tid'];
?>
<h3>Ticket Details for #<?=$tid?></h3>
<?	

$url=TICKET_URL . "&tid=$tid";		
$d = new dataXML($url);
$o = new outputSingle($d);
$o->Class="compass"; $o->ExtendedBorder=true;
 $o->Title="ticket #$tid";
 $o->Description=$url;
 $o->AJAX=false;
 $o->Display();

?>
<h4>Event Log for ticket #<?=$tid?></h4>
<?


$url = TICKET_URL."&roa_id=$ROA_ID";
$url .= "&tid=$tid&fields[]=notes";
$d = new data($url); 
$o = new outputTable($d);
 $o->Title="Ticket Event Log";
 $o->Class="compass"; $o->ExtendedBorder=true;
 $o->Description=$url;
 $o->Types['tid']="hidden";
 $o->AJAX=false;
 $o->hyperlinks['tid']='?tid=$tid';
 $o->Sorting=false; // sorting on XML isn't quite working (may4,07)
 $o->perpage=10;
 $o->Display();

/*
$query = "select * from ticket_notes where tid=$tid order by user_edit desc";
$d = new data($query);
$o = new outputTable($d);
 $o->Title='ticket #$tid';
 $o->Display(); 
*/

?>
<h4>Add event to ticket #<?=$tid?></h4>
<?
$fields = array(
	"Note", 
	"tid"=>$tid,
	'customer_id'=>$ROA_ID
	);
$d = new data($fields);
$o = new outputForm($d);
 $o->Title="New Note";
 $o->Description="Use the form below to add additional notes, or reply to a previous note from the technicians";
 $o->Class="compass"; $o->ExtendedBorder=true;
 $o->Method="POST";
 $o->Types['tid']="hidden";
 $o->Types['customer_id']="hidden";
 $o->Types['Note']="textarea";
 $o->SubmitLabel="Add Note";
 $o->ResetLabel="Clear";
 $o->Action='note';
 $o->Display();


}

?>
<h3>A New Ticket</h3>

<?
$fields = array(
	"Description", 
	"Note", 
//	"Severity"=>array("",1=>"Min",2=>"Med",3=>"Max",4=>"Critical"),
//	"Status"=>array("", 1=>"Open", 2=>"In Work", 3=>"Pending", 4=>"Resovled"),
    "customer_id"=>$ROA_ID
	);
$d = new data($fields);
$o = new outputForm($d);
 $o->Title="New Ticket";
 $o->Description="Use the form below to describe an issue you're having.  This information will be passed along to a technician, and any resulting activity may be monitored from the Ticketing section.";
 $o->Class="compass"; $o->ExtendedBorder=true;
 $o->Method="POST";
 $o->Types['Note']="textarea";
 $o->Types['customer_id']='hidden';
 $o->Display();
?>

<?
include_once("foot.php");
?>

Debug Log:
Memory Usage: 866.53k, Number of Queries: 0
  1. [0.0000]db.inc.php File included   include_once, line 21 home/bartniedner_com/core.bartniedner.com/htdocs/include/db.inc.php
  2. [0.0648]include_once End head.php   include_once, line 52 home/bartniedner_com/core.bartniedner.com/htdocs/examples/head.php
  3. [0.0027]LoadXMLData LoadXMLData: http://66.129.64.42/em7/api.em7?username=portal&password=potato&xname=DEMOX001+-+Peak+10+EM7+Demo+Customer   LoadXMLData, line 52 home/bartniedner_com/core.bartniedner.com/htdocs/include/xml_functions.php
  4. [1.6815]LoadData LoadData() called when data was already loaded! You dummy!!   LoadData, line 302 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/data.php
  5. [0.0001]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/ajax.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
  6. [0.0000]DrawTopPart outputTable - Tickets
         DrawTopPart, line 205 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
    1. [0.0000]DrawTopPart AJAX enabled   DrawTopPart, line 206 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
    2. [0.0001]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/jquery.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    3. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/core.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    4. [0.0000]LoadJavascript Loaded http://core.bartniedner.com/include/javascript/firebug/firebug.js   LoadJavascript, line 854 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
    5. [0.0009]DrawBottomPart cached: /tmp/ticketssZFEvg   DrawBottomPart, line 378 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
    6. [0.0000]DrawBottomPart End
    outputTable - Tickets   DrawBottomPart, line 381 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
  7. [0.0001]__construct Incoming array is single-dimensional. Not that there's anything wrong with that.   __construct, line 144 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/data.php
  8. [0.0019]__destruct    __destruct, line 181 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/data.php
  9. [0.0000]LoadData LoadData() called when data was already loaded! You dummy!!   LoadData, line 302 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/data.php
  10. [0.0001]ErrorHandler preg_match() expects parameter 2 to be string, array given
    /home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/outputForm.php, line 276 (Array)   ErrorHandler, line 140 home/bartniedner_com/core.bartniedner.com/htdocs/include/core_functions.php
  11. [0.0000]DrawTopPart outputForm - New Ticket
         DrawTopPart, line 205 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
    1. [0.0004]Display Hidden Field: customer_id => '181'   Display, line 305 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/outputForm.php
    2. [0.0001]DrawBottomPart End
    outputForm - New Ticket   DrawBottomPart, line 381 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
  12. [0.0002]include_once Begin foot.php   include_once, line 10 home/bartniedner_com/core.bartniedner.com/htdocs/examples/foot.php
  13. [0.0007]DrawTopPart outputFreeText - Source code
         DrawTopPart, line 205 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
    1. [0.0005]DrawBottomPart cached: /tmp/sourcecode04Avde   DrawBottomPart, line 378 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php
    2. [0.0000]DrawBottomPart End
    outputFreeText - Source code   DrawBottomPart, line 381 home/bartniedner_com/core.bartniedner.com/htdocs/include/classes/output.php