예제 #1
0
function mark_new($date_time)
{
    $date_time = DateTimeCustomConvert($date_time, 'd', 'rus2mysql');
    if (isNewItem($date_time)) {
        echo '<span class=warning>new</span>';
    }
}
예제 #2
0
            echo '<td align="center" width="60"> <a href="javascript:del_confirm(\'' . f_ro($tmpval['id']) . '\',\'№';
            // <abarmin date="23.07.2009">
            // ошибка undefined index page
            $page = 1;
            if (array_key_exists("page", $_GET)) {
                $page = $_GET['page'];
            }
            echo f_ro($tmpval['num']) . ' от ' . f_ro($tmpval['date_text']) . '\',\'' . f_ro($page) . '\')" title="Удалить">';
            // </abarmin>
            echo '<img src="images/todelete.png" alt="Удалить" border="0"></a>&nbsp;&nbsp;&nbsp;';
            echo '<a href="?item_id=' . $tmpval['id'] . '&type=edit" title="Правка">
				<img src="images/toupdate.png" alt="Правка" border="0"></a></td>';
        }
        $i++;
        echo '<td width="30">&nbsp;' . color_mark($q, $tmpval['num']) . '</td>';
        $date_text = DateTimeCustomConvert($tmpval['date_text'], 'd', 'mysql2rus');
        echo '<td width="60" valign=top> ';
        if (!isset($_GET['save']) && !isset($_GET['print'])) {
            echo '<a href="?item_id=' . $tmpval['id'] . '&type=view" title="просмотреть">' . color_mark($q, $date_text) . '</a>';
        } else {
            echo $date_text;
        }
        echo '</td>';
        $tmpval['program_content'] = str_replace("\n", "<br>", $tmpval['program_content']);
        echo '<td width="*">' . color_mark($q, $tmpval['program_content']) . '&nbsp;</td>';
        if (!isset($_GET['save']) && !isset($_GET['print'])) {
            echo '<td class="notinfo">';
            //выборка на контроле---------------------------------------------------------------
            // <abarmin date="23.09.2012">
            // ошибка undefined variable search_query
            $query_control = "SELECT protocol_details.id as details_id,protocol_details.section_id,protocol_details.text_content,\n\t\t\t \tkadri.fio_short FROM protocol_details \n\t\t\t \tleft join  kadri on kadri.id=protocol_details.kadri_id \n\t\t\twhere protocol_id='" . $tmpval['id'] . "' and on_control=1 ";
예제 #3
0
            echo '<tr align="left" class="main" ' . $bgcolor . ' valign="top">';
            if (!isset($_GET['save']) && !isset($_GET['print'])) {
                echo '<td align="center"> 
		  	<a href="javascript:del_confirm(\'' . f_ro($tmpval['id']) . '\',\'' . str_replace(" ", "_", f_ro($tmpval['fio'])) . '\');" title="Удалить">
			<img src="images/todelete.png" alt="Удалить" border="0"></a>&nbsp;&nbsp;&nbsp;
			<a href="?item_id=' . $tmpval['id'] . '&type=edit&' . $query_string . '" title="Правка">
			<img src="images/toupdate.png" alt="Правка" border="0"></a></td>';
            }
            $i++;
            echo '<td>&nbsp;' . ($i + ($page - 1) * $pgVals) . '</td>';
            echo '<td>&nbsp;<a href="lect_anketa.php?kadri_id=' . $tmpval['fio_id'] . '&action=update" title="в анкету преподавателя">' . color_mark($q, $tmpval['fio']) . '</a></td>';
            echo '<td>&nbsp;' . color_mark($q, $tmpval['dolgnost']) . '</td>';
            echo '<td>&nbsp;' . color_mark($q, $tmpval['trip_count']) . '</td>';
            $date_start = DateTimeCustomConvert(substr($tmpval['date_start'], 0, 10), 'd', 'mysql2rus');
            echo '<td>&nbsp;' . color_mark($q, $date_start) . '</td>';
            $date_end = DateTimeCustomConvert(substr($tmpval['date_end'], 0, 10), 'd', 'mysql2rus');
            echo '<td>&nbsp;' . color_mark($q, $date_end) . '</td>';
            echo '<td>&nbsp;' . color_mark($q, $tmpval['trip_cost']) . '</td>';
            echo '<td>&nbsp;' . color_mark($q, $tmpval['dotation']) . '</td>';
            echo '<td>&nbsp;' . color_mark($q, $tmpval['house_type']) . '</td>';
            if (!isset($_GET['save']) && !isset($_GET['print'])) {
                echo '<td class="notinfo">&nbsp;' . color_mark($q, $tmpval['comment']) . '</td>';
            }
        }
        echo '</table></form>';
    }
    //-------------------------------------списочная таблица -конец----------------------------------------------------
    //постраничный вывод списка тем (по 10 тем)
    echo '<div align="center"> страницы ';
    $add_string = reset_param_name($query_string, 'page');
    //"&pgVals=".$pgVals;
