Beispiel #1
1
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
$itemID = get_id(2);
$itemsClass = new items();
$item = $itemsClass->get($itemID);
if (!is_array($item) || check_login_bool() && $item['status'] == 'unapproved' && $item['user_id'] != $_SESSION['user']['user_id'] || $item['status'] == 'queue' || $item['status'] == 'extended_buy') {
    header("HTTP/1.0 404 Not Found");
    header("Location: http://" . DOMAIN . "/" . $languageURL . "error");
}
abr('item', $item);
    public static function html($report)
    {
        ?>
		<table id="origin" class="plan" xmlns="http://www.w3.org/1999/html">

			<?php 
        static::html_head();
        ?>

			<tbody>
				<?php 
        $i = 1;
        $educations = education_preview::get_by_report(get('report_id'));
        $optional = [];
        foreach ($educations as $education) {
            ob_start();
            $items = education_items_preview::get_by_order($education->id);
            $summ = [];
            foreach ($items as $item) {
                if ($item->is_optional) {
                    $optional[] = $item;
                    continue;
                }
                ?>
<tr><?php 
                ?>
<td><?php 
                echo $i;
                ?>
</td><?php 
                ?>
<td class="text-left"><?php 
                echo $item->name;
                ?>
</td><?php 
                $vals = education_items_values_preview::get_by_education_item_id($item->id);
                for ($j = 0; $j < 41; $j++) {
                    ?>
<td><?php 
                    foreach ($vals as $val) {
                        if ($val->col_num - 1 == $j) {
                            echo $val->value;
                            if (!isset($summ[$j])) {
                                $summ[$j] = 0;
                            }
                            $summ[$j] += $val->value;
                            break;
                        }
                    }
                    ?>
</td><?php 
                }
                ?>
</tr><?php 
                $i++;
            }
            $buffer = ob_get_clean();
            ?>
						<tr class="borders">
							<td></td>
							<td class="text-left bold">
								<?php 
            echo $education->name;
            ?>
							</td>
							<?php 
            for ($j = 0; $j < 41; $j++) {
                ?>
<td><b><?php 
                echo get($j, $summ);
                ?>
</b></td><?php 
            }
            ?>
						</tr>
						<?php 
            echo $buffer;
        }
        ?>
			</tbody>
		</table>

		<table class="summary">
			<?php 
        static::html_head(true);
        ?>

			<tbody>
				<tr>
					<td>1</td>
					<td class="text-left bold">Количество часов учебных занятий</td>

					<?php 
        $educations = education_preview::get_by_report(get('report_id'));
        $items = [];
        foreach ($educations as $education) {
            $items = array_merge(education_items_preview::get_by_order($education->id), $items);
        }
        $item_ids = [];
        foreach ($items as $item) {
            $item_ids[] = $item->id;
        }
        $edication_items = education_items_values_preview::get_by_education_item_ids($item_ids);
        $summary = [];
        foreach ($edication_items as $item) {
            if (!isset($summary[$item->col_num])) {
                $summary[$item->col_num] = 0;
            }
            $summary[$item->col_num] += $item->value;
        }
        ksort($summary);
        for ($i = 0; $i < 40; $i++) {
            ?>
<td><?php 
            echo get($i + 2, $summary);
            ?>
</td><?php 
        }
        ?>
				</tr>

				<tr>
					<td>2</td>
					<td class="text-left bold">Количество курсовых проектов</td>

					<?php 
        for ($i = 0; $i < 40; $i++) {
            ?>
<td></td><?php 
        }
        ?>
				</tr>

				<tr>
					<td>3</td>
					<td class="text-left bold">Количество курсовых работ</td>

					<?php 
        for ($i = 0; $i < 40; $i++) {
            ?>
<td></td><?php 
        }
        ?>
				</tr>

				<tr>
					<td>4</td>
					<td class="text-left bold">Количество расчётных работ</td>

					<?php 
        for ($i = 0; $i < 40; $i++) {
            ?>
<td></td><?php 
        }
        ?>
				</tr>

				<tr>
					<td>5</td>
					<td class="text-left bold">Количество типовых расчётов</td>

					<?php 
        for ($i = 0; $i < 40; $i++) {
            ?>
<td></td><?php 
        }
        ?>
				</tr>

				<tr>
					<td>6</td>
					<td class="text-left bold">Количество экзаменов</td>

					<?php 
        for ($i = 0; $i < 40; $i++) {
            ?>
<td></td><?php 
        }
        ?>
				</tr>

				<tr>
					<td>7</td>
					<td class="text-left bold">Количество зачётов</td>

					<?php 
        for ($i = 0; $i < 40; $i++) {
            ?>
<td></td><?php 
        }
        ?>
				</tr>
			</tbody>
		</table>

		<div class="optionals">
			<table class="optional width-40">
				<tbody>
					<tr>
						<td class="bold" colspan="4">IV. Факультативные дисциплины</td>
					</tr>

					<tr>
						<td class="bold">№ п/п</td>
						<td class="bold">Название дисциплины</td>
						<td class="bold">Семестр</td>
						<td class="bold">Часов</td>
					</tr>

					<?php 
        foreach ($optional as $key => $item) {
            ?>
							<tr>
								<td><?php 
            echo $key + 1;
            ?>
</td>
								<td><?php 
            echo $item->name;
            ?>
</td>
								<td></td>
								<td></td>
							</tr>
							<?php 
        }
        ?>
				</tbody>
			</table>

			<table class="optional width-20">
				<tbody>
					<tr>
						<td class="bold width-20" colspan="4">V. Учебная практика</td>
					</tr>

					<tr>
						<td class="bold">№ п/п</td>
						<td class="bold">Название практики</td>
						<td class="bold">Семестр</td>
						<td class="bold">Недель</td>
					</tr>

					<?php 
        $lines = $report->study_practice;
        $lines = string::lines($lines);
        if ($lines) {
            foreach ($lines as $key => $line) {
                $vals = explode(' ', $line);
                ?>
								<tr>
									<td><?php 
                echo $key + 1;
                ?>
</td>
									<td><?php 
                echo items::get($vals, 1);
                ?>
</td>
									<td><?php 
                echo items::get($vals, 2);
                ?>
</td>
									<td><?php 
                echo items::get($vals, 3);
                ?>
</td>
								</tr>
								<?php 
            }
        }
        ?>
				</tbody>
			</table>

			<table class="optional width-20">
				<tbody>
					<tr>
						<td class="bold width-20" colspan="3">VI. Производственная практика</td>
					</tr>

					<tr>
						<td class="bold">Название практики</td>
						<td class="bold">Семестр</td>
						<td class="bold">Недель</td>
					</tr>

					<?php 
        $lines = $report->manufact_practice;
        $lines = string::lines($lines);
        if ($lines) {
            foreach ($lines as $key => $line) {
                $vals = explode(' ', $line);
                ?>
								<tr>
									<td><?php 
                echo items::get($vals, 1);
                ?>
</td>
									<td><?php 
                echo items::get($vals, 2);
                ?>
</td>
									<td><?php 
                echo items::get($vals, 3);
                ?>
</td>
								</tr>
								<?php 
            }
        }
        ?>
				</tbody>
			</table>

			<table class="optional width-10">
				<tbody>
					<tr>
						<td class="bold width-10">VII. Дипломные проекты или дипломные работы</td>
					</tr>

					<tr>
						<td><?php 
        echo $report->grad_work;
        ?>
</td>
					</tr>
				</tbody>
			</table>

			<table class="optional width-10">
				<tbody>
					<tr>
						<td class="bold width-10">VIII. Государственный экзамен</td>
					</tr>

					<tr>
						<td><?php 
        echo $report->gos_exam;
        ?>
</td>
					</tr>
				</tbody>
			</table>
		</div>

		<script>
			$(function()
			{
				report.paper.table.optional.format();
			});
		</script>

		<div class="page-break"></div>
		<?php 
    }
