clearCache(); $record["iso"] = $db->mySQLSafe($_POST['iso']); $record["printable_name"] = ucwords($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'])) { $cache = new cache(); $cache->clearCache(); $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') { $cache = new cache(); $cache->clearCache(); $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'])) { $cache = new cache(); $cache->clearCache(); $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; // excluded get vars $excluded = array("deleteCountry" => null,"deleteCounty" => null); // get countries $query ="SELECT * FROM ".$glob['dbprefix']."CubeCart_iso_countries ORDER BY UPPER(printable_name) ASC"; if(isset($_GET['countriesPage'])) { $countriesPage = $_GET['countriesPage']; } else { $countriesPage = 0; } $countries = $db->select($query, $countriesPerPage, $countriesPage); $numrows = $db->numrows($query); $countriesPagination = paginate($numrows, $countriesPerPage, $countriesPage, "countriesPage", "txtLink", 7, $excluded); // 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 = paginate($numrows, $countiesPerPage, $countiesPage, "countiesPage", "txtLink", 7,$excluded); require($glob['adminFolder'].CC_DS."includes".CC_DS."header.inc.php"); ?>

0){ $editCountry = $db->select("select * FROM ".$glob['dbprefix']."CubeCart_iso_countries WHERE id = ".$db->mySQLsafe($_GET['editCountry'])); } ?>
href="?_g=settings/geo&editCountry=" class="txtLink"> href="?_g=settings/geo&deleteCountry=" onclick="return confirm('')" class="txtLink">
Add Country" />

0){ $editCounty = $db->select("select * FROM ".$glob['dbprefix']."CubeCart_iso_counties WHERE id = ".$db->mySQLsafe($_GET['editCounty'])); } ?>
href="?_g=settings/geo&editCounty=" class="txtLink"> href="?_g=settings/geo&deleteCounty=" onclick="return confirm('')" class="txtLink">
select("SELECT printable_name, id FROM ".$glob['dbprefix']."CubeCart_iso_countries ORDER BY printable_name ASC"); ?> Add Zone" />