Ejemplo n.º 1
0
function show_form($errors = '')
{
    global $products;
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    if ($errors) {
        print '<ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // Build up an array of defaults if there is an order saved
    // in the session
    if ($_SESSION['saved_order']) {
        $defaults = array();
        foreach ($products as $product => $description) {
            $defaults["dish_{$product}"] = $_SESSION["dish_{$product}"];
        }
    } else {
        $defaults = $_POST;
    }
    foreach ($products as $product => $description) {
        input_text("dish_{$product}", $defaults);
        print " {$description}<br/>";
    }
    input_submit('submit', 'Order');
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
Ejemplo n.º 2
0
function show_form($errors = '')
{
    // If the form is submitted, get defaults from submitted parameters
    if (array_key_exists('_submit_check', $_POST)) {
        $defaults = $_POST;
        var_dump($defaults);
    } else {
        // Otherwise, set our own defaults: price is $5
        $defaults = array('price' => '5.00', 'dish_name' => '', 'is_spicy' => 'no');
    }
    // If errors were passed in, put them in $error_text (with HTML markup)
    if (is_array($errors)) {
        $error_text = '<tr><td>You need to correct the following errors:';
        $error_text .= '</td><td><ul><li>';
        $error_text .= implode('</li><li>', $errors);
        $error_text .= '</li></ul></td></tr>';
    } else {
        // No errors? Then $error_text is blank
        $error_text = '';
    }
    // Jump out of PHP mode to make displaying all the HTML tags easier
    ?>
<form method="POST" action="<?php 
    print $_SERVER['PHP_SELF'];
    ?>
">
<table>
<?php 
    print $error_text;
    ?>

<tr><td>Dish Name:</td>
<td><?php 
    input_text('dish_name', $defaults);
    ?>
</td></tr>

<tr><td>Price:</td>
<td><?php 
    input_text('price', $defaults);
    ?>
</td></tr>

<tr><td>Spicy:</td>
<td><?php 
    input_radiocheck('checkbox', 'is_spicy', $defaults, 'yes');
    ?>
 Yes</td></tr>

<tr><td colspan="2" align="center"><?php 
    input_submit('save', 'Order');
    ?>
</td></tr>

</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>
<?php 
}
Ejemplo n.º 3
0
function show_form($errors = '')
{
    global $dish_names;
    // If the form is submitted, get defaults from submitted variables
    if ($_POST['_submit_check']) {
        $defaults = $_POST;
    } else {
        // Otherwise, no defaults
        $defaults = array();
    }
    // If errors were passed in, put them in $error_text (with HTML markup)
    if ($errors) {
        $error_text = '<tr><td>You need to correct the following errors:';
        $error_text .= '</td><td><ul><li>';
        $error_text .= implode('</li><li>', $errors);
        $error_text .= '</li></ul></td></tr>';
    } else {
        // No errors? Then $error_text is blank
        $error_text = '';
    }
    // Jump out of PHP mode to make displaying all the HTML tags easier
    ?>
<form method="POST" action="<?php 
    print $_SERVER['PHP_SELF'];
    ?>
">
<table>
<?php 
    print $error_text;
    ?>

<tr><td>Customer Name:</td>
<td><?php 
    input_text('customer_name', $defaults);
    ?>
</td></tr>

<tr><td>Phone Number:</td>
<td><?php 
    input_text('phone', $defaults);
    ?>
</td></tr>

<tr><td>Favorite Dish:</td>
<td><?php 
    input_select('favorite_dish_id', $defaults, $dish_names);
    ?>
</td></tr>

<tr><td colspan="2" align="center"><?php 
    input_submit('save', 'Add Customer');
    ?>
</td></tr>

</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>
<?php 
}
Ejemplo n.º 4
0
function show_form($errors = '')
{
    if ($errors) {
        print 'You need to correct the following errors: <ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // the beginning of the form
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    print '<table>';
    // the first address
    print '<tr><th colspan="2">From</th></tr>';
    print '<td>Name:</td><td>';
    input_text('name_1', $_POST);
    print '</td></tr>';
    print '<tr><td>Street Address:</td><td>';
    input_text('address_1', $_POST);
    print '</td></tr>';
    print '<tr><td>City, State, Zip:</td><td>';
    input_text('city_1', $_POST);
    print ', ';
    input_select('state_1', $_POST, $GLOBALS['us_states']);
    input_text('zip_1', $_POST);
    print '</td></tr>';
    // the second address
    print '<tr><th colspan="2">To</th></tr>';
    print '<td>Name:</td><td>';
    input_text('name_2', $_POST);
    print '</td></tr>';
    print '<tr><td>Street Address:</td><td>';
    input_text('address_2', $_POST);
    print '</td></tr>';
    print '<tr><td>City, State, Zip:</td><td>';
    input_text('city_2', $_POST);
    print ', ';
    input_select('state_2', $_POST, $GLOBALS['us_states']);
    input_text('zip_2', $_POST);
    print '</td></tr>';
    // Package Info
    print '<tr><th colspan="2">Package</th></tr>';
    print '<tr><td>Height:</td><td>';
    input_text('height', $_POST);
    print '</td></tr>';
    print '<tr><td>Width:</td><td>';
    input_text('width', $_POST);
    print '</td></tr>';
    print '<tr><td>Length:</td><td>';
    input_text('length', $_POST);
    print '</td></tr>';
    print '<tr><td>Weight:</td><td>';
    input_text('weight', $_POST);
    print '</td></tr>';
    // form end
    print '<tr><td colspan="2"><input type="submit" value="Ship Package"></td></tr>';
    print '</table>';
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
Ejemplo n.º 5
0
function show_form($errors = '')
{
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    if ($errors) {
        print '<ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    print 'Username: '******'username', $_POST);
    print '<br/>';
    print 'Password: '******'password', $_POST);
    print '<br/>';
    input_submit('submit', 'Log In');
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
Ejemplo n.º 6
0
function show_form($errors = '')
{
    if ($errors) {
        print 'You need to correct the following errors: <ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // the beginning of the form
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    print '<table>';
    // the search term
    print '<tr><td>Search Term:</td><td>';
    input_text('term', $_POST);
    print '</td></tr>';
    // form end
    print '<tr><td colspan="2"><input type="submit" value="Search News Feed"></td></tr>';
    print '</table>';
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
Ejemplo n.º 7
0
function show_form($errors = '')
{
    if ($errors) {
        print 'You need to correct the following errors: <ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // the beginning of the form
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    // the file name
    print ' File name: ';
    input_text('filename', $_POST);
    print '<br/>';
    // the submit button
    input_submit('submit', 'Show File');
    // the hidden _submit_check variable
    print '<input type="hidden" name="_submit_check" value="1"/>';
    // the end of the form
    print '</form>';
}
Ejemplo n.º 8
0
function show_form($errors = '')
{
    print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">';
    if ($errors) {
        print '<ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    // Since we're not supplying any defaults of our own, it's OK
    // to pass $_POST as the defaults array to input_select and
    // input_text so that any user-entered values are preserved
    print 'Dish: ';
    input_select('dish', $_POST, $GLOBALS['main_dishes']);
    print '<br/>';
    print 'Quantity: ';
    input_text('quantity', $_POST);
    print '<br/>';
    input_submit('submit', 'Order');
    print '<input type="hidden" name="_submit_check" value="1"/>';
    print '</form>';
}
Ejemplo n.º 9
0
                             <div class="portlet-body">
                                 
                                 <form id="form_editar" class="form-horizontal form-row-seperated" name="nuevo" action='procesa_datos_editar.php?tipo=<?php 
echo $_GET['tipo'];
?>
&id=<?php 
echo $_GET['id'];
?>
' method="post">
                                    
                                    <?php 
foreach ($inputs as $key => $value) {
    if ($key == 'pass') {
        echo input_password($value);
    } else {
        echo input_text($value);
    }
}
?>

                                    <div class="form-actions">
                                        <div class="row">
                                            <div class="col-lg-offset-10 col-lg-2 col-sm-offset-8 col-sm-4">
                                                <button type="submit" class="btn green button-submit"> <?php 
echo _('Guardar');
?>
 <i class="fa fa-arrow-circle-right"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                    
Ejemplo n.º 10
0
function insertCreateUserForm($w, $ds)
{
    list($userid, $userdescrip, $useremail, $grp) = myRegister("S:userid S:userdescrip S:useremail S:grp");
    insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
    insert($f, hidden(array("name" => "action", "value" => "parsecreateuserform")));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Create new user")));
    insert($con, textbr(my_("User-id (case sensitive!):")));
    insert($con, input_text(array("name" => "userid", "value" => "{$userid}", "size" => "20", "maxlength" => "40")));
    insert($con, textbrbr(my_("User's fullname:")));
    insert($con, input_text(array("name" => "userdescrip", "value" => "{$userdescrip}", "size" => "40", "maxlength" => "80")));
    insert($con, textbrbr(my_("User's e-mail:")));
    insert($con, input_text(array("name" => "useremail", "value" => "{$useremail}", "size" => "40", "maxlength" => "64")));
    if (AUTH_INTERNAL) {
        insert($con, textbrbr(my_("Password (case sensitive!):")));
        insert($con, password(array("name" => "password1", "size" => "20", "maxlength" => "40")));
        insert($con, textbrbr(my_("Password (again):")));
        insert($con, password(array("name" => "password2", "size" => "20", "maxlength" => "40")));
    }
    $result2 = $ds->GetGrps();
    $lst = array("" => "No group");
    while ($row = $result2->FetchRow()) {
        $col = $row["grp"];
        $lst["{$col}"] = $row["grp"] . " - " . $row["grpdescrip"];
    }
    insert($con, textbrbr(my_("Group")));
    insert($con, selectbox($lst, array("name" => "grp"), $grp));
    insert($f, generic("br"));
    insert($f, submit(array("value" => my_("Create User"))));
    insert($f, freset(array("value" => my_("Clear"))));
}
Ejemplo n.º 11
0
insert($w, block("</h3>"));
// start form
insert($w, $f = form(array("name" => "MODIFY", "method" => "post", "action" => "displaysubnet.php")));
myFocus($p, "MODIFY", "user");
insert($f, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("User information")));
insert($con, textbr(my_("User")));
insert($con, input_text(array("name" => "user", "size" => "80", "maxlength" => "80")));
insert($con, block(" <a href='#' onclick='MODIFY.user.value=\"" . DHCPRESERVED . "\";'>" . my_("DHCP address") . "</a>"));
insert($con, textbrbr(my_("Location")));
insert($con, input_text(array("name" => "location", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Device description")));
insert($con, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Telephone number")));
insert($con, input_text(array("name" => "telno", "size" => "15", "maxlength" => "15")));
insert($con, hidden(array("name" => "baseindex", "value" => $baseindex)));
insert($con, hidden(array("name" => "block", "value" => $block)));
insert($con, hidden(array("name" => "search", "value" => $search)));
insert($con, hidden(array("name" => "expr", "value" => "{$expr}")));
$cnt = 0;
foreach ($ip as $value) {
    insert($con, hidden(array("name" => "ip[" . $cnt++ . "]", "value" => "{$value}")));
}
insert($con, hidden(array("name" => "md5str", "value" => "{$md5str}")));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
// start form for delete
// all info will be blank, thus record will be deleted
$settings = array("name" => "DELETE", "method" => "post", "action" => "displaysubnet.php");
if ($ipplanParanoid) {
Ejemplo n.º 12
0
insert($w, $f1 = form(array("name" => "THISFORM", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
// ugly kludge with global variable!
$displayall = TRUE;
$cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
$areaindex = myAreaDropDown($ds, $f1, $cust, $areaindex);
insert($w, $f2 = form(array("name" => "ENTRY", "method" => "get", "action" => "findfree.php")));
// save customer name for actual post of data
insert($f2, hidden(array("name" => "cust", "value" => "{$cust}")));
myRangeDropDown($ds, $f2, $cust, $areaindex);
insert($f2, block("<p>"));
insert($f2, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Search criteria")));
insert($con, textbr(my_("IP range start (leave blank if range selected)")));
insert($con, input_text(array("name" => "start", "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("IP range end (leave blank if range selected)")));
insert($con, input_text(array("name" => "end", "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("Display only subnets between these sizes")));
insert($con, span(my_("Minimum"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "size_from", "size" => "5", "maxlength" => "6")));
insert($con, span(my_("Maximum"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "size_to", "size" => "5", "maxlength" => "6")));
insert($con, textbrbr(my_("Show filter")));
insert($con, radio(array("name" => "showused", "value" => "0"), my_("Free and Unassigned")));
insert($con, radio(array("name" => "showused", "value" => "2"), my_("Unassigned only")));
insert($con, radio(array("name" => "showused", "value" => "1"), my_("All"), "checked"));
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
myCopyPaste($f2, "ipplanCPfindfreeform", "ENTRY");
printhtml($p);
Ejemplo n.º 13
0
 function DisplayTemplate(&$layout)
 {
     //echo "<pre>";var_dump($this->userfld);echo "</pre>";
     foreach ($this->userfld as $field => $val) {
         insert($layout, textbr());
         insert($layout, text($this->userfld["{$field}"]["descrip"]));
         insert($layout, textbr());
         // "name" definition looks strange, but associative arrays
         // in html must not have quotes, something like
         // userfld[fieldname] which will be correctly converted by php
         if ($this->userfld["{$field}"]["type"] == "C") {
             insert($layout, input_text(array("name" => "userfld[{$field}]", "value" => isset($this->userfld["{$field}"]["value"]) ? $this->userfld["{$field}"]["value"] : $this->userfld["{$field}"]["default"], "size" => $this->userfld["{$field}"]["size"], "maxlength" => $this->userfld["{$field}"]["maxlength"])));
         } elseif ($this->userfld["{$field}"]["type"] == "T") {
             insert($layout, textarea(array("name" => "userfld[{$field}]", "cols" => $this->userfld["{$field}"]["size"], "rows" => $this->userfld["{$field}"]["rows"], "maxlength" => $this->userfld["{$field}"]["maxlength"]), isset($this->userfld["{$field}"]["value"]) ? $this->userfld["{$field}"]["value"] : $this->userfld["{$field}"]["default"]));
         } elseif ($this->userfld["{$field}"]["type"] == "S") {
             insert($layout, selectbox($this->userfld["{$field}"]["select"], array("name" => "userfld[{$field}]"), isset($this->userfld["{$field}"]["value"]) ? $this->userfld["{$field}"]["value"] : $this->userfld["{$field}"]["default"]));
         }
         /*
         elseif ($this->userfld["$field"]["type"] == "B") {
             insert($layout,checkbox(array("name"=>"userfld[$field]",
                             "value"=>isset($this->userfld["$field"]["value"]) ? $this->userfld["$field"]["value"] : $this->userfld["$field"]["default"]), "Text"));
         
         }
         */
     }
 }
Ejemplo n.º 14
0
echo "<br/>";
echo input_text(["id" => "'apellido_paterno'"], ["class" => "'label'"], "Apellido Paterno:");
echo input_text(["id" => "'apellido_materno'"], ["class" => "'label'"], "Apellido Materno:");
echo "<br/>";
echo "<div class='label' id='fech'>Fecha Nacimiento:</div>";
echo "<label id='d'>Día:</label>";
echo "<input type='text' class='fecha' id='dia'>";
echo "<label id='m'>Mes:</label>";
echo "<input type='text' class='fecha' id='mes'> ";
echo "<label id='a'>Año:</label>";
echo "<input type='text' class='fecha' id='año'>";
echo "<label id='ed'>Edad:</label>";
echo "<input type='text' id='edad'>";
echo "<br/>";
echo input_text(["id" => "'telefono'"], ["class" => "'label'"], "Teléfono:");
echo input_text(["id" => "'mail'"], ["class" => "'label'"], "Mail:");
echo "<br/>";
$result = DbExecuteQuerys("Select id_prevision,nombre From prevision;");
echo "<div class='label'>Prevision:</div>";
echo "<select id='prevision'>";
echo "<option value='0'>-----------</option>";
while ($datos = mysqli_fetch_array($result)) {
    $valor_id = $datos['id_prevision'];
    $valor = $datos['nombre'];
    echo "<option value='{$valor_id}'>" . $valor . "</option>";
}
echo "</select>";
echo "<div class='label'>Estado Civil:</div>";
echo "<select id='estado_civil'>";
echo "<option value='0'>-----------</option>";
echo "<option value='casada'>CASADA</option>";
Ejemplo n.º 15
0
<?php

include '../general.php';
include_once 'ChromePhp.php';
//ChromePhp::Log("<a href='".RAIZ_HTML."/roles/anonimo/crear_ficha'>Crea Cuenta</a>");
echo "<div id='contenedor-centrado'>";
echo "<div class='titulo-contenedor'>Ingreso Usuario</div>";
echo input_text(["id" => "'usuario'"], ["class" => "'label'"], "RUT:");
echo "<br/>";
echo "<div class='label'>Contraseña:</div>";
echo "<input type='password' id='contraseña'>";
echo "<br/>";
//separador
echo "<div class='separador'></div>";
echo "<input type='button' id='ingreso' value='Ingresar'> ";
echo "</div>";
echo "</div>";
Ejemplo n.º 16
0
        } else {
            $ds->DbfTransactionRollback();
            $formerror .= my_("Area could not be created/modified - probably a duplicate name") . "\n";
        }
    }
}
myError($w, $p, $formerror, FALSE);
// display opening text
insert($w, heading(3, "{$title}."));
if ($action != "modify") {
    insert($w, textbrbr(my_("Create a new network area by entering a unique identifier address for the area. The identifier has the same format as IP addresses, but has no relation to existing IP address records. Areas usually define geographic or administrative boundaries. Areas can also contain multiple ranges of address space, as in many cases the address space is not contiguous - there may be a mix of private or public address space used.")));
}
// start form
insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
if ($action == "modify") {
    insert($f, hidden(array("name" => "cust", "value" => "{$cust}")));
    insert($f, hidden(array("name" => "action", "value" => "modify")));
    insert($f, hidden(array("name" => "areaindex", "value" => $areaindex)));
} else {
    // ugly kludge with global variable!
    $displayall = TRUE;
    $cust = myCustomerDropDown($ds, $f, $cust, $grps, FALSE) or myError($w, $p, my_("No customers"));
}
insert($f, textbrbr(my_("Area address")));
insert($f, input_text(array("name" => "ipaddr", "value" => "{$ipaddr}", "size" => "15", "maxlength" => "15")));
insert($f, textbrbr(my_("Description")));
insert($f, input_text(array("name" => "descrip", "value" => "{$descrip}", "size" => "80", "maxlength" => "80")));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
Ejemplo n.º 17
0
function input_date($name, $value = '', $opt = array())
{
    $opt['append'] = isset($opt['append']) ? $opt['append'] : icon('calendar');
    $opt['class'] = 'date';
    $opt['data-date-format'] = 'mm/dd/yy';
    return input_text($name, $value, $opt);
}
            <input type="hidden" name="type" value="document" />
            <input type="hidden" name="content_dispo" value="<?php 
        echo isset($content['content_dispo']) ? $content['content_dispo'] : '0';
        ?>
" />
<?php 
    } else {
        // non-admin managers creating or editing a reference (weblink) resource
        ?>
            <input type="hidden" name="type" value="reference" />
            <input type="hidden" name="contentType" value="text/html" />
<?php 
    }
}
//if mgrRole
$body = input_text('link_attributes', to_safestr($content['link_attributes']));
$body .= tooltip($_lang['link_attributes_help']);
renderTr($_lang['link_attributes'], $body);
?>

			<tr style="height: 24px;">
				<td width="150"><span class="warning"><?php 
echo $_lang['resource_opt_folder'];
?>
</span></td>
				<td>
<?php 
$cond = $content['isfolder'] == 1 || $_REQUEST['a'] == '85';
echo input_checkbox('isfolder', $cond);
echo input_hidden('isfolder', $cond);
echo tooltip($_lang['resource_opt_folder_help']);
Ejemplo n.º 19
0
	/**
	 * edit a timestamp
	 *
	 * @param string  $colname
	 * @param mixed   $default
	 * @param integer $id
	 * @param boolean $disabled
	 * @param array   $column
	 */
	public function dbtableadmin_edit_timestamp($colname, $default, /** @noinspection PhpUnusedParameterInspection */ $id, $disabled, array $column) {
		if ($default) {
			// adjust time format if it is a valid time
			$time = strtotime($default);
			if ($time) $default = date(DATETIMEYEAR_FORMAT, $time);
		}
		$attributes = array('size="30"');
		if (!empty($column['required'])) {
			$attributes[] = 'required';
		}
		input_text($colname, $default, $disabled, join(" ", $attributes));
		?> <?=sprintf(_("date and time, format e.g. %s"), date(DATETIMEYEAR_FORMAT, 2117003400));
	}
Ejemplo n.º 20
0
function select_date2($name, $date)
{
    if ($date == null) {
        $date = '0000-00-00';
    }
    $dates = explode('-', $date);
    if (DATE_FORMAT == 'mm-dd-yyyy') {
        return select_month($name, '2', $dates[1]) . select_day($name, '3', $dates[2]) . ' ' . input_text($name . '_1', $dates[0], 1);
    } else {
        if (DATE_FORMAT == 'dd-mm-yyyy') {
            return select_day($name, '3', $dates[2]) . select_month($name, '2', $dates[1]) . ' ' . input_text($name . '_1', $dates[0], 1);
        } else {
            return input_text($name . '_1', $dates[0], 1) . ' ' . select_month($name, '2', $dates[1]) . select_day($name, '3', $dates[2]);
        }
    }
}
Ejemplo n.º 21
0
 function Search()
 {
     unset($this->vars[$this->frmvar]);
     unset($this->vars["block"]);
     unset($this->vars["expr"]);
     //    $url=my_http_build_query($vars);
     // start form
     insert($this->w, $f = form(array("name" => "SEARCH", "method" => $this->method, "action" => $_SERVER["PHP_SELF"])));
     insert($f, $con = container("fieldset", array("class" => "fieldset")));
     insert($con, $legend = container("legend", array("class" => "legend")));
     insert($legend, text($this->legend));
     if ($this->expr_disp) {
         $lst = array("START" => my_("Starts with"), "END" => my_("Ends with"), "LIKE" => my_("Contains"), "NLIKE" => my_("Does not contain"), "EXACT" => my_("Equal to"));
         if (DBF_TYPE == "mysql" or DBF_TYPE == "maxsql" or DBF_TYPE == "postgres7") {
             $lst["RLIKE"] = my_("Regex contains");
         }
         // only supported by mysql
         if (DBF_TYPE == "mysql" or DBF_TYPE == "maxsql") {
             $lst["NRLIKE"] = my_("Does not regex contain");
         }
         insert($con, selectbox($lst, array("name" => "expr"), $this->expr));
     }
     insert($con, input_text(array("name" => $this->frmvar, "value" => $this->search, "size" => "20", "maxlength" => "80")));
     foreach ($this->vars as $key => $value) {
         insert($con, hidden(array("name" => "{$key}", "value" => "{$value}")));
     }
     insert($con, submit(array("value" => my_("Submit"))));
     insert($con, block(" <a href='#' onclick='SEARCH." . $this->frmvar . ".value=\"\"; SEARCH.submit();'>" . my_("Reset Search") . "</a>"));
 }
Ejemplo n.º 22
0
insert($con, textbrbr(my_("Expire")));
insert($con, input_text(array("name" => "expire", "value" => "{$expire}", "size" => "5", "maxlength" => "10")));
insert($con, textbrbr(my_("Minimum TTL")));
insert($con, input_text(array("name" => "minimum", "value" => "{$minimum}", "size" => "5", "maxlength" => "10")));
$dbfinfo = $ds->ds->GetOne("SELECT info FROM fwdzoneadd \n                          WHERE customer={$cust} AND data_id={$dataid}");
// use base template (for additional subnet information)
$template = new IPplanIPTemplate("fwdzonetemplate", $cust);
if ($template->is_error() == FALSE) {
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Additional information")));
    $template->Merge($template->decode($dbfinfo));
    $template->DisplayTemplate($con);
}
insert($f, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Forward zone location")));
insert($con, textbr(my_("Zone File Path")));
insert($con, span(my_("The path where the zone file will be written once exported and processed. Examples:"), array("class" => "textSmall")));
insert($con, span(my_("ftp://myhost.com/var/named/test.zone - if you want to transfer the zone using ncftput"), array("class" => "textSmall")));
insert($con, span(my_("user@myhost.com:/var/named/test.zone - if you want to transfer the zone using scp"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "zonepath", "value" => "{$zonepath}", "size" => "80", "maxlength" => "254")));
insert($con, textbrbr(my_("Secondary Zone File Path")));
insert($con, input_text(array("name" => "seczonepath", "value" => "{$seczonepath}", "size" => "80", "maxlength" => "254")));
insert($f, submit(array("value" => my_("Save"))));
insert($f, freset(array("value" => my_("Clear"))));
myCopyPaste($f, "ipplanCPdnsrecord", "ENTRY");
// create the export view form
$export->setInfo(array(array("customer_ID", "customer_description", "data_ID", "domain", "email", "serialdate", "serialnum", "ttl", "retry", "refresh", "expire", "minimum_ttl", "slave_zone", "zone_path", "second_zone_path"), array($cust, $ds->getCustomerDescrip($cust), $dataid, $domain, $responsiblemail, $serialdate, $serialnum, $ttl, $retry, $refresh, $expire, $minimum, $slaveonly, $zonepath, $seczonepath)));
$export->createExportForm($w, $template);
printhtml($p);
Ejemplo n.º 23
0
// set language
isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']);
//setdefault("window",array("bgcolor"=>"white"));
//setdefault("table",array("cellpadding"=>"0"));
//setdefault("text",array("size"=>"2"));
$title = my_("Display subnet information obtained from a routing table");
newhtml($p);
$w = myheading($p, $title, true);
// explicitly cast variables as security measure against SQL injection
list($cust) = myRegister("I:cust");
// display opening text
insert($w, heading(3, "{$title}."));
insert($w, text(my_("Display subnet information obtained from a routing table will show the routing table information on the left of the screen and the corresponding entries in the database on the right. If there are entries on both sides of the table, the subnet exists in the routing table and the database. If there are only entries on the left, the subnet only exists in the routing table. The same is true for the right hand side. If you click on the left, you can add the subnet to the database. If you click on the right, you can view the existing database information.")));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f = form(array("method" => "post", "action" => "displayrouter.php")));
$cust = myCustomerDropDown($ds, $f, $cust, $grps, FALSE) or myError($w, $p, my_("No customers"));
insert($f, textbrbr(my_("IP address of device to query")));
insert($f, span(my_("The device must be SNMP capable"), array("class" => "textSmall")));
insert($f, input_text(array("name" => "ipaddr", "size" => "15", "maxlength" => "15")));
insert($f, textbrbr(my_("Community string")));
$community = SNMP_COMMUNITY == "" ? "public" : SNMP_COMMUNITY;
insert($f, password(array("name" => "community", "value" => $community, "size" => "20", "maxlength" => "20")));
insert($f, textbrbr(my_("Router type")));
insert($f, span(my_("Type 'Generic' will work for most routers"), array("class" => "textSmall")));
$lst = array("generic" => my_("Generic"), "riverstone" => "RiverStone", "juniper" => "Juniper");
insert($f, selectbox($lst, array("name" => "rtrtype")));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
Ejemplo n.º 24
0
                <div class="col-lg-12 text-center">
                    <h2 class="section-heading">Contato</h2>
                    <!--<h3 class="section-subheading text-muted">Lorem ipsum dolor sit amet consectetur.</h3>-->
                </div>
            </div>
            
            
            <div class="row">
                <div class="col-lg-12">
                    <form name="sentMessage" id="contactForm" novalidate>
                        <div class="row">
                            <div class="col-md-6">
                               <?php 
echo input_text($nome_campo = 'nome', $label = "Nome");
echo input_text($nome_campo = 'email', $label = "E-mail");
echo input_text($nome_campo = 'telefone', $label = "felefone");
?>
                                
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <textarea class="form-control" placeholder="Mensagem"  name="mensagem" ></textarea>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="col-lg-12 text-center">
                                <div id="success"></div>
                                <button type="submit" class="btn btn-xl">Enviar Mensagem</button>
                            </div>
                            
                        </div>
Ejemplo n.º 25
0
function show_form($errors = '')
{
    // If the form is submitted, get defaults from submitted parameters
    if (array_key_exists('_submit_check', $_POST)) {
        $defaults = $_POST;
    } else {
        // Otherwise, set our own defaults: medium size and yes to delivery
        $defaults = array('name' => '', 'sweet' => 'puff', 'main_dish' => array('cuke'), 'comments' => '', 'delivery' => 'yes', 'size' => 'medium');
    }
    // If errors were passed in, put them in $error_text (with HTML markup)
    if ($errors) {
        $error_text = '<tr><td>You need to correct the following errors:';
        $error_text .= '</td><td><ul><li>';
        $error_text .= implode('</li><li>', $errors);
        $error_text .= '</li></ul></td></tr>';
    } else {
        // No errors? Then $error_text is blank
        $error_text = '';
    }
    // Jump out of PHP mode to make displaying all the HTML tags easier
    ?>
<form method="POST" action="<?php 
    print $_SERVER['SCRIPT_NAME'];
    ?>
">
<table>
<?php 
    print $error_text;
    ?>

<tr><td>Your Name:</td>
<td><?php 
    input_text('name', $defaults);
    ?>
</td></tr>

<tr><td>Size:</td>
<td><?php 
    input_radiocheck('radio', 'size', $defaults, 'small');
    ?>
 Small <br/>
<?php 
    input_radiocheck('radio', 'size', $defaults, 'medium');
    ?>
 Medium <br/>
<?php 
    input_radiocheck('radio', 'size', $defaults, 'large');
    ?>
 Large
</td></tr>

<tr><td>Pick one sweet item:</td>
<td><?php 
    input_select('sweet', $defaults, $GLOBALS['sweets']);
    ?>
</td></tr>

<tr><td>Pick two main dishes:</td>
<td>
<?php 
    input_select('main_dish', $defaults, $GLOBALS['main_dishes'], true);
    ?>
</td></tr>

<tr><td>Do you want your order delivered?</td>
<td><?php 
    input_radiocheck('checkbox', 'delivery', $defaults, 'yes');
    ?>
 Yes
</td></tr>

<tr><td>Enter any special instructions.<br/>
If you want your order delivered, put your address here:</td>
<td><?php 
    input_textarea('comments', $defaults);
    ?>
</td></tr>

<tr><td colspan="2" align="center"><?php 
    input_submit('save', 'Order');
    ?>
</td></tr>

</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>
<?php 
}
Ejemplo n.º 26
0
		<td width="49%">' . input_text('waktu_mulai', $get['waktu_mulai'], 'text', 15) . ' ' . $wktmulai . '</td>
	</tr>
	<tr>
		<td width="20%">Waktu Akhir</td>
		<td width="1%">:</td>
		<td width="49%">' . input_text('waktu_akhir', $get['waktu_akhir'], 'text', 15) . ' ' . $wktakhir . '</td>
	</tr>
	<tr>
		<td width="20%">Background Color</td>
		<td width="1%">:</td>
		<td width="49%">' . input_text('background', $get['background'], 'text', 15, 'onblur="return ubahbackground(\'ubahwarna\',this);"') . ' <span id="ubahwarna" style="background:' . $get['background'] . '">&nbsp;&nbsp;<span id="tulisanwarna" style="color:' . $get['color'] . '">16</span>&nbsp;&nbsp;</span></td>
	</tr>
	<tr>
		<td width="20%">Color</td>
		<td width="1%">:</td>
		<td width="49%">' . input_text('color', $get['color'], 'text', 15, 'onblur="return ubahcolor(\'tulisanwarna\',this);"') . '</td>
	</tr>
	<tr>
		<td width="20%">Isi</td>
		<td width="1%">:</td>
		<td width="49%">' . input_textarea('isi', $get['isi'], $rows = 5, $cols = 40, $opt = '') . '</td>
	</tr>
	<tr>
		<td width="20%">&nbsp;</td>
		<td width="1%">&nbsp;</td>
		<td width="49%"><input type="submit" name="submit" value="Edit" class="submit" /></td>
	</tr>';
        $content .= '</table></form>';
        $content .= '</div>';
        break;
    case 'delete':
Ejemplo n.º 27
0
// display opening text
insert($w, heading(3, "{$title}."));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f1 = form(array("name" => "THISFORM", "method" => "post", "action" => $_SERVER["PHP_SELF"])));
$cust = myCustomerDropDown($ds, $f1, $cust, $grps) or myError($w, $p, my_("No customers"));
$areaindex = myAreaDropDown($ds, $f1, $cust, $areaindex);
insert($w, $f2 = form(array("name" => "ENTRY", "method" => "get", "action" => "modifybase.php")));
// save customer name for actual post of data
insert($f2, hidden(array("name" => "cust", "value" => "{$cust}")));
insert($f2, hidden(array("name" => "areaindex", "value" => "{$areaindex}")));
myRangeDropDown($ds, $f2, $cust, $areaindex);
insert($f2, block("<p>"));
insert($f2, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("Search criteria")));
myFocus($p, "ENTRY", "ipaddr");
insert($con, textbr(my_("Subnet address (leave blank if range selected)")));
insert($con, span(my_("Partial subnet addresses can be used eg. 172.20"), array("class" => "textSmall")));
insert($con, input_text(array("name" => "ipaddr", "size" => "15", "maxlength" => "15")));
if (DBF_TYPE == "mysql" or DBF_TYPE == "maxsql" or DBF_TYPE == "postgres7") {
    insert($con, textbrbr(my_("Description (only display networks matching the regular expression)")));
} else {
    insert($con, textbrbr(my_("Description (only display networks containing)")));
}
insert($con, input_text(array("name" => "descrip", "size" => "80", "maxlength" => "80")));
insert($con, generic("br"));
insert($f2, submit(array("value" => my_("Submit"))));
insert($f2, freset(array("value" => my_("Clear"))));
myCopyPaste($f2, "ipplanCPmodbaseform", "ENTRY");
printhtml($p);
Ejemplo n.º 28
0
insert($f, input_text(array("name" => "request", "value" => $request, "size" => "80", "maxlength" => "80")));
insert($f, $con = container("fieldset", array("class" => "fieldset")));
insert($con, $legend = container("legend", array("class" => "legend")));
insert($legend, text(my_("User information")));
insert($con, textbr(my_("User")));
insert($con, input_text(array("name" => "user", "value" => $user, "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Location")));
insert($con, input_text(array("name" => "location", "value" => $location, "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Device description")));
insert($con, input_text(array("name" => "descrip", "value" => $descrip, "size" => "80", "maxlength" => "80")));
insert($con, textbrbr(my_("Device hostname")));
insert($con, input_text(array("name" => "hname", "value" => $hname, "size" => "80", "maxlength" => "100")));
insert($con, textbrbr(my_("Telephone number")));
insert($con, input_text(array("name" => "telno", "value" => $telno, "size" => "15", "maxlength" => "15")));
insert($con, textbrbr(my_("MAC address")));
insert($con, input_text(array("name" => "macaddr", "value" => $macaddr, "size" => "17", "maxlength" => "17")));
$template = new IPplanIPTemplate("iptemplate", $cust);
if ($template->is_error() == FALSE) {
    //insert($f,block("<hr>"));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text(my_("Additional information")));
    //insert($f,textbr(my_("Additional information"), array("b"=>1)));
    if (isset($userfld)) {
        $template->Merge($userfld);
    }
    $template->DisplayTemplate($con);
}
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
Ejemplo n.º 29
0
 public function encode($passwd)
 {
     return md5(input_text($passwd));
 }
Ejemplo n.º 30
0
function show_form($errors = '')
{
    // If the form is submitted, get defaults from submitted parameters
    if (array_key_exists('_submit_check', $_POST)) {
        $defaults = $_POST;
    } else {
        // Otherwise, set our own defaults
        $defaults = array('min_price' => '5.00', 'max_price' => '25.00', 'dish_name' => '');
    }
    // If errors were passed in, put them in $error_text (with HTML markup)
    if (is_array($errors)) {
        $error_text = '<tr><td>You need to correct the following errors:';
        $error_text .= '</td><td><ul><li>';
        $error_text .= implode('</li><li>', $errors);
        $error_text .= '</li></ul></td></tr>';
    } else {
        // No errors? Then $error_text is blank
        $error_text = '';
    }
    // Jump out of PHP mode to make displaying all the HTML tags easier
    ?>
<form method="POST" action="<?php 
    print $_SERVER['SCRIPT_NAME'];
    ?>
">
<table>
<?php 
    print $error_text;
    ?>

<tr><td>Dish Name:</td>
<td><?php 
    input_text('dish_name', $defaults);
    ?>
</td></tr>

<tr><td>Minimum Price:</td>
<td><?php 
    input_text('min_price', $defaults);
    ?>
</td></tr>

<tr><td>Maximum Price:</td>
<td><?php 
    input_text('max_price', $defaults);
    ?>
</td></tr>

<tr><td>Spicy:</td>
<td><?php 
    input_select('is_spicy', $defaults, $GLOBALS['spicy_choices']);
    ?>
</td></tr>

<tr><td colspan="2" align="center"><?php 
    input_submit('search', 'Search');
    ?>
</td></tr>

</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>
<?php 
}