// By default, expiration date is 6 months after last day
for($i=0;$i<$count;$i++){
$_SESSION['form']->end_date=$max_expiry_time;
$c=newChoice('');
}
$c->addSlot('');
$c->addSlot('');
// Insert poll in database
$c->addSlot('');
$ids=$pollService->createPoll($_SESSION['form']);
$_SESSION['form']->addChoice($c);
$poll_id=$ids[0];
$admin_poll_id=$ids[1];
// Send confirmation by mail if enabled
if($config['use_smtp']===true){
$message=__('Mail',"This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll.");
$message.='<br/><br/>';
$message.=Utils::htmlEscape($_SESSION['form']->admin_name).' '.__('Mail','hast just created a poll called').' : "'.Utils::htmlEscape($_SESSION['form']->title).'".<br/>';
$message.=__('Mail','Thanks for filling the poll at the link above').' :<br/><br/><a href="%1$s">%1$s</a>';
$message_admin=__('Mail',"This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above");
$mailService->send($_SESSION['form']->admin_mail,'['.NOMAPPLICATION.']['.__('Mail','For sending to the polled users').'] '.__('Generic','Poll').': '.Utils::htmlEscape($_SESSION['form']->title),$message);
}
}
}
// Clean Form data in $_SESSION
// Display step 2
unset($_SESSION['form']);
$smarty->assign('title',__('Step 2 date','Poll dates (2 on 3)'));
$message=__('Mail',"This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll.");
$message.='<br/><br/>';
$message.=Utils::htmlEscape($_SESSION['form']->admin_name).' '.__('Mail','hast just created a poll called').' : "'.Utils::htmlEscape($_SESSION['form']->title).'".<br/>';
$message.=__('Mail','Thanks for filling the poll at the link above').' :<br/><br/><a href="%1$s">%1$s</a>';
$message_admin=__('Mail',"This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above");
$mailService->send($_SESSION['form']->admin_mail,'['.NOMAPPLICATION.']['.__('Mail','For sending to the polled users').'] '.__('Generic','Poll').': '.Utils::htmlEscape($_SESSION['form']->title),$message);