<?php

class demoDataFooter
{
    public function initData()
    {
        $return = true;
        $languages = Language::getLanguages(true);
        $id_shop = Context::getContext()->shop->id;
        $id_hook_footer = (int)Hook::getIdByName('displayFooter');
        $id_hook_footerafter = (int)Hook::getIdByName('displayFooterAfter');
        $id_hook_footebottom = (int)Hook::getIdByName('displayFooterBottom');
        
        $queries = [
            'INSERT INTO `'._DB_PREFIX_.'posstaticfooter` (`id_posstaticfooter`, `id_hook`, `position`, `width`, `type_content`, `name_module`, `content`,`active_title`) VALUES
                (1, '.$id_hook_footer.', 1, 3, 1, 0, \'{"cms":[false],"product":[false],"static":[false]}\', 1),
                (2, '.$id_hook_footer.', 2, 2, 0, 0, \'{"cms":["1","4","5"],"product":[false],"static":["contact","sitemap","stores"]}\', 1),
				(3, '.$id_hook_footer.', 3, 2, 0, 0, \'{"cms":["2"],"product":["prices-drop","new-products","best-sales"],"static":["authentication","my-account"]}\', 1),
				(4, '.$id_hook_footer.', 4, 2, 1, \'ps_customeraccountlinks\', \'{"cms":[false],"product":[false],"static":[false]}\', 1),
				(5, '.$id_hook_footer.', 5, 3, 1, \'ps_socialfollow\', \'{"cms":[false],"product":[false],"static":[false]}\', 1),
				(6, '.$id_hook_footerafter.', 6, 12, 1, 0, \'{"cms":[false],"product":[false],"static":[false]}\', 0),
				(7, '.$id_hook_footebottom.', 7, 6, 1, 0, \'{"cms":[false],"product":[false],"static":[false]}\', 0),
				(8, '.$id_hook_footebottom.', 8, 6, 1, 0, \'{"cms":[false],"product":[false],"static":[false]}\', 0);'
        ];

        foreach (Language::getLanguages(true, Context::getContext()->shop->id) as $lang) {
            $queries[] = 'INSERT INTO `'._DB_PREFIX_.'posstaticfooter_lang` (`id_posstaticfooter`, `id_lang`, `name`, `html_content`, `custom_content`) VALUES
                (1, '.(int)$lang['id_lang'].', "Get the app", \'<div class="get_app">
					<strong>Antomi</strong> App is now available on Google Play 
					& App Store. Get it now.
					<div class="img_app">
						<img src="/pos_antomi/img/cms/app_store.jpg" alt="" />
						<img src="/pos_antomi/img/cms/google_play.jpg" alt="" />
					</div>
				</div>\', ""),
                (2, '.(int)$lang['id_lang'].', "Information", "", ""),
				(3, '.(int)$lang['id_lang'].', "Custom Links", "", ""),
				(4, '.(int)$lang['id_lang'].', "My Account", "", ""),
				(5, '.(int)$lang['id_lang'].', "Contact Info", \'<div class="footer_contact">
				<div class="info-contact">
				<div class="hotline"><img src="/pos_antomi/img/cms/hotline.png" alt="" />
				<div class="content_hl"><span>Hotline Free 24/24:</span> <strong>(+800) 123 456 789</strong></div>
				</div>
				<div class="address add">The Barn, Henley in Arden B578. England.</div>
				<div class="email add"><a href="mailto:demo@posthemes.com">demo@posthemes.com</a></div>
				</div>
				</div>\', ""),
				(6, '.(int)$lang['id_lang'].', "Links Footer", \'<div class="custom_links">
					<a href="#">Online Shopping</a> 
					<a href="#">Promotions</a> 
					<a href="#">My Orders</a> 
					<a href="#">Help</a> 
					<a href="#">Customer Service</a> 
					<a href="#">Support</a> 
					<a href="#">Most Populars</a> 
					<a href="#">New Arrivals</a> 
					<a href="#">Special Products</a> 
					<a href="#">Manufacturers</a> 
					<a href="#">Our Stores</a> 
					<a href="#">Shipping</a> 
					<a href="#">Payments</a> 
					<a href="#">Warantee</a> 
					<a href="#">Refunds</a> 
					<a href="#">Checkout</a> 
					<a href="#">Discount</a> 
					<a href="#">Terms & Conditions</a> 
					<a href="#">Policy</a> 
					<a href="#">Shipping</a> 
					<a href="#">Payments</a> 
					<a href="#">Returns</a> 
					<a href="#">Refunds</a>
				</div>\', ""),
				(7, '.(int)$lang['id_lang'].', "Copyright Block", \'<div class="copyright">Copyright <i class="fa fa-copyright"></i> <a href="http://posthemes.com/">Posthemes</a>. All Rights Reserved</div>\', ""),
				(8, '.(int)$lang['id_lang'].', "Payment Block", \'<div class="payment"><img src="/pos_antomi/img/cms/payment.png" alt="" class="img-responsive"></div>\', "")'
				
            ;
        }

        $queries[] = 'INSERT INTO `'._DB_PREFIX_.'posstaticfooter_shop` (`id_posstaticfooter`, `id_shop`) VALUES
                (1, 1),
                (2, 1),
                (3, 1),
                (4, 1),
                (5, 1),
                (6, 1),
                (7, 1),
                (8, 1)';

        foreach ($queries as $query) {
            $return &= Db::getInstance()->execute($query);
        }

        return $return;
    }
}
?>