Exemple #1
0
$smarty = new Smarty();
$smarty->template_dir = $smarty_dir . 'templates';
$smarty->compile_dir = $smarty_dir . 'templates_c';
$smarty->cache_dir = $smarty_dir . 'cache';
$smarty->config_dir = $smarty_dir . 'configs';
$str = file_get_contents('config.txt');
$config = parse_ini_string($str, true);
// возвращаем файл config.txt в виде массива
$hostName = $config['hostName'];
$userName = $config['userName'];
$dbPassword = $config['dbPassword'];
$dbName = $config['dbName'];
require_once 'functions.php';
db_connect($hostName, $userName, $dbPassword, $dbName);
$categories = categories();
$cities = cities();
$formParams = prepareAD($data = null, $head = 'Страница добавления объявления', $button = 'Далее');
$adStore = adStore();
$id = isset($_GET['id']) ? $_GET['id'] : '';
if (isset($_GET['id'])) {
    $ad = $adStore[$id];
    $formParams = prepareAD($ad, $head = 'Страница редактирования', $button = 'Готово');
} else {
    if (isset($_GET['del'])) {
        $id_for_del = $_GET['del'];
        del($id_for_del);
        header('Location: index.php');
    }
    if (isset($_POST['main_form_submit'])) {
        $uns = isset($adStore) ? $adStore : array();
        $id = isset($_POST['hidden']) ? $_POST['hidden'] : '';
Exemple #2
0
$smarty = new Smarty();
$smarty->template_dir = $smarty_dir . 'templates';
$smarty->compile_dir = $smarty_dir . 'templates_c';
$smarty->cache_dir = $smarty_dir . 'cache';
$smarty->config_dir = $smarty_dir . 'configs';
$str = file_get_contents('config.txt');
$config = parse_ini_string($str, true);
// возвращаем файл config.txt в виде массива
$hostName = $config['hostName'];
$userName = $config['userName'];
$dbPassword = $config['dbPassword'];
$dbName = $config['dbName'];
require_once 'functions.php';
$dbc = db_connect($hostName, $userName, $dbPassword, $dbName);
$categories = categories($dbc);
$cities = cities($dbc);
$formParams = prepareAD($data = null, $head = 'Страница добавления объявления', $button = 'Далее');
$adStore = adStore($dbc);
$id = isset($_GET['id']) ? $_GET['id'] : '';
if (isset($_GET['id'])) {
    $ad = $adStore[$id];
    $formParams = prepareAD($ad, $head = 'Страница редактирования', $button = 'Готово');
} else {
    if (isset($_GET['del'])) {
        $id_for_del = $_GET['del'];
        del($id_for_del, $dbc);
        header('Location: index.php');
    }
    if (isset($_POST['main_form_submit'])) {
        $uns = isset($adStore) ? $adStore : array();
        $id = isset($_POST['hidden']) ? $_POST['hidden'] : '';
</b></p>
<?php 
    cities("\n\tChatham\n\tMadison\n\tSummit\n");
    ?>

	<p><b><?php 
    echo city('Middlesex County');
    ?>
</b></p>
<?php 
    cities("\n\tDunellen\n\tEdison\n\tMiddlesex\n\tNew Brunswick\n\tPiscataway\n");
    ?>

	<p><b>Pennsylvania Cities</b></p>
<?php 
    cities("\n\tEaston, PA\n\tAllentown, PA\n\tStroudsburg, PA\n");
    ?>

	<p>Please note that not ALL cities and counties we service are listed. If you have any questions about our services in your area, please <a href="mailto:drg@artofperio.com">contact us</a>.</p>
</div>
<?php 
    /*
    <p align='center'>Serving <a href='<? print $page ?>?County=Morris' alt='Morris County'>Morris County</a>, NJ, and neighboring Counties in Northern New Jersey:<br><a href='<? print $page ?>?County=Somerset' alt='Somerset County'>Somerset</a>, <a href='<? print $page ?>?County=Hunterdon' alt='Hunterdon County'>Hunterdon</a>, <a href='<? print $page ?>?County=Warren' alt='Warren County'>Warren</a>, and <a href='<? print $page ?>?County=Sussex' alt='Sussex County'>Sussex</a>.</p>
    
    if ($County=="Morris") print "<p align='center'>Morris County includes: Boonton, Lake Hiawatha, Lincoln Park, Montville, Mountain Lake, Parsippany, Pine Brook, Towaco, Butler, Oak Ridge, Pequannock, Pompton Plains, Riverdale, Stockholm, Dover, Mine Hill, Picatiny Arsenal, Budd Lake, Califon, Denville, Flanders, Hackettstown, Hibernia, Ironia, Kenvil, Lake Hopatcong, Landing, Ledgewood, Long Valley, Mount Arlington, Netcong, Rockaway, Randolph, Schooleys Mountain, Succasunna, Mount Tabor, Wharton, Basking Ridge, Brookside, Cedar Knolls, Chatham, Chester, Florham Park, Gillette, Gladstone, Green Village, East Hanover, Madison, Mendham, Millington, Morris Plains, Morristown, Mount Freedom, New Vernon, Stirling, and Whippany.<p>";
    if ($County=="Somerset") print "<p align='center'>Somerset County includes: Warren, Plainfield, Watchung, Basking Ridge, Bedminster, Bernardsville, Far Hills, Gladstone, Liberty Corner, Lyons, Peapack, Pluckemin, Belle Mead, Blawenburg, Hopewell, Kingston, Princeton, Rocky Hill, Skillman, Bound Brook, Bridgewater, Dunellen, Flagtown, Franklin Park, Manville, Martinsville, Hillsborough, Neshanic Station, Raritan, Somerset, Somerville, South Bound Brook and Zarephath.</p>";
    if ($County=="Hunterdon") print "<p align='center'>Hunterdon County includes: Califon, Pottersville, Hopewell, Lambertville, Ringoes, Rosemont, Sergeantsville, Stockton, Titusville, Annandale, Asbury, Baptistown, Bloomsbury, Clinton, Flemington, Frenchtown, Glen Gardner, Hampton, High Bridge, Lebanon, Little York, Milford, Neshanic Station, Oldwick, Phillipsburg, Pittstown, Quakertown, Readington, Somerville, Stanton, Three Bridges, Whitehouse and Whitehouse Station.</p>";
    if ($County=="Warren") print "<p align='center'>Warren County includes: Allamuchy, Andover, Belvidere, Blairstown, Buttzville, Changewater, Columbia, Delaware, Great Meadows, Hackettstown, Hope, Johnsonburg, Oxford, Port Murray, Vienna, Washington, Asbury, Bloomsbury, Broadway, Hapton, Milford, Phillipsburg and Stewartsville.</p>";
    if ($County=="Sussex") print "<p align='center'>Sussex County includes: Franklin, Glenwood, Hamburg, Hewitt, Highland Lakes, Mc Afee, Ogdensburg, Stockholm, Sussex, Vernon, Andover, Augusta, Branchville, Montague, Glasser, Greendell, Hopatcong, Lafayette, Layton, Middleville, Newton, Sparta, Stanhope, Stillwater, Swartswood, Tranquility, Wallpack Center, Branchville and Princeton.</p>";
    */
    ?>