Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- slot(
- 'title',
- sprintf('>Servicio > Registrar Servicio-Armar Menues'))
- ?>
- <?php use_javascript('jquery-1.5.2.min.js') ?>
- <?php use_javascript('jquery-ui-1.8.11.custom.min.js') ?>
- <?php use_javascript('jquery.validate.min.js') ?>
- <?php include_stylesheets() ?>
- <?php include_javascripts() ?>
- <?php
- slot(
- 'ayudacontent',
- sprintf(
- '<strong>En caso de desear un tipo de menu</strong>, debe definir la cantidad del mismo.<br/>
- <strong>Luego de definida la cantidad</strong>, debe seleccionar de cada tipo de componente, un numero de componentes que este
- entre la cantidad minima y la cantidad maxima a elegir.<br/>
- <strong>En caso de desear mozos</strong>, debe tildar dicha opcion.<br/>
- <strong>En caso de desear vajilla</strong>, debe tildar dicha opcion. Si ademas desea alguna vajilla especial, puede elegirla
- tildando la que desee(dejando seteada la opcion de vajilla).'
- ));
- ?>
- <a href="javascript:void(0)" ><img align="right" id="ayuda" src="/images/help.png" alt="Ayuda" title="Ayuda"></a>
- <script type="text/javascript"><!--
- $().ready(function() {
- $("#composicion").validate({
- rules: {
- "cantidadTM[]": {
- number: true
- }
- },
- messages: {
- "cantidadTM[]": {
- number: "La cantidad debe ser numerica"
- }
- }
- });
- });
- // --></script>
- <table border="1" cellpadding="1" cellspacing="1" class="tabla">
- <thead>
- <tr>
- <th class="modo2" colspan="2" align="center"><h1>Registrar Servicio-Armar Menues</h1></th>
- </tr>
- <tr>
- <th class="modo2" colspan="2" align="center"><h2>Datos Servicio</h2></th>
- </tr></thead>
- <tbody>
- <tr>
- <th class="modo1">Nombre:</th>
- <td class="modo2"><?php echo $_SESSION['nombre'] ?></td>
- </tr>
- <tr>
- <th class="modo1">Descripcion:</th>
- <td class="modo2"><?php echo $_SESSION['descripcion'] ?></td>
- </tr>
- <tr>
- <th class="modo1">Hora Inicio:</th>
- <td class="modo2"><?php echo $_SESSION['horainicio'] ?></td>
- </tr>
- <tr>
- <th class="modo1">Hora Fin:</th>
- <td class="modo2"><?php echo $_SESSION['horafin'] ?></td>
- </tr>
- <tr>
- <th class="modo1">Contribucion Marginal(%):</th>
- <td class="modo2"><?php echo $_SESSION['cont'] ?></td>
- </tr>
- <tr>
- <th class="modo1">Tipo de Servicio:</th>
- <td class="modo2">
- <?php echo $_SESSION['tiposervicio'] ?></td>
- </tr>
- <tr>
- <th class="modo1">Cliente:</th>
- <td class="modo2">
- <?php
- $cliente = Doctrine_Query::create()
- ->select('c.*')
- ->from('Cliente c')
- ->where('c.id=?', $_SESSION['idcliente'])
- ->fetchOne();
- echo $cliente['nombreCliente'] . ' ' . $cliente['apellidoCliente'] ?></td>
- </tr>
- </tbody>
- </table>
- <?php if ($tiposmenu != NULL):
- //var_dump($tiposmenu);?>
- <hr/>
- <form id="composicion" name="composicion" method="post" action="<?php echo url_for('servicio/presupuesto') ?>">
- <?php
- $tm = 0;
- foreach ($tiposmenu as $tipomenu):
- ?>
- <h3>Menu: <?php echo $tipomenu->getNombre() ?></h3>
- <h4><strong>Cantidad:</strong>
- <?php
- //$m = new sfWidgetFormInput();
- //echo $m->render("cantidadTM[" . $tipomenu->getId() . "]");
- ?>
- <input type="text" name="cantidadTM[]" id="cantidadTM[<?php echo $tipomenu->getId() ?>]" class="number"/>
- <input type="hidden" name="TM[]" value="<?php echo $tipomenu->getId() ?>" id="TM[<?php echo $tipomenu->getId() ?>]" />
- </h4>
- <?php
- $tiposcomponente = $tipomenu->getTipoMenuTipoComponente();
- $tc = 0;
- foreach ($tiposcomponente as $tipocomponente): ?>
- <table border="1" cellpadding="1" cellspacing="1" class="tabla">
- <thead>
- <tr class="modo1">
- <th>Tipo de Componente</th>
- <th>Cantidad Minima a Elegir</th>
- <th>Cantidad Maxima a Elegir </th>
- </tr>
- </thead>
- <tbody>
- <tr class="modo2">
- <td><?php
- echo $tipocomponente->getTipoComponente()->getNombre();
- ?></td>
- <td><?php
- if ($tipocomponente->getCantidadMinimaAElegir() == 0 || $tipocomponente->getCantidadMinimaAElegir() == NULL) {
- echo "Sin Limite Inferior";
- } else {
- echo $tipocomponente->getCantidadMinimaAElegir();
- }
- ?></td>
- <td><?php
- if ($tipocomponente->getCantidadMaximaAElegir() == 1000 || $tipocomponente->getCantidadMaximaAElegir() == NULL) {
- echo "Sin Limite Superior";
- } else {
- echo $tipocomponente->getCantidadMaximaAElegir();
- } ?></td>
- </tr>
- <?php
- if ($tipocomponente->getCantidadMinimaAElegir() != 0 && $tipocomponente->getCantidadMinimaAElegir() != NULL) {
- if ($tipocomponente->getCantidadMaximaAElegir() != 1000 && $tipocomponente->getCantidadMaximaAElegir() != NULL) {
- $validacion='required: true rangelength:['. $tipocomponente->getCantidadMinimaAElegir().','.$tipocomponente->getCantidadMaximaAElegir().']';
- }
- else{
- $validacion='required: true minlength:'.$tipocomponente->getCantidadMinimaAElegir();
- }
- }
- else{
- if ($tipocomponente->getCantidadMaximaAElegir() != 1000 && $tipocomponente->getCantidadMaximaAElegir() != NULL) {
- $validacion='required: true maxlength:'.$tipocomponente->getCantidadMaximaAElegir();
- }
- else{
- $validacion='';
- }
- }?>
- </tbody>
- </table>
- <?php
- $componentes = Doctrine_Query::create()
- ->select('c.nombre')
- ->from('Componente c')
- ->where('c.idTipoComponente=?', $tipocomponente->getIdTipoComponente())
- ->fetchArray();
- //var_dump($componentes);
- if ($componentes):
- /* $c = 0;
- $nombre = array();
- foreach ($componentes as $comp):
- $index = $comp['id'];
- $nombre[$index] = $comp['nombre'];
- // $ids[$index] = $comp['id'];
- // $index+=1;
- endforeach; */
- //var_dump($ids);
- ?>
- <p>
- <select id="elegidoC[<?php echo $tipocomponente->getIdTipoMenu() ?>]" name="elegidoC[]" title=""
- validate="<?php echo $validacion?> " multiple="multiple">
- <?php foreach ($componentes as $comp):
- ?>
- <option value="<?php echo $tipocomponente->getIdTipoMenu() . '-' . $tipocomponente->getIdTipoComponente() . '+' . $comp['id'] ?>"><?php echo $comp['nombre'] ?></option>
- <?php endforeach; ?>
- </select>
- </p>
- <?php
- /* $w = new sfWidgetFormChoice(array(
- 'expanded' => true,
- 'multiple' => true,
- 'choices' => $nombre,
- )); */
- // echo $w->render("elegidoC[" . $tipocomponente->getIdTipoMenu() . "][" . $tipocomponente->getIdTipoComponente() . "]");
- ?>
- <?php endif; ?>
- <br/>
- <?php
- $tc = $tc + 1;
- endforeach;
- ?>
- <hr/>
- <?php
- $tm = $tm + 1;
- endforeach;
- ?>
- <h4><strong>Desea Mozos:</strong>
- <?php
- $mozo = new sfWidgetFormInputCheckbox();
- echo $mozo->render("elegidoMozos");
- ?></h4>
- <hr/>
- <h4><strong>Desea Vajilla:</strong>
- <?php
- $vajilla = new sfWidgetFormInputCheckbox();
- echo $vajilla->render("elegidoVajilla");
- ?>
- <br>
- <h5><i>Vajilla Especial</i></h5>
- <?php
- $vajillaEspecial = Doctrine_Query::create()
- ->select('m.*')
- ->from('Material m')
- ->where('m.precioServicio!=', NULL)
- ->fetchArray();
- foreach ($vajillaEspecial as $esp):
- $indi = $esp['id'];
- $nomb[$indi] = $esp['nombre'] . '- Costo:' . $esp['precioServicio'];
- // $ids[$index] = $comp['id'];
- // $index+=1;
- endforeach;
- $w = new sfWidgetFormChoice(array(
- 'expanded' => true,
- 'multiple' => true,
- 'choices' => $nomb,
- ));
- echo $w->render("elegidoV");
- ?>
- </h4><hr/>
- <br/>
- <?php
- //var_dump($vajilla);
- ?>
- <input type="submit" value="Siguiente" />
- </form>
- <?php
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement