public function action_index()
 {
     $this->set_title("Module Admin ");
     $f = new Form("?module=admVoiture&action=valide&id=" . $this->req->id, "f_add");
     $f->add_text("annee", "annee", "Année");
     $f->add_text("km", "km", "Kilométrage");
     $f->add_textarea("des", "des", "Description");
     $f->add_submit("valide", "valide")->set_value("Valider");
     $this->tpl->assign("f_add", $f);
     $this->session->f_add = $f;
 }
Example #2
0
 public function action_index()
 {
     $this->set_title("module ex3");
     $f = new Form("?module=log&action=valide", "log");
     //Creation du formulaire
     $f->add_text("log", "log", "Login");
     $f->add_password("mdp", "mdp", "Mot de passe");
     $f->add_password("mdp2", "mdp2", "Confirmation");
     $f->add_submit("Valider", "valLog")->set_value('Valider');
     $this->tpl->assign("f_log", $f);
     $this->session->form = $f;
 }
Example #3
0
 public function action_logadmin()
 {
     $this->set_title("Connexion Administrateur");
     $this->site->ajouter_message("<span style=\"text-decoration: line-through;\">Login : admin // mdp : admin</span>");
     if (isset($this->session->formlogadm)) {
         $f = $this->session->formlogadm;
         $f->populate();
     } else {
         $f = new Form("?module=login&action=validelogadm", "f_log");
         //Creation du formulaire
         $f->add_text("log", "log", "Login");
         $f->add_password("mdp", "mdp", "Mot de passe");
         $f->add_submit("Valider", "valLog")->set_value('Valider');
     }
     $this->tpl->assign("f_logadm", $f);
     $this->session->formlogadm = $f;
     //utilité?
 }
 public function action_index()
 {
     if ($this->session->ouverte()) {
         $user = $this->session->session_ouverte();
         //echo var_dump($user);
         $f = new Form("?module=clientmanage&action=valide", "form");
         //Creation du formulaire
         $f->add_text("Email", "Email", "Email")->set_value($user->getMail());
         $f->add_text("Mdp", "Mdp", "Mot de passe")->set_value($user->getMdp());
         $f->add_text("rue", "rue", "Rue")->set_value($user->getRue());
         $f->add_text("cp", "cp", "Code Postal")->set_value($user->getCodePostal());
         $f->add_text("ville", "ville", "Ville")->set_value($user->getVille());
         $f->add_submit("Valider", "Valider")->set_value("Valider");
         $this->tpl->assign("form", $f);
     } else {
         $this->site->ajouter_message("Vous n'êtes pas connecté(e)");
         Site::redirect("index");
     }
 }
 public function action_index()
 {
     $this->set_title("Module Inscription");
     /** -- En cas de retour sur action_index() suite à des erreurs on remplie le formulaire avec l'ancienne saisie de l'utilisateur -- **/
     //La saisie est sauvegarde jusqu'a ce qu'il reussise l'inscription : -S'il quitte la page et reviens les données sont conservées
     if (isset($this->session->formIns)) {
         $f = $this->session->formIns;
         $f->populate();
     } else {
         $dir = "./images/captcha";
         // Ouvre un dossier bien connu, et liste tous les fichiers
         if (is_dir($dir)) {
             if ($dh = opendir($dir)) {
                 while (($file = readdir($dh)) !== false) {
                     //echo "fichier : $file : type : " . filetype($dir . $file) . "\n";
                     $captcha[] = $file;
                 }
                 closedir($dh);
             }
         }
         $length = 0;
         foreach ($captcha as $cp) {
             $length++;
         }
         $nb = rand(2, $length - 1);
         echo var_dump($length . "ee" . $nb);
         $f = new Form("?module=inscription&action=valide", "f_ins");
         //Creation du formulaire
         $f->add_text("nom", "nom", "Nom");
         $f->add_text("prenom", "prenom", "Prénom");
         $f->add_text("rue", "rue", "Rue");
         $f->add_text("cp", "cp", "Code postal");
         $f->add_text("ville", "ville", "Ville");
         $f->add_text("mail", "mail", "Mail");
         $f->add_password("mdp", "mdp", "Mot de passe");
         $f->add_password("mdp2", "mdp2", "Confirmation");
         $f->add_captcha("cap", "cap", "Code de confirmation")->set_captcha($captcha[$nb]);
         $f->add_hidden("hide", "hide", "")->set_value($captcha[$nb]);
         $f->add_submit("Valider", "valIns")->set_value("Valider");
         $this->session->formIns = $f;
     }
     $this->tpl->assign("f_ins", $f);
 }
