This topic is locked

Email Selected Records

10/6/2009 7:40:22 PM
PHPRunner General questions
D
dlbgp author

Hi - I have Emailing selected records working per the PhPRunner 5.1 manual. (link below) Has anybody modified this so your default email client comes up with the dats so you can send it to who ever you want??
Thanks!!
http://www.xlinesoft.com/phprunner/docs/email_selected_records.htm

J
Jane 10/7/2009

Hi,
you can add new input on the page, then process entered value in the onclick event of 'Email selected' button manually. Then check passed value in the List page: Before delete event.

Here is just a sample:

<INPUT class=button onclick="frmAdmin.a.value=document.forms.editform.custom_email.value; frmAdmin.submit(); return false;" value="Email selected" type=button>
D
dlbgp author 10/7/2009

Jane - here is my List Page: Before Process code, I am still not sure what to change inorder to send the information to the default email client...
Thanks!!
if(@$_REQUEST["a"]=="email")

{
if(@$_REQUEST["selection"])

{

$body="";

foreach(@$_REQUEST["selection"] as $keyblock)

{

$arr=split("&",refine($keyblock));

if(count($arr)<1)

continue;

$keys=array();

$keys["id"]=urldecode(@$arr[0]);

$where = KeyWhere($keys);

//$rs = CustomQuery("select * from bid where $where");
$rs = CustomQuery("
SELECT

company.CompanyName,

bidinfo.JobName,

bidinfo.dateRequired,

bid.dateSent,

bid.emailTo,

company.EmailMain,

bid.faxTo,

company.FaxMain,

company.PhoneMain,

bid.notes,

bid.trade_id,

bid.bidinfo_id,

bid.timberline_id,

trade.id,

trade.Trade,

bidinfo.bidTime,

company.id,

company.timberline_id,

company.Address1,

company.Address2,

company.City,

company.St,

company.Zip,

company.Webpage,

company.EstVen,

company.Notes,

bid.id,

bid.scope,

bid.returnedDate,

trade.timberline_id,

bidinfo.id

FROM

bid

Inner Join bidinfo ON bid.bidinfo_id = bidinfo.id

Inner Join company ON bid.timberline_id = company.timberline_id

Inner Join trade ON bid.trade_id = trade.id
where $where");
$data=db_fetch_array($rs);
$body .= " | Bid Id: " . $data['id'] . " | " . "\n";

$body .= " | Company: " . $data['CompanyName'] . " | JobName: " . $data['JobName'] . " | Trade: " . $data['Trade'] . " | " . "\n";

$body .= " | DateRequired: " . $data['dateRequired'] . " | BidTime " . $data['bidTime'] . " | DateSent: " . $data['dateSent'] . " | " . "\n";

$body .= " | EmailTo: " . $data['emailedTo'] . " | Email Address: " . $data['EmailMain'] . " | " . "\n";

$body .= " | FaxTo: " . $data['faxTo'] . " | Fax # " . $data['FaxMain'] . " | " . "\n";

$body .= " | Phone # " . $data['PhoneMain'] . " | Notes: " . $data['notes'] . " | " . "\n";

$body .= "\n-------------------------------------------------------------------------------------------------------------------------------------------------\n\n";
}
// send the email

$email="xxxxxx@gmail.com";

$subject="Construction Bid Information";

$arr = runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $body));
// if error happened print a message on the web page

if (!$arr["mailed"])

{

echo "Error happened:
";

echo "File: " . $arr["errors"][0]["file"] . "
";

echo "Line: " . $arr["errors"][0]["line"] . "
";

echo "Description: " . $arr["errors"][0]["description"] . "
";

}
}
}

J
Jane 10/8/2009

I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.