} else { //******************************************* IN CASE THERE IS IMAGE ***************************************** if (isset($_FILES)) { if (array_key_exists('image_id', $_FILES)) { if ($_FILES['image_id']['tmp_name'] != '') { $dataImage = array(); $dataTmp = array(); if ($dataTmp['name'] = $image->uploadImage($_FILES, 'image_id')) { if ($image->masterImage($dataTmp)) { $dataImage['name'] = $dataTmp['name']; $item = $index->getGeneralItemById($id, $table); $idImage = $item[$id]['image_id']; $imgItem = $index->getGeneralItemById($idImage, 'image'); $oldImage = $imgItem[$idImage]['name']; if ($idImage != '0') { $index->editGeneralItem($idImage, $dataImage, 'image'); $image->deleteImageFile($oldImage); } else { $data['image_id'] = $index->addGeneralItem($dataImage, 'image'); } } } } } } //******************************************* END IN CASE THERE IS IMAGE ***************************************** if (isset($_GET['newLang'])) { if (false) { } else { $itemEdited = $index->editGeneralItemNewLang($id, $data, $table); if ($itemEdited) {
$TempFILE[$keyN][$property] = $FILE[$property][$keyN]; } $FILE = $TempFILE; if (array_key_exists('image_id', $FILE)) { if ($FILE['image_id']['tmp_name'] != '') { $dataImage = array(); $dataTmp = array(); if ($dataTmp['name'] = $image->uploadImage($FILE, 'image_id')) { if ($image->masterImage($dataTmp)) { $dataImage['name'] = $dataTmp['name']; $item = $index->getGeneralItemById($id, $table); $idImage = $item[$id]['image_id']; $imgItem = $index->getGeneralItemById($idImage, 'image'); $oldImage = $imgItem[$idImage]['name']; if ($idImage != '0') { $index->editGeneralItem($idImage, $dataImage, 'image'); $image->deleteImageFile($oldImage); } else { $data['image_id'] = $index->addGeneralItem($dataImage, 'image'); } } } } } } $itemExist = $index->checkGeneralItemIfExist($id, $data, $table); if ($itemExist) { $tablesData[$table] = "exists"; $existData[$table] = $itemExist; } else { $tablesData[$table] = $data;