Jump to content

Bugs fixing (beginner)


Obad500

Recommended Posts

Hello everyone,

i have a quiestion regarding a bug fixing. We have an online website and right now we are have a bug issue in one of the pages. Basically when we tried to to make changes in the page from the admin panel, and then click "save" we are redirected to the page and all the changes we have made are now blank and there are no changes to the front end. I am running into the issue that nothing can be edited because it will not be saved in the end. Any ideas how to remedy this?

Link to comment
Share on other sites

<?php

session_start();
$mainMenuName = "Site Setting";
include_once("admin.config.inc.php");
include("connect.php");
include("functions.php");
include 'include/setting.php';
include "include/header.php";

$editsuccess = false;
$email = "";
$bidprice = '1';
$maxdiscount = '50';
$avatarfeature = '0';

$winpermonth = '0';
$winperweek = '0';

$autobidderseconds = '0';
$featuredauctioncount = '8';
$taxenable = '0';
$timerdelay = '0';
$seourl = '0';
$flashbanner = '0';
$discounthalfback = 50;
$adminbidtype = '0';
$biduptype='0';
$leavetimeout = 0;
$livemap = 0;
$social = '0';
$allowadminbid = '0';
$refreshrate = '1000';
$reftimeout = '3000';
$dateformat = 'd/m/Y';
$currentthemes = 'default';
$slotmachine = "0";
$enablecdn = 0;
$enablevalidation=0;
$livemaptype='javascript';
$enablecheckip=0;
$bidhistory=10;
$salephone='55555555';
$bidvaluelimit=0;
$separatebidsource=0;
$mystate="";
$statetax=0;
$mapinfo=0;



//echo $_SERVER['HTTP_HOST'];
$ipos = strpos($_SERVER['HTTP_HOST'], "www.");
if ($ipos !== false) {
    $cdnhost = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https' : 'http') . '://cdn.'.substr($_SERVER['HTTP_HOST'], $ipos+4).'/'.($subfolder != '' ? $subfolder . '/' : '');
}else{
    $cdnhost = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https' : 'http') . '://cdn.'.$_SERVER['HTTP_HOST'].'/'.($subfolder != '' ? $subfolder . '/' : '');
}

