<commit_before><?php
//Henter id fra url:
$proTempId = $_GET['proTempId'];
//Henter instruktør id fra sessionsvariabel:
$instId   = $_SESSION['user'];
//Henter instruktør navn fra databasen:
$proTemp_sql_state = "select * from user where id = $instId";
$proTemp_sql_result = mysqli_query($db_conn, $proTemp_sql_state) or die (mysqli_error($db_conn));

while ($row = mysqli_fetch_assoc($proTemp_sql_result)){
    $instName = $row['fName']." ".$row['lName'];
}

//laver dataudtræk fra database:

$proTemp_sql_state = "select * from proTemp";
$proTemp_sql_result = mysqli_query($db_conn, $proTemp_sql_state) or die (mysqli_error($db_conn));

while ($row = mysqli_fetch_assoc($proTemp_sql_result)){
$proTempName= $row['name'];
$proTempDescription= $row['description'] ;
}
?>
<h1><?php echo $proTempName;?></h1>
<form>
    <table border="1">
        <tr>
            <td>
                <b>Instruktør: </b>
            </td>
            <td><?php echo $instName; ?></td>
            <td><b>Besrivelse: </b></td>
        </tr>
        <tr>
            <td><b>Projektleder: </b></td>
            <td> <select required name="proLeader">
                    <option selected name="proLeader" value="proLeader">Vælg projektleder</option>
                    <?php 
                        $sqlState="select * from user";
                        $sql_result = mysqli_query($db_conn, $sqlState) or die (mysqli_error($db_conn));
                       

                        while ($row = mysqli_fetch_assoc($sql_result)){
                           echo "<option value='".$row['id']."'>".$row['fName']." ".$row['lName']."</option>";
                        }
                    ?>
                </select>
            </td>
            <td colspan="10"><?php echo $proTempDescription; ?></td>
        </tr>
        <tr>
            <td><b>Elever:</b></td>
            <td colspan="2">
                <section class="container">
                    <div>
                        <!-- List of students start -->
                        <select id="leftValues" size="4" multiple>
                        <?php 
                            $students_sql = "Select * From user 
                                                Inner Join userRoles On user.id = userRoles.userId
                                                Where roleId = '1'";
                            $students_result = mysqli_query($db_conn, $students_sql) or die (mysqli_error($db_conn));
                            while ($students_row = mysqli_fetch_assoc($students_result)){
                            ?>
                            <option value="<?php echo $students_row['id']; ?>">
                                <?php echo $students_row['fName'].' '.$students_row['lName'] ?>
                            </option>
                            <?php
                            }
                        ?>
                        </select>
                        <!-- List of students end -->
                    </div>
                    <div>
                        <input type="button" id="btnLeft" value="&lt;&lt;" />
                        <input type="button" id="btnRight" value="&gt;&gt;" />
                    </div>
                    <div>
                        <select id="rightValues" size="4" multiple></select>
                    </div>
                </section><commit_msg>minor change dude to new perm system<commit_after><?php
//Henter id fra url:
$proTempId = $_GET['proTempId'];
//Henter instruktør id fra sessionsvariabel:
$instId   = $_SESSION['user'];
//Henter instruktør navn fra databasen:
$proTemp_sql_state = "select * from user where id = $instId";
$proTemp_sql_result = mysqli_query($db_conn, $proTemp_sql_state) or die (mysqli_error($db_conn));

while ($row = mysqli_fetch_assoc($proTemp_sql_result)){
    $instName = $row['fName']." ".$row['lName'];
}

//laver dataudtræk fra database:

$proTemp_sql_state = "select * from proTemp";
$proTemp_sql_result = mysqli_query($db_conn, $proTemp_sql_state) or die (mysqli_error($db_conn));

while ($row = mysqli_fetch_assoc($proTemp_sql_result)){
$proTempName= $row['name'];
$proTempDescription= $row['description'] ;
}
?>
<h1><?php echo $proTempName;?></h1>
<form>
    <table border="1">
        <tr>
            <td>
                <b>Instruktør: </b>
            </td>
            <td><?php echo $instName; ?></td>
            <td><b>Besrivelse: </b></td>
        </tr>
        <tr>
            <td><b>Projektleder: </b></td>
            <td> <select required name="proLeader">
                    <option selected name="proLeader" value="proLeader">Vælg projektleder</option>
                    <?php 
                        $sqlState="select * from user Where fk_role_id = 1";
                        $sql_result = mysqli_query($db_conn, $sqlState) or die (mysqli_error($db_conn));
                       

                        while ($row = mysqli_fetch_assoc($sql_result)){
                           echo "<option value='".$row['id']."'>".$row['fName']." ".$row['lName']."</option>";
                        }
                    ?>
                </select>
            </td>
            <td colspan="10"><?php echo $proTempDescription; ?></td>
        </tr>
        <tr>
            <td><b>Elever:</b></td>
            <td colspan="2">
                <section class="container">
                    <div>
                        <!-- List of students start -->
                        <select id="leftValues" size="4" multiple>
                        <?php 
                            $students_sql = "Select * From user Where fk_role_id = 1";
                            $students_result = mysqli_query($db_conn, $students_sql) or die (mysqli_error($db_conn));
                            while ($students_row = mysqli_fetch_assoc($students_result)){
                            ?>
                            <option value="<?php echo $students_row['id']; ?>">
                                <?php echo $students_row['fName'].' '.$students_row['lName'] ?>
                            </option>
                            <?php
                            }
                        ?>
                        </select>
                        <!-- List of students end -->
                    </div>
                    <div>
                        <input type="button" id="btnLeft" value="&lt;&lt;" />
                        <input type="button" id="btnRight" value="&gt;&gt;" />
                    </div>
                    <div>
                        <select id="rightValues" size="4" multiple></select>
                    </div>
                </section>
{'fraction_non_alphanumeric': 0.1478025285972306, 'fraction_numerical': 0.0028597230583985553, 'mean_word_length': 1.4331746612962284, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 0, '>': 133, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3742257', 'n_tokens_mistral': 1941, 'n_tokens_neox': 1870, 'n_words': 372}