Пример #1
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>";
}
Пример #2
0
                     echo "<pre>\n" . $calMsg . "</pre>";
                 }
                 $Charge = $startBalance - $endBalance;
                 $Credits -= $Charge;
                 printf("<br>%s credits used. %s left.<br>\n", $Charge, $Credits);
                 $db->query("update Members Set SmsCredits='" . $Credits . "' where id='" . $MemberID . "'");
                 if ($CopyToEmail) {
                     $rcpt = $Email;
                     $hdrs = "From: " . $Email;
                     $subj = "Calendar Event";
                     $html = $Message;
                     $text = "";
                     $name = "calendar.vcs";
                     $type = "text/x-vCalendar";
                     $data = $calMsg;
                     htmlMail($rcpt, $subj, $html, $hdrs, $text, $name, $type, $data);
                 }
             } else {
                 echo "Insufficient SMS Credits.  You need to buy more SMS Credits.";
             }
         }
     }
     echo "<br><br>";
 case "View":
 case "Back":
     // echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL=".$sess->self_url()."\">";
     echo "&nbsp<a href=\"" . $sess->self_url() . "\">Back to SmsAddressBook.</a><br>\n";
     page_close();
     exit;
 case "Delete":
     if (isset($auth)) {