Example #6
0
 public function action_index()
 {
     if ($this->session->ouverte()) {
         $this->set_title("Module Nos voitures");
         if ($this->req->name) {
             $db = DB::get_instance();
             $modm = new ModeleManager($db);
             $imgm = new ImageManager($db);
             $mod = $modm->getByName($this->req->name);
             $cm = new CommentaireManager($db);
             if ($mod) {
                 $idmodele = $mod->getIdModele();
                 $listeCom = $cm->listing($idmodele);
                 $this->tpl->assign("com", $listeCom);
                 $listeImg = $imgm->listing($idmodele);
                 $this->tpl->assign("photo", $listeImg);
             } else {
                 Site::redirect('loc', 'index');
             }
         } else {
             Site::redirect('index');
         }
         $fcom = new Form("?module=car&action=validcom&name=" . $this->req->name, "f_com");
         $i = 0;
         $notes[] = '';
         while ($i < 6) {
             $notes[] = $i;
             $i++;
         }
         $fcom->add_select("note", "note", "Note", $notes);
         $fcom->add_textarea("com", "com", "");
         $fcom->add_submit("", "", "")->set_value("Envoyez");
         $this->tpl->assign("f_com", $fcom);
     } else {
         Site::redirect("login");
     }
 }
Example #7
0
$item->is_optional = true;
$item->other_attr = 'class="addresspicker" placeholder="{{Street no, Street, Zip City, etc.}}"';
$item = $f->add_text(_t("VAT#"), "vat", default_value("vat", $user->vat), _t("VAT#, for european compagny only."));
$item->is_optional = true;
$item = $f->add_text(_t("Compagny name"), "compagny_name", default_value("compagny_name", $user->compagny_name), _t("VAT#, for european compagny only."));
$item->is_optional = true;
$item = $f->add_password(_t("New Password (optional)"), "clear_new_pass", _t("Leave empty if you do not want to change your password."));
$item->is_optional = true;
$item = $f->add_password(_t("Retype new Password (optional)"), "clear_new_pass2", _t("Retype your new password."));
$item->is_optional = true;
$item = $f->add_hidden("new_pass", "");
$item->is_optional = true;
$item = $f->add_hidden("new_pass2", "");
$item->is_optional = true;
$f->add_hidden("id", $user->id);
$f->add_submit(_t("Update"));
echo $f->html();
?>
<script>
	var hash_salt = "<?php 
echo RANDOM_SALT;
?>
";
	$(document).ready(function() {
		eb_sync_hash('clear_new_pass', 'new_pass');
		eb_sync_hash('clear_new_pass2', 'new_pass2');
		addresspicker_init();
	});
	$("form").submit(function() {
		$('input[type=password]').attr('name', '');
	});
<?php

$f = new Form();
$f->title = _t("Forgotten password");
$f->action = "?action=handle_forgotten_password";
$f->method = "POST";
$f->add_email(_t("Email"), "email", default_value("email"), _t("Please enter your account email."));
$f->add_submit(_t("Continue"));
echo $f->html();
 public function action_addPhoto()
 {
     $id = $this->req->id;
     $this->set_title("Module Admin Ajouter Photo");
     $f = new Form("?module=admModele&action=validePhoto", "f_addph");
     $f->add_hidden("id", "id", "Id")->set_value($this->req->id);
     $f->add_file("photo", "photo", "photo");
     $f->add_submit("Valider", "val_up")->set_value("Valider");
     $this->tpl->assign("f_addph", $f);
     $this->session->formPh = $f;
 }
Example #10
0
<?php

