Location: PHPKode > scripts > GuestCal > guestcal-2.1.2/admin/pages/import.php
<?php
/**
 * This file is part of GuestCal v2.1.2.
 * 
 * License information available at http://www.guestcal.com/
 * ©2009 dotplex e.K. (hide@address.com)
 */

$pageTitle .= ' - ' . str ('adminImport');

// Import from version 1.x
$r .= '<h3>' . str ('adminImportv1') . '</h3>';
if (isset ($_GET['import']) && $_GET['import'] == 'guestcal1' && count ($_POST)) {
	$notices = array ();
	if ($db -> idExists ('objects', $_POST['object'])) {
		$object = $_POST['object'];
		$prefix = mysql_real_escape_string ($_POST['prefix']);
		$nrImported = $db -> importFromV1 ($prefix, $object);
		if ($nrImported)
			$notices[] = str ('adminImportv1NoticeSuccess', array ($nrImported));
		else
			$notices[] = str ('adminImportv1NoticeFail');
	}
	else
		$notices[] = str ('adminImportNoticeMissingObject');
	$r .= echoError ($notices);
}
$r .= '<p>' . str ('adminImportv1Desc') . '</p>';
$r .= '<form action="?page=import&amp;import=guestcal1" method="post"><table>';
$r .= '<tr><th>' . str ('adminImportv1Prefix') . ':</th><td><input type="text" name="prefix" size="30" maxlength="50" /></td></tr>';
$r .= '<tr><th>' . str ('adminImportToObject') . ':</th><td>' . echoSelectObject ($db, 0, 'object', false) . '</td></tr>';
$r .= '</table><p><input type="submit" value="' . str ('adminContinue') . '" /></p></form>';

?>
Return current item: GuestCal