Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // 6-16 TEMPORARY PATCH - the code below takes 40 seconds to run
- //
- //return;
- //
- // END TEMPORARY PATCH
- //Change by Ocean, Value of coaches
- $coachs_array = array( 'Andrew Draughon' => array('coachName' => 'Andrew Draughon',
- 'coachPhone' => '(321) 285-7662',
- 'coachEmail' => 'askwwn@elitemarketingpro.com',
- 'coachSkype' => 'adraughon',
- 'coachScheduleOnce' => 'http://www.meetme.so/adraughon',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/draughon.jpg'
- ),
- 'Tim Erway' => array('coachName' => '',
- 'coachPhone' => '',
- 'coachEmail' => '',
- 'coachSkype' => '',
- 'coachScheduleOnce' => '',
- 'coachImage' => ''
- ),
- 'Ferny Ceballos' => array('coachName' => 'Ferny Ceballos',
- 'coachPhone' => '',
- 'coachEmail' => '',
- 'coachSkype' => '',
- 'coachScheduleOnce' => '',
- 'coachImage' => ''
- ),
- 'Joshua Smith' => array('coachName' => 'Joshua Smith',
- 'coachPhone' => '(423)-567-4820',
- 'coachEmail' => 'coachjoshuasmith@gmail.com',
- 'coachSkype' => 'coachjoshuasmith',
- 'coachScheduleOnce' => 'http://www.meetme.so/joshuasmith',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/smith.jpg'
- ),
- 'Nick Haubner' => array('coachName' => 'Nick Haubner',
- 'coachPhone' => '(321) 200-0153',
- 'coachEmail' => 'nick@elitemarketingpro.com',
- 'coachSkype' => 'nick.elitemarketingpro',
- 'coachScheduleOnce' => 'http://www.meetme.so/nickhaubner',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/haubner.jpg'
- ),
- 'Rodolfo Rodriguez' => array('coachName' => 'Rodolfo Rodriguez',
- 'coachPhone' => '(408)-359-7839',
- 'coachEmail' => 'coachRodolfoRodriguez@gmail.com',
- 'coachSkype' => 'rodolfo.rudy.rodriguez',
- 'coachScheduleOnce' => 'http://www.meetme.so/rrodriguez',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/rodriguez.jpg'
- ),
- 'Dr. Rafael Santana' => array('coachName' => 'Dr. Rafael Santana',
- 'coachPhone' => '323.459.5228',
- 'coachEmail' => 'santanaempcoach@gmail.com',
- 'coachSkype' => '',
- 'coachScheduleOnce' => 'http://www.meetme.so/rafaelsantana',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/santana.jpg'
- ),
- 'Rebecca Woodhead' => array('coachName' => 'Rebecca Woodhead',
- 'coachPhone' => '917-267-7984',
- 'coachEmail' => 'wordnerdarmy@gmail.com',
- 'coachSkype' => 'TheRebeccaWoodhead',
- 'coachScheduleOnce' => 'http://www.meetme.so/rebeccawoodhead',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/woodhead.jpg'
- ),
- 'Rodney Poon' => array('coachName' => 'Rodney Poon',
- 'coachPhone' => '416-892-2382',
- 'coachEmail' => 'rodney.poon@gmail.com',
- 'coachSkype' => 'coachrodneypoon',
- 'coachScheduleOnce' => 'http://www.meetme.so/rodneypoon',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/poon.jpg'
- ),
- 'Dominik Lipinski' => array('coachName' => 'Dominik Lipinski',
- 'coachPhone' => '312.788.7477',
- 'coachEmail' => 'coachdomlipinski@gmail.com',
- 'coachSkype' => 'dominik.lipinski1',
- 'coachScheduleOnce' => 'http://www.meetme.so/dominiklipinski',
- 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/lipinski.jpg'
- )
- );
- //print_r($coachs_array);
- $contactOwner = getContactOwnerDetail($affiliate);
- //print_r($contactOwner);
- function getContactOwnerDetail($affiliate) {
- $POSTURL = "https://api.ontraport.com/cdata.php";
- $searchData = "<search>
- <equation>
- <field>E-Mail</field><op>e</op><value>".$affiliate['emailaddress']."</value></equation>
- </search>";
- //echo $email;
- $HTTPRequest = curl_init();
- $query="Appid=2_9712_8L5K24UX9&Key=BVx5lFTEKJdkAMb&reqType=search&data=$searchData";
- curl_setopt($HTTPRequest, CURLOPT_URL, $POSTURL);
- curl_setopt($HTTPRequest, CURLOPT_POST, 1);
- curl_setopt($HTTPRequest, CURLOPT_POSTFIELDS,$query);
- curl_setopt($HTTPRequest, CURLOPT_RETURNTRANSFER, 1);
- #curl_setopt($HTTPRequest, CURLOPT_VERBOSE, true);
- $HTTPResponse = curl_exec ($HTTPRequest);
- //echo "<br>Get Contact Id Response Starts<hr>" . $HTTPResponse . "<hr>";
- curl_close($HTTPRequest);
- $xml = $HTTPResponse;
- $full_name = "";
- $pattern_first_name = "/\<field name=\"First Name\"\>(.+)\<\/field\>/";
- preg_match($pattern_first_name, $xml, $matches_f);
- if(is_array($matches_f) && count($matches_f) > 0){
- $reqMatches = explode("</field>", $matches_f[1]);
- $full_name = $reqMatches[0];
- }
- $pattern_last_name = "/\<field name=\"Last Name\"\>(.+)\<\/field\>/";
- preg_match($pattern_last_name, $xml, $matches_l);
- if(is_array($matches_l) && count($matches_l) > 0){
- $reqMatches = explode("</field>", $matches_l[1]);
- $full_name .= " ".$reqMatches[0];
- }
- //Added by Ocean for getting answers info of levels <field name="Ignition: L2 Mod6: Q1">
- $pattern_ignition_L2_Mod6_Q1 = "/\<field name=\"Ignition: L2 Mod6: Q1\"\>(.+)\<\/field\>/";
- preg_match($pattern_ignition_L2_Mod6_Q1, $xml, $matches_il2m6);
- $ignition_L2_Mod6_Q1 = '';
- if(is_array($matches_il2m6) && count($matches_il2m6) > 0){
- $reqMatches = explode("</field>", $matches_il2m6[1]);
- $ignition_L2_Mod6_Q1 = $reqMatches[0];
- }
- //$reqMatches = explode("</field>", $matches[1]);
- if( $affiliate['emailaddress'] != '' ){
- if($full_name != ""){
- $contactOwner['name'] = $full_name;
- } else {
- $contactOwner['name'] = $affiliate['name'];
- }
- $contactOwner['email'] = $affiliate['emailaddress'];
- $contactOwner['phone'] = $affiliate['phone'];
- $contactOwner['profile_picture'] = $affiliate['my_profile_picture'];
- $contactOwner['skype'] = "";
- $contactOwner['schedule'] = "";
- $contactOwner['ignition_L2_Mod6_Q1'] = $ignition_L2_Mod6_Q1;
- }
- return $contactOwner;
- }
- //global $current_coach_array;
- //Change by ocean
- $moduleLevelDetail = false;
- ///print_r($currentUserInfo);
- echo "<!-- ";
- if(is_array($currentUserInfo) && isset($currentUserInfo['aff_emailaddress']) && $currentUserInfo['aff_emailaddress'] != ''){
- $moduleLevelDetail = getModuleDetail($currentUserInfo['aff_emailaddress']);
- //print_r($currentUserInfo);
- }
- //echo " Logged Email Address ".$email;
- echo "-->";
- function getModuleDetail($email) {
- $POSTURL = "http://api.moon-ray.com/cdata.php";
- $searchData = "<search>
- <equation>
- <field>E-Mail</field><op>e</op><value>".$email."</value></equation>
- </search>";
- //echo $email;
- $HTTPRequest = curl_init();
- $query="Appid=2_9712_8L5K24UX9&Key=BVx5lFTEKJdkAMb&reqType=search&data=$searchData";
- curl_setopt($HTTPRequest, CURLOPT_URL, $POSTURL);
- curl_setopt($HTTPRequest, CURLOPT_POST, 1);
- curl_setopt($HTTPRequest, CURLOPT_POSTFIELDS,$query);
- curl_setopt($HTTPRequest, CURLOPT_RETURNTRANSFER, 1);
- #curl_setopt($HTTPRequest, CURLOPT_VERBOSE, true);
- $HTTPResponse = curl_exec ($HTTPRequest);
- echo "<!-- ";
- echo "<br>Get Contact Id Response Starts<hr>" . $HTTPResponse . "<hr>";
- curl_close($HTTPRequest);
- $xml = $HTTPResponse;
- $total_level = 3;
- $total_module = 12;
- for($i = 1; $i <= $total_level; $i++){
- for($j = 1; $j <= $total_module; $j++){
- echo $pattern = "/\<field name=\"Ignition: L".$i.": Mod".$j."\"\>(.+)\<\/field\>/";
- //echo " ocean ";
- preg_match($pattern, $xml, $matches);
- if(is_array($matches) && count($matches) > 0){
- $reqMatches = explode("</field>", $matches[1]);
- $moduleLevelDetail['level'.$i.'_module'.$j] = $reqMatches[0];
- } else {
- $moduleLevelDetail['level'.$i.'_module'.$j] = "No";
- }
- }
- }
- // echo "-->";
- //Contact Owner
- $pattern_ownerName = "/\<field name=\"Owner\"\>(.+)\<\/field\>/";
- preg_match($pattern_ownerName, $xml, $matches_onwer_name);
- if(is_array($matches_onwer_name) && count($matches_onwer_name) > 0){
- $reqMatches = explode("</field>", $matches_onwer_name[1]);
- $moduleLevelDetail['Onwer_name']= $reqMatches[0];
- //Getting Owner details
- //$target_key = array_search($moduleLevelDetail['Onwer_name'], $coachs_array);
- //echo $moduleLevelDetail['Onwer_name'];
- //print_r($coachs_array);
- global $coachs_array;
- $tarket_key = $moduleLevelDetail['Onwer_name'];
- $moduleLevelDetail['coach'] = $coachs_array[$tarket_key];
- //print_r($current_coach_array);
- }
- print_r($moduleLevelDetail);
- return $moduleLevelDetail;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement