Esempio n. 1
0
		public function _delete() {
			//	check data
				$arrId = array();
				if( is_array($_REQUEST['ids']) )	{
					$arrId = $_REQUEST['ids'];
				}	else	{
					$arrId[] = $_REQUEST['ids'];
				}
				foreach( $arrId as $id )	{
					$r= new JTContactus();
					$r->select($id);
				//	delete data
					$r->delete();
				}

			//	list data
				$this->addAlert(new JAlert('刪除完成','告知訊息',"./"));
				$this->action('list');
		}
Esempio n. 2
0
<?php

require_once 'jasonwang826/jasonwang826.inc';
$contactus = new JTContactus();
$contactus->setFields($_POST);
$id = $contactus->insert();
$contactus->select($id);
//
//	send to user
//
$mail = new JMailer();
$mail->setFromAsService();
$smartyMail = new JSmartyTemplate();
$smartyMail->assign('openTo', 'user');
$smartyMail->assign('r', $contactus);
$mail->Body = $smartyMail->fetch('message.tpl.htm');
$mail->Subject = "康和期貨經理事業 - 聯絡表單";
$mail->AddAddress($contactus->data['email'], $contactus->data['name']);
if (!$mail->Send()) {
    JWStdio::error($mail->ErrorInfo);
    exit;
}
//
//	from user to 管理者
//
$mail = new JMailer();
// if( !empty($contactus->data['email']) )	{
$mail->AddReplyTo($contactus->data['email'], $contactus->data['name']);
// }
$mail->setFromAsService();
$smartyMail = new JSmartyTemplate();