<?php
/**
 * @package linea21.modules
 * @subpackage yellowpages
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

//////////// Check Inclusion de pages ////////////
if (!class_exists('auth')){
	include_once("../lib/lib_common.php");
	ReloadIndex('admin');
}
////////////
/** Préparation du mail
 * $email_html_body
 * $email_text_body
 * $email_subject
 * $email_recipient
 **/

switch($todo_mail) {
	// added from front-office - confirmation sent to submitter
	case 'confirm_entry':
		$req_det= SQL_getdetyp($yp_id);
		$result=$sql_object->DBSelect($req_det);

		$email_html_body =_t('yp','mail_body1')."<br />";
		$email_html_body .= "<a href=\"".$full_link."\">".$full_link."</a><br/>\n";

		$email_text_body  = strip_tags(_t('yp','mail_body1')."\n");
		$email_text_body .= $full_link."\n";

		$email_subject = mb_ucfirst(_t('yp','confirm_subscription') . ' - ' . SITE_NAME);
		$email_recipient = $result[0]['yellowp_email'];
		break;
		// added from back-office - notification sent to submitter
		case 'add_entry':
			$email_html_body  = _t('yp','mail_body_added1')."<br />";
			$email_html_body .= "<a href=\"".$full_link."\">".$full_link."</a><br/><br />\n";
			$email_html_body .= _t('yp','mail_body_added2')."<br /><br />";
			
			$email_text_body  = strip_tags(_t('yp','mail_body_added1')."\n");
			$email_text_body .= $full_link."\n";
			$email_text_body .= strip_tags(_t('yp','mail_body_added2')."\n");
			
			$email_subject = mb_ucfirst(_t('yp','mail_subject_added') . ' - ' . SITE_NAME);
			$email_recipient = $data_table[9];
			break;
	default:
		exit();
}
?>