function delcity()
{
    global $db, $ir, $c, $h, $userid;
    if ($_POST['city']) {
        $q = $db->query("SELECT * FROM cities WHERE cityid={$_POST['city']}");
        $old = $db->fetch_row($q);
        if ($old['cityid'] == 1) {
            die("This city cannot be deleted.");
        }
        $db->query("UPDATE users SET location=1 WHERE location={$old['cityid']}");
        $db->query("UPDATE shops SET shopLOCATION=1 WHERE shopLOCATION={$old['cityid']}");
        $db->query("DELETE FROM cities WHERE cityid={$old['cityid']}");
        print "City {$old['cityname']} deleted.";
        stafflog_add("Deleted city {$old['cityname']}");
    } else {
        print "\n\n<div class='generalinfo_txt'>\n<div><img src='images/info_left.jpg' alt='' /></div>\n<div class='info_mid'><h2 style='padding-top:10px;'> Delete City</h2></div>\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\n<div class='generalinfo_simple'><br> <br><br>\n\n\nDeleting a city is permanent - be sure. Any users and shops that are currently in the city you delete will be moved to the default city (ID 1).<form action='staff_cities.php?action=delcity' method='post'>\nCity: " . location_dropdown($c, "city") . "<br />\n<input type='submit' STYLE='color: black;  background-color: white;' value='Delete City' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
    }
}
function new_shop_form()
{
    global $ir, $c, $h;
    print "<h3>Adding a New Shop</h3>\n<form action='new_staff.php?action=newshopsub' method='post'>\nShop Name: <input type='text' name='sn' value='' /><br />\nShop Desc: <input type='text' name='sd' value='' /><br />\nShop Location: " . location_dropdown($c, "sl") . "<br />\n<input type='submit' value='Create Shop' /></form>";
}
function new_shop_form()
{
    global $db, $ir, $c, $h;
    print "\n<div class='generalinfo_txt'>\n<div><img src='images/info_left.jpg' alt='' /></div>\n<div class='info_mid'><h2 style='padding-top:10px;'> Adding a New Shop</h2></div>\n<div><img src='images/info_right.jpg' alt='' /></div> </div>\n<div class='generalinfo_simple'><br> <br><br>\n\n\n<form action='staff_shops.php?action=newshopsub' method='post'>\nShop Name: <input type='text' STYLE='color: black;  background-color: white;' name='sn' value='' /><br />\nShop Desc: <input type='text' STYLE='color: black;  background-color: white;' name='sd' value='' /><br />\nShop Location: " . location_dropdown($c, "sl") . "<br />\n<input type='submit' STYLE='color: black;  background-color: white;' value='Create Shop' /></form></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>";
}