Example #1
0
include_once '../init.php';
include 'header.php';
include_once '../include/teachers.php';
?>
<div align="center">
<span class="head_top">Список учителей школы:</span>
<table id="rounded-corner">
  <thead>
  <tr>
    <th class="rounded-left"> Ф.И.О.</th>
    <th class="rounded-right">&nbsp;</th>
  </tr>
  </thead>
  <tbody>
<?php 
$teacher_list = get_teachers_list();
foreach ($teacher_list as $teacher) {
    echo "<tr><td>{$teacher['first_name']} {$teacher['middle_name']} {$teacher['last_name']}</td><td>\n  <a href=\"teacher.php?teacher_id={$teacher['teacher_id']}&" . uniqid('') . "&keepThis=true&TB_iframe=true&height=350&width=330&modal=true\" class=\"thickbox\" title=\"Редактировать информацию об учителе\">Редактировать</a></td></tr>";
}
?>
</tbody>
<tfoot>
    	<tr>
       	  <td class="rounded-foot-left">&nbsp;</td>
        	<td class="rounded-foot-right"><a href="" onClick="javascript: tb_show('Добавить', 'teacher.php?<?php 
echo uniqid('');
?>
&keepThis=true&TB_iframe=true&height=330&width=350&modal=true'); return false;" class="add" title="Добавить">Добавить</a>
      </td>
        </tr>
    </tfoot>
Example #2
0
<?php

/*****************************************************************************\
+-----------------------------------------------------------------------------+
| SchoolReg                                                                   |
| Copyright (c) 2010 Z.                                                       |
| Copyright (c) 2009 Sergey V. Kuzin <*****@*****.**>                      |
| All rights reserved.                                                        |
+-----------------------------------------------------------------------------+
\*****************************************************************************/
#
# $Id: add_class.php 4 2010-02-02 18:52:58Z kuzmich $
#
define('ADMIN_ZONE', true);
include_once '../init.php';
include_once '../include/teachers.php';
include_once '../include/classes.php';
$renderArray['class_numbers'] = $config['class']['numbers'];
$renderArray['class_letters'] = $config['class']['letters'];
if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'add') {
    $res = add_new_class(intval($_REQUEST['class']), $_REQUEST['letter'], intval($_REQUEST['school_year_id']), intval($_REQUEST['teacher_id']));
    echo json_encode($res);
} else {
    $teachers = get_teachers_list();
    $school_year_id = intval(@$_REQUEST['school_year_id']) or die('Invalid call');
    $template_name = 'add_class-ajax.html';
    $renderArray['teachers'] = $teachers;
    $renderArray['school_year_id'] = $school_year_id;
    $template = $twig->loadTemplate('admins/' . $template_name);
    echo $template->render($renderArray);
}