Jump to content

kirk112

Members
  • Posts

    98
  • Joined

  • Last visited

About kirk112

  • Birthday 10/30/1983

Profile Information

  • Gender
    Not Telling
  • Location
    England

kirk112's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, Just seeing if there is a function or similar that I can use to format currency for styling purposes. All our products are stored in the decimal format in the database and can format them to the correct local, but for the design of the site I need to modify the display price if there is a pence value, so that the .99p has its own class. For example £120 I can display that correct with no decimal points etc but if the price is £79.99 I would want to break after the decimal point and add in tags for presentation display £79.<small>99</small> I have a function that explodes at the decimal point etc but was wondering if there is a simpler way to achieve this, as when the currency is EURO they have the decimal point at the thousand separator... Thanks
  2. Thanks Maxxd, mmm that makes sense the deal ID could be a unique token / guid almost impossible to stumble across by accident. Was way over thinking this Cheers
  3. Hi, Just looking for some advice over a feature I am currently working on. I am building on top of a custom e-commerce site and to increase conversions etc. I want to be able to send a URL to customers that is encoded with their details so that I can identify them when they arrive on the site. For example customer_id=1&offer_id=50&sale_products=1,2,3,4&promoted_product=12&agent=99 From this query string I can query the database and get: the customer details from their id which special offer to display i.e. 20% of products Which products are on sale for them promoted product to display on the landing page who the referrer / agent was so we can show the partner logo I could use some 2 way encryption to encrypt / decrypt this and then I would be able to use the parameters and variables, but I would have to split then and check which were there. Not all the vars are required. But got a bad feeling over this (don't know why, it just does not feel right... and that there is a better way to do this....) Can anyone see if this is a good way to achieve this or think of a better way... Thanks
  4. Thanks for the reply, They all have a article_content_id, and if I select an article from report, article, event or viewpoint I will be able to join the article content and other related information, but if I do a search on the article_content table I will not know which table to join to it as it can be 1 of 4 Regards
  5. Hi I am trying to design an article website and have got a mental block over the best way to design the database, I have attached a screenshot of the current design (please ignore the column types), I will try to best explain the problem below, please let me know if you need any additional information An article can be in any number of categories (article_to_category table) all the articles have set values which are stored in the article_content. Depending on the type of the article it can have additional attributes which are stored in the report, article, event, viewpoint tables. The problem is there is not direct link between the article_content table and the attributes in the above tables, I would have to union all the tables together and workout which of the values I need to display. I have looked at a EAV model and feel it's not the correct way to go. I have thought about combining the report, article, event, viewpoint tables into the article_content and making the column NULL but this feels 'wrong'. Thanks for your advice, please let me know if you need any further explanation [attachment deleted by admin]
  6. You do need the array, after if($_POST['Submit']) { echo"submit button detected"; echo '<pre>'; print_r($_POST); echo '</pre>'; echo '<pre>'; print_r($idarray); echo '</pre>'; and output the results. Does CompetencyGUID contain the id number of each question?
  7. If you change $idarray[]=$row2[CompetencyGUID]; to $idarray=$row2[CompetencyGUID]; Then you sql will look like UPDATE DATA SET COMPETENCYLEVEL = '4' WHERE COMPETENCYGUID = '1' AND STUDENGUID = '32A0EF05-EECB-4E5A-A4D0-F0ED1EFD35F6' Currently $idarray is being define as an array
  8. Hi if you echo '<pre>'; print_r($idarray); echo '</pre>'; What output do you get
  9. Hi Not sure if I am on the right track here but what I am trying to do is set a variable in the parent class and for this to be accessible in the child. class layout { public $site_id; function __construct($site_id) { $this->site_id = $site_id; } function get_flags() { return new flags($this); } function top_nav() { return new top_nav($this); } } class top_nav extends layout { function __construct(){ } function display_site_id() { echo $this->site_id; } } class flags extends layout { function __construct(){ } function display_site_id() { echo $this->site_id; } } $site_id = 1; $layout = new layout($site_id); $flags = $layout->get_flags(); $nav = $layout->top_nav(); var_dump($layout); var_dump($flags); var_dump($nav); This gives me the following output object(layout)#1 (1) { ["site_id"]=> int(1) } object(flags)#2 (1) { ["site_id"]=> NULL } object(top_nav)#3 (1) { ["site_id"]=> NULL } Where I would have expected object(layout)#1 (1) { ["site_id"]=> int(1) } object(flags)#2 (1) { ["site_id"]=> int(1) } object(top_nav)#3 (1) { ["site_id"]=> int(1) } but I am new to OOP and might be doing things completely wrong Thanks for your help Regards
×
×
  • 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.