예제 #4
0
    $query .= ' or 1>0 ';
}
$query .= ')';
if ($speciality_id > 0) {
    $query .= ' and sp.id="' . $speciality_id . '" ';
}
if (isset($search_query)) {
    if ($search_query != '') {
        $query .= $search_query;
    }
}
$query .= ' order by ' . $groupArr[0][2] . ',' . $groupArr[1][2] . ',' . $groupArr[2][2] . ',4 ';
//echo '$query='.$query;
$res_PP = mysql_query($query . ' limit ' . ($page - 1) * $pageVals . ',' . $pageVals);
if (mysql_num_rows($res_PP) == 0) {
    echo '<p class=warning style="width:80%;text-align:center;">В текущем учебном году записей не обнаружено. Возможно не указана предполагаемая дата защиты дипломного проекта, либо она раньше <u>' . DateTimeCustomConvert(substr($def_settings['date_start'], 0, 10), 'd', 'mysql2rus') . '</u>. Подробнее смотрите в <u>Примечание</u></p>';
} else {
    if (!isset($_GET['save']) && !isset($_GET['print'])) {
        echo '<table width=99% class="notinfo"><tr>';
        echo '<td align=left width=350>
	Специальность &nbsp;  
	<select name="speciality_id" id="speciality_id" style="width:200;" onChange=javascript:window.location.href="?"+this.id+"="+this.options[this.selectedIndex].value+"&' . reset_param_name(reset_param_name($query_string, 'speciality_id'), 'page') . '">';
        $query_ = 'select id,name from specialities order by name';
        echo getFrom_ListItemValue($query_, 'id', 'name', 'speciality_id');
        echo '</select> </td><td> ';
        echo '<input type=button value="Все" onclick=javascript:window.location.href="' . $curpage . '";>&nbsp;&nbsp;
	<input type=button value="Печать" onclick=javascript:window.location.href="?print=1&' . $_SERVER["QUERY_STRING"] . '";>&nbsp;&nbsp;
	<input type=button value="в Word" onclick=javascript:window.location.href="?save&attach=doc&' . $_SERVER["QUERY_STRING"] . '"></td> 
	<td align=right><input type=text name="q" id="q" width=50 value=""> &nbsp; <input type=button value="Найти" 
	OnClick=javascript:go2search();></td>
	</tr></table>';
예제 #5
0
<tr align="center" class="title">';
                //------------------------------------------- шапка списочной таблицы -начало-----------------------------------------------------
                echo '<td width="50">№</td>';
                for ($i = 1; $i <= count($table_headers); $i++) {
                    echo '<td width="' . $table_headers[$i][1] . '">' . print_col($i, $table_headers[$i][0]) . '</td>';
                }
                //------------------------------------------- шапка списочной таблицы -конец-----------------------------------------------------
                $bgcolor = '';
                $i = 1;
                while ($tmpval = mysql_fetch_array($res)) {
                    echo '<tr align="left" class="main" style="font-size:10pt;" ' . $bgcolor . ' valign="top">';
                    echo '<td>&nbsp;' . ($i + ($page - 1) * $pageVals) . '</td>';
                    $date_act = $tmpval['date_act'];
                    //$date_act=date("d.m.Y H:i:s",strtotime($tmpval['date_act']));
                    $date_act = substr($date_act, 0, 10);
                    $date_act = DateTimeCustomConvert($date_act, 'd', 'mysql2rus');
                    echo '<td>&nbsp;' . $date_act . '</td>';
                    echo '<td>&nbsp;';
                    if ($tmpval['f_cnt'] > 0) {
                        echo ' <a href="_modules/_library/index.php?action=index&filter=subject:' . $tmpval['subject_id'] . '" title="' . $tmpval['subj_n_full'] . ', пособия по предмету">' . $tmpval['subj_name'] . ' (' . $tmpval['f_cnt'] . ')</a> ';
                    } else {
                        echo $tmpval['subj_name'];
                    }
                    echo '</td>';
                    echo '<td>&nbsp;<a href="_modules/_lecturers/index.php?action=view&id=' . $tmpval['user_id'] . '" title="о преподавателе">' . $tmpval[2] . '</td>';
                    //
                    echo '<td>&nbsp;' . $tmpval['act_name'] . '</td>';
                    echo '<td>&nbsp;' . $tmpval['study_act_comment'] . '</td>';
                    echo '<td>&nbsp;<span style="color:' . $tmpval['mark_color'] . ';">' . $tmpval['mark_name'] . '</span></td>';
                    //echo $i.'. <a href="?student_id='.$a['id'].'">'.color_mark($q,$a['fio']).' ('.$a['gr_name'].')</a><p>';
                    $i++;
예제 #6
0
			<a href="?item_id=' . $tmpval['id'] . '&action=edit" title="править">
			<img src="images/toupdate.png" alt="Правка" border="0"></a>&nbsp;&nbsp;&nbsp;';
            }
            echo '<a href="filial_form.php?item_id=' . $tmpval['id'] . '&print" title="печать" target="_blank">
			<img src="images/print.gif" alt="Печать" border="0"></a>&nbsp;&nbsp;&nbsp;
			<a href="filial_form.php?save&attach=doc&item_id=' . $tmpval['id'] . '" title="передать в Word" target="_blank">
			<img src="images/design/file_types/word_file.gif" alt="Печать" border="0"></a>&nbsp;&nbsp;&nbsp;</td>';
        }
        $i++;
        echo '<td>&nbsp;' . ($i + ($page - 1) * $pgVals) . '</td>';
        echo '<td>&nbsp;<a href="lect_anketa.php?kadri_id=' . $tmpval['kadri_id'] . '&action=update" title="перейти в анкету преподавателя">' . color_mark($q, $tmpval['fio_short']) . '</a></td>';
        echo '<td>&nbsp;' . color_mark($q, $tmpval['fil_name']) . '</td>';
        echo '<td>&nbsp;' . color_mark($q, intval($tmpval['day_cnt']) > 0 ? intval($tmpval['day_cnt']) : '') . '</td>';
        echo '<td>&nbsp;' . color_mark($q, intval($tmpval['hours_cnt']) > 0 ? intval($tmpval['hours_cnt']) : '') . '</td>';
        echo '<td>&nbsp;' . color_mark($q, DateTimeCustomConvert($tmpval['day_start'], 'd', 'mysql2rus')) . '</td>';
        echo '<td>&nbsp;' . color_mark($q, DateTimeCustomConvert($tmpval['day_end'], 'd', 'mysql2rus')) . '</td>';
        echo '<td>&nbsp;' . color_mark($q, $tmpval['fil_act_name']) . '</td>';
        echo '<td>&nbsp;' . color_mark($q, $tmpval['trans_name']) . '</td>';
        if (!isset($_GET['save']) && !isset($_GET['print'])) {
            echo '<td class="notinfo">&nbsp;' . $tmpval['comment'] . '</td>';
        }
        echo "</tr>\n";
    }
    echo '</table>';
    ?>
 
