function new_db_insert()
 {
     $uniqid = md5(uniqid(rand(), true));
     $schulname = General::input_clean($_POST['Schulname']);
     $plz = General::input_clean($_POST['PLZ']);
     $bilder_pfade = array();
     if ($_FILES['bild']['name'][0] != '') {
         $output_path = DOCUMENT_ROOT . INSTALL_PATH . '/Images/BuddyListe/' . $plz . '_' . $schulname . '/';
         if (!is_dir($output_path)) {
             RheinaufFile::mkdir($output_path);
             RheinaufFile::chmod($output_path, 777);
         }
         for ($i = 0; $i < count($_FILES['bild']); $i++) {
             if ($_FILES['bild']['error'][$i] == '0') {
                 $bild = new Bilder($_FILES['bild']['tmp_name'][$i], $output_path . $_FILES['bild']['name'][$i]);
                 $bild->scaleMaxX(200);
                 $bild->output();
                 $bilder_pfade[] = 'Images/BuddyListe/' . $plz . '_' . $schulname . '/' . $_FILES['bild']['name'][$i];
             }
         }
     }
     $insert_sql = 'INSERT INTO `RheinaufCMS>BuddyListe` ( `id` ,';
     $field_names = array();
     for ($i = 0; $i < count($this->fields); $i++) {
         $field_name = $this->fields[$i]['name'];
         $field_names[] = '`' . $field_name . '`';
     }
     $insert_sql .= implode(', ', $field_names);
     $insert_sql .= ",`Bilder`,`angenommen`,`uniqid`) VALUES ('',";
     $field_values = array();
     for ($i = 0; $i < count($this->fields); $i++) {
         $field_value = $_POST[rawurlencode($this->fields[$i]['name'])];
         $field_value = !strstr($field_value, '--') ? $field_value : '';
         $field_value = is_array($field_value) ? implode(', ', $field_value) : $field_value;
         $field_values[] = "'" . General::input_clean(rawurldecode($field_value), true) . "'";
     }
     $insert_sql .= implode(', ', $field_values) . ",'" . implode(';', $bilder_pfade) . "','0','{$uniqid}')";
     $this->connection->db_query($insert_sql);
 }
 function maxscale($file)
 {
     $size = getimagesize($file);
     if ($size[0] > $this->max_scale['x'] || $size[1] > $this->max_scale['y']) {
         if (!class_exists('Bilder')) {
             include_once 'Bilder.php';
         }
         if (!is_writeable($file)) {
             RheinaufFile::chmod($file, '777');
         }
         $img = new Bilder($file, $file);
         if ($size[0] > $this->max_scale['x']) {
             $img->scaleMaxX($this->max_scale['x']);
         } else {
             $img->scaleMaxY($this->max_scale['y']);
         }
         $img->output();
     }
 }
 function big_img()
 {
     $img = INSTALL_PATH . '/' . $_GET['bigimg'];
     if (!class_exists('Bilder')) {
         include_once 'Bilder.php';
     }
     $thumb = new Bilder($img);
     $thumb->scaleMaxX($this->bigimg_size);
     $thumb->output();
     exit;
 }