/
var
/
www
/
html
/
dreamamerica
/
application
/
Upload File
HOME
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); if (!function_exists('do_email')) { function do_email($to, $subject, $message, $from = 'info@dreamamerica.com') { //$to = 'ali.raza@techloyce.com'; /*$config = array( 'mailtype' => 'html', 'charset' => 'utf-8', 'wordwrap' => TRUE ); $CI = &get_instance(); $CI->load->library('Email', $config); $headers = "From: " . $from . "\r\n"; $headers .= "Reply-To: " . "" . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; if (mail($to, $subject, $message, $headers)) { return TRUE; } else { return FALSE; }*/ print_r('in email'); $froms = array( 'email' => 'dream@dreamamerica.com', 'name' => 'Dream America' ); $emailConfig = array( 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => true ); //mail($to,$subject,$message,$from); $CI = &get_instance(); $CI->load->library('email'); $CI->email->initialize($emailConfig); $CI->email->set_newline("\r\n"); $CI->email->from($froms['email'], $froms['name']); $CI->email->to($to); $CI->email->subject($subject); $CI->email->message($message); //$CI->email->set_mailtype("html"); if($CI->email->send()){ return TRUE; }else{ return FALSE; } } } if (!function_exists('getCity')) { function getCity($state_code) { $CI = &get_instance(); $sql = "SELECT * FROM `cities` WHERE `state_code` LIKE '$state_code'"; $result = $CI->db->query($sql); return $result->result_array(); } } if (!function_exists('image_thumb')) { function image_thumb($path, $image_name) { $width = 360; $height = 300; // Get the CodeIgniter super object $CI = &get_instance(); // Path to image thumbnail $image_thumb = dirname($path . $image_name) . '/' . $image_name . '-' . $width . '-' . $height . strrchr($image_name, '.'); // $image_thumb = dirname($path . $image_name) . '/' . $image_name. '-' . $width . '*' . $height . strrchr($image_name, '.');; if (!file_exists($image_thumb)) { // LOAD LIBRARY $CI->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $path . $image_name; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = TRUE; $config['height'] = $height; $config['width'] = $width; $CI->image_lib->initialize($config); $CI->image_lib->resize(); $CI->image_lib->clear(); } return $image_thumb; } } if (!function_exists('timestamp_to_date')) { function timestamp_to_date($timestamp, $format) { $strtotime = strtotime($timestamp); return date("$format", "$strtotime"); } }