$val) { if ($val != '') { array_push($uMotherArr, $categorylist->CategoryRecords($val)); } } $uDMotherLang = implode(", ", $uMotherArr); $uResid = $uPartDet['part_resid']; $ueResid = explode('-', $uResid); $uResArr = array(); foreach ($ueResid as $key => $val) { if ($val != '') { if ($val == 300) { array_push($uResArr, $categorylist->CategoryRecords($val)); } else { array_push($uResArr, $countrydet->sercountry($val)); } } } $uDResid = implode(", ", $uResArr); $uNation = $uPartDet['part_nation']; $uMarital = $uPartDet['part_marital']; $ueMarital = explode("-", $uMarital); $uMarArr = array(); foreach ($ueMarital as $key => $val) { if ($val != '') { array_push($uMarArr, $categorylist->CategoryRecords($val)); } } $uDMarital = implode(", ", $uMarArr); $uProType = $userDet[0]['pro_type']; $uPhotoStatus = getMyPhotoDet($ProfileId); //Instantiate a new HTML Mime Mail object $mail = new htmlMimeMail5(); $msiteName = strtolower(SITE_NAME); // Set the From header $mail->setFrom(SITE_NAME." "); // Set the Return header $mail->setReturnPath("ereturn@".SITE_NAME_MAIL); // Set the Priority - normal, high $mail->setPriority("normal"); $Subject = ''; $mlati=""; $mlog=""; if ($userDet[0]['pro_resid'] != "" && $userDet[0]['pro_ncity'] != "") { $rLanVal = fnGetLongtitudeEm($userDet[0]['pro_resid'], $userDet[0]['pro_ncity']); // calculate latitude and longtitude $mlati=$rLanVal['latitute']; $mlog=$rLanVal['longtitude']; } /* * start on 20917 */ //fnCheckOffer($pProtype,$uUpgradePath); //fnsndmsgtxt("",'','',$uProType); global $BanTop,$BanBottom,$banmsg; /* * end on 20917 */ $html .= ' Nikah.com - Newsletters

You are receiving this mail as a registered member of '.$msiteName.'
Please add ematches@'.SITE_NAME_MAIL.' to your address book to ensure delivery of e-mails, profile responses into your inbox

'.$sub_date.'

New Matches

Assalamualaikum

Dear '.$uName.' ('.$ProfileId.'),

