mySQLSafe($_POST['iso']); $record["printable_name"] = $db->mySQLSafe($_POST['printable_name']); $record["iso3"] = $db->mySQLSafe($_POST['iso3']); $record["numcode"] = $db->mySQLSafe($_POST['numcode']); if($_POST['countryId']>0){ $where = "id = ".$db->mySQLSafe($_POST['countryId']); $update =$db->update($glob['dbprefix']."CubeCart_iso_countries", $record, $where); if($update == TRUE){ $msgCountry = "

'".$_POST['printable_name']."' ".$lang['admin']['settings']['update_success']."

"; } else { $msgCountry = "

'".$_POST['printable_name']."' ".$lang['admin']['settings']['update_fail']."

"; } } else { $insert =$db->insert($glob['dbprefix']."CubeCart_iso_countries", $record); if($insert == TRUE){ $msgCountry = "

'".$_POST['printable_name']."' ".$lang['admin']['settings']['add_success']."

"; } else { $msgCountry = "

'".$_POST['printable_name']."' ".$lang['admin']['settings']['add_fail']."

"; } } } elseif(isset($_GET['deleteCountry'])) { $where = "id = ".$db->mySQLSafe($_GET['deleteCountry']); $delete = $db->delete($glob['dbprefix']."CubeCart_iso_countries", $where, ""); if($delete == TRUE){ $msgCountry = "

".$lang['admin']['settings']['delete_success']."

"; } else { $msgCountry = "

".$lang['admin']['settings']['delete_failed']."

"; } $where = "countryId = ".$db->mySQLSafe($_GET['deleteCountry']); $delete = $db->delete($glob['dbprefix']."CubeCart_iso_counties", $where, ""); } if(isset($_POST['mode']) && $_POST['mode']=='county'){ $record["countryId"] = $db->mySQLSafe($_POST['countryId']); $record["abbrev"] = $db->mySQLSafe($_POST['abbrev']); $record["name"] = $db->mySQLSafe($_POST['name']); if($_POST['countyId']>0){ $where = "id = ".$db->mySQLSafe($_POST['countyId']); $update =$db->update($glob['dbprefix']."CubeCart_iso_counties", $record, $where); if($update == TRUE){ $msgCounty = "

'".$_POST['name']."' ".$lang['admin']['settings']['update_success']."

"; } else { $msgCounty = "

'".$_POST['name']."' ".$lang['admin']['settings']['update_fail']."

"; } } else { $insert =$db->insert($glob['dbprefix']."CubeCart_iso_counties", $record); if($insert == TRUE){ $msgCounty = "

'".$_POST['name']."' ".$lang['admin']['settings']['add_success']."

"; } else { $msgCounty = "

'".$_POST['name']."' ".$lang['admin']['settings']['add_fail']."

"; } } } elseif(isset($_GET['deleteCounty'])) { $where = "id = ".$db->mySQLSafe($_GET['deleteCounty']); $delete = $db->delete($glob['dbprefix']."CubeCart_iso_counties", $where, ""); if($delete == TRUE){ $msgCounty = "

".$lang['admin']['settings']['delete_success']."

"; } else { $msgCounty = "

".$lang['admin']['settings']['delete_fail']."

"; } } $countriesPagination = ""; $countiesPagination = ""; $counties = ""; $countriesPerPage = 20; $countiesPerPage = 20; // get countries $query ="SELECT * FROM ".$glob['dbprefix']."CubeCart_iso_countries ORDER BY printable_name ASC"; if(isset($_GET['countriesPage'])){ $countriesPage = $_GET['countriesPage']; } else { $countriesPage = 0; } $countries = $db->select($query, $countriesPerPage, $countriesPage); $numrows = $db->numrows($query); $countriesPagination = $db->paginate($numrows, $countriesPerPage, $countriesPage, "countriesPage"); // get counties $query = "SELECT ".$glob['dbprefix']."CubeCart_iso_counties.id, countryId, abbrev, name, iso, printable_name, iso3, numcode FROM ".$glob['dbprefix']."CubeCart_iso_counties INNER JOIN ".$glob['dbprefix']."CubeCart_iso_countries ON ".$glob['dbprefix']."CubeCart_iso_counties.countryId = ".$glob['dbprefix']."CubeCart_iso_countries.id ORDER BY printable_name, name ASC"; if(isset($_GET['countiesPage'])){ $countiesPage = $_GET['countiesPage']; } else { $countiesPage = 0; } $counties = $db->select($query, $countiesPerPage, $countiesPage); $numrows = $db->numrows($query); $countiesPagination = $db->paginate($numrows, $countiesPerPage, $countiesPage, "countiesPage"); include("../includes/header.inc.php"); ?>

0){ $editCountry = $db->select("select * FROM ".$glob['dbprefix']."CubeCart_iso_countries WHERE id = ".$db->mySQLsafe($_GET['editCountry'])); } ?>
href="?editCountry=" class="txtLink"> href="javascript:decision('','?deleteCountry=');" class="txtLink">
Add Country" />

0){ $editCounty = $db->select("select * FROM ".$glob['dbprefix']."CubeCart_iso_counties WHERE id = ".$db->mySQLsafe($_GET['editCounty'])); } ?>
href="?editCounty=" class="txtLink"> href="javascript:decision('','?deleteCounty=');" class="txtLink">
select("SELECT printable_name, id FROM ".$glob['dbprefix']."CubeCart_iso_countries ORDER BY printable_name ASC"); ?> Add County" />