hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
home
/
ubuntu
/
bmse.net
/
Upload FileeE
HOME
<?php include('includes/application_includes.php'); //ArrayDisplay($_POST); #getting member details $row = $db->getRows('SELECT * FROM `bmse_speakers_requests`'); $SubscribeRow =$db->getRows('SELECT * FROM `'.BMSE_NEWSLETTERS_SUBSCRIBED.'`'); //$performerterms= $db->getRow('SELECT * FROM `bmse_site_content` WHERE `name`="performer_terms" and language=1'); $performerterms = $db->getRow('SELECT * FROM `bmse_content_newsite` WHERE `content-page`="TermsAndConditions"'); if(isset($_POST['submit']) && $_POST['submit'] == 'Submit') { if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) { //get verify response data $verifyResponsefive = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']); $responseDatafive = json_decode($verifyResponsefive); if($responseDatafive->success) { $row=$db->getRow("SELECT * FROM `bmse_speakers_requests` WHERE email= '".$_POST['email']."'"); if ($errormessage=='') { if($row) { //header("location:error.php?bspaction=fail"); $errormessage = "Email already exists, please choose another one."; }else { if (is_array($_POST['citiesofinterest']) AND !empty($_POST['citiesofinterest'])){ $citiesofinterest = implode(',', $_POST['citiesofinterest']); } else if (!is_array($_POST['citiesofinterest']) AND $_POST['citiesofinterest']!='') { $citiesofinterest = $_POST['citiesofinterest']; } $values = array( 'name' => $_POST['name'], 'contactname' => $_POST['name'], 'companyname' => $_POST['company_name'], 'username' => $_POST['email'], 'password' => encode($_POST['password']), 'confirm_password' => encode($_POST['confirmpassword']), 'email' => $_POST['email'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'address' => $_POST['address'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'zip' => $_POST['zip'], 'title' => $_POST['title'], 'short_description' => $_POST['short_description'], 'citiesofinterest' => $citiesofinterest, 'joined_date' => $current_date, 'updated_date' => $current_date ); $user_id = $db->insert('bmse_speakers_requests', $values); $country = $db->getRow('SELECT `countries_name` FROM `bmse_countries` WHERE `countries_id`='.$_POST['country'].''); # zoho api lead insertion -starts here # $jayParsedAryp = "refresh_token=".$refresh_token."&client_id=".$client_id."&client_secret=".$client_secret."&grant_type=refresh_token"; $make_callp = callAPIP('POST', 'https://accounts.zoho.com/oauth/v2/token?', ($jayParsedAryp)); $responsep = json_decode($make_callp, true); //ArrayDisplay($responsep); $jayParsedAry = array( "data" => array( array( "itempkid" => "spkr".$user_id, "Company" => $_POST['company_name'], "Last_Name" => $_POST['name'], "Email" => $_POST['email'], "Lecture_Title" => $_POST['title'], "Phone" => $_POST['phone'], "Website" => $_POST['website'], "Street" => $_POST['address'] , "City" => $_POST['city'] , "State" => $_POST['state'], "Zip_Code" => $_POST['zip'], "Country" => $country['countries_name'], "Event_Interested_In" => $citiesofinterest, "Account_Name" => $_POST['company_name'], "itemtype" => "becomeperformer" )), "trigger" =>array( "approval", "workflow", "blueprint" ) ); $make_call = callAPI('POST', 'https://www.zohoapis.com/crm/v2/Leads', json_encode($jayParsedAry), $responsep['access_token']); $response = json_decode($make_call, true); # inserting lead in to the db table $zohoValues = array( "itempkid" => "spkr".$user_id, "company" => $_POST['company_name'], "user_name" => $_POST['name'], "email" => $_POST['email'], "account_name" => $_POST['company_name'], "itemtype" => "becomeperformer", "sourcefrom" => "ui_becomeperformer", "insert_dttm" => $current_date, "zoho_tags" => "Speaker App", "record_type" => "lead" ); $db->insert('bmse_zoho_records', $zohoValues); # Email functionality- start $registermailConfigs=$db->getRow("SELECT * FROM ".MAIL_CONFIGS_TABLE." WHERE `id`=36"); $ToAddress = $_POST['email']; $subject = $registermailConfigs['subject']; $message = $registermailConfigs['message']; $message = preg_replace("/\[name\]/",$_POST['name'],$message); $message = preg_replace("/\[email\]/",$_POST['email'],$message); $message = preg_replace("/\[password\]/",$_POST['password'],$message); $message = preg_replace("/\[exhibitor_site_path\]/",SITE_EXHIBITORADMIN_PATH."login.php",$message); $message.=$registermailConfigs['mail_signature']; $headers = ''; $headers .= 'From : '.$frommarkedemail.''. "\r\n"; $headers .= 'Cc : '.$ccmarkedemail.''. "\r\n"; $mailStatus = ''; if($useMailType != '') { $mailStatus = sendMailThroughSMTP($useMailType,$ToAddress,$subject,$message); }else { $mailStatus = sendMailThroughPHP($ToAddress,$subject,$message,$headers); } $mailStatus = true; ####### 25th July 2018 - Mail content insertion by Bhoom ############### $values = array( 'toAddress' => $ToAddress, 'mailSubject' => $subject, 'mailMessage' => $message, 'moduleSection' => 'Speaker request from UI' ); $db->insert('bmse_outgoing_mails', $values); # Email functionality- end header("location:thankyou.php?bspaction=success"); } } } else { $errormessage = "Please verify the captcha."; $smarty->assign('ERROR', $errormessage); $smarty->assign('FIELD', $_POST); } } else { $errormessage = "Please verify the captcha."; $smarty->assign('ERROR', $errormessage); $smarty->assign('FIELD', $_POST); } } $smarty->assign('ERROR', $errormessage); $performerterms['content']=str_replace('<strong','<b',$performerterms['content']); $performerterms['content']=str_replace('<strong>','<b>',$performerterms['content']); $performerterms['content']=str_replace('</strong>','</b>',$performerterms['content']); $categories = getCategories(); $countries = getCountries(); $states = getStates(); $citiesofinterest=getCities(); $smarty->assign('CATEGORIES', $categories); $smarty->assign('MYCATEGORYSELECT', $categories['id']); $smarty->assign('COUNTRIES', $countries); $smarty->assign('MYCOUNTRYSELECT', $countries['id']); $smarty->assign('STATES', $states); $smarty->assign('MYSTATESELECT', $states['id']); $smarty->assign('NAME', $_POST['name']); $smarty->assign('USERNAME', $_POST['email']); $smarty->assign('COMPANY', $_POST['company_name']); $smarty->assign('COUNTRY', $_POST['country']); $smarty->assign('STATE', $_POST['state']); $smarty->assign('CITY', $_POST['city']); $smarty->assign('ZIP', $_POST['zip']); $smarty->assign('PHONE', $_POST['phone']); $smarty->assign('ADDRESS', $_POST['address']); $smarty->assign('TITLE', $_POST['title']); $smarty->assign('SHORTDESCRIPTION', $_POST['short_description']); $smarty->assign('CAPTCHADISPLAY', $captchadisplay); $smarty->assign('sitekey', $sitekey); $smarty->assign('performerterms', $performerterms['content']); $smarty->assign('CITIESOFINTEREST', $citiesofinterest); $smarty->assign('MYCITIESOFINTEREST', $_POST['citiesofinterest']); $smarty->assign('TERMS_TITLE',$performerterms['header-image-title']); $smarty->assign('TERMS_CONTENT',$performerterms['container1-content']); $smarty->display(TEMPLATE_DOCROOT_PATH.'default/becomeperformern.tpl'); ?>