function ap_copernica_transfer($data) { require_once 'soapclient.php'; $query = mysql_query("SELECT wpc.hostname AS host, wpc.username AS user, wpc.accountname AS account, wpc.password AS pw, wpc.datenbank AS dbID\n FROM wp_copernica wpc\n WHERE wpc.id = 1"); while ($row = mysql_fetch_assoc($query)) { $coptab[] = $row; } $soapclient = new PomSoapClient($coptab[0]["host"], $coptab[0]["user"], $coptab[0]["account"], $coptab[0]["pw"]); $query = mysql_query("SELECT `datenbank` AS db FROM `wp_copernica` WHERE `id` = 1"); while ($row = mysql_fetch_assoc($query)) { $db = $row; } echo "<br /><br/><table width=\"50%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; foreach ($data as $key => $value) { $param = array("id" => $db["db"], "fields" => array("login" => $value["login"], "email" => '*****@*****.**', "registered" => $value["registered"], "bedrijfsnaam" => $value["bedrijfsnaam"], "plaats" => $value["plaats"], "straatnaam" => $value["straatnaam"], "huisnummer" => $value["huisnummer"], "postcode" => $value["postcode"], "tel" => $value["tel"], "telmob" => $value["telmob"], "geslacht" => $value["geslacht"], "firstname" => $value["firstname"], "lastname" => $value["lastname"])); $result = $soapclient->Database_createProfile($param); echo "<tr><td>{$value['email']}</td><td>"; echo !empty($result) ? "Success" : "Error"; echo "</td></tr>"; } echo "</table>"; }
/** * Charset * @var string */ $charset = "iso-8859-1"; /** * Should the script output what is being done? */ $verbose = true; /** * Instantiate SOAP api client */ if ($verbose) { echo "Make connection to SOAP environment\n"; } $soapclient = new PomSoapClient($email, $password, $account, $url, $charset); // show what we are doing if ($verbose) { echo "Check if database already exists\n"; } // before we are going to construct a new database, we first check if there // is already a database with this name $database = $soapclient->Account_database(array('identifier' => 'Fictional Persons 3')); // Was an old database with the same name found? if (is_object($database)) { // show what we are doing if ($verbose) { echo "Remove old database\n"; } // remove the old database $soapclient->Database_remove(array('id' => $database->id));