</form>

<?php 
    //постраничный вывод списка данных о (по 10)
    //оптимизация для подсчета числа страниц с учетом всех условий фильтрации
예제 #7
0
    //include_once 'task_menu.php';
    echo '<br><div class="main">Консоль управления </div>
  <br>
  <div class="middle_lite">Здравствуйте, <b>' . $_SESSION['FIO'] . ',</b>';
    if (isset($_SESSION['group_blocked']) && $_SESSION['group_blocked'] == 1) {
        echo '<h4> Ваша группа <span class=warning> заблокирована </span>. Обратитесь к администратору портала </h4>';
    } else {
        //print_r($_SESSION);//
        $query = 'select ua.`last_page`,`tasks`.`name` from `' . $sql_stats_base . '`.`user_activity` ua 
	left join `tasks` on `tasks`.`url`=ua.`last_page` where ua.`user_id`=' . intval($_SESSION['id']);
        $res = mysql_query($query);
        $a = mysql_fetch_array($res);
        if ($a['name'] == '') {
            $a['name'] = $a['last_page'];
        }
        echo '<p>Последний раз вы были авторизованы: ' . DateTimeCustomConvert($_SESSION['date_time'], 'dt', 'mysql2rus') . ' &nbsp; <a href="' . $a['last_page'] . '" title="последняя посещенная страница">' . $a['name'] . "</a>";
        $query = 'SELECT count(*) as develop_news_cnt FROM `develop_news` 
  	where date_time>="' . $_SESSION['date_time'] . '" 
	ORDER BY `id` DESC LIMIT 0 , 30';
        //echo $query;
        $result = mysql_query($query);
        $a = mysql_fetch_array($result);
        if ($a['develop_news_cnt'] > 0) {
            echo '<a href="develop_news.php" title="обновления портала с момента Вашего отсутствия">
  	, обновлений портала: <b>' . $a['develop_news_cnt'] . '</b> <img src="images/notice.gif" border=0></a>';
        }
        $a = null;
        $result = null;
        echo '.</div>';
        //---------------------------------------------
        //добавляем информацию о днях рождения сотрудников, только тем, у кого открыт доступ к своей анкете
                    <tr class=title>
                        <td width="37" valign="top">№</td>
                        <td width="250" valign="top">Студент</td>
                        <td width="100" valign="top">Группа</td>
                        <td width="100" valign="top">Дата</td>
                    </tr>                   
                   ';
        $k = 1;
        while ($paramVal1 == $res_pp['comm_id'] && $i < $elemCnt) {
            //вывод ФИО студентов
            echo '
                        <tr>
                            <td >' . $k . '</td>
                            <td >' . $res_pp['stud_fio'] . '</td>
                            <td >' . $res_pp['stud_group'] . '</td>
                            <td >' . DateTimeCustomConvert(substr($res_pp['date_preview'], 0, 10), 'd', 'mysql2rus') . '</td>
                        </tr>
                        ' . "\n";
            $res_pp = mysql_fetch_assoc($res);
            $i++;
            $k++;
        }
        echo '</table><p>&nbsp;</p>' . "\n";
        $comm_cnt++;
    }
}
?>
<div><b>Число комиссий по предзащите в отчете:</b> <?php 
echo $comm_cnt;
?>
</div>
예제 #9
0
echo '<form method="get" action=""> <div class="main">Cтатистика посещений портала</div>  
	<div class="text" style="text-align:center">за <font size=+1 color="#FF0000">' . $days4stat . '</font> последних дней (с  
	<input type=text value=' . DateTimeCustomConvert($date_from, 'd', 'mysql2rus') . ' name="date_from" id="date_from" size="10">
	<button type="reset" id="f_trigger_date_from">...</button>
	<script type="text/javascript">
    Calendar.setup({
        inputField     :    "date_from",      // id of the input field
        ifFormat       :    "%d.%m.%Y",       // format of the input field "%m/%d/%Y %I:%M %p"
        showsTime      :    false,            // will display a time selector
        button         :    "f_trigger_date_from",   // trigger for the calendar (button ID)
        singleClick    :    true,           // double-click mode false
        step           :    1                // show all years in drop-down boxes (instead of every other year as default)
    });
	</script>
	по  
	<input type=text value=' . DateTimeCustomConvert($date_to, 'd', 'mysql2rus') . ' name="date_to" id="date_to" size="10">
	<button type="reset" id="f_trigger_date_to">...</button>
	<script type="text/javascript">
    Calendar.setup({
        inputField     :    "date_to",      // id of the input field
        ifFormat       :    "%d.%m.%Y",       // format of the input field "%m/%d/%Y %I:%M %p"
        showsTime      :    false,            // will display a time selector
        button         :    "f_trigger_date_to",   // trigger for the calendar (button ID)
        singleClick    :    true,           // double-click mode false
        step           :    1                // show all years in drop-down boxes (instead of every other year as default)
    });
	</script>) <input type=submit value="ok"></div></form>';
