Ejemplo n.º 1
0
 function aworkspage()
 {
     $this->page();
     $this->stylesheet = "style.css";
     $this->__widgetfields[] = html::write("<script src=\"shortcuts.js\"></script><div id=\"header\"></div>");
     $t = new toolbar();
     $t->addWidget(new button("Oficina", "index.php", "page"));
     $t->addWidget(new button("Operador de Taller", "taller.php", "wrench"));
     $t->addWidget(new button("Operador de Almacen", "almacen.php", "car"));
     $this->__widgetfields[] = $t;
 }
Ejemplo n.º 2
0
        $sf->estado = $sfe->estado_nuevo;
        $sf->fecha_entrega_prevista = $sfe->fecha_entrega_prevista;
        if ($sfe->estado_nuevo == 8) {
            $sf->fecha_entrega = time();
        }
        $sf->update();
        header("location:pedido.php?pedido_id=" . $r->pedido_id);
    } else {
        $p->addWidget(new infobox("Error", "Error en el formulario, compruebe los datos", false));
    }
}
error_reporting(E_ALL);
$p->addWidget(html::write("<h1>A&ntilde;adir evento a pedido <b>" . $sf->referencia . "</b> de <b>" . $sf->cliente . "</b> </h1>"));
$b = new Box("Datos del Evento");
$t = new toolbar();
$t->addWidget(new button("Guardar Datos del Evento", "javascript:document.forms[0].submit()", "disk"));
$b->addWidget($t);
$f = new form("", "");
$opts[] = array("caption" => "Sin procesar", "value" => 0);
$opts[] = array("caption" => "Orden", "value" => 1);
$opts[] = array("caption" => "Taller", "value" => 2);
$opts[] = array("caption" => "Excepci&oacute;n Taller", "value" => 3);
$opts[] = array("caption" => "Fabricaci&oacute;n", "value" => 4);
$opts[] = array("caption" => "Excepci&oacute;n en Fabricaci&oacute;n", "value" => 5);
$opts[] = array("caption" => "Almac&eacute;n", "value" => 6);
$opts[] = array("caption" => "Excepci&oacute;n en Almac&eacute;n", "value" => 7);
$opts[] = array("caption" => "Entrega", "value" => 8);
$opts[] = array("caption" => "Excepci&oacute;n en Entrega", "value" => 9);
$sel = new form_select("estado_nuevo", "Nuevo estado");
$sel->addOptions($opts);
$ew = new estadolistwidget();
Ejemplo n.º 3
0
$p->addWidget(html::write("<h1>Bienvenid@</h1>"));
$d = new datagrid("pedido", "pedido.php?");
$d->toolbar = false;
$sf->__query = "SELECT * FROM pedidos order by estado";
$d->objectField("idmodelo", new scaffold("modelos"), "referencia");
$d->objectField("idmadera", new scaffold("maderas"), "referencia");
$d->specialField("fecha", "timestamp", "date", "html");
$d->headers("tipo_pedido", "Tipo de Pedido");
$d->specialField("tipo_pedido", "tipo_pedido", "ooentity", "tipowidget");
$d->headers("estado", "Estado");
$d->headers("cliente", "Cliente");
$d->headers("referencia", "Referencia");
$d->hideField("observaciones");
$d->hideField("otro_material");
$d->specialField("estado", "estado", ooentity, estadolistwidget);
$d->specialField("fecha_pedido", "timestamp", date, html);
$d->specialField("fecha_entrega_prevista", "timestamp", date, html);
$d->specialField("fecha_entrega", "timestamp", date, html);
$d->headers("fecha_entrega", "Fecha de Entrega");
$d->headers("fecha_entrega_prevista", "Fecha de Entrega Prevista");
$d->headers("fecha_pedido", "Fecha de Pedido");
$b = new Box("Pedidos en Cartera");
$d->drop($sf);
$t = new toolbar();
$t->addWidget(new button("A&ntilde;adir Pedido", "pedido_add.php", "add"));
$t->addWidget(new button("Gestionar Modelos", "modelos.php", "package"));
$t->addWidget(new button("Gestionar Maderas", "maderas.php", "map"));
$b->addWidget($t);
$b->addWidget($d);
$p->addWidget($b);
$p->draw();
Ejemplo n.º 4
0
    $sf->fecha_pedido = time();
    $sf->fecha_entrega = -1;
    $tracking = "AW/" . date("y") . date("w") . "/" . strtoupper(substr(md5(uniqid(rand)), 4, 2) . substr(md5(uniqid(rand)), 7, 2) . substr(md5(uniqid(rand)), 12, 2));
    $sf->tracking = $tracking;
    $sf->insert();
    if (errorobject::haserrors()) {
    } else {
        $id = mysql_insert_id();
        header("location:pedido.php?pedido_id=" . $id);
    }
}
$p = new aworkspage();
$b = new Box("A&ntilde;adir Pedido");
$p->addWidget(html::write("<h1>A&ntilde;adir Pedido</h1>"));
$t = new toolbar();
$t->addWidget(new button("Guardar Pedido", "javascript:document.forms[0].submit()", "add"));
$b->addWidget($t);
$f = new form("", "");
$f->addWidget(new form_separator("Referencia y Cliente"));
$f->addWidget(new form_input("referencia", "Referencia Cliente", $r->referencia));
$f->addWidget(new form_input("cliente", "Cliente", $r->cliente));
$sel = new form_select("tipo_pedido", "Tipo de Pedido");
$opts[] = array("value" => 0, "caption" => "Puertas");
$opts[] = array("value" => 1, "caption" => "Ventanas");
$opts[] = array("value" => 2, "caption" => "Puertas+Ventanas");
$sel->addOptions($opts);
unset($opts);
$f->addWidget($sel);
$f->addWidget(new form_separator("Fechas"));
$d = new date();
$d->timestamp = time();
Ejemplo n.º 5
0
 function predrawWidget()
 {
     $identificator = $this->name;
     $action = $this->name . "_action";
     $_identificator = $this->name . "_id";
     $r = new request();
     if ($r->filter_text) {
         if (strpos($this->controller, "?") === false) {
             $this->controller .= "?prepend=1";
         }
         $this->controller .= "&filter_text=" . $r->filter_text . "&filter_field=" . $r->filter_field;
         if ($r->filter_match) {
             $this->controller .= "&filter_match=1";
         }
     }
     if ($r->{$_identificator}) {
         $this->__scaffoldobject->open($r->{$_identificator});
     }
     $this->__gridobject->drop($this->__scaffoldobject);
     if ($r->{$action} == "insert") {
         $this->__scaffoldobject->fromObject($r);
     }
     $this->__formobject->drop($this->__scaffoldobject);
     switch ($r->{$action}) {
         default:
             $button_add = new button($this->button_add, $this->controller . (strpos($this->controller, "?") === false ? "?" : "&") . $action . "=add", "add");
             $b = new box($this->name ? $this->name : "List", $this->__gridobject);
             if (!$this->__disable_add) {
                 $b->addWidget($button_add);
             }
             return $b;
             break;
         case "add":
             $this->__formobject->action = $this->__formobject->action . (strpos($this->__formobject->action, "?") === false ? "?" : "&") . $action . "=insert";
             $this->__formobject->submit = $this->button_add;
             $this->__formobject->__target = $this->__formobject->action;
             return new box($this->name ? $this->name : "Add", $this->__formobject);
             break;
         case "insert":
             $this->__scaffoldobject->fromObject($r);
             if (is_array($this->__composites)) {
                 foreach ($this->__composites as $k => $v) {
                     $entity = $this->__composites[$k]["entity"];
                     $efield = $this->__composites[$k]["efield"];
                     $this->__scaffoldobject->composeField($k, $entity, $efield);
                 }
             }
             if ($this->__scaffoldobject->insert()) {
                 $b = new box($this->name ? $this->name : "Message", html::write($this->message_insert_ok));
                 $t = new toolbar();
                 $b->addWidget(html::write("<script>setTimeout(\"document.location='" . $this->controller . "'\",1000);</script>"));
                 $b->addWidget($t);
                 return $b;
             } else {
                 $w = new oowidget();
                 $b = new box($this->name ? $this->name : "Message", html::write($this->message_insert_failed));
                 $b->addWidget(errorobject::errorList());
                 $this->__formobject->action = $this->__formobject->action . (strpos($this->__formobject->action, "?") === false ? "?" : "&") . $action . "=insert";
                 $this->__formobject->submit = $this->button_add;
                 $this->__formobject->__target = $this->__formobject->action;
                 $b2 = new box($this->name ? $this->name : "Add", $this->__formobject);
                 $w->addWidget($b);
                 $w->addWidget($b2);
                 $b->addWidget(new button($this->button_list, $this->controller));
                 return $w;
             }
             break;
         case "update":
             $tmpsf = $this->__scaffoldobject;
             $this->__scaffoldobject = new scaffold($this->name);
             $this->__scaffoldobject->__validators = $tmpsf->__validators;
             $this->__scaffoldobject->fromObject($r);
             if (is_array($this->__composites)) {
                 foreach ($this->__composites as $k => $v) {
                     $entity = $this->__composites[$k]["entity"];
                     $efield = $this->__composites[$k]["efield"];
                     $this->__scaffoldobject->composeField($k, $entity, $efield);
                 }
             }
             if ($this->__scaffoldobject->update()) {
                 $b = new box($this->name ? $this->name : "Message", html::write($this->message_update_ok));
                 $t = new toolbar();
                 //$b->addWidget(new button($this->button_list, $this->controller));
                 $b->addWidget(html::write("<script>setTimeout(\"document.location='" . $this->controller . "'\",1000);</script>"));
                 return $b;
             } else {
                 $w = new oowidget();
                 $this->__formobject->action = $this->__formobject->action . (strpos($this->__formobject->action, "?") === false ? "?" : "&") . $action . "=update&" . $this->name . "_id=" . $r->{$_identificator};
                 $this->__formobject->__target = $this->__formobject->action;
                 $this->__formobject->submit = $this->button_update;
                 $b2 = new box($this->name ? $this->name : "View", $this->__formobject);
                 $b = new box($this->name ? $this->name : "Message", html::write($this->message_update_failed));
                 $b->addWidget(errorobject::errorList());
                 $b->addWidget(new button($this->button_list, $this->controller));
                 $w->addWidget($b);
                 $w->addWidget($b2);
                 $b->addWidget(new button($this->button_list, $this->controller));
                 return $w;
                 return $b;
             }
             break;
         case "view":
             $this->__formobject->action = $this->__formobject->action . (strpos($this->__formobject->action, "?") === false ? "?" : "&") . $action . "=update&" . $this->name . "_id=" . $r->{$_identificator};
             $this->__formobject->__target = $this->__formobject->action;
             $this->__formobject->submit = $this->button_update;
             $b = new box($this->name ? $this->name : "View", $this->__formobject);
             for ($i = 0; $i < count($this->__additionalwidgets); $i++) {
                 $b->addWidget($this->__additionalwidgets[$i]);
             }
             $t = new toolbar();
             $t->addWidget(new button($this->button_list, $this->controller, "book_previous"));
             $t->addWidget(new button($this->button_delete, $this->controller . (strpos($this->controller, "?") === false ? "?" : "&") . $action . "=delete&" . $_identificator . "=" . $r->{$_identificator}, "delete"));
             $b->addWidget($t);
             return $b;
             break;
         case "delete":
             $b = new box($this->name ? $this->name : "Delete");
             $b->addWidget(html::write($this->message_delete_confirm));
             $t = new toolbar();
             $t->addWidget(new button($this->button_delete, $this->controller . (strpos($this->controller, "?") === false ? "?" : "&") . $action . "=delete_confirm&" . $_identificator . "=" . $r->{$_identificator}, "delete"));
             $t->addWidget(new button($this->button_list, $this->controller . (strpos($this->controller, "?") === false ? "?" : "&") . $action . "=&" . $_identificator . "=" . $r->{$_identificator}, "book_previous"));
             $b->addWidget($t);
             return $b;
             break;
         case "delete_confirm":
             $this->__scaffoldobject->open($r->{$_identificator});
             if ($this->__scaffoldobject->delete()) {
                 $b = new box($this->name ? $this->name : "Message", html::write($this->message_delete_ok));
                 $t = new toolbar();
                 $t->addWidget(new button($this->button_list, $this->controller));
                 $t->addWidget(html::write("<meta http-equiv=\"refresh\" content=\"1; url=" . $this->controller . "\" />"));
                 $b->addWidget($t);
                 return $b;
             } else {
                 $b = new box($this->name ? $this->name : "Message", html::write($this->message_delete_failed));
                 $b->addWidget(errorobject::errorList());
                 $b->addWidget(new button($this->button_list, $this->controller));
                 return $b;
             }
             break;
     }
 }
