Ejemplo n.º 1
0
            page_close();
            exit;
        case "Save Changes":
            echo "Saving. . . .";
            $cart->update_all();
            echo "<b>Done!</b><br>\n";
            $QUERY_STRING = "";
            echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=" . $sess->self_url() . $extra . "\">";
            echo "&nbsp<a href=\"" . $sess->self_url() . $extra . "\">Back to Products.</a><br>\n";
            page_close();
            exit;
            break;
    }
} else {
    if ($id) {
        $f->find_values($id);
        $TicketNo = $id;
        echo "&nbsp<a href=\"" . $sess->url("/SupportComments.php") . $sess->add_query(array("cmd" => "Add", "TicketNo" => $TicketNo)) . "\">Add Comment</a>&nbsp\n";
        echo "&nbsp;<a href=SupportTickets.php>Back to Support Tickets List</a>";
        $SrchLocation = $Location;
    }
}
include 'phplib/locations.inc';
$id = $TicketNo;
echo "<h2>{$cmd} Support Ticket {$id} </h2> ";
$origcmd = $cmd;
switch ($cmd) {
    case "View":
        if ($UID = UserID($UserName)) {
            echo "<h3>User Information</h3>\n";
            $mf = new my_userinfoform();
Ejemplo n.º 2
0
function SupportEmail($TicketNo, $OldStatus = "")
{
    global $UserName, $Name, $Company, $StreetAddress, $Town, $State, $PostCode, $CO, $OtherDetail;
    global $Quantity, $ProductCode, $PartNo, $Description, $Price, $Duration, $Rate, $Details, $Email, $Comment, $ByContact;
    global $HomePhone, $WorkPhone, $Mobile, $Status, $ShortDesc, $EngineerEmail, $Created, $EnteredBy, $SequenceNo;
    global $AssignedTo, $ByUser;
    if ($TicketNo < 1) {
        return false;
    }
    $Level = 0;
    $db = new DB_hotspot();
    $stf = new SupportTicketsform();
    $stf->find_values($TicketNo);
    $mf = new userinfoform();
    $mf->find_values(UserID($UserName));
    $EngineerEmail = get_email($AssignedTo);
    if ($OldStatus) {
        $Status = $OldStatus . "->" . $Status;
    }
    $subj = "Ticket: {$TicketNo}, {$Status}, {$ShortDesc}";
    $Msg = "Job for: <b>{$UserName}, {$Name}</b><br>\n";
    if ($StreetAddress . $Town . $State . $PostCode) {
        $Msg .= "at: <b>";
        if ($StreetAddress) {
            $Msg .= "{$StreetAddress}, ";
        }
        if ($Town) {
            $Msg .= "{$Town}, ";
        }
        if ($State) {
            $Msg .= "{$State}, ";
        }
        if ($PostCode) {
            $Msg .= "{$PostCode}";
        }
        $Msg .= "</b><br>\n";
    }
    if (isset($HomePhone)) {
        $Msg .= "HomePhone: <b>{$HomePhone}</b><br>\n";
    }
    if (isset($WorkPhone)) {
        $Msg .= "WorkPhone: <b>{$WorkPhone}</b><br>\n";
    }
    if (isset($Mobile)) {
        $Msg .= "Mob: <b>{$Mobile}</b><br>\n";
    }
    if (isset($Mail)) {
        $Msg .= "Email: <b>{$Mail}</b><br>\n";
    }
    $Msg .= "------------------------------------------------------------<br>\n";
    $Msg .= "Entered By: <b>{$EnteredBy}</b><br>\n";
    $Msg .= "Date: <b>{$Created}</b><br>\n";
    if (isset($Location)) {
        $Msg .= "Location: <b>{$Location}</b><br>\n";
    }
    if (isset($RoomNo)) {
        $Msg .= "Room No: <b>{$RoomNo}</b><br>\n";
    }
    if (isset($Severity)) {
        $Msg .= "Severity: <b>{$Severity}</b><br>\n";
    }
    if ($Level > 0) {
        $Msg .= "Level: <b>{$Level}</b><br>\n";
    }
    $Msg .= "Description: <b>{$ShortDesc}</b> {$OtherDetail}<br>\n";
    $Msg .= "------------------------------------------------------------<br>\n";
    /*
    	$db->query("select id from SupportParts where TicketNo='".$TicketNo."'");
    	$sp = new SupportPartsform;
    	while ($db->next_record()) {
    		$sp->find_values($db->f(0));
    		$Msg .= "Part: <b>$Quantity x $ProductCode, $PartNo, $Description @ $Price</b><br>\n";
    	}
    	$db->query("select id from SupportDetails where TicketNo='".$TicketNo."'");
    	$sd = new SupportDetailsform;
    	while ($db->next_record()) {
    		$sd->find_values($db->f(0));
    		$Msg .= "Work: <b>$Duration minutes @ $Rate /hour, $Details</b><br>\n";
    	}
    */
    $db->query("select distinct FileName from SupportFiles where TicketNo='" . $TicketNo . "'");
    while ($db->next_record()) {
        $Msg .= "Attachment: http://os.{$CO}.com.au/files/{$TicketNo}/" . $db->f(0) . "<br>\n";
    }
    $db->query("select id from SupportComments where TicketNo='" . $TicketNo . "'");
    $sc = new SupportCommentsform();
    while ($db->next_record()) {
        $sc->find_values($db->f(0));
        $mf->find_values($ByContact);
        $Msg .= "Comment by <b>{$ByUser}:</b> ";
        $Msg .= str_replace('" src="/candy/', '" src="http://os.' . $CO . '.com.au/candy/', $Comment);
        $Msg .= "<br>\n";
    }
    $url = "https://os.{$CO}.com.au/SupportTickets.php?cmd=View&id=" . $TicketNo;
    $Msg .= "<a href='{$url}'>{$url}</a><br>\n";
    $hdrs = "From: ticket+{$TicketNo}@{$CO}.net.au";
    if ($EngineerEmail) {
        $hdrs .= "\r\nTo: {$EngineerEmail}";
    }
    htmlMail("info@{$CO}.com.au", $subj, $Msg, $hdrs);
    //, $text="", $name="", $type="Application/Octet-Stream", $data="", $name2="", $display2="")
    echo "<pre>";
    echo $hdrs;
    echo $subj;
    echo "\n";
    echo $Msg;
    echo "</pre>";
}