Example #1
0
 private function wrapComponent(IComponent $component)
 {
     $component = new ProgramLang($component);
     $component->setFeature($this->progLange);
     $component = new Hardware($component);
     $component->setFeature($this->hardware);
     $component = new Food($component);
     $component->setFeature($this->food);
     return $component;
 }
Example #2
0
 private function wrapComponent(IComponent $component)
 {
     $component = new ProgramLang($component);
     $component->setFeature("php");
     $component = new Hardware($component);
     $component->setFeature("lin");
     $component = new Food($component);
     $component->setFeature("veg");
     return $component;
 }
Example #3
0
 public function run()
 {
     DB::table('hardwares')->delete();
     Hardware::create(array('id' => 1, 'name' => 'Portatil', 'reference' => '0x000', 'brand' => 'Toshiba'));
     Hardware::create(array('id' => 2, 'name' => 'Video Bean', 'reference' => '1x001', 'brand' => 'Epson'));
     Hardware::create(array('id' => 3, 'name' => 'Portatil', 'reference' => '0x001', 'brand' => 'SONY VAIO'));
 }
Example #4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $hardware = Hardware::find($id);
     $hardware->delete();
     Session::flash('message', 'Equipo Eliminado Con Exito');
     return Redirect::to('hardware');
 }
Example #5
0
$shoes->ShowInfo();
echo "<p><strong>Discount</strong></p>";
$shoes->actualPrice();
//$sold, $delivered, $broken
$shoes_sold = 1000;
$shoes_delivered = 500;
$shoes_broken = 10;
$shoes->InStock($shoes_sold, $shoes_delivered, $shoes_broken);
echo "<br>";
$shoes->profit($shoes_sold, $shoes_broken);
echo "<hr>";
$shoes->model = 'female shoes';
echo $shoes->model;
echo "<hr>";
/*
* class Hardware
* Second Object
* $prod_model, $prod_date_production, $prod_quantity, $prod_price, $product_expenses
*/
$computer = new Hardware('computer', '2015-01', 500, 700, 400);
$computer->ShowInfo();
$computer_sold = 250;
$computer_delivered = 200;
$computer_broken = 2;
$computer->profit($computer_sold, $computer_broken);
$computer->InStock($computer_sold, $computer_delivered, $computer_broken);
echo "<br>";
echo "<hr>";
$computer->model = 'DELL inspiron';
echo $computer->model;
echo "<hr>";
Example #6
0
 /**
  * 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 the ID of the model to be loaded
  */
 public function loadModel($type, $id)
 {
     if ($type == 'Employees') {
         $model = Employees::model()->findByPk($id);
     } elseif ($type == 'Hardware') {
         $model = Hardware::model()->findByPk($id);
     } elseif ($type == 'Facilities') {
         $model = Facilities::model()->findByPk($id);
     } elseif ($type == 'CustomResources') {
         $model = CustomResources::model()->findByPk($id);
     }
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #7
0
 public function verify()
 {
     $logica = false;
     $hardwares = Hardware::where('name', '=', 'Portatil')->get();
     $reserves = Reserve::all();
     $arrayRef = array();
     foreach ($reserves as $item) {
         array_push($arrayRef, $item->hardware_id);
     }
     if (count($reserves) == 0) {
         $logica = true;
     } else {
         $cant = 1;
         foreach ($hardwares as $item) {
             if (!in_array($item->reference, $arrayRef)) {
                 if ($cant == 1) {
                     $logica = true;
                 }
             }
         }
     }
     return Response::json(array('verify' => $logica));
 }