$keys = array(); $keys['icon_id'] = $new_id; unset($marker_display['icon_id']); $keys['type'] = $marker_display['type']; unset($marker_display['type']); //save data to DB set_data_with_comp_pk('marker_display', $keys, $marker_display); } } if (array_key_exists('marker', $pano_video_data)) { $trans_id_table['marker'] = array(); for ($i = 0; $i < count($pano_video_data['marker']); $i++) { $marker = $pano_video_data['marker'][$i]; //save old_id and new_id $old_id = $marker['marker_id']; $new_id = alloc_new_marker_id(); $trans_id_table['marker'][$old_id] = $new_id; //transform old data into new data $marker['layer_id'] = $trans_id_table['layer'][$marker['layer_id']]; $marker['icon_id'] = $trans_id_table['marker_icon'][$marker['icon_id']]; //delete id from array to save data correctly unset($marker['marker_id']); //save data to DB $fields = array(); $values = array(); foreach ($marker as $field => $value) { $fields[] = $field; $values[] = $value; } set_data('marker', 'marker_id', $new_id, $fields, $values); }
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++) { $data[$i] = array(); $normal_display = null; $display_data = get_marker_display_list($main_data[$i]['icon_id']);