Ejemplo n.º 1
0
    $page1 = "page 1";
    $smarty->assign('page1', $page1);
    $id = $staff->printField('identifier');
    $smarty->assign('id', $id);
    $fname = $staff->printField('firstname');
    $smarty->assign('fname', $fname);
    $lname = $staff->printField('lastname');
    $smarty->assign('lname', $lname);
    $reg_date = $staff->printField('reg_date');
    $smarty->assign('reg_date', $reg_date);
    $username = $staff->printField('username');
    $smarty->assign('username', $username);
    $password = $staff->printField('password');
    $smarty->assign('password', $password);
    $pass_verify = $staff->printField('password', '', true);
    $smarty->assign('pass_verify', $pass_verify);
    $chg_pass = $staff->printField('change_password');
    $smarty->assign('chg_pass', $chg_pass);
    $acc_status = $staff->printField('account_status');
    $smarty->assign('acc_status', $acc_status);
    $end = $staff->multiPage("end");
    $smarty->assign('end', $end);
    $staffClose = $staff->closeForm();
    $smarty->assign('staffClose3', $staffClose);
} else {
    #submit msg
    $smarty->assign('updateMsg', $staff->submitMsg);
    #unset prevPath
    unset($_SESSION['prevPath']);
}
$content = $smarty->fetch("./user/user.reg_user.tpl.html");
if (!isset($_POST['submit']) || isset($_POST['submit']) && $newForm->submitForm() == -1) {
    $newForm->openForm();
}
if (!isset($_POST['submit'])) {
    $newForm->openForm();
}
//hide primary key field, force a few field types
$newForm->hideField("ID");
$newForm->forceTypes(array("foods", "day_of_week"), array("checkbox", "radio"));
//get data pairs from another table
$newForm->normalizedField("toon", "formitable_toons", "ID", "name", "pkey ASC");
#print_r($newForm->_getFieldData('toon')
//set custom field labels
$newForm->labelFields(array("f_name", "l_name", "description", "pets", "foods", "color", "day_of_week", "b_day", "toon"), array("First Name", "Last Name", "About Yourself", "Your Pets", "Favorite Foods", "Favorite Color", "Favorite Day", "Your Birthday", "Favorite Cartoon"));
$newForm->registerValidation("required", ".+", "Input is required.");
$newForm->validateField("f_name", "required");
$newForm->uniqueField("f_name", "fname is already registered.");
print_r($newForm->validate);
echo isset($newForm->validate[f_name]);
$newForm->printField("f_name");
$newForm->printField("l_name");
//output form
#$newForm->printForm();
#$newForm->printField('toon');
$newForm->closeForm();
#$newForm = @mysql_list_fields($DB, "formitable_demo", @mysql_connect("localhost",$user,$pass));
#print($newForm);
?>

</td></tr></table>
</body></html>
#set default values
#submit msg
$profile->msg_updateSuccess = "Your Profile was updated successfully.";
//set all output to be returned instead of printed
$profile->returnOutput = true;
//test for last page and no errors to submit form, otherwise start form
if (@$_POST['formitable_multipage'] != "end" || isset($profile->errMsg)) {
    $profileOpen = $profile->openForm();
    $smarty->assign('profileOpen', $profileOpen);
} else {
    $profile->submitForm(false);
}
//first page - test for no submit OR errors set with a field on the first page
if (!isset($_POST['submit']) || isset($profile->errMsg) && isset($_POST['firstname'])) {
    #print first page
    $page1 = "page 1";
    $smarty->assign('page1', $page1);
    $fname = $profile->printField('firstname');
    $smarty->assign('fname', $fname);
    $lname = $profile->printField('lastname');
    $smarty->assign('lname', $lname);
    $end = $profile->multiPage("end");
    $smarty->assign('end', $end);
    $profileClose = $profile->closeForm();
    $smarty->assign('profileClose2', $profileClose);
} else {
    $smarty->assign('updateMsg', $profile->submitMsg);
    #unset prevPath
    unset($_SESSION['prevPath']);
}
$content = $smarty->fetch("./user/user.upd_profile.tpl.html");
//set up fields for validation using regexs above
$sec->validateField("profile_id", "required");
#set default values
$sec->setDefaultValue('object', $objectpath);
$nmSQL = "SELECT profile FROM sionapros_profiles WHERE profile_id = {$_POST['profile_id']}";
$nm = $db->execute($nmSQL);
$sec->msg_insertSuccess = "The object {$objectpath} is now only accessible to users under the {$nm[0]['profile']} profile.";
//set all output to be returned instead of printed
$sec->returnOutput = true;
$smarty->assign('msg', $msg);
$smarty->assign('assignedTo', $assignedTo);
$smarty->assign('result', $result);
$smarty->assign('objectpath', $objectpath);
if (!isset($_POST['submit']) || isset($_POST['submit']) && $sec->submitForm(false) == -1) {
    $secOpen = $sec->openForm();
    $smarty->assign('secOpen', $secOpen);
    $objectId = $sec->printField('object');
    $smarty->assign('objectId', $objectId);
    $profile = $sec->printField('profile_id');
    $smarty->assign('profile', $profile);
    $secClose = $sec->closeForm();
    $smarty->assign('secClose', $secClose);
    //        $secForm = $sec->printForm();
    //        $smarty->assign('sec', $secForm);
} else {
    #submit msg
    $smarty->assign('updateMsg', $sec->submitMsg);
    #unset prevPath
    unset($_SESSION['prevPath']);
}
$content = $smarty->fetch("./security/tm0.security.add_object.tpl.html");