foreach ( $lastCampaigns ['campaigns'] as $recent ) {
                                				if ($recent->name == $CampaignResult->name) {
                                					$CampaignResult == $ConstantContact->getCampaignDetails ( $recent );
                                                                                      print_r($CampaignResult);
                                				}
                                			}
                                		}*/
                                //  $CampaignResult = $ConstantContact->scheduleCampaign($myCampaign, $time);
                                // $CampaignResult = $ConstantContact->scheduleCampaign($lastCampaigns['campaigns'][0], $time);
                            } else {
                                if ($_POST['AddList'] == 'Add List') {
                                    $listInfo = array();
                                    $listInfo['name'] = 'News Letter1';
                                    $listInfo['sortOrder'] = 1;
                                    $List = new ContactList($listInfo);
                                    $listReturn = $ConstantContact->addList($List);
                                    print_r($listReturn);
                                    exit;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    ?>

	<!-- this form searches for a contact by their email address -->
	<H1>Search for a contact</H1>
	<form action="index.php" method="post">
                             /* $listInfo = array();
                                $listInfo['name'] = 'News Letter1';
                                $listInfo['sortOrder'] = 1;*/
                             $flageExist = 0;
                             $CurrentLists = $ConstantContact->getLists();
                             //print_r($CurrentLists['lists']);echo $constantparam['name'];exit;
                             foreach ($CurrentLists['lists'] as $key => $list1) {
                                 if ($list1->name == $constantparam['name']) {
                                     $flageExist = 1;
                                     $constantresult = $list1;
                                     break;
                                 }
                             }
                             if ($flageExist == 0) {
                                 $List = new ContactList($constantparam);
                                 $constantresult = $ConstantContact->addList($List);
                             }
                             $_SESSION['constantresult'] = $constantresult->id;
                         }
                     }
                 }
             }
         }
     }
 }
 $headerurl = $_SESSION['constantparam']['redirecturl'];
 if ($headerurl == "") {
     $headerurl = "../";
 }
 header("location:" . $headerurl);
 exit;