63mb3l Posted September 10, 2011 Share Posted September 10, 2011 para sesepuh sekalian ane punya sedikit masalah ni... mohon bantuannya..... semua produk list ane menghilang.... muncul cuman beberapa detik langsung ilang lg..... pas ane cek pake 'display_errors', 'on' ada scritp yg error tp yg aneh nya semua product muncul meskipun warnanya agak memudar kek kena disable gitu.... error nya Warning: Invalid argument supplied for foreach() in /home/sebo/public_html/balisilverjewellry.com/prestashop/classes/CompareProduct.php on line 36 ini full script CompareProduct.php <?php class CompareProduct extends ObjectModel { public $id; public $id_product; public $id_guest; public $id_customer; public $date_add; public $date_upd; protected $fieldRequired = array( 'id_product', 'id_guest', 'id_customer'); protected $fieldsValidate = array( 'id_product' => 'isUnsignedInt', 'id_guest' => 'isUnsignedInt', 'id_customer' => 'isUnsignedInt' ); protected $table = 'compare_product'; protected $identifier = 'id_compare_product'; /** * Get all compare products of the guest * @param int $id_guest * @return array */ public static function getGuestCompareProducts($id_guest) { $results = Db::getInstance()->ExecuteS(' SELECT DISTINCT `id_product` FROM `'._DB_PREFIX_.'compare_product` WHERE `id_guest` = '.(int)($id_guest)); $compareProducts = null; foreach($results as $result) $compareProducts[] = $result['id_product']; return $compareProducts; } /** * Add a compare product for the guest * @param int $id_guest, int $id_product * @return boolean */ public static function addGuestCompareProduct($id_guest, $id_product) { return Db::getInstance()->Execute(' INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_guest`, `date_add`, `date_upd`) VALUES ('.(int)($id_product).', '.(int)($id_guest).', NOW(), NOW()) '); } /** * Remove a compare product for the guest * @param int $id_guest, int $id_product * @return boolean */ public static function removeGuestCompareProduct($id_guest, $id_product) { return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'compare_product` WHERE `id_guest` = '.(int)($id_guest).' AND `id_product` = '.(int)($id_product)); } /** * Get the number of compare products of the guest * @param int $id_guest * @return int */ public static function getGuestNumberProducts($id_guest) { return (int)(Db::getInstance()->getValue(' SELECT count(`id_compare_product`) FROM `'._DB_PREFIX_.'compare_product` WHERE `id_guest` = '.(int)($id_guest)));; } /** * Get all comapare products of the customer * @param int $id_customer * @return array */ public static function getCustomerCompareProducts($id_customer) { $results = Db::getInstance()->ExecuteS(' SELECT DISTINCT `id_product` FROM `'._DB_PREFIX_.'compare_product` WHERE `id_customer` = '.(int)($id_customer)); $compareProducts = null; foreach($results as $result) $compareProducts[] = $result['id_product']; return $compareProducts; } /** * Add a compare product for the customer * @param int $id_customer, int $id_product * @return boolean */ public static function addCustomerCompareProduct($id_customer, $id_product) { return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'compare_product` (`id_product`, `id_customer`, `date_add`, `date_upd`) VALUES ('.(int)($id_product).', '.(int)($id_customer).', NOW(), NOW())'); } /** * Remove a compare product for the customer * @param int $id_customer, int $id_product * @return boolean */ public static function removeCustomerCompareProduct($id_customer, $id_product) { return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'compare_product` WHERE `id_customer` = '.(int)($id_customer).' AND `id_product` = '.(int)($id_product)); } /** * Get the number of compare products of the customer * @param int $id_customer * @return int */ public static function getCustomerNumberProducts($id_customer) { return (int)(Db::getInstance()->getValue(' SELECT count(`id_compare_product`) FROM `'._DB_PREFIX_.'compare_product` WHERE `id_customer` = '.(int)($id_customer))); } /** * Clean entries which are older than the period * @param string $period * @return void */ public static function cleanCompareProducts($period = 'week') { if ($period === 'week') $interval = '1 WEEK'; elseif ($period === 'month') $interval = '1 MONTH'; elseif ($period === 'year') $interval = '1 YEAR'; else return; if ($interval != null) { Db::getInstance()->Execute(' DELETE FROM `'._DB_PREFIX_.'compare_product` WHERE date_upd < DATE_SUB(NOW(), INTERVAL '.pSQL($interval).')'); } } } Ini TKP nya ane pake ps 1440 sm 1441 hasil nya sama..... Link to comment Share on other sites More sharing options...
theme_designer Posted September 10, 2011 Share Posted September 10, 2011 Apakah website Anda diserang? Link to comment Share on other sites More sharing options...
63mb3l Posted September 13, 2011 Author Share Posted September 13, 2011 Apakah website Anda diserang? web satu nya lg...yg kena tp list product nya gak ilang, tp ada kemungkinan ini jg kena.... dah patch ngikutin tatetertib nya... yg pake herfix.... masih ttp kek gini.... ada solusinya??? thx... Link to comment Share on other sites More sharing options...
63mb3l Posted September 15, 2011 Author Share Posted September 15, 2011 udah kelar masalah nya..... terpaksa bikin ulang... untung masih punya backup DB nya.... Link to comment Share on other sites More sharing options...
mlx01 Posted September 15, 2011 Share Posted September 15, 2011 udah kelar masalah nya..... terpaksa bikin ulang... untung masih punya backup DB nya.... penyebabnya udah ketahuan ? Link to comment Share on other sites More sharing options...
gonebdg - webindoshop.com Posted September 21, 2011 Share Posted September 21, 2011 SIlahkan baca informasi ini : http://www.prestashop.com/forums/topic/126145-please-read-security-procedure/page__pid__615938 Link to comment Share on other sites More sharing options...
63mb3l Posted October 11, 2011 Author Share Posted October 11, 2011 penyebabnya udah ketahuan ? penyebabnya pasti dari kejadian PS kena hack itu..... yg penting DB nya masih selamat... jd tinggal bikin ulang web nya.... SIlahkan baca informasi ini : http://www.prestasho...ge__pid__615938 udah di coba tp masih ttp blank..... THX..... all.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now