Пример #1
0
	
	///////////////////////////////////////// AJAX ////////////////////////////////////////////////////
	
	if(isset($_GET['send_kp_by_mail'])){
	    // echo  $_GET['send_kp_by_mail'];exit;
		
		include_once(ROOT."/libs/php/classes/manager_class.php");
		$manager = new Manager($user_id);
		
		
		include_once(ROOT."/libs/php/classes/client_class.php");
		$client_mails = Client::cont_faces_data_for_mail($client_id);

	    $kp_id = $_GET['send_kp_by_mail'];
		$kp_filename = Com_pred::prepare_send_mail($kp_id,$client_id,$user_id);
		$theme = Com_pred::fetch_theme($kp_id);
        //$kp_filename = ROOT.'/data/com_offers/1894apelburg_1894_2015_56_01.pdf';
		
		$main_window_tpl_name = ROOT.'/skins/tpl/client_folder/business_offers/send_mail_window.tpl';
		$fd = fopen($main_window_tpl_name,'r');
		$main_window_tpl = fread($fd,filesize($main_window_tpl_name));
	    fclose($fd);
        
        // кодируем данные в формате HTML перед передачей в формате JSON
		$main_window_tpl = base64_encode($main_window_tpl); 
		
		
		// $message_tpl_filenames = array('recalculation','new_kp_new_client','new_kp');
		$message_tpl_filenames = array('empty','new_kp_new_client','order_performance');
		foreach($message_tpl_filenames as $tpl_filename){
			$tpl_path = ROOT.'/skins/tpl/common/mail_tpls/'.$tpl_filename.'.tpl';