find the customer type and direct to relevent information - forms

I am developing a site to sell some beverages to retail customers and wholesale customers.
I want to keep a log in form in landing page which help both customers to access site according their customer type (retail or wholesale)
I used member:log in_form and check my member_group. It is “1” because I already log in into my system.
Is this possible in EE: Create a Button for retail and button for wholesale. Then when a customer click a button system pick customer choice and give access to relevant member group using code snippet below.
{if member_group == 7}
Access to Retail group
{/if: elseif member_group == 8}
Access to wholesale group
{if:else}
Welcome to our site.
{/if}
If it is not possible can you please guide me to the right track. I am new to EE.

What your suggesting is exactly the way to do it, with just a little change in the code:
{if member_group == 7}
Access to Retail group
{if:elseif member_group == 8}
Access to wholesale group
{if:else}
Welcome to our site.
{/if}
Note the change in line 3 - just a few typos.
Advanced conditionals are notoriously slow though, so look into Mark Croxton's Switchee for speed. You can more easily create entire blocks and case-test them en-masse with Switchee, and it's far faster overall than working on a per-component basis.

Related

ms-access linking each checkbox(true/false column) to run a individual code in forms

New Edition June 2, 2017
I'm creating a database for a preventative maintenance program for the equipment in my facility. We have about 70 different machines with individuals preventative maintenance instructions, and I've been able to create tables for machines with the instructions attached to them by using forms that will update the database. I created a main form that will filter which PM needs to be done based on the date that is searched that will filter through the machines in the database, access does this fine. The problem I'm currently having trouble with is finding a way to add checkboxes to this main form, and print off only the ones that are selected with a button. The plan we have is to have the mechanics to be able to print off the PM instructions, and use the print off to update the database. Is there a way this can be done with checkboxes or optionboxes?Here's a picture of the main form that doesn't have the checkbox field attached to it yetHere's a picture of the forms that will show the preventative maintenance instructions that we will be printed.
Your question is a little vague and doesn't provide any insight on what you might have tried (this would actually help us determine what you want to do). That said, based on what's given:
If you have a single checkbox and want some action to be performed when it is checked/unchecked.
Private Sub CheckboxName_Click()
If CheckboxName.Value = -1 Then
'Do something
Else
'Do something else (Else is optional)
End If
End Sub
If you have multiple checkboxes you want to confirm which are checked and which aren't when a button or something is pushed you use the Controls object to cycle through all the checkboxes.
Private Sub ButtonName_Click()
Dim ctrl as Control
Dim i as Integer
For Each ctrl In Me.Controls
If ctrl.ControlType = acCheckBox and ctrl.Value = -1
'Do something (e.g., Select Case ctrl.name)
End If
End Sub
Hopefully that at least points you in the right direction.

iab.taxonome.org error code -5

i'm trying to use iab.taxonome.org service to classify texts, and get error response -5 (text too short)
Here is what i'm sending to the service:
https://rest.taxonome.org/v1/taxono?me=A college basketball game at Allen Fieldhouse, in Lawrence, Kansas, the home of the Kansas Jayhawks
The history of basketball is traced back to a YMCA International Training School, known today as Springfield College, located in Springfield, Massachusetts&token=[...MyKey...]&ver=1
Indeed I had the same issue. After clearing this with taxonome support team I figure out there is a requirement for at least 500 words per classification.
I have asked to add it to the API reference page.
Double checking and editing my answer: It is depends which framework is being used to send this data. In case you are implementing the client and not encoding the URL string it won't work for you (e.g. space = %20).
Check the API example here:
https://iab.taxonome.org/api

Confusing example of drools this operator

I am learning Drools and have come across an example in PACKT "Instant Drools Starter" (page 19) that has me confused.
Can someone explain what this is actually doing please.
$p : Purchase ( total > 15)
Purchase ( this != $p, tacoCount > 2)
What I understand is that the first line is finding a Purchase with a "total" of more than 15 and assigning that to a variable $p.
The second line is then (I think) saying match with another Purchase, other than the Purchase assigned to $p, with a tacoCount more than 2 .
But what purpose does that provide? What is the plain english version of these rules.
Concerned that there is something subtle hidden here or is this just a "poor" example?
Plain English. Let there be a purchase with a total greater than 15.- (Purchase ( total > 15)) and let's call it $p. Now, if there is another purchase (Purchase ( this != $p,) where the taco count is greater than two (tacoCount > 2)) then let's do something.
I don't think that there is much "meaning" behind this pair of patterns. I merely illustrates that you have to use the Java keyword (not a Drools operator) this to avoid the situation that the rule matches a single purchase greater than 15.- with more than two tacos. If you want two different facts, that's essential.
(It's the kind of rule some TacoHouse marketing marvel might come up with, to provide one free chili dip to a customer's next purchase, if he's had a couple of purchases like these during the last fortnight. Additional constraints may be required. -- It just might happen. ;-) )

How to edit the email order template of OpenCart 1.5.6.1?

I would like to ask, how I can edit the following email order template of Opencart version 1.5.6.1?
Subject: Gifts - Order 804
You have received an order.
Order ID: 804
Date Added: 22/04/2014
Order Status: Pending
Products
1x Mother of Pearl Rosary (RO-21) $26.00 1x Holy Water & Oil From Holy Land (HWC-01) $15.00 1x Rosary with holy earth (RO-12) $15.00 1x Box with Jerusalem Cross (BO-08) $14.00
Order Totals
Sub-Total: $70.00
UPS Ground: $12.67
Total: $82.67
The comments for your order are:
sacramental gifts for first communion
Now I want to add the name of the recipient at the top of the message, above the sentence "You have received an order", what I can do? What is the code I should add, and which files?
Please help me, I searched all Google and didn't find a solution !!
/catalog/model/checkout/order.php
but all the texts are translates, then you need to change on this file:
/catalog/language/english/mail/order.php

stored long description in Sqlite database manager in iphone

I want to store long description in sqlite database manager in iphone like this data.
"The Golden Temple: The Golden Temple, popular as Sri Harmandir Sahib or Sri Darbar Sahib, is the sacred seat of Sikhism. Bathed in a quintessential golden hue that dazzles in the serene waters of the Amrit Sarovar that lace around it, the swarn mandir (Golden temple) is one that internalizes in the mindscape of its visitors, no matter what religion or creed, as one of the most magnificent House of Worship. On a jewel-studded platform is the Adi Grantha or the sacred scripture of Sikhs wherein are enshrined holy inscriptions by the ten Sikh gurus and various Hindu and Moslem saints. While visiting the Golden Temple you need to cover your head. Street sellers sell bandanas outside the temple at cheap prices."
I am trying to take as description (VARCHAR(5000)) but when i execute query it is showing half text with dotted (....) like that http://i.stack.imgur.com/gyMqi.png
Thanks
The ... surely indicate that the full text is present in the database. It also indicates that "Sqlite database browser" truncates past a certain length:
m_textWidthMarkSize = s.value("prefs/sqleditor/textWidthMarkSpinBox", 60).toInt();
Is there a way to change the settings?
Edit
You can verify that the text is fully saved with the following query (replace theTable with the correct table name):
select length(description) from theTable;