Ejemplo n.º 1
0
//$breadcrumbs["New Crumb"] => "http://url.com"
$breadcrumbs["Misc"] = "";
include "inc/ribbon.php";
?>

	<!-- MAIN CONTENT -->
	<div id="content">
		<section id="widget-grid" class="">
			
			<?php 
$ui = new SmartUI();
$ui->start_track();
$data = json_decode(file_get_contents(APP_URL . '/data/data.json'));
// SmartForm layout
$fields = array('fname' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'First name', 'icon' => 'fa-user', 'icon_append' => false)), 'lname' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'Last name', 'icon' => 'fa-user', 'icon_append' => false)), 'email' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'E-mail', 'icon' => 'fa-envelope', 'type' => 'email', 'icon_append' => false)), 'phone' => array('type' => 'input', 'col' => 6, 'properties' => array('placeholder' => 'Phone', 'icon' => 'fa-phone', 'type' => 'email', 'icon_append' => false)), 'country' => array('type' => 'select', 'col' => 5, 'properties' => array('data' => array(array('country' => 'Philippines'), array('country' => 'USA'), array('country' => 'Canada')))), 'city' => array('type' => 'input', 'col' => 4, 'properties' => array('placeholder' => 'City')), 'zip' => array('type' => 'input', 'col' => 3, 'properties' => array('placeholder' => 'Post Code')), 'address' => array('type' => 'input', 'properties' => 'Address'), 'other-info' => array('type' => 'textarea', 'properties' => 'Additional Info'), 'card' => array('type' => 'radio', 'properties' => array('items' => array(array('label' => 'Visa', 'checked' => true), 'MasterCard', 'American Express'), 'inline' => true)), 'name-on-card' => array('col' => 10, 'properties' => 'Name on card'), 'cvv' => array('col' => 2, 'properties' => 'CVV2'), 'card-label' => array('type' => 'label', 'col' => 4, 'properties' => 'Expiration Date'), 'card-month' => array('type' => 'select', 'col' => 5, 'properties' => array('data' => array(array('month' => 'January'), array('month' => 'February'), array('month' => '...')))), 'card-year' => array('col' => 3, 'properties' => 'Year'));
$form = $ui->create_smartform($fields);
$form->options('method', 'post');
$form->fieldset(0, array('fname', 'lname', 'email', 'phone'));
$form->fieldset(1, array('country', 'city', 'zip', 'address', 'other-info'));
$form->fieldset(2, array('card', 'name-on-card', 'cvv', 'card-label', 'card-month', 'card-year'));
$form->header('Automatic Layout Creation!');
$form->footer(function ($this) use($ui) {
    $btn = $ui->create_button('Submit', 'primary')->attr(array('type' => 'submit'));
    return $btn->print_html(true);
});
$form->title('<h2>Auto Layout</h2>');
$result = $form->print_html(true);
echo $result;
// individual print field
$body = '