Skip to content

Instantly share code, notes, and snippets.

@eduardoromero
Created January 25, 2013 04:00
Show Gist options
  • Save eduardoromero/4631631 to your computer and use it in GitHub Desktop.
Save eduardoromero/4631631 to your computer and use it in GitHub Desktop.
Foundation Form Sample
<?php
$formas_pago = array(
0 => 'No identificado',
1 => 'Transferencia',
2 => 'Cheque',
3 => 'Efectivo',
4 => 'Tarjeta',
);
?>
<script type="text/javascript">
<!--
jQuery(document).ready(function() {
/* pretty forms */
});
//-->
</script>
<div class="clientes form ten columns">
<?php echo $this->Form->create('Cliente', array('id' => 'empresa-add', 'class' => 'custom', 'inputDefaults' => array('div' => false, 'label' => false, 'class' => '', 'error' => array('wrap' => 'small', 'class' => '')))); ?>
<fieldset>
<legend><?php __('Add Cliente'); ?></legend>
<div class="row">
<?php $input_error = $this->Form->isFieldError('nombre') ? 'error': ''; ?>
<div class="eight columns <?php echo $input_error ?>">
<?php echo $this->Form->input('nombre', array('type' => 'text', 'placeholder' => 'Nombre del Cliente', 'class' => '')); ?>
</div>
</div>
<div class="row">
<?php $input_error = $this->Form->isFieldError('rfc') ? 'error': ''; ?>
<div class="five columns <?php echo $input_error ?>">
<?php echo $this->Form->input('rfc', array('type' => 'text', 'placeholder' => 'RFC', 'class' => '')); ?>
</div>
</div>
<div class="row">
<?php $input_error = $this->Form->isFieldError('direccion') ? 'error': ''; ?>
<div class="twelve columns <?php echo $input_error ?>">
<?php echo $this->Form->input('direccion', array('type' => 'textarea', 'placeholder' => 'Domicilio', 'class' => '')); ?>
</div>
</div>
<div class="row">
<?php $input_error = $this->Form->isFieldError('telefono') ? 'error': ''; ?>
<div class="six columns <?php echo $input_error ?>">
<?php echo $this->Form->input('telefono', array('type' => 'text', 'placeholder' => 'Teléfono', 'class' => '')); ?>
</div>
<?php $input_error = $this->Form->isFieldError('contacto') ? 'error': ''; ?>
<div class="six columns <?php echo $input_error ?>">
<?php echo $this->Form->input('estado', array('contacto' => 'text', 'placeholder' => 'Contacto', 'class' => '')); ?>
</div>
</div>
<div class="row">
<?php $input_error = $this->Form->isFieldError('ciudad') ? 'error': ''; ?>
<div class="four columns <?php echo $input_error ?>">
<?php echo $this->Form->input('ciudad', array('type' => 'text', 'placeholder' => 'Ciudad', 'class' => '')); ?>
</div>
<?php $input_error = $this->Form->isFieldError('estado') ? 'error': ''; ?>
<div class="four columns <?php echo $input_error ?>">
<?php echo $this->Form->input('estado', array('type' => 'text', 'placeholder' => 'Estado', 'class' => '')); ?>
</div>
<?php $input_error = $this->Form->isFieldError('cp') ? 'error': ''; ?>
<div class="four columns <?php echo $input_error ?>">
<?php echo $this->Form->input('cp', array('type' => 'text', 'placeholder' => 'Código Postal', 'class' => '')); ?>
</div>
</div>
<div class="row">
<?php $input_error = $this->Form->isFieldError('refpago') ? 'error': ''; ?>
<div class="four columns <?php echo $input_error ?>">
<?php echo $this->Form->input('refpago', array('type' => 'text', 'placeholder' => 'Referencia de Pago', 'class' => '')); ?>
</div>
<?php $input_error = $this->Form->isFieldError('formapago') ? 'error': ''; ?>
<div class="four columns <?php echo $input_error ?>">
<?php echo $this->Form->input('formapago', array('type' => 'select', 'options' => $formas_pago, 'class' => 'custom', 'style' => 'display: none;')); ?>
<div class="custom dropdown">
<a class="current" href="#">Transferencia</a><a class="selector" href="#"></a>
<ul>
<?php foreach($formas_pago as $forma): ?>
<li><?php echo $forma; ?>&nbsp;&nbsp;</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<div class="four columns">&nbsp;</div>
</div>
</fieldset>
<div>
<?php echo $this->Form->submit('Crear', array('class' => 'button small radius', 'escape' => false))?>
</div>
<?php echo $this->Form->end();?>
</div>
<div class="actions two columns">
<h3><?php __('Actions'); ?></h3>
<ul class="button-group radius">
<li><?php echo $this->Html->link(__('<i class="foundicon-left-arrow"></i>', t rue), array('action' => 'index'), array('escape' => FALSE, 'class' => 'button tiny radius', 'title' => 'Listado')); ?> </li>
</ul>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment