<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$url = base_url();
echo form_open( base_url('Student_Staz/MojeStaze/' ));
?>

<?php if($komunikat): ?>
	<div class="container-fluid" id="komunikat">
		<div class="container">
			<div class="alert alert-<?= $komunikatTyp ?>">
				<p><?= $komunikatTresc ?></p>
			</div>
		</div>
	</div>
<?php endif; ?>



<div class="tlo-default">
<div class="container-fluid"> 
    <h1 class="section-title dash-left"><?php echo $this->company; ?></h1>
</div>

<div class="container">
    <div class="col-xs-12 col-sm-12 col-md-9 offset-md-3 col-lg-9 offset-lg-3 ramka">
            <div class="row margtop20">
                <h2 class="karta_tytul">Moje staże</h2>
            </div>
            <hr />
            <?php if(!$mojeProjekty){ ?>
                <div class="alert alert-danger">W obecnej chwili nie jesteś zapisany na żaden staż. </div>
            <?php } // koniec if
            else{ ?>
            <div class="table-responsive">
                <table class="listing">
                    <tbody>
                        <?php foreach ($mojeProjekty as $data): 
                            if($data['status'] == 1){ 
                                $statusx = '<img src="'.$url.'assets/img/ikony/check.png" class="ikonki odsun chmurka" data-toggle="tooltip" data-placement="left" title="Status: zaakceptowany" />';
                                $enter_project = '<a href="'.base_url('Student_Staz/SzczegolyStazu/' . $data['id_project']).'"><div class="table_labels">'.$data['project_name'].'</div></a>';
                                $view_project = '<a href="'.base_url('Student_Staz/SzczegolyStazu/' . $data['id_project']).'"><img class="odsun" src="' . base_url('assets/img/ikony/view2.png') . '"></a>';
                                $rate_project = '<a href="'.base_url('Student_Staz/OcenStaz/' . $data['id']).'"><img class="odsun" src="' . base_url('assets/img/ikony/rate.jpg') . '"></a>';
                                
                            }
                            else{
                                $statusx = '<img src="'.$url.'assets/img/ikony/cancel.png" class="ikonki odsun chmurka" data-toggle="tooltip" data-placement="left" title="Status: oczekujący" />';
                                $enter_project = '<div class="table_labels_deactivate">'.$data['project_name'].'</div>';
                                $view_project = '<img class="odsun szczegoly_stazu" data-idstaz="'.$data['id_project'].'" src="' . base_url('assets/img/ikony/view2.png') . '">';
                                $rate_project = '<img class="odsun" src="' . base_url('assets/img/ikony/rate.jpg') . '">';
                            }                        
                        ?>
                            <tr>    
                                <td data-projectid="<?php echo $data['id'];?>" class="col-sm-9">        
                                    <?php echo $enter_project; ?>
                                </td>
                                <td class="col-sm-2 text-right table_edit_icon">
                                    <?php echo $statusx;?>
                                    
                                    <?php echo $view_project; ?>

                                    <?php echo $rate_project; ?>
                                </td>         
                            </tr>
                        <?php endforeach; ?>
                    </tbody>            
                </table>
            </div>
            <?php } // koniec else?>
 
        <hr />    
    </div>
</div>
</div> 