'; $getMatch = getUserMatchDetail($ProfileId); $getVal = explode(',', $getMatch[0]["match_proid"]); $cntGetVal = count($getVal); $cntTxt = ''; if (($cntGetVal - 1) > 1) { $cntTxt = '(' . ($cntGetVal - 1) . ')'; } $photoArr = array(); // store profileid who has photos $wPhotoArr = array();// without photos foreach ($getVal as $key => $val) { $getRVal = getUserPhotoDet($val); // check whether inputed profileid has photos or not if ($getRVal == 2) { // 2 means the profileid has vp photos array_push($photoArr, $val); } else { array_push($wPhotoArr, $val); } } $photoArr1 = array(); foreach ($photoArr as $key => $val) { $uMatchDet = getUserProfileDetail($val); if (count($uMatchDet) == 0) { continue; } $uMatchDet = $uMatchDet[0]; $lati = ""; $long = ""; if ($uMatchDet['pro_resid'] != "" && $uMatchDet['pro_ncity'] != "") { $rLanVal = fnGetLongtitudeEm($uMatchDet['pro_resid'], $uMatchDet['pro_ncity']); // calculate latitude and longtitude $lati=$rLanVal['latitute']; $long=$rLanVal['longtitude']; } if ($mlati!="" && $mlog!="" && $lati != "" && $long != "") { $miles=distanceEm($mlati,$mlog,$lati,$long,'m'); $photoArr1[strval($miles)] = $val; } } $nPhotoArr = $photoArr; if (count($photoArr1) > 0) { ksort($photoArr1); $nPhotoArr = $photoArr1; } $wPhotoArr1 = array(); foreach ($wPhotoArr as $key => $val) { $uMatchDet = getUserProfileDetail($val); if (count($uMatchDet) == 0) { continue; } $uMatchDet = $uMatchDet[0]; $lati = ""; $long = ""; if ($uMatchDet['pro_resid'] != "" && $uMatchDet['pro_ncity'] != "") { $rLanVal = fnGetLongtitudeEm($uMatchDet['pro_resid'], $uMatchDet['pro_ncity']); // calculate latitude and longtitude $lati=$rLanVal['latitute']; $long=$rLanVal['longtitude']; } if ($mlati!="" && $mlog!="" && $lati != "" && $long != "") { $miles=distanceEm($mlati,$mlog,$lati,$long,'m'); $wPhotoArr1[strval($miles)] = $val; } } $nWPhotoArr = $wPhotoArr; if (count($wPhotoArr1) > 0) { ksort($wPhotoArr1); $nWPhotoArr = $wPhotoArr1; } $getVal1 = array(); $getVal1 = array_merge($nPhotoArr, $nWPhotoArr); $ii = 0; $jj = 0; foreach ($getVal1 as $key => $val) { if ($ii == 7) { break; } $jj++; $uMatchDet = getUserProfileDetail($val); if (count($uMatchDet) == 0) { $jj--; continue; } $uMatchDet = $uMatchDet[0]; $mDispArr = array(); $mDob = $uMatchDet['pro_dob']; $mAge = fnAgeCalculation($mDob); $mAgeD = $mAge . " yrs"; array_push($mDispArr, $mAgeD); $mPhoto = $uphoto->getMatchphotos($ProfileId, $val, 'vp', '', $uGender); $mPhoto=$mPhoto["image"]; $mName = $uMatchDet["dpro_name"]; $mMarital = $uMatchDet["pro_marital"]; $mMaritalStaus = $categorylist->CategoryRecords($mMarital); array_push($mDispArr, $mMaritalStaus); $mMotherLang = $uMatchDet["dpro_language"]; $mEMotherLang = explode(',', $mMotherLang); $mDMotherLang = $categorylist->CategoryRecords($mEMotherLang[0]); $mDMotherLang .= " Speaking"; array_push($mDispArr, $mDMotherLang); /* $mMathab = $uMatchDet["pro_caste"]; $mMathabStaus = $categorylist->CategoryRecords($mMathab); array_push($mDispArr, $mMathabStaus); $mOldmem = $uMatchDet["pro_oldmem"]; $mEdu = $uMatchDet["pro_edu"]; $mOccp = $uMatchDet["pro_occp"]; if($mOldmem) $mOccupation = $categorylist->CategoryRecords($mEdu); else $mOccupation = $categorylist->JobCategoryRecords($mOccp); array_push($mDispArr, $mOccupation); */ $mAboutMeStat = $uMatchDet["dpro_aboutmestat"]; $mAboutMe = ""; if ($mAboutMeStat) { $mAboutMe = 'The user has modified this section recently. This information will be available within 4 hours.'; } else if ($uMatchDet["dpro_aboutme"] != "") { $mAboutMe = substr(htmlspecialchars_decode($uMatchDet["dpro_aboutme"],ENT_NOQUOTES),0,140); } if (strlen($mAboutMe) > 100) { $mAboutMe = substr($mAboutMe, 0, 100) . "..."; } /* $mRCity = $uMatchDet["pro_ncity"]; if ($mOldmem) $mRState = $uMatchDet["pro_state"]; else $mRState = $uMatchDet["pro_nstate"]; */ $mRCountry = $uMatchDet["pro_resid"]; /* $mRCityDis = $countrydet->sercity($mRCountry, $mRCity); array_push($mDispArr, $mRCityDis); $mRStateStatus = $countrydet->serstate($mRState, $mRCountry); array_push($mDispArr, $mRStateStatus); */ $mRCountryStatus = $countrydet->sercountry($mRCountry); array_push($mDispArr, $mRCountryStatus); $mDispContent = implode(", ", $mDispArr); $mProType = $uMatchDet["pro_type"]; $backStyle = "border:1px solid #ddd;background:#f6f6f6;"; if ($mProType == 1) { $backStyle = "border:1px solid #559f11;background:radial-gradient(#fff,#d4f9d8);background:-webkit-radial-gradient(#fff,#d4f9d8);background:-o-radial-gradient(#fff,#d4f9d8)"; } if ($ii == 0) { //$Subject .= $mName . ' and more suitable matches waiting to be viewed by you. ('.$sub_date.' )'; $mName1 = explode(' ', $mName); $sub_date1 = date('d M y', strtotime("yesterday")); $Subject .= $mName1[0] . ' and more'.$cntTxt.' New Matches added yesterday('.$sub_date1.' )'; $html .= '

