コード例 #1
0
ファイル: HistoryController.php プロジェクト: vitaliy5118/ss1
 public function indexAction()
 {
     // action body
     $history = new Application_Model_DbTable_History();
     $number = $this->getRequest()->getParam('number');
     $this->view->history = $history->getHistory($number);
 }
コード例 #2
0
ファイル: Device.php プロジェクト: vitaliy5118/ss1
 public function edit()
 {
     //Добавляем данные в базу
     $save_data = new Application_Model_DbTable_Devices();
     $save_data->editDevice($this);
     //Сохраняем историю
     $history = new Application_Model_DbTable_History();
     $history->addHistory($this);
 }
コード例 #3
0
ファイル: Repaire.php プロジェクト: vitaliy5118/ss1
 public function editRepair($id, $number, $device)
 {
     // вносим изменения в склад запчастей
     $this->id = $id;
     $this->number = $number;
     if ($this->spares != '') {
         $this->spares .= ' ';
     }
     if ($this->check_data) {
         $warehouse = new Application_Model_DbTable_Warehouse();
         $warehouse_data = $warehouse->fetchAll();
         $warehistory = new Application_Model_DbTable_Warehistory();
         foreach ($this->check_data as $id => $value) {
             $spare_data = $warehouse->getWarehouse($id);
             $this->spares .= "|| {$spare_data['serial']}-{$spare_data['name']}-{$value}шт ";
             $row = $warehouse->getWarehouse($id);
             foreach ($warehouse_data as $rows) {
                 if ($rows['id'] == $id) {
                     $this->remain = $rows['remain'];
                 }
             }
             $this->remain -= $value;
             $this->serial = $row['serial'];
             $this->name = $row['name'];
             $this->type = $row['type'];
             $this->price = 'unload';
             $this->path = $row['path'];
             //имя картинки для запчасти
             // Вызываем метод модели addMovie для вставки новой записи
             $warehouse->editWarehouse($id, $this->serial, $this->name, $this->type, $this->remain, $this->price, $this->path);
             $warehistory->addWarehistory($this->serial, $this->name, "редактирование ремонта -{$this->number}-{$device['name']}", $row['remain'], $value, $this->remain);
         }
     }
     //редактируем запись о ремонте
     $editRepaire = new Application_Model_DbTable_Repairs();
     $editRepaire->editRepaire($this);
     //сохраняем статус ремонта
     $devices = new Application_Model_DbTable_Devices();
     $devices->editDeviceStatus($this);
     //сохраняем историю
     $history = new Application_Model_DbTable_History();
     $history->addRepairHistory($this);
 }