Пример #1
0
 protected function DecrementCounter($mark_id, $model_id)
 {
     $this->base->Update('auto_marks', array("auto_num" => "IF(auto_num=0, 0, auto_num-1)"), array('id' => $mark_id), true);
     if ($model_id) {
         $this->base->Update('auto_models', array("auto_num" => "IF(auto_num=0, 0, auto_num-1)"), array('id' => $model_id), true);
     }
 }
Пример #2
0
 public function UpdateField($id, array $data)
 {
     if (empty($id)) {
         throw new ExceptionAllError('Не передан индификатор дополнительного поля');
     }
     $this->_check_error($data);
     $field = $this->GetField($id);
     $field_data = $this->_pre_save($field['type'], $data);
     if (!$this->_errors) {
         Cache::ClearArrayCache('fields');
         $this->_db->Update('job_fields', array('title' => $data['title'], 'description' => $data['description'], 'data' => $field_data, 'required' => $data['required'], 'regex' => $data['regex'], 'default' => $data['default'], 'active' => $data['active']), array('id' => $id));
         return true;
     } else {
         return false;
     }
 }
Пример #3
0
 /**
  * Save editing resume
  *
  * @param int $id
  * @return boolean
  */
 protected function SaveResume($id)
 {
     $this->CheckResumeError();
     $xfields = new Fields(XFIELDS_RESUME, $this);
     $this->add_value['xfields'] = $xfields->EncodeFields($this->add_value);
     $this->Errors = $this->Errors + $xfields->getErrors();
     if (!$this->Errors) {
         $this->PreparationResumeValues();
         if (!empty($_FILES['photo']['name']) || !empty($this->add_value['del_photo']) && $this->old_value['photo']) {
             @unlink(PHOTO_PATCH . $this->old_value['photo']);
         }
         $this->dbase->Update('job_resumes', $this->add_value, array('id' => $id));
         return true;
     } else {
         return false;
     }
 }