We have found the following newly registered members who could be of interest to you. You may go through their profile and send interest to them if you feel they could be your potential partner.

'; /* * start on 20917 */ //$html.=$banmsg; /* * end on 20917 */ } $html .= '

'.$mName.' ('.$val.')

'.$mDispContent.'

'.$mAboutMe.' More Details

View
'; $ii++; } if ($cntGetVal > 7) { $html .= ' More
'; } $html .= '

Your partner preference search settings :

Age Range:'.$uAgeFT.' Marital Status:'.$uDMarital.'
Language:'.$uDMotherLang.'Residing Country:'.$uDResid.'
'; // start awaiting response $getWait = getawaitprof($ProfileId); $aw_cnt=count($getWait); if($aw_cnt > 0){ $html.='
Awaiting Response
'; $ii = 0; $jj = 0; foreach ($getWait as $key => $val1) { $val = $val1["userid"]; if ($ii == 7) { break; } $jj++; $uMatchDet = getUserProfileDetail($val); if (count($uMatchDet) == 0) { $jj--; continue; } $uMatchDet = $uMatchDet[0]; $mDispArr = array(); $mDob = $uMatchDet['pro_dob']; $mAge = fnAgeCalculation($mDob); $mAgeD = $mAge . " yrs"; array_push($mDispArr, $mAgeD); $mPhoto = $uphoto->getMatchphotos($ProfileId, $val, 'vp', '', $uGender); $mPhoto=$mPhoto["image"]; $mName = $uMatchDet["dpro_name"]; $mMarital = $uMatchDet["pro_marital"]; $mMaritalStaus = $categorylist->CategoryRecords($mMarital); array_push($mDispArr, $mMaritalStaus); $mMotherLang = $uMatchDet["dpro_language"]; $mEMotherLang = explode(',', $mMotherLang); $mDMotherLang = $categorylist->CategoryRecords($mEMotherLang[0]); $mDMotherLang .= " Speaking"; array_push($mDispArr, $mDMotherLang); /* $mMathab = $uMatchDet["pro_caste"]; $mMathabStaus = $categorylist->CategoryRecords($mMathab); array_push($mDispArr, $mMathabStaus); $mOldmem = $uMatchDet["pro_oldmem"]; $mEdu = $uMatchDet["pro_edu"]; $mOccp = $uMatchDet["pro_occp"]; if($mOldmem) $mOccupation = $categorylist->CategoryRecords($mEdu); else $mOccupation = $categorylist->JobCategoryRecords($mOccp); array_push($mDispArr, $mOccupation); */ $mAboutMeStat = $uMatchDet["dpro_aboutmestat"]; $mAboutMe = ""; if ($mAboutMeStat) { $mAboutMe = 'The user has modified this section recently. This information will be available within 4 hours.'; } else if ($uMatchDet["dpro_aboutme"] != "") { $mAboutMe = substr(htmlspecialchars_decode($uMatchDet["dpro_aboutme"],ENT_NOQUOTES),0,140); } if (strlen($mAboutMe) > 100) { $mAboutMe = substr($mAboutMe, 0, 100) . "..."; } /* $mRCity = $uMatchDet["pro_ncity"]; if ($mOldmem) $mRState = $uMatchDet["pro_state"]; else $mRState = $uMatchDet["pro_nstate"]; */ $mRCountry = $uMatchDet["pro_resid"]; /* $mRCityDis = $countrydet->sercity($mRCountry, $mRCity); array_push($mDispArr, $mRCityDis); $mRStateStatus = $countrydet->serstate($mRState, $mRCountry); array_push($mDispArr, $mRStateStatus); */ $mRCountryStatus = $countrydet->sercountry($mRCountry); array_push($mDispArr, $mRCountryStatus); $mDispContent = implode(", ", $mDispArr); $mProType = $uMatchDet["pro_type"]; $backStyle = "border:1px solid #ddd;background:#f6f6f6;"; if ($mProType == 1) { $backStyle = "border:1px solid #559f11;background:radial-gradient(#fff,#d4f9d8);background:-webkit-radial-gradient(#fff,#d4f9d8);background:-o-radial-gradient(#fff,#d4f9d8)"; } $html .= '

