Example #1
0
 public function AddField($type, array $data)
 {
     if (empty($type) || !in_array($type, $this->_support_types)) {
         throw new ExceptionAllError('Не указан тип дополнительного поля');
     }
     $this->_check_error($data);
     $field_data = $this->_pre_save($type, $data);
     if (!$this->_errors) {
         Cache::ClearArrayCache('fields');
         return $this->_db->Insert('job_fields', array('title' => $data['title'], 'ctype' => $data['ctype'], 'description' => $data['description'], 'type' => $type, 'data' => $field_data, 'required' => $data['required'], 'regex' => $data['regex'], 'default' => $data['default'], 'active' => $data['active']));
     } else {
         return 0;
     }
 }
Example #2
0
 /**
  * Create new resume
  *
  */
 protected function AddResume()
 {
     $this->PreparationResumeValues();
     $this->add_value['user_id'] = $this->member['id'];
     $this->add_value['user_name'] = $this->member['name'];
     $this->add_value['add_date'] = $this->dbase->timer->cur_time;
     return $this->dbase->Insert('job_resumes', $this->add_value);
 }
Example #3
0
 protected function handlingImage($name, $current, $id = 0)
 {
     $thumb = new auto_thumbnail(UPLOAD_DIR . $this->values['model_id'] . "/" . $name);
     $thumb->size_auto($this->config['photo_size_width']);
     $thumb->jpeg_quality($this->config['photo_quality']);
     if ($this->config['photo_logo']) {
         $thumb->insert_watermark($this->config['photo_size_for_logo']);
     }
     $thumb->save(UPLOAD_DIR . $this->values['model_id'] . "/" . $name);
     $thumb->auto_thumbnail(UPLOAD_DIR . $this->values['model_id'] . "/" . $name);
     $thumb->size_auto($this->config['photo_size_width_th']);
     $thumb->jpeg_quality($this->config['photo_quality']);
     $thumb->save(UPLOAD_DIR . $this->values['model_id'] . "/thumbs/" . $name);
     $cur_id = $this->base->Insert('auto_images', array('model_id' => $this->values['model_id'], 'auto_id' => $id, 'add_date' => $this->base->timer->cur_time, 'image_name' => $name, 'user_id' => $this->member['id'], 'guest_session' => empty($this->guest_session) ? '' : $this->guest_session));
     return $cur_id;
 }