Exemple #1
0
 /**
  * @return array
  */
 protected function _getFields()
 {
     if ($this->_fields) {
         return $this->_fields;
     }
     if (!$this->_auto->config['general_cache'] || !($this->_fields = Cache::GetArrayCache('fields'))) {
         $this->_fields = array();
         $this->_db->Select('auto_fields', array('*'), array('active' => 1));
         while ($field = $this->_db->FetchArray()) {
             $this->_fields[$field['id']] = $field;
         }
         Cache::SetArrayCache('fields', $this->_fields);
     }
     return $this->_fields;
 }
 public function GetFields()
 {
     $fields = array();
     $this->_db->Select('job_fields', array('ctype', 'title', 'required', 'type', 'default', 'id', 'active'));
     while ($row = $this->_db->FetchArray()) {
         $fields[$row['id']] = $row;
     }
     return $fields;
 }
Exemple #3
0
 protected function DelPhotos($auto_id)
 {
     $resource = $this->base->Select('auto_images', array("*"), array("auto_id" => $auto_id));
     while ($row = $this->base->FetchArray($resource)) {
         @unlink(ROOT_DIR . "/uploads/auto_foto/" . $row['model_id'] . "/" . $row['image_name']);
         @unlink(ROOT_DIR . "/uploads/auto_foto/" . $row['model_id'] . "/thumbs/" . $row['image_name']);
         $this->base->Delete('auto_images', array('id' => $row['id']));
     }
 }
Exemple #4
0
 /**
  * Return array of specialties
  *
  * @param int $sphere_id
  * @param string $type add or search
  * @return array
  */
 public function &GetSpecialties($sphere_id, $type = '')
 {
     if (!$sphere_id) {
         return array('' => $this->lang['sel_sphere']);
     }
     if (empty($this->specialties[$sphere_id]) && (!$this->config['general_cache'] || !($this->specialties[$sphere_id] = Cache::GetArrayCache('specialties_s' . $sphere_id)))) {
         $this->dbase->Select('job_specialties', array("*"), array('sphere_id' => $sphere_id), array("name" => 'ASC'));
         $this->specialties[$sphere_id] = array();
         while ($row = $this->dbase->FetchArray()) {
             $this->specialties[$sphere_id][$row['id']] = $row['name'];
         }
         if ($this->config['general_cache']) {
             Cache::SetArrayCache('specialties_s' . $sphere_id, $this->specialties[$sphere_id]);
         }
     }
     if ($type == "add") {
         return array('' => $this->lang['sel_specialty']) + $this->specialties[$sphere_id];
     } elseif ($type == "search") {
         return array('' => $this->lang['any']) + $this->specialties[$sphere_id];
     }
     return $this->specialties[$sphere_id];
 }