Пример #1
0
 function _addsection()
 {
     $array = array('section_name' => strip_tags(params::get('section_name')), 'section_desc' => params::get('section_desc'));
     db::table('catalog_sections');
     db::smartInsert($array);
     $section_id = mysql_insert_id();
     $dir = IMAGES_ROOT . 'sections/';
     @mkdir(IMAGES_ROOT);
     @mkdir($dir);
     if (!empty($_FILES['section_photo']['name'])) {
         $file = $dir . $section_id . '.jpg';
         copy($_FILES['section_photo']['tmp_name'], $file);
         images::src($file);
         images::thumb($file);
         images::square(78);
     }
     headers::action('catalog', 'main', 'sections');
 }