Example #1
0
 protected function setup_form()
 {
     $form = new Petro_Form();
     $form->add_model('Model_Group');
     $form->add_form_action(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary')));
     $form->add_form_action(\Html::anchor('groups', 'Cancel', array('class' => 'btn')));
     return $form;
 }
Example #2
0
 protected function setup_form()
 {
     $form = new Petro_Form(array('class' => 'form-horizontal'));
     $form->add_model('Model_Client');
     $form->add_form_action(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary')));
     $form->add_form_action(\Html::anchor('clients', 'Cancel', array('class' => 'btn')));
     // $form->sequence(array('status', '<hr/>', 'name_en', 'name', 'code'));
     $this->sidebars->add('New Client!', '<form action="#">' . 'Edit Client: This is the demo sidebar section inspired ' . 'by the <a href="#">ActiveAdmin</a> package for ruby' . '</form>');
     return $form;
 }
Example #3
0
?>
</h3>
					<?php 
$belt_grade = Petro_Lookup::get_array('belt.grade');
echo Petro_Form::select('belt_grade', Input::post('belt_grade', isset($docmk) ? $docmk->belt_grade : ''), $belt_grade, array('id' => 'form1_belt_grade', 'class' => 'span2'), __('belt_grade'), $errors);
echo Petro_Form::input('belt_top_grade', Input::post('belt_top_grade', isset($docmk) ? $docmk->belt_top_grade : ''), array('id' => 'form1_belt_top_grade', 'class' => 'span2'), __('belt_top_grade'), $errors);
echo Petro_Form::input('belt_bot_grade', Input::post('belt_bot_grade', isset($docmk) ? $docmk->belt_bot_grade : ''), array('id' => 'form1_belt_bot_grade', 'class' => 'span2'), __('belt_bot_grade'), $errors);
?>
					<h3><?php 
echo __('belt_thick_head');
?>
</h3>
					<?php 
echo Petro_Form::input('belt_thick', Input::post('belt_thick', isset($docmk) ? $docmk->belt_thick : ''), array('id' => 'form1_belt_thick', 'class' => 'span2'), __('belt_thick'), $errors);
echo Petro_Form::input('belt_top_thick', Input::post('belt_top_thick', isset($docmk) ? $docmk->belt_top_thick : ''), array('id' => 'form1_belt_top_thick', 'class' => 'span2'), __('belt_top_thick'), $errors);
echo Petro_Form::input('belt_bot_thick', Input::post('belt_bot_thick', isset($docmk) ? $docmk->belt_bot_thick : ''), array('id' => 'form1_belt_bot_thick', 'class' => 'span2'), __('belt_bot_thick'), $errors);
?>
				</div>
			</div><!--/row-->
			<div class="row-fluid">
				<div class="span12">
					<div class="control-group form-inline<?php 
echo isset($errors['belt_length']) ? ' error' : '';
?>
">
						<label class="control-label">
							<?php 
echo __('belt_length');
echo Petro::render_errors($errors, 'belt_length');
?>
						</label>
Example #4
0
 protected function setup_form_change_password()
 {
     $form = new Petro_Form();
     $form->set_fields(array('old_password' => array('validation' => array('required'), 'form' => array('type' => 'password')), '<hr/>', 'new_password' => array('validation' => array('required', 'min_length' => array(6)), 'form' => array('type' => 'password')), 'confirm_password' => array('validation' => array('match_field' => array('new_password')), 'form' => array('type' => 'password'))));
     $form->add_form_action(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary')));
     $form->add_form_action(\Html::anchor('users', 'Cancel', array('class' => 'btn')));
     return $form;
 }
Example #5
0
<?php

$this_controller = Str::lower(Uri::segment(1));
$this_method = Str::lower(Uri::segment(2));
isset($edit_mode) or $edit_mode = false;
isset($errors) or $errors = array();
echo Form::open(array('class' => 'form-horizontal'));
?>
	<div class="row-fluid">
		<div class="well span8">
			<?php 
echo Petro_Form::input('first_name', Input::post('first_name', isset($user) ? $user->profile_fields['first_name'] : ''), array(), 'First Name', $errors);
echo Petro_Form::input('last_name', Input::post('last_name', isset($user) ? $user->profile_fields['last_name'] : ''), array(), 'Last Name', $errors);
echo Petro_Form::input('email', Input::post('email', isset($user) ? $user->email : ''), array(), 'Email', $errors);
echo '<hr/>';
echo Petro_Form::input('username', Input::post('username', isset($user) ? $user->username : ''), $edit_mode ? array('readonly' => 'readonly') : array(), 'Username', $errors);
if (!$edit_mode) {
    echo Petro_Form::password('password', Input::post('password', ''), array(), 'Password', $errors);
    echo Petro_Form::password('password2', Input::post('password2', ''), array(), 'Confirm Password', $errors);
}
echo '<hr/>';
$groups = Petro_Lookup::table('groups', 'level', 'name');
echo Petro_Form::select('group', Input::post('group', isset($user) ? $user->group : '1'), $groups, array(), 'Group', $errors);
echo Petro_Form::render_buttons(array(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary')), \Html::anchor('users', 'Cancel', array('class' => 'btn'))));
?>
		</div>
	</div><!--/row-->

<?php 
echo Form::close();
Example #6
0
echo Petro_Form::input('belt_price_net', Input::post('belt_price_net', isset($docmk) ? $docmk->belt_price_net : ''), array('id' => 'form1_belt_price_net'), __('belt_price_net'), $errors);
echo Petro_Form::input('belt_amount', Input::post('belt_amount', isset($docmk) ? $docmk->belt_amount : ''), array('id' => 'form1_belt_amount'), __('belt_amount'), $errors);
echo Petro_form::textarea('remark', Input::post('remark', isset($docmk) ? $docmk->remark : ''), array('id' => 'form1_remark', 'class' => 'span4'), __('remark'), $errors);
$status = Petro_Lookup::get('prd.status');
echo Petro_Form::select('status', Input::post('status', isset($docmk) ? $docmk->status : ''), $status, array('id' => 'form1_status'), __('status'), $errors);
?>
				</div>
				<div class="span5">
					<h3><?php 
echo __('belt_price_head');
?>
</h3>
				<?php 
echo Petro_Form::input('belt_price', Input::post('belt_price', isset($docmk) ? $docmk->belt_price : ''), array('id' => 'form1_belt_price', 'readonly' => 'readonly'), __('belt_price'), $errors);
echo Petro_Form::input('belt_disc1', Input::post('belt_disc1', isset($docmk) ? $docmk->belt_disc1 : ''), array('id' => 'form1_belt_disc1'), __('belt_disc1'), $errors);
echo Petro_Form::input('disc_price', Input::post('disc_price', isset($docmk) ? $docmk->belt_price : ''), array('id' => 'form1_disc_price', 'readonly' => 'readonly'), __('disc_price'), $errors);
?>
				</div>
			</div><!--/row-->
			<div class="form-actions">
				<button type="submit" class="btn btn-primary">Submit</button>
				<?php 
echo Html::anchor($this_controller, 'Cancel', array('class' => 'btn'));
?>
			</div>
		</div><!--/panel-content-->
	</div><!--/panel-->

<?php 
echo Form::close();
?>