<?php
/*
 * member/mail/Preview.class.php
 * 
 * CopyRight(C) 2010 Shopformer Development Team. All Right Reserved
 * URL: http://sourceforge.jp/projects/shopformer/
 * 
 * 
 * Mail: m_nakashima@users.sourceforge.jp
 * Auther: Masanori Nakashima
 * Last Update: 2010-06-18
 */
require_once( dirname(dirname(__FILE__))
.DIRECTORY_SEPARATOR.'PackageConfig.class.php');
/**
 * spider : メンバーメール 配信確認用アクションモジュールクラス
 * 
 * @package member メンバー管理パッケージ
 * @subpackage mail メールパッケージ
 * @version 1.0.0
 * @author  <m_nakashima@users.sourceforge.jp>
 * @since PHP 4.0
 */
class member_mail_Preview extends system_login_ModuleBase {
	function member_mail_Preview(){
		array_push($this->require_module_array,'database2.Connect');
	}
	function execute( & $request ) {
		$dbo					= $request->getAttribute( 'dbo' );
		$targetType				= stripslashes( $_POST['target_type'] );
		$mailType				= stripslashes( $_POST['mail_type'] );
		$backColor				= stripslashes( $_POST['bgcolor'] );
		$subject				= stripslashes( $_POST['subject'] );
		$body					= stripslashes( $_POST['body'] );
		$memberId				= $_GET['mi'];
		$select_type			= trim(stripslashes( $_GET['stype'] ));
		if( 'q' != $select_type && 's' != $select_type ) {
			$select_type		= 'm';
		}
		$session_sufix			= '_'.$select_type.'_';
		if(is_array($memberId)) {
			$session_sufix		.= implode('.',$memberId);
		} else {
			$session_sufix		.= trim($memberId);
		}
		$sessionObjectName	= MEMBER_SESSION_NAME_MAIL_OBJECT.$session_sufix;

		$request->setAttribute('member.mail.target_type',$targetType );
		$request->setAttribute('member.mail.mail_type',$mailType );
		$request->setAttribute('member.mail.back_color',$backColor );
		$request->setAttribute('member.mail.preview_subject',$subject );
		$request->setAttribute('member.mail.preview_body',$body );

	}
}
?>