if ($DB->value("SELECT locked FROM thread WHERE id=\$1", array(id())) == 't') {
    return;
}
$Form = new Form();
$Form->header(url(0, 1) . "reply", "post", FORM_SALT);
$Form->values(array("thread_id" => id(true)));
$Form->add_hidden("thread_id");
$Form->account_login();
$Form->fieldset_open("Reply");
$Form->add_textarea("body", "Body:");
$Form->fieldset_close();
$Form->add_submit(SAY_BUTTON, "id=\"submit\"/>");
$Form->add_button("preview", PREVIEW_BUTTON, "preview_post('{$Form->name}','thread'," . id() . ");");
if (id() == 362137) {
    print "&nbsp;";
    $Form->add_button("_load", "load bradyism", "\$(this).val('loading...');\$.post('/thread/view/bradyism/',{},function(data){ \$('#body').val(\$.trim(data));\$('#_load').val('load bradyism')});");
}
print "&nbsp;<sup><a href=\"javascript:;\" onclick=\"\$('#bbcode').slideToggle()\">[help]</a></sup>\n";
$Form->footer();
$Form->header_validate();
$Form->add_notnull("body", "Please enter a post body.");
$Form->footer_validate();
print BBCODE_GUIDE;
?>
<script type="text/javascript">
function completed(data)
{
  if(jQuery.trim(data) == "")
  {
Example #11
0
if (REGISTRATION_PASSWORD && !session('authorized')) {
    $Form = new Form();
    $Form->header(url(0, -2) . "authorize/", "post", FORM_SALT);
    $Form->fieldset_open("Registration Authorization");
    $Form->add_password("password", "Password:"******"Authorize Me");
    $Form->footer();
}
if (session('authorized')) {
    $Form = new Form();
    $Form->header(url(), "post", FORM_SALT);
    $Form->fieldset_open("Create Account");
    $Form->add_text("account", "Name:", 150);
    $Form->add_text("secret", "Secret Word:", 150, false, "/><span class=\"small\">(to recover forgotten password)</span>");
    $Form->add_text("email_signup", "Email:", 200);
    $Form->add_text("email_confirm", "Email (confirm):", 200);
    $Form->add_text("postalcode", "Postal Code:", 75);
    $Form->fieldset_close();
    $Form->add_submit("Create Account");
    $Form->footer();
    $Form->header_validate();
    $Form->add_notnull("account", "Please enter an account name.");
    $Form->add_notnull("secret", "Please enter a secret word for password recovery.");
    $Form->add_notnull("email_signup", "Please enter an email address.");
    $Form->add_notnull("email_confirm", "Please confirm your email address.");
    $Form->add_notnull("postalcode", "Please enter a postal code.");
    $Form->footer_validate();
}
$Base->footer();
print "</div>";
Example #12
0
		<td width="100" align="center">
			&nbsp;
		</td>
		<td width="300" class="evt_sign_in_form">
<div class="evt_sign_in_table_title">{{Password connect}}</div>
<div class="form_cancel"><small>{{Not registered? Then}} <a href="index.php?action=get_form&amp;type=account">{{create an account}}</a></small></div>
<?php 
$f = new Form();
$f->action = "?action=authenticate";
$f->other_attrs = 'id="sign_in"';
$f->method = "POST";
$f->add_text(_t("Email"), "email", default_value("email"), _t("Enter your email"));
$f->add_password(_t("Password"), "clear_password", _t("Enter your password"));
$f->add_hidden("password", "");
$f->add_hidden("cnonce", "");
$f->add_submit(_t("Sign in"));
echo $f->html();
?>
<br/>
<br/>
<a href="?action=get_form&type=forgotten_password">{{Forgot your password?}}</a><br/>
		</td>
	</tr>
</table>
<script>
	var hash_salt = "<?php 
echo RANDOM_SALT;
?>
";
	var nonce = "<?php 
echo $g_display['nonce'];
Example #13
0
 public function action_rent()
 {
     if ($this->session->ouverte()) {
         if ($this->req->id) {
             $f = new Form("?module=loc&action=valide&idmod=" . $this->req->id, "form_rent");
             $f->add_dateAndTime("dateloc", "dateloc", "Date location");
             $f->add_dateAndTime("daterendu", "daterendu", "Date retour ");
             $f->add_hidden("id", "id")->set_value($this->req->id);
             $f->add_submit("valider", "valider")->set_value("Valider");
             $this->tpl->assign("f_rent", $f);
             $this->session->frent = $f;
             //echo var_dump($_SERVER['HTTP_USER_AGENT']);
         }
     } else {
         Site::redirect("Login");
     }
 }
<?php

$f = new Form();
$f->title = "{{Reset password}}";
$f->action = "?action=handle_reset_password";
$f->method = "POST";
$f->add_password(_t("New password"), "clear_password1", _t("Choose a new password"));
$f->add_password(_t("Retype new password"), "clear_password2", _t("Confirm the new password"));
$f->add_hidden("password1", "");
$f->add_hidden("password2", "");
$f->add_submit(_t("Reset password"));
echo $f->html();
?>
<script>
	var hash_salt = "<?php 
echo RANDOM_SALT;
?>
";
	$(document).ready(function() {
		eb_sync_hash('clear_password1', 'password1');
		eb_sync_hash('clear_password2', 'password2');
	});
	$("form").submit(function() {
		$('input[type=password]').attr('name', '');
	});
</script>
Example #15
0
<?php

if (session('id')) {
    return to_index();
}
$Base = new Base();
$Base->title("Forgotten Password");
$Base->type(CREATE);
$Base->header();
print "<div class=\"box clear\">\n";
print FORGOT_PASSWORD;
$Form = new Form();
$Form->ajax(false);
$Form->header(url(), "post", FORM_SALT);
$Form->fieldset_open("Reset Password");
$Form->add_text("email_signup", "Email Signup:");
$Form->fieldset_close();
$Form->add_submit("Send Reset Email");
$Form->footer();
$Form->header_validate();
$Form->add_notnull("email_signup", "Please enter an email address.");
$Form->footer_validate();
print "</div>";
$Base->footer();
Example #16
0
if ($theme['hover'] == "transparent") {
    $theme['hover'] = "none";
}
$Form->values(array_merge($theme, get('theme') ? array("theme" => get('theme')) : array()));
$Form->header(url(), "post", FORM_SALT);
$Form->fieldset_open("Theme Options");
$Form->add_text("font", "Font Family:", 250);
$Form->add_select("fontsize", "Font Size:", "Select Size", $fontsizes);
$Form->add_text("body", "Background #:", 50, 6, "/> <input type=\"radio\" id=\"type\" name=\"type\" value=\"body\" checked=\"true\"/>");
$Form->add_text("even", "Even #:", 50, 6, "/> <input type=\"radio\" id=\"type\" name=\"type\" value=\"even\"/>");
$Form->add_text("odd", "Odd #:", 50, 6, "/> <input type=\"radio\" id=\"type\" name=\"type\" value=\"odd\"/>");
$Form->add_text("me", "My Posts #:", 50, 6, "/> <input type=\"radio\" id=\"type\" name=\"type\" value=\"me\"/>");
$Form->add_text("hover", "Hover Bar #:<br/><span class=\"small\">(or 'none')</span>", 50, 6, "/> <input type=\"radio\" id=\"type\" name=\"type\" value=\"hover\"/>");
$Form->add_text("readbar", "Read Bars #:", 50, 6, "/> <input type=\"radio\" id=\"type\" name=\"type\" value=\"readbar\"/>");
$Form->fieldset_close();
$Form->add_submit("Save");
$Form->add_button("preview", "Preview", "preview_theme()");
$Form->labels(false);
$Form->fieldset_open("Preset Themes");
$DB->query("SELECT name as id,name FROM theme");
$Form->add_select("theme", "Themes:", "Select Theme", $DB->load_all_key());
$Form->add_button("preview", "Preview", "if(jQuery('#theme')[0].selectedIndex) location.href='/member/editcolors/&theme='+jQuery('#theme')[0][jQuery('#theme')[0].selectedIndex].value;");
$Form->fieldset_close();
$Form->footer();
?>
</div>
<div class="clear"><br/></div>
<div class="hr"><hr/></div><br/>
<?php 
$list = array();
$list[0][LIST_ID] = 0;
Example #17
0
$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() {
		$('input[type=clear_password]').attr('name', '');
		$('input[type=clear_password2]').attr('name', '');
	});
Example #18
0
$Form->fieldset_close();
$Form->fieldset_open("Optional Fields");
print "<li>will return in a bit</li>\n";
/*
$Form->add_text("member","By Member:");
$Form->labels(false);
print "<li>\n";
print "  <label>Date Range:</label>\n";
$Form->add_date("start",false);
$Form->add_date("end",false);
print "</li>\n";
$Form->labels(true);
$Form->add_select("quickdate","Quick Ranges:","Choose",array("thisweek"=>"This Week","thismonth"=>"This Month","lastweek"=>"Last Week","lastmonth"=>"Last Month"),"onchange=\"quickrange($(this).val())\">");
*/
$Form->fieldset_close();
$Form->add_submit("Search");
$Form->footer();
$Form->header_validate();
$Form->add_notnull("search", "Please enter a search term.");
$Form->add_notnull("_type", "Please choose what to search.");
$Form->footer_validate();
if (!isset($res)) {
    $Base->footer();
}
?>
<script type="text/javascript">
function quickrange(what)
{
  switch(what)
  {
Example #19
0
<?php

$Base = new Base();
$Base->type(CREATE);
$Base->title("Create New Thread");
$Base->header();
$Form = new Form();
$Form->header(url(), "post", FORM_SALT);
$Form->account_login();
$Form->fieldset_open("Thread Details");
$Form->add_text("subject", "Subject:", 400, 200);
$Form->add_textarea("body", "Body:");
$Form->fieldset_close();
$Form->add_submit(SAY_BUTTON, "class=\"nodisable\"/>");
$Form->add_button("preview", PREVIEW_BUTTON, "preview_post('{$Form->name}','thread',99999999);");
print "&nbsp;<sup><a href=\"javascript:;\" onclick=\"\$('#bbcode').slideToggle()\">[help]</a></sup>\n";
$Form->footer();
$Form->header_validate();
$Form->add_notnull("subject", "Please enter a subject.");
$Form->add_notnull("body", "Please enter a post body.");
$Form->footer_validate();
$Base->footer();
print BBCODE_GUIDE;
?>
<script type="text/javascript">
function completed(data)
{
  if(jQuery.trim(data) == "") window.location = '/';
  $('.submit').attr('disabled',false);
}
</script>
Example #20
0
$Form->fieldset_open("Details");
$DB->query("SELECT\r\n              p.display,\r\n              p.name as field,\r\n              pt.name as type,\r\n              p.width\r\n            FROM\r\n              pref p\r\n            LEFT JOIN\r\n              pref_type pt\r\n            ON\r\n              pt.id = p.pref_type_id\r\n            WHERE\r\n              p.editable IS true\r\n            ORDER BY\r\n              p.ordering");
while ($pref = $DB->load_array()) {
    switch ($pref['type']) {
        case "input":
            $Form->add_text($pref['field'], "{$pref['display']}:", $pref['width']);
            break;
        case "textarea":
            $Form->add_textarea($pref['field'], "{$pref['display']}:");
            break;
        case "checkbox":
            $Form->add_checkbox($pref['field'], "{$pref['display']}:");
            break;
    }
}
$Form->add_submit("Save Changes");
$Form->fieldset_close();
$Form->footer();
$Form->header_validate();
$Form->add_notnull("postalcode", "Please enter a postal code.");
$Form->footer_validate();
$Base->footer();
print "</div>";
?>
<script type="text/javascript">
function completed() { $('.submit').attr('disabled',false); }
function change_password()
{
  if($('#password').css('display') != "block")
  {
    $('#_change').val('Cancel');
Example #21
0
    $f->add_checkbox(_t("I want to know the name of my attendees"), "event_type_checkbox", $checked, "");
}
$f->add_raw_html(<<<EOF
<table id="tickets" class="evt_rate">
</table>
<a href="JavaScript:eb_add_rate('tickets');">{{Add another ticket rate}}</a><br/><br/>
EOF
);
if ($scenario == "create") {
    $f->add_checkbox(_t("I have read and agree to the <a href=\"info/terms\">Terms and Conditions</a>"), "confirm", "", _t("You have to check this to continue."));
}
$f->add_raw_html(<<<EOF
\t</div>
EOF
);
$f->add_submit($button_text);
$_SESSION["form"] = $f;
//echo $f->html();
?>

<form class="form" action="<?php 
echo $g_display["form_action"];
?>
" method="POST">
	<div class="evt_title"><p><?php 
echo $f->title;
?>
</p></div>
	<h1>{{Define your event}}</h1>
	<div class="form_section">
		<table width="700" style="margin: 0px auto;">