$query = 'SELECT count(*)as total_vizitors,count(distinct host_ip) as host_num,count(distinct url) as url_num
    FROM `' . $sql_stats_base . '`.`stats` 
    where 1 ' . str_replace('and is_bot=0', '', $where_sql);
//echo $query;
    
<p class=main><?php 
echo $head_title;
?>
</p>
<?php 
$query = "SELECT concat(s.fio,' - ',sg.name) as stud_name,\r\n       d.dipl_name,\r\n       dp.diplom_percent,\r\n       dp.another_view,\r\n       concat(IFNULL(k_rez.fio_short,''),IF(IFNULL(d.recenz,'')!='',concat(' - ',substring(d.recenz,1,30),'...'),'')) AS rec_fio,\r\n       dp.date_preview, " . ($comm_id == 0 ? "concat(dpc.name,' (',k_secr.fio_short,')') AS comm_name," : "") . "dp.comment,\r\n       dp.id,\r\n       dpc.id as comm_id,\r\n       d.id as dipl_id \r\n  FROM    diplom_previews dp \r\n          LEFT OUTER JOIN diplom_preview_committees dpc ON (dpc.id = dp.comm_id)\r\n          LEFT OUTER JOIN students s ON (s.id = dp.student_id) \r\n\t  LEFT OUTER JOIN study_groups sg ON (sg.id = s.group_id) \r\n          LEFT OUTER JOIN kadri k_secr ON (k_secr.id = dpc.secretary_id) \r\n\t  LEFT OUTER JOIN diploms d ON (dp.student_id = d.student_id) \r\n\t  LEFT OUTER JOIN kadri k_rez ON (k_rez.id = d.recenz_id)";
$search_query = '';
if ($q != '') {
    $search_query = ' and (
				        convert(d.dipl_name USING utf8) like "%' . $q . '%" or 
					convert(k_rez.fio_short USING utf8) like "%' . $q . '%" or 
					convert(k_secr.fio_short USING utf8) like "%' . $q . '%" or ' . ($comm_id == 0 ? 'convert(dpc.name USING utf8) like "%' . $q . '%"
					 or convert(k_secr.fio_short USING utf8) like "%' . $q . '%" or ' : ' ') . 'convert(s.fio USING utf8) like "%' . $q . '%" or
				        convert(sg.name USING utf8) like "%' . $q . '%" or
					dp.date_preview like "%' . DateTimeCustomConvert($q, 'd', 'rus2mysql') . '%" or
					convert(dp.comment USING utf8) like "%' . $q . '%"
		    )';
}
if ($comm_id > 0) {
    $search_query .= ' and dpc.id="' . $comm_id . '"';
}
$query = $query . " where 1 " . $search_query . " order by 5, " . $sort . ' ' . $stype . '';
//доп.сортировка";
$res = mysql_query($query);
$flag1 = false;
$flag2 = false;
$i = 0;
$comm_cnt = 0;
$elemCnt = mysql_num_rows($res);
$res_pp = mysql_fetch_assoc($res);