<commit_before><div class="row">
<?php

function writeOrg ($id, $orgName, $logoUrl, $description) {
  echo '<a href="' . substr($orgName, 0 ,1) . '">';
  echo '<div id="listbox">';
  echo ' <div id="logobox"><img src="' . $logoUrl . '">';
  echo ' </div> ';
  echo ' <div id="textbox"> ';
  echo '<p>' . $orgName . '</p></div></div></a>';
}

include 'database_init.php';

$con = getDBConnection($db_config);
$query = "SELECT id, name, logo_url, description FROM orgs ORDER BY name";
$results = $con->query($query);
$i=0;
while ($row = $results->fetch_assoc()) {
  $id = $row["id"];
  $orgName = $row["name"];
  $logoUrl = $row["logo_url"];
  $logoUrl = './remoteimage.php?org=' . $id;
  $description = $row["description"];
  writeOrg($id, $orgName, $logoUrl, $description);
  $i++;
  if ($i % 4 == 0 ) {
    echo '</div>';
    echo '<div class="row">';
  }
}
?>
</div><commit_msg>Updated to include org_status and logo validity check.<commit_after><div class="row">
<?php

function writeOrg ($id, $orgName, $logoUrl, $description) {
  echo '<a href="' . substr($orgName, 0 ,1) . '">';
  echo '<div id="listbox">';
  echo ' <div id="logobox"><img src="' . $logoUrl . '">';
  echo ' </div> ';
  echo ' <div id="textbox"> ';
  echo '<p>' . $orgName . '</p></div></div></a>';
}

include 'database_init.php';

$con = getDBConnection($db_config);
$query = "SELECT orgs.id, name, orgs.logo_url, description FROM orgs LEFT JOIN logo_details ON (orgs.id = logo_details.id) WHERE org_status = 1 and logo_details.valid = 1 ORDER BY name";
$results = $con->query($query);

$i=0;
while ($row = $results->fetch_assoc()) {
  $id = $row["id"];
  $orgName = $row["name"];
  $logoUrl = $row["logo_url"];
  $logoUrl = './localimage.php?org=' . $id . '&width=200';
  $description = $row["description"];
  writeOrg($id, $orgName, $logoUrl, $description);
  $i++;
  if ($i % 4 == 0 ) {
    echo '</div>';
    echo '<div class="row">';
  }
}
?>
</div>
{'fraction_non_alphanumeric': 0.24273858921161826, 'fraction_numerical': 0.007780082987551867, 'mean_word_length': 4.116710875331565, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5796060', 'n_tokens_mistral': 745, 'n_tokens_neox': 719, 'n_words': 177}