$infusion->cfgCon("main"); //*================= //* WISHLIST //*================= //WISHLISTMEMBER $wishlist = new wlmapiclass('http://www.mojoleadmastery.com/members', 'LXbfqw59CFNUWaexLXbfqw59CFNUWaex'); $wishlist->return_format = 'php'; // <- value can also be xml or json //*=============================== //* GET USER INFORMATION FROM IS //*=============================== $returnFields = array('contactId'); $query = array('Id' => $order_id); $contacts = $infusion->dsQuery("Job", 1, 0, $query, $returnFields); $fields = array('FirstName', 'LastName', 'Email', 'Phone1', 'Company', 'Username', 'Password'); $IS_DATA = $infusion->loadCon($contacts[0]['contactId'], $fields); //*============================================== //* POST TO MOJO Lead Mastery //* http://mojoleadmastery.com/ //*============================================== //SET LEVEL //if($level == 'MLMMonthly') //{ // $wllevels = array("1409152379"); //mojo full // $member= 'Mojo Lead Mastery'; //} // //else if($level == 'MLMYearly') //{ // $wllevels = array("1409698826"); //mojo annual // $member = 'Mojo Lead Mastery Annual';
<?php require_once "../src/isdk.php"; $app = new iSDK(); if ($app->cfgCon("connectionName")) { echo "connected<br/>"; echo "app connected<br/>"; $cid = 36; $returnFields = array('Email', 'FirstName', 'LastName'); $conDat = $app->loadCon($cid, $returnFields); echo "<pre>"; print_r($conDat); echo "</pre>"; } else { echo "Connection Failed"; }
//* INCLUDES //*================= //INFUSIONSOFT include 'includes/isdk.php'; //*================= //* CONFIGURATION //*================= //INFUSIONSOFT $connInfo = array('main:mojo:i:679c2a2a6aef93984f48e3ec4794db26:Mojo Video'); $app = new iSDK(); $app->cfgCon("main"); //*=============================== //* GET USER INFORMATION FROM IS //*=============================== $fields = array('FirstName', 'LastName', 'Email', 'Phone1', 'Company', '_PlanCode', '_UserId', '_WishListId', '_WishListLevels'); $IS_DATA = $app->loadCon((int) $contactId, $fields); //*============================================== //* CANCEL MOJO VIDEO UNIVERSITY ACCOUNT //* http://mojovideouniversity.com/ //*============================================== //KEY $Secret = "LXbfqw59CFNUWaex"; //PARAMETERS $fxn = 'DeleteUserLevels'; $WishListId = $IS_DATA['_WishListId']; $levels = $IS_DATA['_WishListLevels']; $autoresponder = false; $params = array($WishListId, $levels, $autoresponder); $key = md5($fxn . '__' . $Secret . '__' . implode('|', $params)); $URL = "http://www.mojovideouniversity.com/?WLMAPI={$fxn}/{$key}/{$WishListId}/{$levels}/{$autoresponder}"; //POST
function UpdateInfusionsoftUser($infusionsoft_id) { //this is used for update the user activity info to infusionsoft and categories them into 4 levels. //auth.php will access this funciton. //fistly, use user id to find the infusionsoft id $contactId = $infusionsoft_id; //check the infusionsoft id, //0 -> no infusionsoft id, //-1 -> do not need infusionsoft id, //others are correct infusionsoft id. if ($contactId > 0) { require_once 'isdk.php'; $app = new iSDK(); if ($app->cfgCon("mps")) { //remove all tags level 5 is (316) level 4 is (318) Lvel 3 is (320) level 2 is (322) $result = $app->grpRemove($contactId, 316); $result = $app->grpRemove($contactId, 318); $result = $app->grpRemove($contactId, 320); $result = $app->grpRemove($contactId, 322); //Get the last login time $returnFields = array('_LastLogin'); $data = $app->loadCon($contactId, $returnFields); $current_date = date("Ymd\\T00:00:00"); if (!empty($data)) { //existing last login time, get the last login date $last_login_date = $data['_LastLogin']; //calc the day difference between current_time and last login $current_date_time = mktime(0, 0, 0, substr($current_date, 4, 2), substr($current_date, 6, 2), substr($current_date, 0, 4)); //echo "full:".$current_date."\nM:".substr($current_date,4,2)."\nD:".substr($current_date,6,2)."\nY:".substr($current_date,0,4)."\n"; $last_login_date_time = mktime(0, 0, 0, substr($last_login_date, 4, 2), substr($last_login_date, 6, 2), substr($last_login_date, 0, 4)); //echo "full:".$last_login_date."\nM:".substr($last_login_date,4,2)."\nD:".substr($last_login_date,6,2)."\nY:".substr($last_login_date,0,4)."\n"; $datediff = floor(($current_date_time - $last_login_date_time) / (60 * 60 * 24)); //echo $datediff; if ($datediff <= 7) { //within 7 days assign level 5 tag $app->grpAssign($contactId, 316); //$app->achieveGoal("om185", "TriggerSizzling", $contactId); } else { if ($datediff >= 8 and $datediff <= 14) { //within 8-14 days assign level 4 tag $app->grpAssign($contactId, 318); } else { if ($datediff >= 15 and $datediff <= 21) { //within 15-21 days assign level 3 tag $app->grpAssign($contactId, 320); } else { //over 22 days assign level 2 tag $app->grpAssign($contactId, 322); } } } } else { //last login time not existed, assign to level 5 tag $app->grpAssign($contactId, 316); } //update last login $conDat = array('_LastLogin' => $current_date); $conID = $app->updateCon($contactId, $conDat); return TRUE; } } else { return FALSE; } }
<?php include 'config.php'; require "src/isdk.php"; $app = new iSDK(); if ($app->cfgCon("connectionName")) { echo "app connected<br/>"; $contactId = (int) $_POST['contactId']; $number = (int) $_POST['number']; $field = $_POST['field']; // Get Value of Current Field $counter = $app->loadCon($contactId, array("{$field}")); $countervalue = $counter[$field]; // Do Some Math $newvalue = $countervalue + $number; echo "Old value = {$countervalue} <br> New Value = {$newvalue} <br> Field Incrased by {$number}"; // Update The field With New Value $conDat = array($field => $newvalue); $app->updateCon($contactId, $conDat); } else { echo "Connection to API failed"; }
if ($membership === 'mojoleadmastery') { $wishlist = new wlmapiclass('http://www.mojoleadmastery.com/', '5ae8c42d96a15001cfd6b70de330b70b'); } else { if (!is_object($wishlist)) { die('Invalid membership program specified.'); } } $wishlist->return_format = 'php'; //*=============================== //* GET USER INFORMATION FROM IS //*=============================== $fields2 = array('Id', 'FirstName', 'LastName'); $IS_DATA2 = $infusion->findByEmail($email, $returnFields); print_r($IS_DATA2); $fields = array('FirstName', 'LastName', 'Email', 'Phone1', 'Company', 'Username', 'Password', '_WishListId', '_WishListLevels'); $IS_DATA = $infusion->loadCon((int) $contact_id, $fields); //*============================================== //* POST TO WISHLIST //*============================================== //ADD if ($action === 'add') { //CHECK FOR INVALID USERNAME if ($IS_DATA['Username'] == '') { //EMAIL DEFAULT $IS_DATA['Username'] = $IS_DATA['Email']; //UPDATE INFUSIONSOFT $data['Username'] = $IS_DATA['Email']; } //CHECK FOR INVALID PASSWORD if ($IS_DATA['Password'] == '') { //PASSWORD DEFAULT
//INFUSIONSOFT $connInfo = array('main:mojo:i:679c2a2a6aef93984f48e3ec4794db26:Mojo Video'); $infusion = new iSDK(); $infusion->cfgCon("main"); //*================= //* WISHLIST //*================= //WISHLISTMEMBER $wishlist = new wlmapiclass('http://www.mojoleadmastery.com/members', 'LXbfqw59CFNUWaexLXbfqw59CFNUWaex'); $wishlist->return_format = 'php'; // <- value can also be xml or json //*=============================== //* GET USER INFORMATION FROM IS //*=============================== $fields = array('FirstName', 'LastName', 'Email', 'Phone1', 'Company', 'Username', 'Password'); $IS_DATA = $infusion->loadCon((int) $order_id, $fields); //*============================================== //* POST TO MOJO Lead Mastery //* http://mojoleadmastery.com/ //*============================================== //SET LEVEL //if($level == 'MLMMonthly') //{ // $wllevels = array("1409152379"); //mojo full // $member= 'Mojo Lead Mastery'; //} // //else if($level == 'MLMYearly') //{ // $wllevels = array("1409698826"); //mojo annual // $member = 'Mojo Lead Mastery Annual';