<?php

// OPERATION *********************************************************************

$user_add=$_REQUEST['user_add'];
$user_edit=$_REQUEST['user_edit'];
$user_delete=$_REQUEST['user_delete'];

$user_demographics=$_REQUEST['user_demographics'];
$user_whichtobacco=$_REQUEST['user_whichtobacco'];
$user_tobaccouse=$_REQUEST['user_tobaccouse'];
$user_attempts=$_REQUEST['user_attempts'];
$user_triggers=$_REQUEST['user_triggers'];
$user_stress=$_REQUEST['user_stress'];
$user_substitutes=$_REQUEST['user_substitutes'];
$user_distractions=$_REQUEST['user_distractions'];
$user_motivation=$_REQUEST['user_motivation'];
$user_support=$_REQUEST['user_support'];
$user_environment=$_REQUEST['user_environment'];
$user_healthyhabits=$_REQUEST['user_healthyhabits'];
$user_quitdate=$_REQUEST['user_quitdate'];
$user_quitting=$_REQUEST['user_quitting'];
$user_stayingquit=$_REQUEST['user_stayingquit'];
$send_chat=$_REQUEST['send_chat'];
$med_problems=$_REQUEST['med_problems'];
$med_orders=$_REQUEST['med_orders'];
$edit_address=$_REQUEST['edit_address'];

$promptred=$_REQUEST['promptred'];
$promptgreen=$_REQUEST['promptgreen'];



// NAVIGATION *********************************************************************

$area=$_REQUEST['area'];



$tab=$_REQUEST['tab'];
$forum=$_REQUEST['forum'];
$forumtab=$_REQUEST['forumtab'];
$quitplan=$_REQUEST['quitplan'];
$topic_id=$_REQUEST['topic_id'];
$add_topic=$_REQUEST['add_topic'];
$forumrow=$_REQUEST['forumrow'];
$add_post=$_REQUEST['add_post'];

if (!$area and $userID) { $area='user_welcome'; $quitplan="Y";}

if (!$area and !$userID) { $area='introduction'; }

// CHAT *********************************************************************


$chattext = $_REQUEST['chattext'];


// FORUM *********************************************************************

$topic = $_REQUEST['topic'];
$discuss = $_REQUEST['discuss'];
$comment = $_REQUEST['comment'];

// USERS *********************************************************************

