function main() { $data = parseRepoXML(); //$data = $data->fermat; $platformList = []; $layerList = []; $pluginList = []; $superLayerList = []; $layerIndex = 0; $platformIndex = 0; $superLayerIndex = 0; foreach ($data->platforms->children() as $platform) { array_push($platformList, array('code' => strval($platform['code']), 'name' => strval($platform['name']), 'logo' => strval($platform['logo']), 'index' => $platformIndex)); if ($platform['dependsOn']) { $platformList[$platformIndex]['dependsOn'] = strval($platform['dependsOn']); } $platformIndex++; foreach ($platform->children() as $layer) { if (searchName(strval($layer['name']), $layerList) === false) { array_push($layerList, array('name' => strval($layer['name']), 'index' => $layerIndex, 'super_layer' => false)); $layerIndex++; } if (isset($layer['super_layer'])) { foreach ($data->super_layers->children() as $super_layer) { if (search('code', strval($super_layer['code']), $superLayerList) === null) { array_push($superLayerList, array('name' => strval($super_layer['name']), 'code' => strval($super_layer['code']), 'index' => $superLayerIndex)); if ($super_layer['dependsOn']) { $superLayerList[$superLayerIndex]['dependsOn'] = strval($super_layer['dependsOn']); } $superLayerIndex++; } if (strval($super_layer['code']) === strval($layer['super_layer'])) { foreach ($super_layer->children() as $sub_superLayer) { if (searchName(strval($sub_superLayer['name']), $layerList) === false) { array_push($layerList, array('name' => strval($sub_superLayer['name']), 'index' => $layerIndex, 'super_layer' => strval($super_layer['code']))); $layerIndex++; } if ($sub_superLayer->androids) { foreach ($sub_superLayer->androids->children() as $android) { $newElement = createElement($android, 'Android', $sub_superLayer); array_push($pluginList, $newElement); } } if ($sub_superLayer->plugins) { foreach ($sub_superLayer->plugins->children() as $plugin) { $newElement = createElement($plugin, 'Plugin', $sub_superLayer); array_push($pluginList, $newElement); } } if ($sub_superLayer->addons) { foreach ($sub_superLayer->addons->children() as $addon) { $newElement = createElement($addon, 'Addon', $sub_superLayer); array_push($pluginList, $newElement); } } if ($sub_superLayer->libraries) { foreach ($sub_superLayer->libraries->children() as $library) { $newElement = createElement($library, 'Library', $sub_superLayer); array_push($pluginList, $newElement); } } } } } } else { if ($layer->androids) { foreach ($layer->androids->children() as $android) { $newElement = createElement($android, 'Android', $layer, $platform); array_push($pluginList, $newElement); } } if ($layer->plugins) { foreach ($layer->plugins->children() as $plugin) { $newElement = createElement($plugin, 'Plugin', $layer, $platform); array_push($pluginList, $newElement); } } if ($layer->addons) { foreach ($layer->addons->children() as $addon) { $newElement = createElement($addon, 'Addon', $layer, $platform); array_push($pluginList, $newElement); } } if ($layer->libraries) { foreach ($layer->libraries->children() as $library) { $newElement = createElement($library, 'Library', $layer, $platform); array_push($pluginList, $newElement); } } } } } $result = array('groups' => $platformList, 'layers' => $layerList, 'plugins' => $pluginList, 'superLayers' => $superLayerList); $output = gzencode(json_encode($result)); header('Content-Encoding: gzip'); header("Access-Control-Allow-Origin: *"); //header('Content-Length: '.strlen($gzipoutput)); echo $output; }
//flag to see if we are going to use patient names in search result of clone others. $show_phone_flag = false; //if we do show patient names, flag to see if we show phone numbers too $pid_clause = ''; //if name search, will return a limited list of names to search for. if (strpos($clone_search, "::") !== false) { $name_data_flag = true; $show_phone_flag = true; $split = preg_split('/\\s*::\\s*/', $clone_search); $clone_search = $split[1]; $pid_clause = searchName($split[0]); } elseif (strpos($clone_search, ":") !== false) { $name_data_flag = true; $split = preg_split('/\\s*:\\s*/', $clone_search); $clone_search = $split[1]; $pid_clause = searchName($split[0]); } $clone_search_term = ''; if ($clone_search != '') { $clone_search = preg_replace('/\\s+/', '%', $clone_search); if (substr($clone_search, 0, 1) == "`") { $clone_subcategory_term = ''; $clone_item_term = ''; $clone_search = substr($clone_search, 1); } $clone_search_term = " and content like '%{$clone_search}%'"; } if (substr($_POST['hidden_mode'], 0, 12) == 'clone others') { //clone from search box if (preg_match('/^(export)(.*)/', $clone_search, $matches)) { $query1 = "select id, category from form_CAMOS_category";
<!DOCTYPE html> <html> <?php include "includes/mainhead.html"; ?> <body> <!--Navigation Bar--> <?php include "includes/navbar.php"; $name = $_GET['name']; $talent = $_GET['talent']; if (strlen($name) > 0) { $users = searchName($name); } else { $users = searchTalent($talent); } ?> <?php if (count($users) == 0) { ?> <h2 class="text-center">Sorry, none of our current users match your search query</h2> <?php } ?> <?php foreach ($users as $user) {