Skip to content

Instantly share code, notes, and snippets.

@renatoschroepfer
Created November 14, 2017 19:40
Show Gist options
  • Save renatoschroepfer/1645497ecbb244e940446a246a1ad3cf to your computer and use it in GitHub Desktop.
Save renatoschroepfer/1645497ecbb244e940446a246a1ad3cf to your computer and use it in GitHub Desktop.
$query = "SELECT id, name FROM `glpi_entities`.`name";
$result = $DB->query($query);
echo "<script>";
echo "function change(select) {";
echo " window.open('helpdesk.public.php?create_ticket=1&active_entity=' + select.value,'_self'); ";
echo "}";
echo "</script>";
echo '<td>Deseja abrir chamado para qual setor</td>';
echo '<td>';
echo '<select onchange="change(this)">';
foreach ($res as $result) {
echo '<option value="' . $result['id'] . '">' . $result['name'] . '</option>';
}
echo '</select>';
echo '</td>';
echo '</tr>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment