Jump to content

Problem z paragonczyfaktura


Recommended Posts

Witam,
 
Mam problem z wczytywaniem danych z bazy przez PHP tak aby w Panelu Admina wyświetlalo mi informacje Paragon czy Faktura.
Mianowicie, dodałem do tablelii ps_address nowy wiersz czy_faktura.
 
W pliku address.tpl dodałem linie <input type="hidden" name="czy_faktura" value="1" />
Jezeli ktos wypelni formularz Faktury zmieni wartosc na 1 jezeli nie wypeni formularza zostaje 0
lecz problem mam z odpowiednim warunkiem aby wyswietlal mi w Panelu Admina co klient wybrał

public function hookDisplayAdminOrderFaktura($params)
	{
		global $smarty, $cookie;
		$id_customer = (int)(Tools::getValue('id_customer'));
		$customer = new Customer($id_customer);

		$ch = Db::getInstance()->ExecuteS('SELECT czy_faktura FROM `'._DB_PREFIX_.'address` WHERE id_customer = '.$customer->id_customer);
		
		$type = '';
		if($ch[0]['czy_faktura'] == 1)
			$type = $this->l('Invoice');
		elseif($ch[0]['czy_faktura'] == 0)
			$type = $this->l('Bill');
		else
			$type = $this->l('NULL');
			
		$this->context->smarty->assign(
			array(
				'type' => $type
			)
		);
		$this->context->smarty->assign(
			array(
				'id_customer' => $id_customer
			)
		);
		return $this->display(__FILE__, 'paragonfaktura.tpl');
	}
Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...