$fields = array(); $values = array(); foreach ($layer as $field => $value) { $fields[] = $field; $values[] = $value; } set_data('layer', 'layer_id', $new_id, $fields, $values); } } if (array_key_exists('marker_icon', $pano_video_data)) { $trans_id_table['marker_icon'] = array(); for ($i = 0; $i < count($pano_video_data['marker_icon']); $i++) { $marker_icon = $pano_video_data['marker_icon'][$i]; //save old_id and new_id $old_id = $marker_icon['icon_id']; $new_id = alloc_new_marker_icon_id(); $trans_id_table['marker_icon'][$old_id] = $new_id; //get order for new marker_icon $new_order = get_new_order('marker_icon', 'project_id', $project_id); $marker_icon['orders'] = $new_order; $marker_icon['project_id'] = $project_id; //delete id from array to save data correctly unset($marker_icon['icon_id']); //save data to DB $fields = array(); $values = array(); foreach ($marker_icon as $field => $value) { $fields[] = $field; $values[] = $value; } set_data('marker_icon', 'icon_id', $new_id, $fields, $values);
} if ($_GET['req'] == "getNewId") { if ($_GET['data']['type'] == "project") { echo alloc_new_project_id($_GET['data']['options']['userId']); } if ($_GET['data']['type'] == "layer") { echo alloc_new_layer_id(); } if ($_GET['data']['type'] == "vtour") { echo alloc_new_vtour_id(); } if ($_GET['data']['type'] == "pvr") { echo alloc_new_pvr_id(); } if ($_GET['data']['type'] == "markerIcon") { echo alloc_new_marker_icon_id(); } if ($_GET['data']['type'] == "marker") { echo alloc_new_marker_id(); } if ($_GET['data']['type'] == "hotspotIcon") { echo alloc_new_hotspot_icon_id(); } if ($_GET['data']['type'] == "hotspot") { echo alloc_new_hotspot_id(); } } if ($_GET['req'] == "getMarkerIconList") { $data = array(); $main_data = get_marker_icon_list($_GET['data']['projectId']); for ($i = 0; $i < count($main_data); $i++) {