force_compile = true; $smarty->debugging = false; $smarty->caching = false; $smarty->cache_lifetime = 120; ##================================= ##================================= include_once('libs/db_config.php'); include_once('libs/my_class.php'); ##============================================================ if (!isset($obj)) $obj = new myclass($SERVER, $DBASE, $USERNAME, $PASSWORD); ##============================================================ if(isset($_REQUEST["file"])) { $file=$_REQUEST["file"]; } ##========== if(!isset($_SESSION["customerRegistrationEmail"])) { $_SESSION["customerRegistrationEmail"]=""; } ##========== ##============================================================ include_once("libs/general_settings.php"); ##============================================================ include_once("function/general0.php"); include_once("function/general1.php"); /***********/ include_once("function/catalog_functions0.php"); include_once("function/catalog_functions1.php"); ##============================================================ ##============================================================ ##============================================================ ?> itemcount > 0) { $cart_rec = $cart->get_all_contents(); $cart_total = $cart->total; } else { $_SESSION['top_grand_total']=''; $cart_rec=array(); } $smarty->assign("tot_cart_item", count($cart_rec)); $smarty->assign("cart_item_total", $_SESSION['top_grand_total']); ##=============================== ##======================================================== $site_url2=$site_url; ##======================================================== ?> insert( $ins_sql ); if ( $_SESSION['customerRegistrationEmail'] != "" ) { $obj->sql_query("Update newsletter set pageCount=pageCount+1, lastClicked='" . getSystemDateTime() . "', lastPage='" . getenv( 'REQUEST_URI' ) . "' where vEmail='" . $_SESSION['customerRegistrationEmail']."'"); } } /*********************/ if (isset($_REQUEST['unblock']) && $_REQUEST['unblock'] == "unblock" ) { $usrIpIs0 = explode( ",", getIP() ); $obj->sql_query( "Update ip_black_listing set eStatus='Inactive' where ip LIKE '" . $usrIpIs0[ 0 ] . "%'" ); } /*********************/ /* check and add ip black listing */ $usrIpIs = explode( ",", getIP() ); $sql_login_logs_chk = "Select iLLogsId from login_logs where vIP LIKE '%" . $usrIpIs[ 0 ] . "%'"; $db_login_logs_chk = $obj->select( $sql_login_logs_chk ); if ( $usrIpIs[ 0 ] != "" && count( $db_login_logs_chk ) == 0 && !strstr( getIP(), "66.249" ) && !strstr( getenv( 'REQUEST_URI' ), "Cataloging" ) && !strstr( getenv( 'REQUEST_URI' ), "gclid" ) && !strstr( getenv( 'REQUEST_URI' ), "utm_source" ) && !strstr( getenv( 'REQUEST_URI' ), "notify_admin_ask_question" ) && !strstr( getIP(), "103.42.194" ) && !strstr( getIP(), "192.166.44" ) && !strstr( getIP(), "185.156.64" ) && !strstr( getIP(), "172.26.89.57" )) { /************/ $sql_ip_black_listing = "Select * from ip_black_listing where ip LIKE '" . $usrIpIs[ 0 ] . "%' AND eStatus='Active'"; $db_ip_black_listing = $obj->select( $sql_ip_black_listing ); if ( count( $db_ip_black_listing ) > 0 ) { /*******/ $obj->sql_query( "Update ip_black_listing set iCount=iCount+1, dDate='" . getSystemDateTime() . "' where ipId='" . $db_ip_black_listing[ 0 ]['ipId'] . "'" ); /*******/ header( "HTTP/1.1 301 Moved Permanently" ); header( "Location: " . $site_url . "404error.html" ); exit(); /*******/ } else { if ( strstr( getenv( 'REQUEST_URI' ), "wp-admin" ) || strstr( getenv( 'REQUEST_URI' ), "wordpress" ) || strstr( getenv( 'REQUEST_URI' ), "wp-content" ) || strstr( getenv( 'REQUEST_URI' ), "wp-login" ) || strstr( getenv( 'REQUEST_URI' ), "login" ) || strstr( getenv( 'REQUEST_URI' ), "/admin/" ) || strstr( getenv( 'REQUEST_URI' ), "admin/" ) || strstr( getenv( 'REQUEST_URI' ), "webadmin" ) || strstr( getenv( 'REQUEST_URI' ), "/phpmyadmin/" ) || strstr( getenv( 'REQUEST_URI' ), "myadmin" ) || strstr( getenv( 'REQUEST_URI' ), "siteadmin" ) || strstr( getenv( 'REQUEST_URI' ), "/pma/" ) || strstr( getenv( 'REQUEST_URI' ), "/db/" ) || strstr( getenv( 'REQUEST_URI' ), "shopadmin" ) || strstr( getenv( 'REQUEST_URI' ), "administrator" ) || strstr( getenv( 'REQUEST_URI' ), "xampp" ) || strstr( getenv( 'REQUEST_URI' ), "cpanel" ) || strstr( getenv( 'REQUEST_URI' ), "/install/" ) || strstr( getenv( 'REQUEST_URI' ), "configure" ) || strstr( getenv( 'REQUEST_URI' ), "config" ) || strstr( getenv( 'REQUEST_URI' ), "forum" ) || strstr( getenv( 'REQUEST_URI' ), "setup.php" ) || strstr( getenv( 'REQUEST_URI' ), "sql" ) || strstr( getenv( 'REQUEST_URI' ), "database" ) || strstr( getenv( 'REQUEST_URI' ), "connector" ) || strstr( getenv( 'REQUEST_URI' ), "mysql" ) || strstr( getenv( 'REQUEST_URI' ), "upload" ) || strstr( getenv( 'REQUEST_URI' ), "m=member" ) || strstr( getenv( 'REQUEST_URI' ), "siteid" ) || strstr( getenv( 'REQUEST_URI' ), ".rar" ) || strstr( getenv( 'REQUEST_URI' ), ".zip" ) || strstr( getenv( 'REQUEST_URI' ), ".ini" ) || strstr( getenv( 'REQUEST_URI' ), ".asp" ) || strstr( getenv( 'REQUEST_URI' ), "sqzr" ) || strstr( getenv( 'REQUEST_URI' ), ".aspx" ) || strstr( getenv( 'REQUEST_URI' ), "cache" ) || strstr( getenv( 'REQUEST_URI' ), "fuck" ) || strstr( getenv( 'REQUEST_URI' ), "formguide" ) || strstr( getenv( 'REQUEST_URI' ), "fuck" ) || strstr( getenv( 'REQUEST_URI' ), "default.php" ) || strstr( getenv( 'REQUEST_URI' ), "default.htm" ) || strstr( getenv( 'REQUEST_URI' ), "defect.php" ) || strstr( getenv( 'REQUEST_URI' ), "hell.php" ) || strstr( getenv( 'REQUEST_URI' ), "help.php" ) || strstr( getenv( 'REQUEST_URI' ), "htdocs" ) || strstr( getenv( 'REQUEST_URI' ), "java.php" ) || strstr( getenv( 'REQUEST_URI' ), "knal.php" ) || strstr( getenv( 'REQUEST_URI' ), "/joomla/" ) || strstr( getenv( 'REQUEST_URI' ), "phpStudy" ) || strstr( getenv( 'REQUEST_URI' ), "phpplus" ) || strstr( getenv( 'REQUEST_URI' ), "filezilla" ) || strstr( getenv( 'REQUEST_URI' ), "invoker" ) || strstr( getenv( 'REQUEST_URI' ), "wls-wsat" ) || strstr( getenv( 'REQUEST_URI' ), "w00t" ) || strstr( getenv( 'REQUEST_URI' ), "WAITFOR" ) || strstr( getenv( 'REQUEST_URI' ), "DELAY" ) || strstr( getenv( 'REQUEST_URI' ), "varchar" ) || strstr( getenv( 'REQUEST_URI' ), "syscolumns" ) || strstr( getenv( 'REQUEST_URI' ), "convert" ) || strstr( getenv( 'REQUEST_URI' ), "SLEEP(" ) || strstr( getenv( 'REQUEST_URI' ), "timeout" ) || strstr( getenv( 'REQUEST_URI' ), "boot.ini" ) || strstr( getenv( 'REQUEST_URI' ), "win.ini" ) || strstr( getenv( 'REQUEST_URI' ), "windows" ) || strstr( getenv( 'REQUEST_URI' ), "passwd" ) || strstr( getenv( 'REQUEST_URI' ), ".ini" ) || strstr( getenv( 'REQUEST_URI' ), "/etc/" ) || strstr( getenv( 'REQUEST_URI' ), "SCHEMA" ) || strstr( getenv( 'REQUEST_URI' ), "select%2" ) || strstr( getenv( 'REQUEST_URI' ), "/admin/" ) || strstr( getenv( 'REQUEST_URI' ), "/plus/" ) || strstr( getenv( 'REQUEST_URI' ), "webkit-linear-gradient" ) || strstr( getenv( 'REQUEST_URI' ), "webkit-gradient" ) || strstr( getenv( 'REQUEST_URI' ), "/admin/" ) || strstr( getenv( 'REQUEST_URI' ), "/admin/" ) || strstr( getenv( 'REQUEST_URI' ), "/admin/" ) || strstr( getenv( 'REQUEST_URI' ), "/admin/" ) || strstr( getenv( $_SERVER[ 'HTTP_REFERER' ] ), "testing" ) || strstr( getenv( 'REQUEST_URI' ), "testing" ) || strstr( getenv( 'REQUEST_URI' ), "besttempmail" ) || strstr( getenv( 'REQUEST_URI' ), "controlpanel" ) || strstr( getenv( 'REQUEST_URI' ), "wp-admin" ) ) { /************************************/ $obj->sql_query( "Insert INTO ip_black_listing set ip='" . getIP() . "', iCount=iCount+1, dDate='" . getSystemDateTime() . "', vReferPageUrl='" . $_SERVER[ 'HTTP_REFERER' ] . "', vLastPageUrl='" . getenv( 'REQUEST_URI' ) . "', eStatus='Active'" ); /************************************/ header( "HTTP/1.1 301 Moved Permanently" ); header( "Location: " . $site_url . "404error.html" ); exit(); /************************************/ } } } } #========================================================== #========================================================== ## Braintree Credentials /* TEST */ /* $BT_environment="sandbox"; $BT_merchantId="mcxfnwmbgfsxbfx5"; $BT_publicKey="xkwhfkbq588jnryy"; $BT_privateKey="82c462a9e1500ceb778fee9a6019c564"; */ ##=============== /* LIVE */ /*$BT_environment="production"; $BT_merchantId="67dmvpx3m4cr6bt4"; $BT_publicKey="2c5fp6n4jwmn69cw"; $BT_privateKey="765d0d199613ce5b8d72a24ef28da86a";*/ #========================================================== #========================================================== ## Klarna Credentials /* Test */ /* $Klarna_apiKey = "K517351_882fc5f3cacf"; $Klarna_apiPassword = "xTig1QYNvv5VIdrO"; $Klarna_testApiTxt="playground."; */ /* Live */ /* $Klarna_apiKey = "K517351_a8ed20b2c777"; $Klarna_apiPassword = "mPULDsLcqhpxEYkK"; $Klarna_testApiTxt=""; */ /* $Klarna_apiKey = "K517351_a8ed20b2c777"; $Klarna_apiPassword = "mPULDsLcqhpxEYkK"; $Klarna_testApiTxt=""; */ #========================================================== #========================================================== ?>select( $sql_product_popular ); $smarty->assign( "db_new_popular", $db_product_popular ); $sql_brand_popular = "Select `iBrandId`,`vTitle`,`vImage` from brand where eStatus='Active' AND eShowOnHome='Yes' order by iDispOrder LIMIT 0,9"; $db_brand_popular = $obj->select( $sql_brand_popular ); $smarty->assign( "db_brand_popular", $db_brand_popular ); $sql_3dbrand_popular = "Select DISTINCT pc.iCategoryId from products as p INNER JOIN product_category as pc ON p.iProductId = pc.iProductId WHERE p.eStatus='Active' AND pc.iCategoryId != 0 AND p.iBrandId='1' order by pc.iCategoryId DESC LIMIT 0,9"; $db_3dbrand_popular = $obj->select( $sql_3dbrand_popular ); $smarty->assign( "db_3dbrand_popular", $db_3dbrand_popular ); $sql_cat_popular = "Select * from category where eStatus='Active' AND ePopular='Yes' order by iDispOrder LIMIT 0,16"; $db_cat_popular = $obj->select( $sql_cat_popular ); $smarty->assign( "db_cat_popular", $db_cat_popular ); function getproductcountbycategory($iCategoryId) { global $obj; $sqlGetTotalProductCount="Select iCategoryId from product_category where iCategoryId='".$iCategoryId."' AND eMain='No'"; $dbGetTotalProductCount=$obj->select($sqlGetTotalProductCount); return count($dbGetTotalProductCount); } // eFeatured='Yes' AND $dDate = date( "Y-m-d H:i:s" ); $sql_eFeatured = "SELECT p.`iProductId`,p.`vProductName`,count(od.iQty) as c FROM products p,order_details_new od where od.iBrandId>0 AND od.iStatusId NOT IN (9,32) AND od.dDate > '" . date( 'Y-m-d', strtotime( $dDate . ' -31 days' ) ) . "' AND od.iProductId=p.iProductId GROUP BY od.iProductId ORDER BY c DESC LIMIT 6"; $db_eFeatured = $obj->select( $sql_eFeatured ); $smarty->assign( "db_eFeatured", $db_eFeatured ); $sql_home_main_banner="Select * from site_banner where eStatus = 'Active' AND ePosition = 'main' ORDER BY iDisplayOrder ASC"; $db_home_main_banner=$obj->select($sql_home_main_banner); $smarty -> assign("db_home_main_banner",$db_home_main_banner); $sql_home_mobile_banner="Select * from site_banner where eStatus = 'Active' AND ePosition = 'mobile' ORDER BY iDisplayOrder ASC"; $db_home_mobile_banner=$obj->select($sql_home_mobile_banner); $smarty -> assign("db_home_mobile_banner",$db_home_mobile_banner); $smarty->assign( "main", "home" ); ?>