您好,'.$apply_data['name'].' 透過 資料科學人才媒合平台 向貴單位投遞履歷,以下是他/她的履歷資料。
姓名:'.$apply_data['name'].'
信箱:'.$apply_data['email'].'
電話:'.$apply_data['phone'].'
出生年份:'.$apply_data['age_year'].'
畢業年份:'.$apply_data['graduate_year'].'
畢業學校:'.$apply_data['gradute_school'].'
畢業科系:'.$apply_data['gradute_master'].'
目前或最後一間公司名稱:'.$apply_data['latest_company'].'
目前或最後一份工作職稱:'.$apply_data['latest_job_title'].'
英文能力:'.$apply_data['english_ability_id'].' '.$english_opt.'
最高學歷:'.$apply_data['highest_education_id'].' '.$educations_opt.'
處理資料的相關能力經驗:
'.$apply_data['experience'].'
其他能力、經驗:
'.$apply_data['other'].'
******************
本徵才服務由
台灣資料科學協會提供。如有任何問題或建議,歡迎隨時來信與我們聯絡:
secretary@datasci.tw
';
$file_path = $_SERVER['DOCUMENT_ROOT'] .'/application/'.$apply_data['cv_path'];
if(is_file($file_path)){
$mail->AddAttachment($file_path);
}
if(!$mail->send()) {
return array('status'=>'error','msg'=> $mail->ErrorInfo) ;
// return false;
} else {
return array('status'=>'success','msg'=> '確認信件將在幾分鐘後送至您的 Email 信箱');
// return true;
}
}
function square_thumbnail_with_proportion($src_file,$destination_file,$square_dimensions,$jpeg_quality=90)
{
// Step one: Rezise with proportion the src_file *** I found this in many places.
$src_img = imagecreatefromstring(file_get_contents($src_file));
$image = imagecreatetruecolor(imagesx($src_img), imagesy($src_img));
$white = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $white);
imagecopy($image, $src_img, 0, 0, 0, 0, imagesx($image), imagesy($image));
// $src_img=imagecreatefromjpeg($src_file);
$old_x=imageSX($image);
$old_y=imageSY($image);
$ratio1=$old_x/$square_dimensions;
$ratio2=$old_y/$square_dimensions;
if($ratio1>$ratio2)
{
$thumb_w=$square_dimensions;
$thumb_h=$old_y/$ratio1;
}
else
{
$thumb_h=$square_dimensions;
$thumb_w=$old_x/$ratio2;
}
// we create a new image with the new dimmensions
$smaller_image_with_proportions=ImageCreateTrueColor($thumb_w,$thumb_h);
// resize the big image to the new created one
imagecopyresampled($smaller_image_with_proportions,$image,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
// *** End of Step one ***
// Step Two (this is new): "Copy and Paste" the $smaller_image_with_proportions in the center of a white image of the desired square dimensions
// Create image of $square_dimensions x $square_dimensions in white color (white background)
$final_image = imagecreatetruecolor($square_dimensions, $square_dimensions);
$bg = imagecolorallocate ( $final_image, 255, 255, 255 );
// imagefilledrectangle($final_image,0,0,$square_dimensions,$square_dimensions,$bg);
imagefill($final_image,0,0,$bg);
// need to center the small image in the squared new white image
if($thumb_w>$thumb_h)
{
// more width than height we have to center height
$dst_x=0;
$dst_y=($square_dimensions-$thumb_h)/2;
}
elseif($thumb_h>$thumb_w)
{
// more height than width we have to center width
$dst_x=($square_dimensions-$thumb_w)/2;
$dst_y=0;
}
else
{
$dst_x=0;
$dst_y=0;
}
$src_x=0; // we copy the src image complete
$src_y=0; // we copy the src image complete
$src_w=$thumb_w; // we copy the src image complete
$src_h=$thumb_h; // we copy the src image complete
$pct=100; // 100% over the white color ... here you can use transparency. 100 is no transparency.
imagecopymerge($final_image,$smaller_image_with_proportions,$dst_x,$dst_y,$src_x,$src_y,$src_w,$src_h,$pct);
imagejpeg($final_image,$destination_file,$jpeg_quality);
// destroy aux images (free memory)
imagedestroy($image);
imagedestroy($smaller_image_with_proportions);
imagedestroy($final_image);
}