403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/(Del)pathways.org.hk/MIS_bk/program/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/(Del)pathways.org.hk/MIS_bk/program/index.php
<?php
require_once(__DIR__ . '/../checkuser.php');
function index() {
	global $dbh;
	
	$message = $_GET['message'] ?: null;
	
	if (isPost()) {
		Db\Util::transaction($dbh, function() use ($dbh) {
			foreach ($_POST['program']['sort'] as $id => $sort) {
				$data = array(
					'id' => $id,
					'sort' => $sort,
				);
				Db\Util::update($dbh, 'mis_program', $data);
			}
		});
		$message = 'Updated';
	}
	
	$sql = "SELECT * FROM mis_program WHERE deleted = ? ORDER BY sort";
	$parameters = array(0);
	$sth = Db\Util::execute($dbh, $sql, $parameters);
	$programs = $sth->fetchAll();
	
	return array(
		'programs' => $programs,
		'message' => $message,
	);
}
extract(index());
?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	
	<?php require(__DIR__ . '/../inc/_head_meta.php'); ?>
	
	<?php require(__DIR__ . '/../inc/_head_css.php'); ?>
	
	<?php require(__DIR__ . '/../inc/_head_script.php'); ?>
	
</head>
<body>
	
	<?php require( __DIR__ . '/../inc/_navbar.php'); ?>
	
	<div class="text-right">
		<ul class="breadcrumb">
			<li><a href="#">Master</a> <span class="divider">&gt;</span></li>
			<li class="active">Program</li>
		</ul>
	</div>
	
	<div class="container-fluid pathways-container">
		
		<?php if (isset($message) && !empty($message)): ?>
		<div class="alert alert-info">
			<button type="button" class="close" data-dismiss="alert">&times;</button>
			<h5 class="alert-heading">Note:</h5>
			<p><?=$message?></p>
		</div>
		<?php endif; ?>

		<a href="form.php" class="btn pull-right"><i class="icon-plus"></i> Add</a>
		<h3>Program</h3>
		
		<?php if (empty($programs)): ?>
		<p>There are no records.</p>
		<?php else: ?>
		<div class="row-fluid" style="margin-bottom:10px">
			<div class="btn-group">
				<button id="select_all_btn" class="btn btn-small">Select All</button>
				<button id="delete_btn" class="btn btn-small">Delete</button>
			</div>
		</div>
		<script type="text/javascript">
			$(function() {
				$('#select_all_btn').click(function() {
					var $selectAllCheckbox = $('.select-all-checkbox');
					$selectAllCheckbox.prop('checked', !$selectAllCheckbox.prop('checked'));
				});
				$('#delete_btn').click(function() {
					if ($('.select-all-checkbox:checked').length == 0) {
						bootbox.alert('At least select 1 record.');
					} else {
						bootbox.dialog('Delete selected records?', [
							{
								'label': 'Delete',
								'class': 'btn-danger',
								'callback': function() {
									$('#form').attr('action', 'delete.php').submit();
								}
							},
							{
								'label': 'Cancel',
								'class': 'btn'
							}
						]);
					}
				});
			});
		</script>
		
		<form id="form" action="" method="post">
			<table class="table table-striped table-bordered table-hover table-condensed">
				<thead>
					<tr>
						<th style="min-width:20px; width:20px"></th>
						<th style="min-width:50px; width:50px">Edit</th>
						<th style="min-width:50px; width:50px">Sort</th>
						<th style="min-width:200px; width:200px">Code</th>
						<th>Name</th>
					</tr>
				</thead>
				<tbody>
					<?php foreach ($programs as $program): ?>
					<tr>
						<td><input type="checkbox" name="program[selected][]" class="select-all-checkbox" value="<?=h($program['id'])?>" /></td>
						<td><a href="form.php?id=<?=h($program['id'])?>" class="btn"><i class="icon-pencil"></i></a></td>
						<td><input type="text" name="program[sort][<?=h($program['id'])?>]" class="input-super-mini digits" value="<?=h($program['sort'])?>" maxlength="200" /></td>
						<td><?=h($program['code'])?></td>
						<td><?=h($program['name'])?></td>
					</tr>
					<?php endforeach; ?>
				</tbody>
			</table>
			<button type="submit" class="btn btn-danger">Update</button>
		</form>
		<script type="text/javascript">
			$(function() {
				$('#form').validate();
			});
		</script>
		<?php endif; ?>
	
		<?php require( __DIR__ . '/../inc/_footer.php'); ?>

	</div> <!-- /container -->
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit