'description' => $_POST['description'], 'title_en' => $_POST['title_en'], 'description_en' => $_POST['description_en'], 'detail_title' => $_POST['detail_title'], 'detail_description' => substr($_POST['detail_description'], 0,4999), 'detail_title_en' => $_POST['detail_title_en'], 'detail_description_en' => substr($_POST['detail_description_en'], 0,4999), ); $m_action->update_action($data,$_POST['id']); $sort_order=1; foreach ($_POST['file_path'] as $key => $value) { $filename = $value; $pos = strpos($filename, "old_file_picture__"); if ($pos === false&&$filename!="") { $ad_pid=$m_action->generate_pid(); $ext = explode(".", $filename); $new_ext = $ext[count($ext) - 1]; $new_filename = $_POST['id'] . "_".$ad_pid."." . $new_ext; $file = '../media/tmp/' . $filename; $newfile = '../media/action/' . $new_filename; if (!copy($file, $newfile)) { echo "failed to copy $file...\n" . $file . " to " . $newfile . " and "; @unlink("../media/tmp/" . $filename); $data['picture'] = "no"; } else { $pdata = array( 'id' => $ad_pid,