<?php

if ($satisfaction and $quit_30days and $submit_survey) {

if ($submit_survey) {

$query = "UPDATE surveys SET 
satisfaction = '$satisfaction',
quit_30days = '$quit_30days',
quit_24hours = '$quit_24hours',
cigs_use = '$cigs_use',
cigs_when = '$cigs_when',
cigs_days = '$cigs_days',
cigs_amount = '$cigs_amount',
cigs_intent = '$cigs_intent',
cgr_use = '$cgr_use',
cgr_when = '$cgr_when',
cgr_days = '$cgr_days',
cgr_amount = '$cgr_amount',
cgr_intent = '$cgr_intent',
pipe_use = '$pipe_use',
pipe_when = '$pipe_when',
pipe_days = '$pipe_days',
pipe_amount = '$pipe_amount',
pipe_intent = '$pipe_intent',
dip_use = '$dip_use',
dip_when = '$dip_when',
dip_days = '$dip_days',
dip_amount = '$dip_amount',
dip_intent = '$dip_intent',
other_use = '$other_use',
other_when = '$other_when',
other_days = '$other_days',
other_amount = '$other_amount',
other_intent = '$other_intent',
med_patch = '$med_patch',
med_gum = '$med_gum',
med_loz = '$med_loz',
med_spray = '$med_spray',
med_inhaler = '$med_inhaler',
med_zyban = '$med_zyban',
med_chantix = '$med_chantix',
med_other = '$med_other',
help_healthpro = '$help_healthpro',
help_website = '$help_website',
help_phone = '$help_phone',
help_counseling = '$help_counseling',
help_self = '$help_self',
help_other = '$help_other',
survey_date = now(),
user_staff = 'User',
status = 'Completed'

WHERE userID='$userID' and user_name='$user_name'";


$promptgreen="Survey Saved";

}


mysql_query($query);
mysql_close();


}

if ((!$satisfaction or !$quit_30days) and $submit_survey) {


$promptred="Please answer both questions 1 and 2";

}



?>

