<form> ContactId: <input type="text" name="ContactId" value="<?php if (isset($_REQUEST['ContactId'])) { echo $_REQUEST['ContactId']; } ?> " /> <input type="submit"/> </form><br/> <?php include '../infusionsoft.php'; if (isset($_REQUEST['ContactId'])) { Infusionsoft_Contact::addCustomField('_LeadScore'); $contact = new Infusionsoft_Contact($_REQUEST['ContactId']); $contact->_LeadScore = $contact->_LeadScore + 1; $contact->save(); echo 'Lead Score for Contact: ' . $contact->FirstName . ' ' . $contact->LastName . ' is now: ' . $contact->_LeadScore; }
<?php include '../infusionsoft.php'; include 'testUtils.php'; ?> <h1>Testing Add</h1> <?php $contact = new Infusionsoft_Contact(); $contact->FirstName = 'Joey'; $out = $contact->save(); ?> <pre><?php didItWorkInt($out); ?> </pre> <h1>Testing Update</h1> <?php $contact->LastName = 'Novak'; $out = $contact->save(); ?> <pre><?php didItWorkInt($out); ?> </pre> <h1>Testing Loading of an object by FirstName (findByField)</h1><?php $out = Infusionsoft_DataService::findByField(new Infusionsoft_Contact(), 'FirstName', 'Joey', 1, 0); ?>