hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
home
/
ubuntu
/
bmse.net
/
Upload FileeE
HOME
<?php include('includes/application_includes.php'); //ArrayDisplay($_POST); 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) { $thumb= 'images/sponsor_logos/thumbs/'; $target_path = SITE_ADMIN_IMAGES_SPONSOR_LOGOS_DOC_PATH; $thumb_target_path = SITE_ADMIN_IMAGES_SPONSOR_LOGOS_DOC_PATH; $ImgPrefix = randamString(4); $img = $ImgPrefix.basename($_FILES['logo']['name']); $img=str_replace(" ","_",$img); $uploadfile = $thumb_target_path.$img; $image_types = Array ( "image/pjpeg", "image/jpeg", "image/jpg", "image/png", "image/gif" ); list($imagewidth,$imageheight)=getimagesize($exiName); if($_FILES['logo']['name']!=''&&!in_array ($file_type, $image_types)){ header('location:error.php?bsaction=no_imagetypes'); } if((isset($imagewidth)&&$imagewidth!=110)||(isset($imageheight)&&$imageheight!=120)) { header('location:become_sponsor.php?action=imagesize_exceeds'); }else { $values = array( 'expo_id' => $_POST['expo_id'], 'sponsorship' => $_POST['sponsorship'], 'companyname' => $_POST['companyname'], 'name' => $_POST['name'], 'country' => $_POST['country'], 'state' => $_POST['state'], 'city' => $_POST['city'], 'phone' => $_POST['phone'], 'email' => $_POST['email'], 'website' => $_POST['website'], 'insert_dttm' => $current_date, 'update_dttm' => $current_date, 'status' => 0, 'street_address' => $_POST['street_address'], 'zip'=> $_POST['zip'] ); if (in_array(strtolower($_FILES["logo"]["type"]),$image_types)){ if(move_uploaded_file($_FILES['logo']['tmp_name'], $uploadfile)){ list($sponsorlogowidth,$sponsorlogoheight)=getimagesize($uploadfile); if($sponsorlogowidth>150||$sponsorlogoheight>60){ createthumbnail($uploadfile,$thumb_target_path.$img,150,60); } chmod($uploadfile, 0777); $values['sponsor_logo']=$img; } } $insertid=$db->insert(BMSE_SPONSOR_REQUESTS, $values); $sponsorInfo = $db->getRow('SELECT `sponsor_type` FROM `bmse_sponsors` WHERE `id`='.$_POST['sponsorship'].''); $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" => "spsr".$insertid, "Company" => $_POST['companyname'], "Sponsorship_Type" => $sponsorInfo['sponsor_type'], "Last_Name" => $_POST['name'], "Email" => $_POST['email'], "Phone" => $_POST['phone'], "Website" => $_POST['website'], "Street" => $_POST['street_address'] , "City" => $_POST['city'] , "State" => $_POST['state'], "Zip_Code" => $_POST['zip'], "Country" => $country['countries_name'], "Account_Name" => $_POST['companyname'], "itemtype" => "becomesponsor" )), "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" => "spsr".$insertid, "company" => $_POST['companyname'], "user_name" => $_POST['name'], "email" => $_POST['email'], "account_name" => $_POST['companyname'], "itemtype" => "becomesponsor", "sourcefrom" => "ui_becomesponsor", "insert_dttm" => $current_date, "zoho_tags" => "Sponsor App", "record_type" => "lead" ); $db->insert('bmse_zoho_records', $zohoValues); if($insertid) { /* Sending mail After Registration */ /* Starts here */ /* Get Mail Content */ //$MailContents=$db->getRow('SELECT * FROM '.BMSE_MAIL_CONFIGS.' WHERE actor_name="SPONSOR"'); $sponsormailConfigs=$db->getRow('SELECT * FROM '.MAIL_CONFIGS.' WHERE `id`=3'); $sponsorType = $db->getRow('SELECT sponsor_type,price FROM '.BMSE_SPONSORS.' where id='.$_POST['sponsorship'].' and status='.ACTIVE.' and remove_flag='.ACTIVE.''); $expoInfo=$db->getRow('SELECT `name` FROM '.BMSE_EXPOS.' WHERE id='.$_POST['expo_id']); $to = $_POST['email']; $subject=$sponsormailConfigs['subject']; $message=$sponsormailConfigs['message']; $message = preg_replace("/\[name\]/",$_POST['name'],$message); $message = preg_replace("/\[sponsor_type\]/",$sponsorType['sponsor_type'],$message); $message = preg_replace("/\[expo_name\]/",$expoInfo['name'],$message); $message = preg_replace("/\[name\]/",$_POST['name'],$message); $message.=$sponsormailConfigs['mail_signature']; //$message=preg_replace("<br[^>]*>","\n",$message); $headers = ''; $headers .= 'From : '.$frommarkedemail.''. "\r\n"; # Modified by Bhoom on 1st Oct 2014 issue #7160 // $headers .= 'Cc : marcella@bmse.net'. "\r\n"; $headers .= 'Bcc : '.$ccmarkedemail.''. "\r\n"; $mailStatus = ''; if($useMailType != ''){ $mailStatus = sendMailThroughSMTP($useMailType,$_POST['email'],$subject,$message); }else{ $mailStatus = sendMailThroughPHP($_POST['email'],$subject,$message,$headers) ; } $mailStatus=true; /* Ends here */ header("location:thankyou.php?bsaction=success"); } } } else { $msg = "Please verify the captcha."; $smarty->assign('ERROR', $msg); $smarty->assign('FIELD', $_POST); } } else { $msg = "Please verify the captcha."; $smarty->assign('ERROR', $msg); $smarty->assign('FIELD', $_POST); } } $smarty->assign('ERROR', $msg); $states = getStates(); $row = $db->getRows('SELECT * FROM '.BMSE_SPONSORS.' WHERE status='.ACTIVE.' AND remove_flag='.ACTIVE.''); $noofsponsorships=count($row); $smarty->assign('NOOFSPONSORSHIPS', $noofsponsorships); $smarty->assign('SPONSOR_TYPES', $row); $Expos=getExpoNames('become-sponsor'); $countries = getCountries(); $smarty->assign('EXPOS', $Expos); $smarty->assign('MYEXPOSSELECT', $Expos['id']); $smarty->assign('COUNTRIES', $countries); $smarty->assign('STATES', $states); $smarty->assign('MYCOUNTRYSELECT', $countries['id']); $smarty->assign('sitekey', $sitekey); $smarty->display(TEMPLATE_DOCROOT_PATH.'default/becomesponsorn.tpl'); ?>