public function remove($id)
 {
     $user = User::findOrFail($id);
     $thes_id = $user->thesis_id;
     $user->thesis_id = NULL;
     $thesis = Thesis::findOrFail($thes_id);
     $thesis->student_id = NULL;
     $thesis->fileName = NULL;
     $thesis->save();
     $user->save();
     return $thesis;
 }
示例#2
0
if (Auth::check()) {
    //$students = DB::table('users')->where('access','=',0)->get();
    $accesses = Auth::user()->access;
    //$names = Auth::user()->name;
    ?>
														
<!--.................................   Zalogowany jako student    ......................................-->
						<?php 
    if ($accesses == 0) {
        if (Auth::user()->thesis_id == NULL) {
            ?>
							<h3>Twoja praca dyplomowa </h3>
							<br>Nie masz jeszcze wybranego tematu pracy. Idz do panelu z lewej strony, aby wybrać temat.
						<?php 
        } else {
            $thesis = Thesis::findOrFail(Auth::user()->thesis_id);
            //$subj = $thesis->subject;
            //$desc = $thesis->descr;
            $lect = $thesis->lecturer_id;
            $lect_name = User::findOrFail($lect)->name;
            //$rec = User::findOrFail($thesis->reviewer)->name
            ?>
							<h3>Twoja praca dyplomowa </h3>
							<?php 
            if ($thesis->docum == 1) {
                ?>
						     	<br><br><font size="3"><div align="left">Temat Twojej pracy: <div><span class="showHide btn btn-success" style="cursor:pointer; font-size: 10px">Rozwiń</span>
						     	<a href="/showThesis_{{$thesis->id}}" > {{ $thesis->subject }} </a> 
						     	<div class="extendableText">{{ $thesis->descr }}</div>
						     	<font size="3"><div align="left">Twój promotor: </font><?php 
                echo $lect_name;