Ejemplo n.º 1
0
 public function maintenanceProduct()
 {
     $ids = DB::table('tblProduct')->select('strProdId')->orderBy('created_at', 'desc')->orderBy('strProdId', 'desc')->take(1)->get();
     $ID = $ids["0"]->strProdId;
     $newID = $this->smart($ID);
     $product = DB::table('tblProduct')->join('tblSupplier', 'tblProduct.strPSupp', '=', 'tblSupplier.strSuppId')->join('tblUOM', 'tblProduct.strPUOM', '=', 'tblUOM.strUOMId')->join('tblProdSerCat', 'tblProduct.strPCategory', '=', 'tblProdSerCat.strCategId')->select('tblProduct.*', 'tblSupplier.strSuppName', 'tblUOM.strUOMDesc', 'tblProdSerCat.strCategName')->get();
     $category = MProdServCat::all();
     $supplier = MSupplier::all();
     $uom = MUOM::all();
     return View::make('productMaintenance')->with('newID', $newID)->with('products', $product)->with('uom', $uom)->with('uom2', $uom)->with('categories', $category)->with('suppliers', $supplier);
 }
Ejemplo n.º 2
0
 public function updateSupplier()
 {
     $id = Input::get('supplier_id_edit');
     $supplier = MSupplier::find($id);
     $supplier->strSuppName = Input::get('supplier_name_edit');
     $supplier->strSuppStAdd = Input::get('supplier_st_edit');
     $supplier->strSuppCityAdd = Input::get('supplier_brgy_edit');
     $supplier->strSuppStateAdd = Input::get('supplier_city_edit');
     $supplier->strSSCont = Input::get('supplier_contactNo_edit');
     $supplier->strSuppEAdd = Input::get('supplier_emailAd_edit');
     $supplier->strSSContFName = Input::get('supplier_fname_edit');
     $supplier->strSSContMInit = Input::get('supplier_mname_edit');
     $supplier->strSSContLName = Input::get('supplier_lname_edit');
     $supplier->save();
     return Redirect::to('/SupplierDetails');
 }
 public function actionDelete($id)
 {
     MSupplier::model()->deleteByPk($id);
     Yii::app()->user->setFlash('success', "Data deleted.");
     $this->redirect(array('index'));
 }