'.$mName.' ('.$val.')

'.$mDispContent.'

'.$mAboutMe.' More Details

'; $ii++; } $html .= '
'; } // end awaiting response if ($uPhotoStatus == 1) { $html .= '

Adding photos to your profile gives you better results and responses.

Upload your pictures now

'; } else if ($uProType == 0) { $html .= '

Get noticed by more members. Upgrade and unlock the contact details.

Upgrade Now

'; } $html .= '
'; //echo "here" . $jj . " **** " . count($getVal1); //print_r($getMatch); //echo $html; //exit; // Set the Subject $mail->setSubject($Subject); // Create the HTML email $mail->setHTML($html, ""); // Create Message Text/plain $Message = ""; $mail->setText($Message); //$toAdd = "michaelstarss@gmail.com"; //$toAdd = "varusaimhd@yahoo.com"; if ($jj > 0) { //$toAdd = "varusai24@gmail.com"; $toAdd = $userDet[0]["pro_email"]; //echo $toAdd = "vijay1987a@yahoo.com"; return $result = $mail->send(array($toAdd)); } else { return 1; } } // get user details who has been invited by others function getUserProfileDetail($ProfileId) { global $inputs,$dbase; $sql = "select dpro_name,pro_dob,pro_height,pro_caste,pro_occp,pro_ncity,pro_nstate,pro_resid,dpro_aboutmestat,dpro_aboutme, pro_gender,pro_oldmem,pro_edu,pro_marital,pro_caste,pro_state,dpro_language,pro_type,pro_email,pro_type from profile p join det_profile d on p.pro_profileid = d.dpro_profileid where p.pro_profileid = '$ProfileId'"; $exeQuery = $dbase->db_sql_query($sql); $proDetArray = array(); if (count($exeQuery) > 0) { if (is_array($exeQuery[0])) { $proDetArray = $exeQuery; } else { $proDetArray[0] = $exeQuery; } } return $proDetArray; } // get user details who has been invited by others function getUserMatchDetail($ProfileId) { global $inputs,$dbase; $sql = "select match_proid from partner_locality where profileid = '$ProfileId'"; $exeQuery = $dbase->db_sql_query($sql); $proDetArray = array(); if (count($exeQuery) > 0) { if (is_array($exeQuery[0])) { $proDetArray = $exeQuery; } else { $proDetArray[0] = $exeQuery; } } return $proDetArray; } // get age calculation function fnAgeCalculation($dob) { $dobDay = new DateTime($dob); $curDay = new DateTime(); $ddiffInv = $dobDay->diff($curDay); $pro_age = $ddiffInv->y; return $pro_age; } // get user details who has been invited by others function getUserPartPrefDet($ProfileId) { global $inputs,$dbase; $sql = "select part_agefrom,part_ageto,part_marital,part_motherlang,part_resid,part_nation from partner where part_profileid = '$ProfileId'"; $exeQuery = $dbase->db_sql_query($sql); $proDetArray = array(); if (count($exeQuery) > 0) { if (is_array($exeQuery[0])) { $proDetArray = $exeQuery; } else { $proDetArray[0] = $exeQuery; } } return $proDetArray; } // get photo status function getUserPhotoDet($ProfileId) { global $inputs,$dbase; $sql = "select count(ph_profileid) cnt from photo_status where ph_profileid = '$ProfileId' and ph_lock = 1"; $exeQuery = $dbase->db_sql_query($sql); $rval = 1; if ($exeQuery['cnt'] > 0) { $sql1 = "select count(ph_profileid) cnt from photos where ph_profileid = '$ProfileId' and ph_change = 1 and ph_vp_photo <> ''"; $exeQuery1 = $dbase->db_sql_query($sql1); if ($exeQuery['cnt'] > 0) { $rval = 2; } } return $rval; } // get my photo status function getMyPhotoDet($ProfileId) { global $inputs,$dbase; $sql = "select count(ph_profileid) cnt from photo_status where ph_profileid = '$ProfileId'"; $exeQuery = $dbase->db_sql_query($sql); $rval = 1; if ($exeQuery['cnt'] > 0) { $rval = 2; } return $rval; } function fnGetLongtitudeEm($_reg_country, $_reg_city) { global $querybuild; // CIty details - (USA UK Canada) if($_reg_country=='97' || $_reg_country=='188' || $_reg_country=='189') { $table = DB_com_name.".zipcode"; $selectzipvalues = array("POSTAL_CODE","LATITUDE","LONGITUDE"); $zipdetval = $querybuild->build_query($selectzipvalues,$table,'cityid',$_reg_city,'looparray','','','','',''); $zipcode = $zipdetval['POSTAL_CODE']; $latitude = $zipdetval['LATITUDE']; $longitude = $zipdetval['LONGITUDE']; } else { // CIty details other than - (USA UK Canada) $table = DB_com_name.".city"; $zipcode = ''; $selectcityvalues = array("lat","long1"); $citydetval = $querybuild->build_query($selectcityvalues,$table,'id',$_reg_city,'looparray','','','','',''); $latitude = $citydetval['lat']; $longitude = $citydetval['long1']; } $rArray = array('zipcode' => $zipcode, 'latitute'=>$latitude, 'longtitude'=>$longitude); return $rArray; } // distance calculation function distanceEm($lat1, $lon1, $lat2, $lon2, $unit) { $theta = $lon1 - $lon2; $theta = floatval($theta); $lat1 = floatval($lat1); $lat2 = floatval($lat2); $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit = strtoupper($unit); if ($unit == "K") { return round(($miles * 1.609344)); } else if ($unit == "N") { return ($miles * 0.8684); } else { return $miles; } } // get awaiting detail based on communication function getawaitprof($ProfileId) { global $inputs,$dbase; $sql = "select i.*,date_format(ini_inidate,'%D %b %Y') as date from (select ini_profileid as userid,ini_inidate from initiate where ini_contactid = '$ProfileId' and ((ini_status = 0 and ini_reinistatus = 0) or (ini_status =4 and ini_reinistatus =1)) and pro_adminappstatus = 1 union select ini_contactid as userid,ini_inidate from initiate where ini_profileid = '$ProfileId' and ((ini_status = 3 and ini_reinistatus = 1) or (ini_status =2 and ini_reinistatus =1)) and pro_adminappstatus = 1) i join profile p on i.userid = p.pro_profileid and p.pro_adminappstatus = 1 order by i.ini_inidate asc limit 0, 10"; //limit $sLimit, 2 // and userid not in (select dec_to from pendingdecision where dec_to = userid and curdate() between dec_from and dec_till) $exeQuery = $dbase->db_sql_query($sql); $proDetArray = array(); if (count($exeQuery) > 0) { if (is_array($exeQuery[0])) { $proDetArray = $exeQuery; } else { $proDetArray[0] = $exeQuery; } } return $proDetArray; } ?>