Ejemplo n.º 6
0
<?php

include "local.php";
$p = new aworkspage();
error_reporting(E_ALL);
$sf = new scaffold("pedidos");
$sf->open($r->pedido_id);
if ($r->referencia) {
    $sf->fromObject($r);
    $sf->update();
}
$b = new Box("Datos Generales del Pedido");
$t = new toolbar();
$t->addWidget(new button("Guardar Datos", "javascript:document.forms[0].submit()", "disk"));
$t->addWidget(new button("Actualizar Estado del Pedido", "pedido_evento_add.php?pedido_id=" . $r->pedido_id, "lightning"));
$b->addWidget($t);
$f = new form("", "");
$f->addWidget(new form_separator("Referencia y Cliente"));
$f->addWidget(new form_input("referencia", "Referencia", $sf->referencia));
$f->addWidget(new form_html("Tracking", "<span style=\"font-size:14px;font-weight:bold;\">" . $sf->tracking));
$f->addWidget(new form_input("cliente", "Cliente", $sf->cliente));
$f->addWidget(new form_separator("Fechas"));
$d = new date();
$d->timestamp = $sf->fecha_pedido;
$d->parse();
$f->addWidget(new form_html("Fecha de Pedido ", $d->string));
$d = new date();
$d->timestamp = $sf->fecha_entrega_prevista;
$d->parse();
$f->addWidget(new form_html("Fecha Entrega Prevista", $d->string));
$d = new date();