function bodega_crear() { $bodega_ubicacion = $_POST["bodega_ubicacion"]; $bodega_observacion = $_POST["bodega_descripcion"]; if (validarDescripcion($bodega_observacion) and validarUbicacion($bodega_ubicacion)) { $bodega_instancia = new Bodega(0, $bodega_ubicacion, $bodega_observacion); $bodega_id = $bodega_instancia->Bod_Nueva(); if ($bodega_id == FALSE) { header("Location: ../vista/adm/bodegas.php?seccion=crear&mensaje=crearError"); } else { header("Location: ../vista/adm/bodegas.php?seccion=modificar&id={$bodega_id}&mensaje=crearOk"); } } else { header("Location: ../vista/adm/bodegas.php?seccion=crear&mensaje=crearError"); } }
function stock_agregar() { $material_id = $_POST["material_id"]; $instanciasBodega = new Bodega(0, 0, 0); $bodega_array = array(); $bodega_array = $instanciasBodega->Bod_Ver(false); for ($count = 0; $count < count($bodega_array); $count++) { $bodega_id = $bodega_array[$count][0]; if (isset($_POST["agregar_stock_{$bodega_id}"]) and is_numeric($_POST["agregar_stock_{$bodega_id}"])) { $cantidad = $_POST["agregar_stock_{$bodega_id}"]; $instanciasStockBodega = new StockBodega($cantidad, 0, 0, $material_id, $bodega_id); $validador = $instanciasStockBodega->Stock_Agregar(); unset($instanciasStockBodega); if ($validador == false) { header("Location: ../vista/bodega/materiales.php?seccion=ver&id={$material_id}&mensaje=modificarError"); } else { header("Location: ../vista/bodega/materiales.php?seccion=ver&id={$material_id}&mensaje=modificarOk"); } } else { header("Location: ../vista/bodega/materiales.php?seccion=ver&id={$material_id}&mensaje=modificarError"); } } }
public function getMenuBodega() { // return CHtml::listData(Bodega::model()->findAll('estatus=?',array(1)),'Id','selectName'); return CHtml::listData(Bodega::model()->findAll(), 'CodBodega', 'Descripcion'); }
case 2: $tipobodega = new Tipobodega(); $tipobodega->editarbodega($miconexion, $_GET); $eventos = new Eventos(); $evento = "Editar Tipo Bodega "; $eventos->insertareventos($miconexion, $idusuario, $evento); break; case 3: $bodega = new Bodega(); $bodega->insertarbodega($miconexion, $_GET); $eventos = new Eventos(); $evento = "Insertar Bodega Nueva"; $eventos->insertareventos($miconexion, $idusuario, $evento); break; case 4: $bodega = new Bodega(); $bodega->editarbodega($miconexion, $_GET); $eventos = new Eventos(); $evento = "Editar Bodega"; $eventos->insertareventos($miconexion, $idusuario, $evento); break; case 5: $cliente = new Cliente(); $cliente->insertarcliente($miconexion, $_GET); break; case 6: $cliente = new Cliente(); $cliente->editarcliente($miconexion, $_GET); break; case 7: $proveedor = new Proveedor();
<div class="bodega"> <p style="text-align: right"> <button class="boton" id="ventananuevabodega"><img src="images/nuevo.png" style="width:40px; "></button></p> <center><table style="width: 600px; height: 56px;" border="1"> <tbody> <tr> <td style="width: 150.65px;"><center>NOMBRE</center></td> <td style="width: 307.533px;"><center>MUNICIPIO</center></td> <td style="width: 200.067px;"><center>DIRECCION</center></td> <td style="width: 200.067px;"><center>TIPO BODEGA</center></td> <td style="width: 200.067px;"><center>EDITAR</center></td> </tr> <?php include_once '../../class/bodega/bodega.php'; include_once '../../class/conexion.php'; $bodega = new Bodega(); $tabla = $bodega->seleccionartodo($miconexion); while ($rs = mysqli_fetch_array($tabla)) { echo "\n <tr>\n \n <td class='nombrebodega" . $rs["idbodega"] . "'>" . $rs["nombrebodega"] . "<br>\n </td>\n <td class='" . $rs["nombreMunicipio"] . "'>" . $rs["nombreMunicipio"] . "<br>\n </td>\n <td class='direccionbodega" . $rs["idbodega"] . "'>" . $rs["direccionbodega"] . "<br>\n </td>\n <td class='" . $rs["tipo"] . "'>" . $rs["tipo"] . "<br>\n </td>\n <td>\n <img src='images/editar.png' class='editarbodega' id='" . $rs["idbodega"] . "'>\n<br>\n </td>\n </tr>\n "; } ?> </div>
echo $form->labelEx($model, 'Proveedor'); ?> <?php echo $form->dropDownList($model, 'CodProveedor', CHtml::listData(Proveedor::model()->findAll(), 'CodProveedor', 'Descripcion'), array('empty' => ' ')); ?> <?php echo $form->error($model, 'CodProveedor'); ?> </th> <th> <?php echo $form->labelEx($model, 'Bodega'); ?> <?php echo $form->dropDownList($model, 'CodBodega', CHtml::listData(Bodega::model()->findAll(), 'CodBodega', 'Descripcion'), array('empty' => ' ')); ?> <?php echo $form->error($model, 'CodBodega'); ?> </th> </tr> </table> <table> <th> <?php echo $form->labelEx($model, 'ForPago'); ?> <?php echo $form->dropDownList($model, 'ForPago', CHtml::listData(Formapago::model()->findAll(), 'Id', 'Descripcion'), array('empty' => ' '));
public function getMenuBodega() { return CHtml::listData(Bodega::model()->findAll(), 'CodBodega', 'Descripcion'); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Bodega the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Bodega::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
function material_crear() { if (empty($_POST["material_nombre"]) or empty($_POST["material_descripcion"]) or $_POST["material_proveedor"] == "no_option" or $_POST["material_categoria"] == "no_option") { header("Location: ../vista/bodega/materiales.php?seccion=crear&mensaje=crearError"); } else { $material_nombre = $_POST["material_nombre"]; $material_descripcion = $_POST["material_descripcion"]; $material_proveedor = $_POST["material_proveedor"]; $material_categoria = $_POST["material_categoria"]; if (validarMaterialNombre($material_nombre) and validarDescripcion($material_descripcion) and validarID($material_categoria) and validarRut($material_proveedor)) { $instacia_usuario = new Usuario($_SESSION["session_username"], 0, 0, 0, 0); $rut_usuario = $instacia_usuario->User_getRut(); $instancia_material = new Material(0, $material_nombre, $material_categoria, $material_descripcion, 0, $material_proveedor); $material_ultimo_id = $instancia_material->Mat_Nuevo($rut_usuario); $bodega_array = array(); $instanciasBodega = new Bodega(0, 0, 0); $bodega_array = $instanciasBodega->Bod_Ver(false); for ($count = 0; $count < count($bodega_array); $count++) { $instanciasStockBodega = new StockBodega(0, 0, 0, $material_ultimo_id, $bodega_array[$count][0]); $instanciasStockBodega->Stock_Agregar(); unset($instanciasStockBodega); } if ($material_ultimo_id == false) { header("Location: ../vista/bodega/materiales.php?seccion=crear&mensaje=crearError"); } else { if ($_FILES['imagen']['size'] <= 500000) { $nombre_archivo_imagen = ""; switch ($_FILES['imagen']['type']) { case "image/jpg": $nombre_archivo_imagen = "mat_" . $material_ultimo_id . ".jpg"; break; case "image/jpeg": $nombre_archivo_imagen = "mat_" . $material_ultimo_id . ".jpg"; break; case "image/gif": $nombre_archivo_imagen = "mat_" . $material_ultimo_id . ".gif"; break; case "image/png": $nombre_archivo_imagen = "mat_" . $material_ultimo_id . ".png"; break; default: $nombre_archivo_imagen = false; break; } if ($nombre_archivo_imagen == false) { } else { require_once PATH_ROOT . '/controlador/functions/class_imgUpldr.php'; $subir = new imgUpldr(); $subir->_dest = PATH_ROOT . '/vista/images/productos-images/'; $subir->_name = $nombre_archivo_imagen; $subir->init($_FILES['imagen']); if (file_exists(PATH_ROOT . '/vista/images/productos-images/' . $nombre_archivo_imagen)) { // $instancia_material_img = new Material($material_id, 0, 0, 0, $nombre_archivo_imagen, 0); // $instancia_material_img->Mat_Modificar_imagen(); $instancia_material->material_img_referencial = $nombre_archivo_imagen; $instancia_material->Mat_Modificar_imagen(); } } } header("Location: ../vista/bodega/materiales.php?seccion=ver&id={$material_ultimo_id}&mensaje=crearOk"); } } else { header("Location: ../vista/bodega/materiales.php?seccion=crear&mensaje=crearError"); } } }