Example #1
0
$item = $f->add_password(_t("Password"), "clear_password", _t("The password you want to associate to your account."));
$item->is_optional = true;
$item = $f->add_password(_t("Retype Password"), "clear_password2", _t("Retype your password."));
$item->is_optional = true;
$f->add_hidden("password", "");
$f->add_hidden("password2", "");
//$f->add_text("Street# and street name", "street", default_value("street"), "Number and street name");
//$f->add_text("ZIP", "zip", default_value("zip"), "ZIP code of your city.");
//$f->add_text("City", "city", default_value("city"), "Your city.");
//$item = $f->add_text("State (Optional)", "state", default_value("state"), "Your state if any");
//$item->is_optional = true;
//$f->add_text("Country", "country", default_value("country"), "Your country");
if ($g_use_recaptcha) {
    $publickey = CAPTCHA_PUB_KEY;
    // you got this from the signup page
    $f->add_raw_html(recaptcha_get_html($publickey));
}
$f->add_checkbox(_t("I have read and understood the <a href=\"info/terms\" target=\"_blank\">Terms and Conditions</a> and accept them."), "confirm", "", "");
$f->add_submit(_t("Submit"));
echo $f->html();
?>
<script>
	var hash_salt = "<?php 
echo RANDOM_SALT;
?>
";
	$(document).ready(function() {
		eb_sync_hash('clear_password', 'password');
		eb_sync_hash('clear_password2', 'password2');
	});
	$("form").submit(function() {
Example #2
0
$f->cancel = true;
if ($scenario == "create") {
    $f->cancel_url = "";
    // Main menu
    $button_text = _t("Create");
    $f->title = _t("Event creation");
} else {
    $f->cancel_url = "?action=retrieve&amp;type=event&amp;id=" . $event->id;
    $button_text = _t("Update");
    $f->title = _t("Event edition");
}
$f->action = $g_display["form_action"];
$f->method = "POST";
$f->add_raw_html(<<<EOF
\t<h1>{{Describe your event}}</h1>
\t<div class="form_section">
EOF
);
$item = $f->add_text(_t("[event]Title"), "title", default_value("title", $event->title), _t("Conference, or meeting name."));
$item->other_attr = ' size="60" maxlength="255"';
$item = $f->add_text(_t("Organizer name"), "organizer_name", default_value("organizer_name", $event->organizer_name, $user->get_company_name()), _t("The entity that is responsible for organizing the event."));
$item->other_attr = ' size="60" maxlength="255"';
$item = $f->add_text(_t("Organizer phone (optional but recommended)"), "phone", default_value("phone", $event->phone, $user->phone), _t("Contact phone not published. Used ONLY for support purpose."));
$item->is_optional = true;
if (!$event->has_accountancy_activity()) {
    $item = $f->add_number(_t("Required funding (Euro)"), "funding_needed", default_value("funding_needed", $event->funding_needed), _t("Minimum amount of fund needed to organize the event. Please indicate 0 if no requirement."));
    $item->other_attr = ' step="0.01" min="0"';
} else {
    $f->add_hidden("funding_needed", $event->funding_needed);
}
$item = $f->add_text(_t("Event date"), "happening_t", default_value("happening_t", $event->happening_t), _t("Date at which starts the event (Format: YYYY-MM-DD)."));