Advertisement
Guest User

Untitled

a guest
Jun 16th, 2015
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.58 KB | None | 0 0
  1. <?php
  2. // 6-16 TEMPORARY PATCH - the code below takes 40 seconds to run
  3. //
  4. //return;
  5. //
  6. // END TEMPORARY PATCH
  7.  
  8. //Change by Ocean, Value of coaches
  9. $coachs_array = array( 'Andrew Draughon' => array('coachName' => 'Andrew Draughon',
  10. 'coachPhone' => '(321) 285-7662',
  11. 'coachEmail' => 'askwwn@elitemarketingpro.com',
  12. 'coachSkype' => 'adraughon',
  13. 'coachScheduleOnce' => 'http://www.meetme.so/adraughon',
  14. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/draughon.jpg'
  15. ),
  16. 'Tim Erway' => array('coachName' => '',
  17. 'coachPhone' => '',
  18. 'coachEmail' => '',
  19. 'coachSkype' => '',
  20. 'coachScheduleOnce' => '',
  21. 'coachImage' => ''
  22. ),
  23. 'Ferny Ceballos' => array('coachName' => 'Ferny Ceballos',
  24. 'coachPhone' => '',
  25. 'coachEmail' => '',
  26. 'coachSkype' => '',
  27. 'coachScheduleOnce' => '',
  28. 'coachImage' => ''
  29. ),
  30. 'Joshua Smith' => array('coachName' => 'Joshua Smith',
  31. 'coachPhone' => '(423)-567-4820',
  32. 'coachEmail' => 'coachjoshuasmith@gmail.com',
  33. 'coachSkype' => 'coachjoshuasmith',
  34. 'coachScheduleOnce' => 'http://www.meetme.so/joshuasmith',
  35. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/smith.jpg'
  36. ),
  37. 'Nick Haubner' => array('coachName' => 'Nick Haubner',
  38. 'coachPhone' => '(321) 200-0153',
  39. 'coachEmail' => 'nick@elitemarketingpro.com',
  40. 'coachSkype' => 'nick.elitemarketingpro',
  41. 'coachScheduleOnce' => 'http://www.meetme.so/nickhaubner',
  42. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/haubner.jpg'
  43. ),
  44. 'Rodolfo Rodriguez' => array('coachName' => 'Rodolfo Rodriguez',
  45. 'coachPhone' => '(408)-359-7839',
  46. 'coachEmail' => 'coachRodolfoRodriguez@gmail.com',
  47. 'coachSkype' => 'rodolfo.rudy.rodriguez',
  48. 'coachScheduleOnce' => 'http://www.meetme.so/rrodriguez',
  49. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/rodriguez.jpg'
  50. ),
  51. 'Dr. Rafael Santana' => array('coachName' => 'Dr. Rafael Santana',
  52. 'coachPhone' => '323.459.5228',
  53. 'coachEmail' => 'santanaempcoach@gmail.com',
  54. 'coachSkype' => '',
  55. 'coachScheduleOnce' => 'http://www.meetme.so/rafaelsantana',
  56. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/santana.jpg'
  57. ),
  58. 'Rebecca Woodhead' => array('coachName' => 'Rebecca Woodhead',
  59. 'coachPhone' => '917-267-7984',
  60. 'coachEmail' => 'wordnerdarmy@gmail.com',
  61. 'coachSkype' => 'TheRebeccaWoodhead',
  62. 'coachScheduleOnce' => 'http://www.meetme.so/rebeccawoodhead',
  63. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/woodhead.jpg'
  64. ),
  65. 'Rodney Poon' => array('coachName' => 'Rodney Poon',
  66. 'coachPhone' => '416-892-2382',
  67. 'coachEmail' => 'rodney.poon@gmail.com',
  68. 'coachSkype' => 'coachrodneypoon',
  69. 'coachScheduleOnce' => 'http://www.meetme.so/rodneypoon',
  70. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/poon.jpg'
  71. ),
  72. 'Dominik Lipinski' => array('coachName' => 'Dominik Lipinski',
  73. 'coachPhone' => '312.788.7477',
  74. 'coachEmail' => 'coachdomlipinski@gmail.com',
  75. 'coachSkype' => 'dominik.lipinski1',
  76. 'coachScheduleOnce' => 'http://www.meetme.so/dominiklipinski',
  77. 'coachImage' => 'https://elitemarketingpro.com/getcoaching/assets/lipinski.jpg'
  78. )
  79.  
  80. );
  81.  
  82. //print_r($coachs_array);
  83.  
  84. $contactOwner = getContactOwnerDetail($affiliate);
  85. //print_r($contactOwner);
  86.  
  87. function getContactOwnerDetail($affiliate) {
  88. $POSTURL = "https://api.ontraport.com/cdata.php";
  89. $searchData = "<search>
  90. <equation>
  91. <field>E-Mail</field><op>e</op><value>".$affiliate['emailaddress']."</value></equation>
  92. </search>";
  93. //echo $email;
  94. $HTTPRequest = curl_init();
  95.  
  96. $query="Appid=2_9712_8L5K24UX9&Key=BVx5lFTEKJdkAMb&reqType=search&data=$searchData";
  97. curl_setopt($HTTPRequest, CURLOPT_URL, $POSTURL);
  98. curl_setopt($HTTPRequest, CURLOPT_POST, 1);
  99. curl_setopt($HTTPRequest, CURLOPT_POSTFIELDS,$query);
  100. curl_setopt($HTTPRequest, CURLOPT_RETURNTRANSFER, 1);
  101. #curl_setopt($HTTPRequest, CURLOPT_VERBOSE, true);
  102. $HTTPResponse = curl_exec ($HTTPRequest);
  103. //echo "<br>Get Contact Id Response Starts<hr>" . $HTTPResponse . "<hr>";
  104. curl_close($HTTPRequest);
  105. $xml = $HTTPResponse;
  106.  
  107.  
  108. $full_name = "";
  109. $pattern_first_name = "/\<field name=\"First Name\"\>(.+)\<\/field\>/";
  110. preg_match($pattern_first_name, $xml, $matches_f);
  111.  
  112. if(is_array($matches_f) && count($matches_f) > 0){
  113. $reqMatches = explode("</field>", $matches_f[1]);
  114. $full_name = $reqMatches[0];
  115.  
  116. }
  117.  
  118. $pattern_last_name = "/\<field name=\"Last Name\"\>(.+)\<\/field\>/";
  119. preg_match($pattern_last_name, $xml, $matches_l);
  120.  
  121. if(is_array($matches_l) && count($matches_l) > 0){
  122. $reqMatches = explode("</field>", $matches_l[1]);
  123. $full_name .= " ".$reqMatches[0];
  124.  
  125. }
  126.  
  127.  
  128. //Added by Ocean for getting answers info of levels <field name="Ignition: L2 Mod6: Q1">
  129. $pattern_ignition_L2_Mod6_Q1 = "/\<field name=\"Ignition: L2 Mod6: Q1\"\>(.+)\<\/field\>/";
  130. preg_match($pattern_ignition_L2_Mod6_Q1, $xml, $matches_il2m6);
  131. $ignition_L2_Mod6_Q1 = '';
  132. if(is_array($matches_il2m6) && count($matches_il2m6) > 0){
  133. $reqMatches = explode("</field>", $matches_il2m6[1]);
  134. $ignition_L2_Mod6_Q1 = $reqMatches[0];
  135. }
  136.  
  137.  
  138. //$reqMatches = explode("</field>", $matches[1]);
  139.  
  140. if( $affiliate['emailaddress'] != '' ){
  141.  
  142. if($full_name != ""){
  143. $contactOwner['name'] = $full_name;
  144. } else {
  145. $contactOwner['name'] = $affiliate['name'];
  146. }
  147.  
  148. $contactOwner['email'] = $affiliate['emailaddress'];
  149. $contactOwner['phone'] = $affiliate['phone'];
  150. $contactOwner['profile_picture'] = $affiliate['my_profile_picture'];
  151. $contactOwner['skype'] = "";
  152. $contactOwner['schedule'] = "";
  153. $contactOwner['ignition_L2_Mod6_Q1'] = $ignition_L2_Mod6_Q1;
  154. }
  155.  
  156. return $contactOwner;
  157. }
  158. //global $current_coach_array;
  159. //Change by ocean
  160. $moduleLevelDetail = false;
  161. ///print_r($currentUserInfo);
  162.  
  163. echo "<!-- ";
  164. if(is_array($currentUserInfo) && isset($currentUserInfo['aff_emailaddress']) && $currentUserInfo['aff_emailaddress'] != ''){
  165. $moduleLevelDetail = getModuleDetail($currentUserInfo['aff_emailaddress']);
  166. //print_r($currentUserInfo);
  167. }
  168.  
  169. //echo " Logged Email Address ".$email;
  170. echo "-->";
  171. function getModuleDetail($email) {
  172. $POSTURL = "http://api.moon-ray.com/cdata.php";
  173. $searchData = "<search>
  174. <equation>
  175. <field>E-Mail</field><op>e</op><value>".$email."</value></equation>
  176. </search>";
  177. //echo $email;
  178. $HTTPRequest = curl_init();
  179.  
  180. $query="Appid=2_9712_8L5K24UX9&Key=BVx5lFTEKJdkAMb&reqType=search&data=$searchData";
  181. curl_setopt($HTTPRequest, CURLOPT_URL, $POSTURL);
  182. curl_setopt($HTTPRequest, CURLOPT_POST, 1);
  183. curl_setopt($HTTPRequest, CURLOPT_POSTFIELDS,$query);
  184. curl_setopt($HTTPRequest, CURLOPT_RETURNTRANSFER, 1);
  185. #curl_setopt($HTTPRequest, CURLOPT_VERBOSE, true);
  186. $HTTPResponse = curl_exec ($HTTPRequest);
  187. echo "<!-- ";
  188. echo "<br>Get Contact Id Response Starts<hr>" . $HTTPResponse . "<hr>";
  189. curl_close($HTTPRequest);
  190. $xml = $HTTPResponse;
  191.  
  192.  
  193. $total_level = 3;
  194. $total_module = 12;
  195. for($i = 1; $i <= $total_level; $i++){
  196. for($j = 1; $j <= $total_module; $j++){
  197. echo $pattern = "/\<field name=\"Ignition: L".$i.": Mod".$j."\"\>(.+)\<\/field\>/";
  198. //echo " ocean ";
  199. preg_match($pattern, $xml, $matches);
  200. if(is_array($matches) && count($matches) > 0){
  201. $reqMatches = explode("</field>", $matches[1]);
  202.  
  203. $moduleLevelDetail['level'.$i.'_module'.$j] = $reqMatches[0];
  204.  
  205. } else {
  206. $moduleLevelDetail['level'.$i.'_module'.$j] = "No";
  207. }
  208. }
  209. }
  210. // echo "-->";
  211. //Contact Owner
  212. $pattern_ownerName = "/\<field name=\"Owner\"\>(.+)\<\/field\>/";
  213. preg_match($pattern_ownerName, $xml, $matches_onwer_name);
  214. if(is_array($matches_onwer_name) && count($matches_onwer_name) > 0){
  215. $reqMatches = explode("</field>", $matches_onwer_name[1]);
  216. $moduleLevelDetail['Onwer_name']= $reqMatches[0];
  217.  
  218.  
  219. //Getting Owner details
  220. //$target_key = array_search($moduleLevelDetail['Onwer_name'], $coachs_array);
  221. //echo $moduleLevelDetail['Onwer_name'];
  222. //print_r($coachs_array);
  223. global $coachs_array;
  224. $tarket_key = $moduleLevelDetail['Onwer_name'];
  225. $moduleLevelDetail['coach'] = $coachs_array[$tarket_key];
  226. //print_r($current_coach_array);
  227. }
  228.  
  229. print_r($moduleLevelDetail);
  230. return $moduleLevelDetail;
  231. }
  232. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement