<div class="essential">
    <div class="row">
        <div class="col-xs-12 col-sm-6 col-md-6 col-lg-8">
            <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="<?php 
print URL;
?>
?c=manageRozklads&f=checkEditing_subject">
            <?php 
$obj = new TimeTableStudents('group_id', 0, 0);
$class = '';
$error = '';
$errors = '';
if (isset($this->error[$v[1]])) {
    $class = ' has-error panel panel-danger';
    $errors = '<div class="panel-heading alert alert-danger">' . $this->error[$v[1]] . '</div>';
    $error = '<span class="glyphicon glyphicon-remove form-control-feedback"></span>';
}
$field = '<div class="form-group' . $class . '">' . $errors . '>
                        <div class="essential_group">
                            <div class="panel-body">
                                <div class="col-xs-8 col-sm-8 col-md-6 col-lg-4">
							        <font size="4" color="#8d8a8a" face="Arial">Назва: </font><br/>
							            <input type="text" id="name" name="name" placeholder="" value="' . $this->data['name'] . '" class="form-control" /></br></br>
                                        <font size="4" color="#8d8a8a" face="Arial">Викладач: </font><br/>
							            <div class="form-group" >
                                            <div class="col-xs-12 selectContainer">
                                                <select name="teacher_id" id="teacher_id" class="form-control">
                                                    <option value="' . $this->data['teacher_id'] . '">' . $obj->getTeacherById($this->data['teacher_id']) . '
                                                    </option>';
$allTeachers = $obj->getTeacherById();
for ($i = 0; $i < count($allTeachers); $i++) {
    print '
            <table class="table table-condensed table-bordered table-hover" border="1" >
                <thead>
                    <tr  class="active" >
                        <th scope="col">' . $days[$i] . '</th>
                        <th scope="col">8:00</th>
                        <th scope="col">9:35</th>
                        <th scope="col">11:10</th>
                        <th scope="col">12:50</th>
                        <th scope="col">14:25</th>
                        <th scope="col">16:00</th>
                        <th scope="col">17:25</th>
                    </tr>
                </thead>
                <tbody>';
    $status = "sub";
    if (SC::getSession('group') == 'lector') {
        $obj = new TimeTableStudents('group_id', $s_id, $i + 1, $status);
        print $obj->getOneDayContentForLector();
    } else {
        $obj = new TimeTableStudents('group_id', $s_id, $i + 1, $status);
        print $obj->getOneDayContent();
    }
    print '
                </tbody>
            </table>
            ';
}
?>
        </div>
    <div class="overlay" id="overlay">
        <div class="wrap"></div>
    </div>

    <?php 
for ($i = 0; $i < count($days); $i++) {
    print '
            <table class="table table-condensed table-bordered table-hover" border="1">
                <thead>
                    <tr  class="success" >
                        <th scope="col">' . $days[$i] . '</th>
                        <th scope="col">8:00</th>
                        <th scope="col">9:35</th>
                        <th scope="col">11:10</th>
                        <th scope="col">12:50</th>
                        <th scope="col">14:25</th>
                        <th scope="col">16:00</th>
                        <th scope="col">17:25</th>
                    </tr>
                </thead>
                <tbody>';
    if (SC::getSession('group') == 'admin') {
        $obj = new TimeTableStudents('group_id', $_GET['p'], $i + 1, "sub");
        print $obj->getOneDayContentForAdmin();
    } else {
        print 'Немає доступу';
    }
    print '
                </tbody>
            </table>';
}