if (isset($_POST['submit'])) {
    $email = $_POST['email'];
    $bidprice = $_POST['bidprice'];
    $maxdiscount = $_POST['maxdiscount'];
    $avatarfeature = $_POST['avatarfeature'];
    $winpermonth = $_POST['winpermonth'];
    $winperweek = $_POST['winperweek'];
    //$autobidderseconds = $_POST['autobidderseconds'];
    $featuredauctioncount = $_POST['featuredauctioncount'];
    $taxenable = $_POST['taxenable'];
    $timerdelay = $_POST['timerdelay'];
    $seourl = $_POST['seourl'];
    $flashbanner = $_POST['flashbanner'];
    $discounthalfback = $_POST['halfback'];
    $adminbidtype = $_POST['adminbidtype'];
    $biduptype=$_POST['biduptype'];
    $leavetimeout = $_POST['leavetimeout'];
    $livemap = $_POST['livemap'];
    $social = $_POST['social'];
    $allowadminbid = $_POST['allowadminbid'];

    $refreshrate = $_POST['refreshrate'];
    $reftimeout = $_POST['reftimeout'];
    $dateformat = $_POST['dateformat'];
    $currentthemes = $_POST['currentthemes'];
    $slotmachine = $_POST['slotmachine'];

    $enablecdn = $_POST['enablecdn'];
    $cdnhost = $_POST['cdnhost'];
    $enablevalidation=$_POST['enablevalidation'];
    
    $livemaptype=$_POST['livemaptype'];
    $enablecheckip=$_POST['enablecheckip'];
    $bidhistory=$_POST['bidhistory'];
    $salephone=$_POST['salephone'];
    $bidvaluelimit=$_POST['bidvaluelimit'];
    $separatebidsource=$_POST['separatebidsource'];
    $mystate=$_POST['mystate'];
    $statetax=$_POST['statetax'];
    $mapinfo=$_POST['mapinfo'];

    $cdnstrlen=strlen($cdnhost);
    if(substr_compare($cdnhost,"/",$cdnstrlen-1,1)!=0 && substr_compare($cdnhost,"\\",$cdnstrlen-1,1)!=0){
        $cdnhost=$cdnhost.'/';
    }

    $valid = true;

    if (preg_match('/^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$/', $email) == false) {
        $msg = "<br/>".MSG_ENTER_VALID_EMAIL;
        $valid = false;
    }

    if (is_numeric($bidprice) == false) {
        $msg = "<br/>".BID_PRICE.MSG_MUST_BE_NUMBER;
        $valid = false;
    }

    if (is_numeric($maxdiscount) == false) {
        $msg = "<br/>".MAX_DISCOUNT_BUYNOW.MSG_MUST_BE_NUMBER;
        $valid = false;
    }


    if (is_numeric($winpermonth) == false) {
        $msg = "<br/>".WIN_LIMIT_PER_MONTH.MSG_MUST_BE_NUMBER;
        $valid = false;
    }
    if (is_numeric($winperweek) == false) {
        $msg = "<br/>".WIN_LIMIT_PER_WEEK.MSG_MUST_BE_NUMBER;
        $valid = false;
    }

    if (is_numeric($autobidderseconds) == false) {
        //$msg = "<br/>".FEATURED_AUCTION_COUNT.MSG_MUST_BE_NUMBER;
        $valid = false;
    }

    if (is_numeric($featuredauctioncount) == false) {
        $msg = "<br/>".FEATURED_AUCTION_COUNT.MSG_MUST_BE_NUMBER;
        $valid = false;
    }

    if (is_numeric($discounthalfback) == false) {
        $msg = "<br/>".DISCOUNT_OF_HALF_BACK_BID.MSG_MUST_BE_NUMBER;
        $valid = false;
    }

    if (is_numeric($leavetimeout) == false) {
        $msg = "<br/>".TIMEOUT_LEAVE_PAGE.MSG_MUST_BE_NUMBER;
        $valid = false;
    }
    
    if(is_numeric($bidhistory)==false) {
        $msg="<br/>".BID_HISTORY_COUNT.MSG_MUST_BE_NUMBER;
        $valid=false;
    }
    
    if(is_numeric($statetax)==false){
        $msg="<br/>".STATE_TAX.MSG_MUST_BE_NUMBER;
        $valid=false;
    }

    if ($valid == true) {
        $sql = "update sitesetting set value='$email' where name='adminemail';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$bidprice' where name='bidprice';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$maxdiscount' where name='maxdiscount';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$avatarfeature' where name='avatarfeature';";
        mysql_query($sql) or die('Query Not Success');


        $sql = "update sitesetting set value='$winpermonth' where name='winpermonth';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$winperweek' where name='winperweek';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$autobidderseconds' where name='autobidsecond';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$featuredauctioncount' where name='featuredcount';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$taxenable' where name='taxenable';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$timerdelay' where name='timerdelay';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$seourl' where name='seourl';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$flashbanner' where name='flashbanner'";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$discounthalfback' where name='halfback'";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$adminbidtype' where name='adminbidtype';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$biduptype' where name='biduptype';";
        mysql_query($sql) or die('Query Not Success');
        

        $sql = "update sitesetting set value='$leavetimeout' where name='leavetimeout';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$livemap' where name='livemap';";
        mysql_query($sql) or die('Query Not Success');


        $sql = "update sitesetting set value='$social' where name='social';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$allowadminbid' where name='allowadminbid';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$refreshrate' where name='refreshrate';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$reftimeout' where name='reftimeout';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$dateformat' where name='dateformat';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$currentthemes' where name='currentthemes';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$slotmachine' where name='slotmachine';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$enablecdn' where name='enablecdn';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$cdnhost' where name='$cdnhost';";
        mysql_query($sql) or die('Query Not Success');

        $sql = "update sitesetting set value='$enablevalidation' where name='enablevalidation';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$livemaptype' where name='livemaptype';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$enablecheckip' where name='enablecheckip';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$bidhistory' where name='bidhistory';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$salephone' where name='salephone';";
        mysql_query($sql) or die('Query Not Success');
        
        
        $sql = "update sitesetting set value='$bidvaluelimit' where name='bidvaluelimit';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$separatebidsource' where name='separatebidsource';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$mystate' where name='mystate';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$statetax' where name='statetax';";
        mysql_query($sql) or die('Query Not Success');
        
        $sql = "update sitesetting set value='$mapinfo' where name='mapinfo';";
        mysql_query($sql) or die('Query Not Success');
        
        
        $editsuccess = true;
        header('location:message.php?msg=108');
    }
} else {
    $sql = "select * from sitesetting where name='adminemail';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $email = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('adminemail','');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('email', $email);

    $sql = "select * from sitesetting where name='bidprice';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $bidprice = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('bidprice','');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('bidprice', $bidprice);

    $sql = "select * from sitesetting where name='maxdiscount';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $maxdiscount = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('maxdiscount','');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('maxdiscount', $maxdiscount);


    $sql = "select * from sitesetting where name='avatarfeature';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $avatarfeature = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('avatarfeature','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('avatarfeature', $avatarfeature);


    $sql = "select * from sitesetting where name='winpermonth';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $winpermonth = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('winpermonth','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('winpermonth', $winpermonth);

    $sql = "select * from sitesetting where name='winperweek';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $winperweek = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('winperweek','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('winperweek', $winperweek);


    $sql = "select * from sitesetting where name='autobidsecond';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $autobidderseconds = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('autobidsecond','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('autobidderseconds', $autobidderseconds);

    $sql = "select * from sitesetting where name='featuredcount';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $featuredauctioncount = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('featuredcount','8');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('featuredauctioncount', $featuredauctioncount);

    $sql = "select * from sitesetting where name='taxenable';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $taxenable = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('taxenable','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('taxenable', $taxenable);

    $sql = "select * from sitesetting where name='timerdelay';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $timerdelay = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('timerdelay','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('timerdelay', $timerdelay);


    $sql = "select * from sitesetting where name='seourl';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $seourl = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('seourl','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('seourl', $seourl);

    $sql = "select * from sitesetting where name='flashbanner';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $flashbanner = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('flashbanner','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('flashbanner', $flashbanner);

    $sql = "select * from sitesetting where name='halfback';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $discounthalfback = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('halfback','50');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('discounthalfback', $discounthalfback);

    $sql = "select * from sitesetting where name='adminbidtype';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $adminbidtype = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('adminbidtype','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('adminbidtype', $adminbidtype);
    
    $sql = "select * from sitesetting where name='biduptype';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $biduptype = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('biduptype','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('biduptype', $biduptype);
    

    $sql = "select * from sitesetting where name='leavetimeout';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $leavetimeout = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('leavetimeout','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('leavetimeout', $leavetimeout);

    $sql = "select * from sitesetting where name='livemap';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $livemap = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('livemap','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('livemap', $livemap);


    $sql = "select * from sitesetting where name='social';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $social = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('social','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('social', $social);


    $sql = "select * from sitesetting where name='allowadminbid';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $allowadminbid = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('allowadminbid','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('allowadminbid', $allowadminbid);

    $sql = "select * from sitesetting where name='refreshrate';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $refreshrate = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('refreshrate','1000');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('refreshrate', $refreshrate);

    $sql = "select * from sitesetting where name='reftimeout';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $reftimeout = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('reftimeout','3000');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('reftimeout', $reftimeout);

    $sql = "select * from sitesetting where name='dateformat';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $dateformat = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('dateformat','d/m/Y');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('dateformat', $dateformat);

    $sql = "select * from sitesetting where name='currentthemes';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $currentthemes = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('currentthemes','default');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('currentthemes', $currentthemes);

    $sql = "select * from sitesetting where name='slotmachine';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $slotmachine = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('slotmachine','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('slotmachine', $slotmachine);

    $sql = "select * from sitesetting where name='enablecdn';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $enablecdn = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('enablecdn','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('enablecdn', $enablecdn);

    $sql = "select * from sitesetting where name='cdnhost';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $cdnhost = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('cdnhost','$cdnhost');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('cdnhost', $cdnhost);
    
    
    $sql = "select * from sitesetting where name='enablevalidation';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $enablevalidation = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('enablevalidation','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('enablevalidation', $enablevalidation);
    
    $sql = "select * from sitesetting where name='livemaptype';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $livemaptype = $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('livemaptype','javascript');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('livemaptype', $livemaptype);
    
    $sql = "select * from sitesetting where name='enablecheckip';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $enablecheckip= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('enablecheckip','1');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('enablecheckip', $enablecheckip);
    
    $sql = "select * from sitesetting where name='bidhistory';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $bidhistory= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('bidhistory','10');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('bidhistory', $bidhistory);
    
    $sql = "select * from sitesetting where name='salephone';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $salephone= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('salephone','55555555');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('salephone', $salephone);
    
    $sql = "select * from sitesetting where name='separatebidsource';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $separatebidsource= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('separatebidsource','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('separatebidsource', $separatebidsource);
    
    
    
    $sql = "select * from sitesetting where name='bidvaluelimit';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $bidvaluelimit= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('bidvaluelimit','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('bidvaluelimit', $bidvaluelimit);
    
    $sql = "select * from sitesetting where name='mystate';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $mystate= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('mystate','');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('mystate', $mystate);
    
    $sql = "select * from sitesetting where name='statetax';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $statetax= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('statetax','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('statetax', $statetax);
    
    $sql = "select * from sitesetting where name='mapinfo';";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        $obj = mysql_fetch_object($result);
        $mapinfo= $obj->value;
        mysql_free_result($result);
    } else {
        $sql = "insert into sitesetting(name,value) values('mapinfo','0');";
        mysql_query($sql) or die('Insert Not Success');
    }
    $template->assign('mapinfo', $mapinfo);
    
    
}

$themeslist = array();
if (($handle = opendir('../themes')) != FALSE) {
    while (($file = readdir($handle)) != false) {
        if ($file == '.' || $file == '..' || $file == 'common' || $file == '.svn')
            continue;

        if (is_dir('../themes/' . $file)) {
            $themeslist[] = $file;
        }
    }
}
$template->assign('themeslist', $themeslist);


$statelist=array();
$stateret=  mysql_query("select * from usstates");
while($statear=  mysql_fetch_array($stateret)){
    $statelist[]=array('id'=>$statear['id'],'stname'=>$statear['stname'],'stcode'=>$statear['stcode']);
}
$template->assign("statelist",$statelist);

$subtitle = 'Site Setting';
$template->assign('subtitle', $subtitle);
$template->assign('title', $subtitle . $ADMIN_MAIN_SITE_NAME);
$template->assign('contentfile', 'sitesetting', true);
$template->display('layout.tpl');
?>

Thank you,

This is the code for the page that is not responding

 

P.S: Since this page isn't responding and still can use "phpmyadmin" to make changes, but it's a such hassle to do it everytime. How can i fix that.

Edited by Obad500
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.