<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Common_model extends CI_Model {

    function __construct() {
        parent::__construct();
        $this->HT = $this->load->database('HT', TRUE);
    }

    function save_mail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $frominfo = '中华游在线', $M_Web = 'chtcdn') {
        $sql = "INSERT INTO Email_AutomaticSend 
                        (
                            M_ReplyToName, 
                            M_ReplyToEmail, 
                            M_ToName, 
                            M_ToEmail, 
                            M_Title, 
                            M_Body, 
                            M_Web,
                            M_FromName, 
                            M_State
                        )
                        VALUES(?, ?, ?, ?, ?, ?, ?, ?, 0) ";
        $query = $this->HT->query($sql, array($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_Web, $frominfo));
        return $query;
    }

}