$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$active = $_REQUEST['active'];
$user_lastname = $_REQUEST['user_lastname'];
$user_firstname = $_REQUEST['user_firstname'];
$user_address = $_REQUEST['user_address'];
$user_city = $_REQUEST['user_city'];
$user_state = $_REQUEST['user_state'];
$user_zip = $_REQUEST['user_zip'];
$user_county = $_REQUEST['user_county'];
$user_dialone = $_REQUEST['user_dialone'];
$user_message = $_REQUEST['user_message'];
$user_phone = $_REQUEST['user_phone'];
$user_phone2 = $_REQUEST['user_phone2'];
$user_cell = $_REQUEST['user_cell'];
$user_besttime = $_REQUEST['user_besttime'];
$user_email = $_REQUEST['user_email'];
$user_text_ok = $_REQUEST['user_text_ok'];
$user_email_ok = $_REQUEST['user_email_ok'];
$user_sex = $_REQUEST['user_sex'];
$user_dob = $_REQUEST['user_dob'];
$user_dob_refused = $_REQUEST['user_dob_refused'];
$user_insurance = $_REQUEST['user_insurance'];
$user_race = $_REQUEST['user_race'];
$user_hispanic = $_REQUEST['user_hispanic'];
$user_education = $_REQUEST['user_education'];
$user_employment = $_REQUEST['user_employment'];
$user_pregnant = $_REQUEST['user_pregnant'];
$user_military = $_REQUEST['user_military'];
$user_military_status = $_REQUEST['user_military_status'];
$cigarette_freq = $_REQUEST['cigarette_freq'];
$cigarette_amount = $_REQUEST['cigarette_amount'];
$cigarette_length = $_REQUEST['cigarette_length'];
$cigar_freq = $_REQUEST['cigar_freq'];
$cigar_amount = $_REQUEST['cigar_amount'];
$cigar_length = $_REQUEST['cigar_length'];
$chew_freq = $_REQUEST['chew_freq'];
$chew_amount = $_REQUEST['chew_amount'];
$chew_length = $_REQUEST['chew_length'];
$dip_freq = $_REQUEST['dip_freq'];
$dip_amount = $_REQUEST['dip_amount'];
$dip_length = $_REQUEST['dip_length'];
$pipe_freq = $_REQUEST['pipe_freq'];
$pipe_amount = $_REQUEST['pipe_amount'];
$pipe_length = $_REQUEST['pipe_length'];
$user_cigarettes_how_soon = $_REQUEST['user_cigarettes_how_soon'];
$user_cigarettes_which_one = $_REQUEST['user_cigarettes_which_one'];
$user_cigarettes_hard_not_allowed = $_REQUEST['user_cigarettes_hard_not_allowed'];
$user_cigarettes_when_ill = $_REQUEST['user_cigarettes_when_ill'];
$user_smokeless_swallow = $_REQUEST['user_smokeless_swallow'];
$user_smokeless_how_soon = $_REQUEST['user_smokeless_how_soon'];
$user_smokeless_mouth_how_long = $_REQUEST['user_smokeless_mouth_how_long'];
$att_have_you = $_REQUEST['att_have_you'];
$att_longest = $_REQUEST['att_longest'];
$att_help1 = $_REQUEST['att_help1'];
$att_help2 = $_REQUEST['att_help2'];
$att_help3 = $_REQUEST['att_help3'];
$att_help4 = $_REQUEST['att_help4'];
$att_help5 = $_REQUEST['att_help5'];
$att_help6 = $_REQUEST['att_help6'];
$att_help7 = $_REQUEST['att_help7'];
$att_help8 = $_REQUEST['att_help8'];
$att_help_other = $_REQUEST['att_help_other'];
$att_nohelp1 = $_REQUEST['att_nohelp1'];
$att_nohelp2 = $_REQUEST['att_nohelp2'];
$att_nohelp3 = $_REQUEST['att_nohelp3'];
$att_nohelp4 = $_REQUEST['att_nohelp4'];
$att_nohelp5 = $_REQUEST['att_nohelp5'];
$att_nohelp6 = $_REQUEST['att_nohelp6'];
$att_nohelp7 = $_REQUEST['att_nohelp7'];
$att_nohelp8 = $_REQUEST['att_nohelp8'];
$att_nohelp_other = $_REQUEST['att_nohelp_other'];
$att_reasons = $_REQUEST['att_reasons'];
$att_notes = $_REQUEST['att_notes'];
$trig_wake_face = $_REQUEST['trig_wake_face'];
$trig_wake_brush = $_REQUEST['trig_wake_brush'];
$trig_wake_shower = $_REQUEST['trig_wake_shower'];
$trig_coffee_juice = $_REQUEST['trig_coffee_juice'];
$trig_coffee_less = $_REQUEST['trig_coffee_less'];
$trig_coffee_decaf = $_REQUEST['trig_coffee_decaf'];
$trig_drive_sip = $_REQUEST['trig_drive_sip'];
$trig_drive_chew = $_REQUEST['trig_drive_chew'];
$trig_drive_pen = $_REQUEST['trig_drive_pen'];
$trig_meal_wash = $_REQUEST['trig_meal_wash'];
$trig_meal_gum = $_REQUEST['trig_meal_gum'];
$trig_meal_toothpick = $_REQUEST['trig_meal_toothpick'];
$trig_breaks_music = $_REQUEST['trig_breaks_music'];
$trig_breaks_read = $_REQUEST['trig_breaks_read'];
$trig_breaks_call = $_REQUEST['trig_breaks_call'];
$trig_bored_walk = $_REQUEST['trig_bored_walk'];
$trig_bored_puzzles = $_REQUEST['trig_bored_puzzles'];
$trig_bored_snack = $_REQUEST['trig_bored_snack'];
$trig_bored_water = $_REQUEST['trig_bored_water'];
$trig_users_walk = $_REQUEST['trig_users_walk'];
$trig_users_water = $_REQUEST['trig_users_water'];
$trig_users_tell = $_REQUEST['trig_users_tell'];
$trig_alcohol_avoid = $_REQUEST['trig_alcohol_avoid'];
$trig_alcohol_smokefree = $_REQUEST['trig_alcohol_smokefree'];
$stress_how_much = $_REQUEST['stress_how_much'];
$stress_use_tobacco = $_REQUEST['stress_use_tobacco'];
$stress1 = $_REQUEST['stress1'];
$stress2 = $_REQUEST['stress2'];
$stress3 = $_REQUEST['stress3'];
$stress4 = $_REQUEST['stress4'];
$stress5 = $_REQUEST['stress5'];
$stress6 = $_REQUEST['stress6'];
$stress7 = $_REQUEST['stress7'];
$stress8 = $_REQUEST['stress8'];
$stress9 = $_REQUEST['stress9'];
$stress_other = $_REQUEST['stress_other'];
$challenges_notes = $_REQUEST['challenges_notes'];
$substitute_straws = $_REQUEST['substitute_straws'];
$substitute_toothpicks = $_REQUEST['substitute_toothpicks'];
$substitute_pen = $_REQUEST['substitute_pen'];
$substitute_breath = $_REQUEST['substitute_breath'];
$substitute_other = $_REQUEST['substitute_other'];
$distractions_gum = $_REQUEST['distractions_gum'];
$distractions_seeds = $_REQUEST['distractions_seeds'];
$distractions_water = $_REQUEST['distractions_water'];
$distractions_puzzles = $_REQUEST['distractions_puzzles'];
$distractions_books = $_REQUEST['distractions_books'];
$distractions_exercise = $_REQUEST['distractions_exercise'];
$distractions_call = $_REQUEST['distractions_call'];
$distractions_other = $_REQUEST['distractions_other'];
$substitute_notes = $_REQUEST['substitute_notes'];
$motive_health = $_REQUEST['motive_health'];
$motive_health_specific = $_REQUEST['motive_health_specific'];
$motive_family = $_REQUEST['motive_family'];
$motive_family_specific = $_REQUEST['motive_family_specific'];
$motive_social = $_REQUEST['motive_social'];
$motive_social_specific = $_REQUEST['motive_social_specific'];
$motive_sports = $_REQUEST['motive_sports'];
$motive_sports_specific = $_REQUEST['motive_sports_specific'];
$motive_prevention = $_REQUEST['motive_prevention'];
$motive_prevention_specific = $_REQUEST['motive_prevention_specific'];
$motive_cost = $_REQUEST['motive_cost'];
$motive_cost_specific = $_REQUEST['motive_cost_specific'];
$motive_pregnant = $_REQUEST['motive_pregnant'];
$motive_pregnant_specific = $_REQUEST['motive_pregnant_specific'];
$motive_other = $_REQUEST['motive_other'];
$motive_harmful = $_REQUEST['motive_harmful'];
$motive_benefits = $_REQUEST['motive_benefits'];
$motive_notes = $_REQUEST['motive_notes'];
$support_name1 = $_REQUEST['support_name1'];
$support_email1 = $_REQUEST['support_email1'];
$support_name2 = $_REQUEST['support_name2'];
$support_email2 = $_REQUEST['support_email2'];
$support_name3 = $_REQUEST['support_name3'];
$support_email3 = $_REQUEST['support_email3'];
$quitbuddy_name1 = $_REQUEST['quitbuddy_name1'];
$quitbuddy_email1 = $_REQUEST['quitbuddy_email1'];
$quitbuddy_name2 = $_REQUEST['quitbuddy_name2'];
$quitbuddy_email2 = $_REQUEST['quitbuddy_email2'];
$quitbuddy_name3 = $_REQUEST['quitbuddy_name3'];
$quitbuddy_email3 = $_REQUEST['quitbuddy_email3'];
$environment_others = $_REQUEST['environment_others'];
$environment_smokers = $_REQUEST['environment_smokers'];
$environment_quitters = $_REQUEST['environment_quitters'];
$environment_around = $_REQUEST['environment_around'];
$environment_allowed = $_REQUEST['environment_allowed'];
$environment_presteps1 = $_REQUEST['environment_presteps1'];
$environment_presteps2 = $_REQUEST['environment_presteps2'];
$environment_presteps3 = $_REQUEST['environment_presteps3'];
$environment_presteps4 = $_REQUEST['environment_presteps4'];
$environment_presteps5 = $_REQUEST['environment_presteps5'];
$environment_presteps6 = $_REQUEST['environment_presteps6'];
$environment_presteps_other = $_REQUEST['environment_presteps_other'];
$environment_poststeps1 = $_REQUEST['environment_poststeps1'];
$environment_poststeps2 = $_REQUEST['environment_poststeps2'];
$environment_poststeps3 = $_REQUEST['environment_poststeps3'];
$environment_poststeps4 = $_REQUEST['environment_poststeps4'];
$environment_poststeps_other = $_REQUEST['environment_poststeps_other'];
$environment_notes = $_REQUEST['environment_notes'];
$habits_exercise1 = $_REQUEST['habits_exercise1'];
$habits_exercise2 = $_REQUEST['habits_exercise2'];
$habits_exercise_other = $_REQUEST['habits_exercise_other'];
$habits_water1 = $_REQUEST['habits_water1'];
$habits_water2 = $_REQUEST['habits_water2'];
$habits_water3 = $_REQUEST['habits_water3'];
$habits_water4 = $_REQUEST['habits_water4'];
$habits_water5 = $_REQUEST['habits_water5'];
$habits_water_other = $_REQUEST['habits_water_other'];
$habits_snacks1 = $_REQUEST['habits_snacks1'];
$habits_snacks2 = $_REQUEST['habits_snacks2'];
$habits_snacks3 = $_REQUEST['habits_snacks3'];
$habits_snacks_other = $_REQUEST['habits_snacks_other'];
$habits_sleep1 = $_REQUEST['habits_sleep1'];
$habits_sleep2 = $_REQUEST['habits_sleep2'];
$habits_sleep3 = $_REQUEST['habits_sleep3'];
$habits_sleep_other = $_REQUEST['habits_sleep_other'];
$habits_medical1 = $_REQUEST['habits_medical1'];
$habits_medical2 = $_REQUEST['habits_medical2'];
$habits_medical_other = $_REQUEST['habits_medical_other'];
$habits_notes = $_REQUEST['habits_notes'];
$demographics_saved = $_REQUEST['demographics_saved'];
$whichtobacco_saved = $_REQUEST['whichtobacco_saved'];
$tobaccouse_saved = $_REQUEST['tobaccouse_saved'];
$attempts_saved = $_REQUEST['attempts_saved'];
$triggers_saved = $_REQUEST['triggers_saved'];
$substitutes_saved = $_REQUEST['substitutes_saved'];
$motivation_saved = $_REQUEST['motivation_saved'];
$support_saved = $_REQUEST['support_saved'];
$environment_saved = $_REQUEST['environment_saved'];
$healthyhabits_saved = $_REQUEST['healthyhabits_saved'];
$motive_smokefree = $_REQUEST['motive_smokefree'];
$motive_smokefree_specific = $_REQUEST['motive_smokefree_specific'];
$quit_howsoon = $_REQUEST['quit_howsoon'];
$quit_date = $_REQUEST['quit_date'];
$quit_usemeds = $_REQUEST['quit_usemeds'];
$quit_medical = $_REQUEST['quit_medical'];
$quit_weekend = $_REQUEST['quit_weekend'];
$quit_notes = $_REQUEST['quit_notes'];
$med_patch = $_REQUEST['med_patch'];
$med_gum = $_REQUEST['med_gum'];
$med_lozenge = $_REQUEST['med_lozenge'];
$med_inhaler = $_REQUEST['med_inhaler'];
$med_spray = $_REQUEST['med_spray'];
$med_chantix = $_REQUEST['med_chantix'];
$med_zyban = $_REQUEST['med_zyban'];
$med_none = $_REQUEST['med_none'];
$actual_quitdate = $_REQUEST['actual_quitdate'];
$stress_saved = $_REQUEST['stress_saved'];
$distractions_saved = $_REQUEST['distractions_saved'];
$withdrawal_irritable = $_REQUEST['withdrawal_irritable'];
$withdrawal_tired = $_REQUEST['withdrawal_tired'];
$withdrawal_sleeping = $_REQUEST['withdrawal_sleeping'];
$withdrawal_concentrating = $_REQUEST['withdrawal_concentrating'];
$withdrawal_weight = $_REQUEST['withdrawal_weight'];
$withdrawal_craving = $_REQUEST['withdrawal_craving'];
$concerns_alcohol = $_REQUEST['concerns_alcohol'];
$concerns_caffeine = $_REQUEST['concerns_caffeine'];
$concerns_weight = $_REQUEST['concerns_weight'];
$concerns_stress = $_REQUEST['concerns_stress'];
$concerns_others = $_REQUEST['concerns_others'];
$actual_meds = $_REQUEST['actual_meds'];
$afterquit_benefits = $_REQUEST['afterquit_benefits'];
$afterquit_risk = $_REQUEST['afterquit_risk'];
$afterquit_alternates = $_REQUEST['afterquit_alternates'];
$afterquit_rewards_short = $_REQUEST['afterquit_rewards_short'];
$afterquit_rewards_long = $_REQUEST['afterquit_rewards_long'];
$afterquit_slip_why = $_REQUEST['afterquit_slip_why'];
$afterquit_slip_action = $_REQUEST['afterquit_slip_action'];
$afterquit_slip_future = $_REQUEST['afterquit_slip_future'];
$lastpuff = $_REQUEST['lastpuff'];
$environment_presteps7 = $_REQUEST['environment_presteps7'];
$health_heart_disease = $_REQUEST['health_heart_disease'];
$health_heart_attack = $_REQUEST['health_heart_attack'];
$health_heartbeats = $_REQUEST['health_heartbeats'];
$health_high_bp = $_REQUEST['health_high_bp'];
$health_diabetes = $_REQUEST['health_diabetes'];
$health_ulcers = $_REQUEST['health_ulcers'];
$health_pregnant = $_REQUEST['health_pregnant'];
$health_zyban = $_REQUEST['health_zyban'];
$health_chantix = $_REQUEST['health_chantix'];
$health_depression = $_REQUEST['health_depression'];
$health_asthma = $_REQUEST['health_asthma'];
$health_sodium = $_REQUEST['health_sodium'];
$health_adhesive = $_REQUEST['health_adhesive'];
$health_skin = $_REQUEST['health_skin'];
$health_none = $_REQUEST['health_none'];
$order1_id = $_REQUEST['order1_id'];
$order1_date = $_REQUEST['order1_date'];
$order2_id = $_REQUEST['order2_id'];
$order2_date = $_REQUEST['order2_date'];
$source_search = $_REQUEST['source_search'];
$source_facebook = $_REQUEST['source_facebook'];
$source_myspace = $_REQUEST['source_myspace'];
$source_twitter = $_REQUEST['source_twitter'];
$source_website = $_REQUEST['source_website'];
$source_family = $_REQUEST['source_family'];
$source_insurance = $_REQUEST['source_insurance'];
$source_doctor = $_REQUEST['source_doctor'];
$source_employer = $_REQUEST['source_employer'];
$source_school = $_REQUEST['source_school'];
$source_clinic = $_REQUEST['source_clinic'];
$source_flyer = $_REQUEST['source_flyer'];
$source_newspaper = $_REQUEST['source_newspaper'];
$source_tv_commercial = $_REQUEST['source_tv_commercial'];
$source_tv_news = $_REQUEST['source_tv_news'];
$source_tv_teenad = $_REQUEST['source_tv_teenad'];
$source_radio = $_REQUEST['source_radio'];
$source_1_800 = $_REQUEST['source_1_800'];
$source_billboard = $_REQUEST['source_billboard'];
$physician_name = $_REQUEST['physician_name'];
$physician_fax = $_REQUEST['physician_fax'];
$can_post = $_REQUEST['can_post'];
$user_type = $_REQUEST['user_type'];

if ($_REQUEST['plannedyear'] and $_REQUEST['plannedmonth'] and $_REQUEST['plannedday'] ) {
$quit_date = $_REQUEST['plannedyear']."-".$_REQUEST['plannedmonth']."-".$_REQUEST['plannedday'];
}

if ($_REQUEST['actualyear'] and $_REQUEST['actualmonth'] and $_REQUEST['actualday'] ) {
$actual_quitdate = $_REQUEST['actualyear']."-".$_REQUEST['actualmonth']."-".$_REQUEST['actualday'];
}


if ($_REQUEST['puffyear'] and $_REQUEST['puffmonth'] and $_REQUEST['puffday'] ) {
$lastpuff = $_REQUEST['puffyear']."-".$_REQUEST['puffmonth']."-".$_REQUEST['puffday'];
}
else{
$lastpuff = $_REQUEST['lastpuff'];
}