Beispiel #3
0
$cms = new items();
require_once ROOT_PATH . '/apps/users/models/users.class.php';
$usersClass = new users();
$data = $cms->getForUpdate($_GET['id']);
//获取所有预览图
$data['preview'] = $itemsClass->get_theme_preview($data['item_id'], true);
$data['preview_status'] = 0;
if (empty($data['theme_preview'])) {
    $data['preview_status'] = 1;
}
//路径
$data["thumbnail"] = empty($data["thumbnail"]) ? "" : DATA_SERVER . '/uploads/items/' . $data['item_id'] . '/' . $data["thumbnail"];
$data["first_preview"] = empty($data["first_preview"]) ? "" : DATA_SERVER . '/uploads/items/' . $data['item_id'] . '/' . $data["first_preview"];
$data["main_file"] = empty($data["main_file"]) ? "" : DATA_SERVER . '/uploads/items/' . $data['item_id'] . '/' . $data["main_file"];
abr('data', $data);
$item = $cms->get($data['item_id']);
if (!is_array($item)) {
    refresh('?m=' . $_GET['m'] . '&c=queue_update', 'WRONG ID', 'error');
}
$item['user'] = $usersClass->get($item['user_id']);
$item["thumbnail"] = DATA_SERVER . '/uploads/items/' . $data['item_id'] . '/' . $item["thumbnail"];
$item["theme_preview"] = DATA_SERVER . '/uploads/items/' . $data['item_id'] . '/' . $item["theme_preview"];
$item["main_file"] = DATA_SERVER . '/uploads/items/' . $data['item_id'] . '/' . $item["main_file"];
abr('item', $item);
if (isset($_POST['submit'])) {
    if ($_POST['action'] == 'approve') {
        $s = $cms->approveUpdate($_GET['id']);
        if ($s === true) {
            refresh("?m=" . $_GET['m'] . "&c=queue_update&p=" . $_GET['p'], $langArray['complete_approve_item_update']);
        } else {
            addErrorMessage($s, '', 'error');
Beispiel #4
0
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['queue']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=queue', 'WRONG ID', 'error');
}
if (!isset($_GET['p'])) {
    $_GET['p'] = '1';
}
$cms = new items();
require_once ROOT_PATH . '/apps/users/models/users.class.php';
$usersClass = new users();
$data = $cms->get($_GET['id'], false);
$data['preview'] = $cms->get_theme_preview($_GET['id']);
$data['user'] = $usersClass->get($data['user_id']);
//路径
$data["thumbnail"] = DATA_SERVER . '/uploads/items/' . $_GET['id'] . '/' . $data["thumbnail"];
$data["theme_preview"] = DATA_SERVER . '/uploads/items/' . $_GET['id'] . '/' . $data["theme_preview"];
$data["main_file"] = DATA_SERVER . '/uploads/items/' . $_GET['id'] . '/' . $data["main_file"];
abr('data', $data);
if (isset($_POST['submit'])) {
    if ($_POST['action'] == 'approve') {
        $s = $cms->approve($_GET['id']);
        if ($s == true) {
            refresh("?m=" . $_GET['m'] . "&c=queue&p=" . $_GET['p'], $langArray['complete_approve_item']);
        } else {
            addErrorMessage($s, '', 'error');
        }
Beispiel #5
0
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'WRONG ID', 'error');
}
$cms = new comments();
if (isset($_GET['report']) && is_numeric($_GET['report'])) {
    $cms->reported($_GET['report']);
}
$data = $cms->getAll(START, LIMIT, " `item_id` = '" . $_GET['id'] . "' ");
if (is_array($data)) {
    require_once ROOT_PATH . '/apps/users/models/users.class.php';
    $usersClass = new users();
    $users = $usersClass->getAll(0, 0, $cms->usersWhere);
    abr('users', $users);
}
abr('data', $data);
$p = paging("?m=" . $_GET['m'] . "&c=comments&id=" . $_GET['id'] . "&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
$itemsClass = new items();
$item = $itemsClass->get($_GET['id']);
_setTitle($item['name'] . ' &rsaquo; ' . $langArray['comments']);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
Beispiel #6
0
        die('
				jQuery("#follow").html("' . $text . '");
			');
    }
    refresh('/' . $languageURL . 'user/' . $users['username']);
}
#加载公开书签集
require_once ROOT_PATH . '/apps/collections/models/collections.class.php';
$collectionsClass = new collections();
$collections = $collectionsClass->getAll(0, 2, " `public` = 'true' AND `user_id` = '" . intval($users['user_id']) . "' ");
abr('collections', $collections);
#获取推荐文件
if ($users['featured_item_id'] != '0') {
    require_once ROOT_PATH . '/apps/items/models/items.class.php';
    $itemsClass = new items();
    $featureItem = $itemsClass->get($users['featured_item_id'], true);
    abr('featureItem', $featureItem);
}
#获取粉丝
$follow['to'] = $usersClass->getFollowers($users['user_id'], 0, 9, 'RAND()', true);
$follow['to_count'] = $usersClass->foundRows;
$follow['from'] = $usersClass->getFollowers($users['user_id'], 0, 9, 'RAND()');
$follow['from_count'] = $usersClass->foundRows;
abr('follow', $follow);
$follow['toto'] = $usersClass->getFollowers($users['user_id'], 0, 10000000, 'RAND()', true);
$follow['toto_count'] = $usersClass->foundRows;
$follow['fromfrom'] = $usersClass->getFollowers($users['user_id'], 0, 10000000, 'RAND()');
$follow['fromfrom_count'] = $usersClass->foundRows;
abr('follow', $follow);
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'users/' . $users['username'] . '" title="">' . $users['username'] . '</a>');