Compare commits

..

2 commits

Author SHA1 Message Date
e50c5f2b0b a 2023-11-20 14:06:26 +01:00
4fa753f252 a 2023-11-20 11:43:32 +01:00

View file

@ -39,7 +39,7 @@
exit;
}
$sql_mid = "SELECT szef.id, szef.last_name FROM emp AS szef INNER JOIN emp AS prac ON szef.id = prac.manager_id;";
$sql_mid = "SELECT DISTINCT szef.id, szef.last_name FROM emp AS szef INNER JOIN emp AS prac ON szef.id = prac.manager_id;";
$wyn_mid = mysqli_query($id_conn, $sql_mid);
if (mysqli_errno($id_conn))
{
@ -53,9 +53,9 @@
<table cellspacing="0" cellpadding="0" border="0" style="width: 26%;" align="Left">
<tbody align="Left">
<form action='ins_prac.php' method='post'>
<tr><td width="160">Nazwisko:</td><td><input type='text' name='nazwisko' ></td></tr>
<tr><td>Imię: </td><td><input type='text' name='imie' ></td></tr>
<tr><td>Użytkownik: </td><td><input type='text' name='userid' ></td></tr>
<tr><td width="160">Nazwisko:</td><td><input type='text' id="lastname" name='nazwisko' onchange="usernameR()"></td></tr>
<tr><td>Imię: </td><td><input onchange="usernameR()" type='text' id="firstname" name='imie' ></td></tr>
<tr><td>Użytkownik: </td><td><input type='text' name='userid' id="userid"></td></tr>
<tr><td>Stanowisko: </td><td>
<select id="Stanowiska" name="title">
@ -79,15 +79,16 @@
<select id="Departament" name="dept_id">
<?php $dept = '';
$w_dept = mysqli_fetch_array($wyn_dept);
$deptle = $w_dept['id'] . '|' . $w_dept['name'] . '|' . $w_dept['region'];
$deptle1 = $w_dept['id'];
?>
<option value=<?php printf("%s", "'" . $deptle . "'"); ?> selected><?php printf("%s", $deptle); ?></option>
<?php
while ($w_dept = mysqli_fetch_array($wyn_dept))
{
$deptle = $w_dept['id'];
$deptle1 = $w_dept['id'];
$deptle = $w_dept['id'] . '|' . $w_dept['name'] . '|' . $w_dept['region'];
?>
<option value=<?php printf("%s", "'" . $deptle . "'"); ?>><?php printf("%s", $deptle); ?></option>
<option value=<?php printf("%s", "'" . $deptle1 . "'"); ?>><?php printf("%s", $deptle); ?></option>
<?php
}
?>
@ -97,17 +98,16 @@
<tr><td>ID managera:</td><td><select id="Manager" name="man_id">
<?php $mid = '';
$w_mid = mysqli_fetch_array($wyn_mid);
$midle = $w_mid['id'];
$midle .= ' | ' . $w_mid['last_name'];
$midle1 = $w_mid['id'];
?>
<option value=<?php printf("%s", "'" . $midle . "'"); ?> selected><?php printf("%s", $midle); ?></option>
<?php
while ($w_mid = mysqli_fetch_array($wyn_mid))
{
$midle = $w_mid['name'];
$midle .= ' | ' . $w_mid['last_name'];
{
$midle1 = $w_mid['id'];
$midle = $w_mid['id'] . ' | ' . $w_mid['last_name'];
?>
<option value=<?php printf("%s", "'" . $midle . "'"); ?>><?php printf("%s", $midle); ?></option>
<option value=<?php printf("%s", "'" . $midle1 . "'"); ?>><?php printf("%s", $midle); ?></option>
<?php
}
?>
@ -116,6 +116,14 @@
<tr><td><p><input type='submit' value='Wyślij'></td></tr>
</form>
</tbody>
</table>
</table>
<script>
function usernameR() {
let firstname = document.getElementById('firstname').value;
let lastname = document.getElementById('lastname').value;
let output = firstname.substring(0,1) + lastname.substring(0,6);
document.getElementById('userid').value = output.toLowerCase();
}
</script>
</body>
</html>