$dnum = date(Ymd)*4;
$from = $_GET['fr'];
if($from == ""){
$from = $_POST['fr'];
}
if($from != $dnum){
echo("<<<<Restricted Area>>>>" .
"
Sorry, you must Log In to view this Page
");
exit();
}
$usrn = $_GET['usrn'];
if($usrn == ""){
$usrn = $_POST['usrn'];
}
if($usrn == ""){
echo("<<<<Restricted Area>>>>" .
"
Problem with your username. Please Log In again.
");
exit();
}
$cmdt = $_POST['cmdt'];
$num = $_POST['num'];
if($num == 0){
$comdot = "
";
$cmdt = 0;
}else{
$comdot = "
";
$cmdt = 1;
}
$dtnum = date(Ymd);
$dtup = $dtnum;
$thisday = date(m)."/".date(d)."/".date(Y);
$thisdate = date("F j, Y");
$tellit = array();
$tellit2 = array();
$subject = $_POST['subject'];
$content = $_POST['content'];
$content1 = nl2br($content);
$mtou = $_POST[mtou2];
$mcount = count($mtou);
if($mcount > 1){
$mlist = implode(',', $mtou);
}else{
$mlist = $mtou[0];
}
$mtoe = $_POST[mtoe2];
$etou = $_POST[etou2];
$ecount = count($etou);
if($ecount > 1){
$elist = implode(',', $etou);
}else{
$elist = $etou[0];
}
$etoe = $_POST[etoe2];
$addylist = implode(',', $etoe);
$urgent = $_POST['urgent'];
$phone = $_POST['phone'];
$fremail = $_POST['fremail'];
if($urgent == 'yes'){
$status = 'urgent';
}else{
$status = 'unread';
}
$dbcnx = @mysql_connect('mysql.plainhost.com','ecosmar_ecosmart','ecoman1');
if($mcount > 0){
$m = 1;
mysql_select_db('ecosmar_friendly', $dbcnx);
$i = 0;
while($i < $mcount){
$addem = @mysql_query("INSERT INTO messages SET MID='0',fr_name='$usrn',fr_email='$fremail',subject='$subject',message='$content',status='$status',usrn='$mtou[$i]',dtnum='$dtnum',dtup='$dtup'");
if(!$addem){
$tellit[] = "Problem Sending Internal Message
" . mysql_error();
$color = "maroon";
}else{
$tellit[] = "Internal Message Sent to ".$mtou[$i];
$color = "green";
}
$i = $i + 1;
}
}
if($ecount == 1){
$recipient = $etoe[0];
$message = "ECO-\$MART, INC." .
"\n" .
"(888)329-2705 - www.eco-smart.com" .
"\n" .
"$thisdate" .
"\n" .
"-------------------------------" .
"\n" .
"FROM: $usrn" .
"\n" .
"$fremail" .
"\n" .
"-------------------------------" .
"\n" .
"TO: $etou[0]" .
"\n" .
"$etoe[0]" .
"\n" .
"-------------------------------" .
"\n" .
"\n" .
"$content" .
"\n" .
"\n" .
"$usrn" .
"\n" .
"Eco-\$mart Representative" .
"\n" .
"$phone" .
"\n";
if(@mail($recipient, $subject, $message, "From: $usrn <$fremail>")){
$tellit2[] = "Email sent to " . $etou[0];
$color2 = "green";
}else{
$tellit2[] = "Error Sending Email to " . $etou[0];
$color2 = "maroon";
}
}elseif($ecount > 1){
$i = 0;
while($i < $ecount){
$recipient = $etoe[$i];
$message = "ECO-\$MART, INC." .
"\n" .
"(888)329-2705 - www.eco-smart.com" .
"\n" .
"$thisdate" .
"\n" .
"-------------------------------" .
"\n" .
"FROM: $usrn" .
"\n" .
"$fremail" .
"\n" .
"-------------------------------" .
"\n" .
"TO: $etou[$i]" .
"\n" .
"$etoe[$i]" .
"\n" .
"-------------------------------" .
"\n" .
"\n" .
"$content" .
"\n" .
"\n" .
"$usrn" .
"\n" .
"Eco-\$mart Representative" .
"\n" .
"$phone" .
"\n";
if(@mail($recipient, $subject, $message, "From: $usrn <$fremail>")){
$tellit2[] = "Email sent to " . $etou[$i];
$color2 = "green";
}else{
$tellit2[] = "Error Sending Email to" . $etou[$i];
$color2 = "maroon";
}
$i = $i + 1;
}
}
?>
Write a Message
|
Messages() |
Discussions( ) New
|
foreach($tellit as $value){
echo("$value ");
}
?>
|
foreach($tellit2 as $value){
echo("$value ");
}
?>
|
Subject:
|
Message:
|