Example #1
0
    
       ["57.1"]=>
       string(29) "Organ Stress Assesment Hidden"
       [64]=>
       string(18) "Urgent (+$20)|0.02"
    
       ["62.1"]=>
       string(37) "Vitamin and Mineral Assessment Hidden"
       [63]=>
       string(18) "Urgent (+$20)|0.02"
    
       ["78.1"]=>
       string(49) "Heavy Metal and Toxic Elemental Assessment Hidden"
       [79]=>
       string(15) "Choose option|0"
    */
    //    var_dump($entry);
    //    exit;
    //echo " point 2 ";
    // the 4 numbers in the following array relate to the field ids on the test entry form. The order in which they appear in the array relates to the value assigned and pushed through to the backend api. The correct values are Food = 1, Vitamin = 2, Organ = 3, Metal = 4. If this breaks, check that the numbers in the array correctly correspond with the gravity form field ids.
    foreach (array(88, 90, 89, 91) as $k => $v) {
        if (strpos($entry[$v], 'Standard') === false && strpos($entry[$v], 'Urgent') === false) {
            continue;
        }
        //var_dump($k + 1);
        $params = array('username' => 'reportcr34tor', 'password' => 'lv^nzvtA4', 'report' => array('Category' => $k + 1, 'City' => '', 'DateOfBirth' => $entry[10] . 'T00:00:00', 'DateOfHairSample' => $entry[12] . 'T00:00:00', 'Email' => $entry[9], 'FirstName' => empty($entry['6.3']) ? '-' : $entry['6.3'], 'IsPaid' => true, 'IsUrgent' => strpos($entry[$v], 'Urgent') !== false, 'PaymentType' => !empty($_SERVER["HTTP_REFERER"]) && substr($_SERVER['HTTP_REFERER'], -10) == 'ccform.php' ? 0 : 2, 'Phone' => $entry[8], 'Postcode' => '1001', 'StreetNameAndNo' => $entry[93], 'Suburb' => '', 'Surname' => empty($entry['6.6']) ? '-' : $entry['6.6']));
        //		print_r($params);
        $objResponse = $objClient->CreateReport($params);
    }
    //    unset($_SESSION['allergenics_form_entry']);
}