• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP privilege函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中privilege函数的典型用法代码示例。如果您正苦于以下问题:PHP privilege函数的具体用法?PHP privilege怎么用?PHP privilege使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了privilege函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: startNewSession

 public function startNewSession()
 {
     if (!loggedIn() && (privilege() != 'dean' || privilege() != 'director' || privilege() != 'admin')) {
         return 0;
     }
     $this->_connect();
     if (!Session::exists('semester_session')) {
         $type = 'odd';
         $session = date('Y');
     } else {
         if (Session::get('semester_type') === 'even') {
             $type = 'odd';
             $session = Session::get('semester_session');
         } else {
             if (Session::get('semester_type') === 'odd') {
                 $type = 'even';
                 $session = Session::get('semester_session') + 1;
             }
         }
     }
     $timestamp = date('Y-m-d H:i:s');
     $query = "INSERT INTO semester_session (session,type,starting_timestamp) VALUES('" . $session . "','" . $type . "','" . $timestamp . "')";
     $result = $this->_db->query($query);
     if ($this->_db->affected_rows && $this->_db->error == '') {
         $this->getRunningSession();
         return 1;
     } else {
         return 0;
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:30,代码来源:Semester.php


示例2: importCSV

 public function importCSV($course_code, $course_dep, $filename)
 {
     if (!loggedIn() || privilege() == NULL || privilege() == 'admin') {
         return 0;
     }
     $file = fopen($filename, "r");
     $count = 0;
     while (($data = fgetcsv($file, 10000, ",")) !== FALSE) {
         $count++;
         if ($count > 1) {
             $save = $this->newEntry($data[0], $course_code, $course_dep, $data[1], $data[2]);
         }
     }
     fclose($file);
     return 1;
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:16,代码来源:Attendance.php


示例3: privilegePriority

/**
 * Admin has a priority of 0
 * Director, Dean  has a priority of 1
 * HOD has a priority of 2
 * DUPC/DPPC has a priority of 3
 * Teacher has a priority of 4
 * Student has a priority of 5
 * @return integer
 * @author Harsh Vardhan Ladha & Yogesh Chauhan
 * @package MIS
 * @link http://mis.nits.ac.in
 * @license NIT Silchar
 */
function privilegePriority()
{
    switch (privilege()) {
        case 'admin':
            return 0;
        case 'director':
        case 'dean':
            return 1;
        case 'hod':
            return 2;
        case 'dupc':
        case 'dppc':
            return 3;
        case 'teacher':
            return 4;
        case 'student':
            return 5;
    }
}
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:32,代码来源:privilege.php


示例4: Validate

<?php

require_once '../core/init.php';
if (Input::exists() && privilege() != NULL && privilege() != 'admin') {
    $validate = new Validate();
    $validation = $validate->check($_POST, array('course_id' => array('required' => true)));
    if ($validate->passed()) {
        if (empty($_FILES["file"]["tmp_name"])) {
            echo '<div class="alert alert-danger alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
            echo 'Please Select CSV File';
            echo '</div>';
            die;
        }
        $input = explode(',', Input::get('course_id'));
        $m = new Attendance();
        $import = $m->importCSV($input[0], $input[1], $_FILES["file"]["tmp_name"]);
        if ($import) {
            echo '<div class="alert alert-success alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
            echo "Successfully Imported";
            echo '</div>';
        } else {
            echo '<div class="alert alert-danger alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
            echo "Temporary problem!";
            echo '</div>';
        }
    } else {
        echo '<div class="alert alert-warning alert-dismissible" role="alert">';
        echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:import_attendance.php


示例5: Validate

<?php

require_once '../core/init.php';
if (Input::exists('post') && privilege() != NULL) {
    $validate = new Validate();
    $validation = $validate->check($_POST, array('coursecode' => array('required' => true), 'department' => array('required' => true), 'teacher' => array('required' => true), 'semester' => array('required' => true)));
    if ($validate->passed()) {
        $course = new Course();
        $add = $course->appointCourse(Input::get('teacher'), Input::get('coursecode'), Input::get('semester'), Input::get('department'));
        if ($add == 3) {
            echo '<div class="alert alert-danger alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
            echo 'Sorry, This teacher is not yet approved to use this system.';
            echo '</div>';
        } else {
            if ($add == 2) {
                echo '<div class="alert alert-danger alert-dismissible" role="alert">';
                echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
                echo 'Same course is already assigned to same teacher in this department.';
                echo '</div>';
            } else {
                if ($add == 1) {
                    echo '<div class="alert alert-success alert-dismissible" role="alert">';
                    echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
                    echo 'Course assigned to teacher successfully.';
                    echo '</div>';
                } else {
                    if ($add == 0) {
                        echo '<div class="alert alert-danger alert-dismissible" role="alert">';
                        echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
                        echo 'Temporary Error!';
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:assign_course_teacher.php


示例6: Student

<?php

require_once '../core/init.php';
if (!loggedIn() || privilege() == NULL || privilege() == 'admin') {
    die;
}
?>
<!-- DATA TABLES -->
<link href="css/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<?php 
$s = new Student();
$s->getInfo(Session::get('sn'));
?>
				<section class="content-header">
                    <h1>
                        Attendance System
                        <small>View attendance</small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="home.php"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li><a href="#">Attendance System</a></li>
                        <li class="active">View attendance</li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">
                	<div class="row">
                		<div class="col-md-1">
                			&nbsp;
                		</div>
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:attendance_page.php


示例7: Validate

<?php

require_once '../core/init.php';
if (Input::exists() && privilege() != NULL) {
    $validate = new Validate();
    $validation = $validate->check($_POST, array('course_id' => array('required' => true), 'examtype' => array('required' => true), 'category' => array('required' => true)));
    if ($validate->passed()) {
        $m = new Marks();
        $lastdate = $m->getLastDate(Input::get('examtype'))->fetch_object()->date;
        $today = date('Y-m-d');
        if ($today >= $lastdate) {
            $date = date_create($lastdate);
            echo '<div class="alert alert-danger alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
            echo "Last Date for " . strtoupper(Input::get('examtype')) . " was " . date_format($date, 'd-M-Y');
            echo '</div>';
            die;
        }
        if (empty($_FILES["file"]["tmp_name"])) {
            echo '<div class="alert alert-danger alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
            echo 'Please Select CSV File';
            echo '</div>';
            die;
        }
        $input = explode(',', Input::get('course_id'));
        $m = new Marks();
        $import = $m->importCSV($input[0], $input[1], Input::get('examtype'), Input::get('category'), $_FILES["file"]["tmp_name"]);
        if ($import) {
            echo '<div class="alert alert-success alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:import_excel.php


示例8:

<?php

require_once '../core/init.php';
if (!loggedIn()) {
    die;
}
if (privilege() == NULL) {
    die;
}
?>
                    <div class="row" id="content_area">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-header">
                                    <h3 class="box-title">List of all Teachers</h3>
                                </div><!-- /.box-header -->
                                <div class="box-body table-responsive">
                                    <table id="example1" class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
                                                <th>Name</th>
                                                <th>Privilege</th>
                                                <th>Department</th>
                                                <th>Email</th>
                                                <th>Mobile</th>
                                                <th>Approved</th>
                                                <th>Blocked</th>
                                                <th>&nbsp;</th>
                                            </tr>
                                        </thead>
                                        <tbody>
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:load_teacher.php


示例9: updateBiography

 public function updateBiography($scholar_no, $biography, $cv = '')
 {
     if (!loggedIn() || privilege() == NULL) {
         return 0;
     }
     $this->_connect();
     $scholar_no = $this->_db->real_escape_string(escape($scholar_no));
     $biography = $this->_db->real_escape_string($biography);
     if ($cv == '') {
         $query = "UPDATE students_info SET biography = '" . $biography . "' WHERE scholar_no='" . $scholar_no . "'";
     } else {
         $cv = $this->_db->real_escape_string($cv);
         $query = "UPDATE students_info SET biography = '" . $biography . "', cv_link='" . $cv . "' WHERE scholar_no='" . $scholar_no . "'";
     }
     $result = $this->_db->query($query);
     if ($this->_db->error == '') {
         if ($this->_db->affected_rows) {
             return 1;
         } else {
             return 2;
         }
     } else {
         return 0;
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:25,代码来源:Student.php


示例10:

                            </ul>
                        </li>
                        <?php 
if (privilege() != 'admin') {
    ?>
                        <li <?php 
    echo Session::get('side-nav-active') === 'attendance' ? 'class=active' : '';
    ?>
 >
                            <a href="attendance.php">
                                <i class="fa fa-calendar"></i> <span>Attendance System</span>
                            </a>
                        </li>
                        <?php 
}
if (privilege() === 'admin' || privilege() === 'director' || privilege() === 'dean') {
    ?>
                        <li <?php 
    echo Session::get('side-nav-active') === 'settings' ? 'class=active' : '';
    ?>
 >
                            <a href="settings.php">
                                <i class="fa fa-wrench"></i> <span>System Settings</span>
                            </a>
                        </li>
                        <?php 
}
?>
                    </ul>
                </section>
                <!-- /.sidebar -->
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:sidebar.php


示例11:

<?php

require_once 'core/init.php';
if (!loggedIn()) {
    Redirect::to('index.php');
} else {
    if (loggedIn() && (privilege() === 'teacher' || privilege() === 'dppc' || privilege() === 'dupc') || privilege() === 'student') {
        include 'includes/errors/404.php';
        die;
    }
}
?>
<link rel="icon" href="images/nits2.jpg">
<link rel="shortcut icon" href="images/nits2.jpg" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/result.css">
<script>
	function load_pie(type){
		$("#pie").load('ajax/log_pie.php?type='+type);
	}
</script>
<div class="tableh">System Log</div>
		<div class="res">
			<table>
				<tr>
					<td class="sel">
						Select Log Type
					</td>
					<td>
						<select name="credit" class="box" OnChange="load_pie(this.value);">
							<option value="" selected>Default</option>
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:system_log.php


示例12: Approval

<?php

require_once '../core/init.php';
if (loggedIn() && privilege() != NULL) {
    if (Input::exists('get')) {
        $tid = Input::get('tid');
        $cid = Input::get('cid');
        $did = Input::get('did');
        $a = new Approval();
        $b = $a->approve($tid, $cid, $did);
        if ($b === 1) {
            echo '<div class="alert alert-success alert-dismissible" role="alert">';
            echo 'Result approved!';
            echo '</div>';
        } else {
            if ($b === 2) {
                echo '<div class="alert alert-warning alert-dismissible" role="alert">';
                echo 'Already approved by you!';
                echo '</div>';
            } else {
                if ($b === 0) {
                    echo '<div class="alert alert-success alert-dismissible" role="alert">';
                    echo 'Temporary Error!';
                    echo '</div>';
                } else {
                    echo '<div class="alert alert-danger alert-dismissible" role="alert">';
                    echo $b;
                    echo '</div>';
                }
            }
        }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:approve_result.php


示例13: remove_appointed_course

 public function remove_appointed_course($id, $course_code, $department, $semester)
 {
     if (!loggedIn()) {
         return 'Temporary Problem.';
     }
     if (loggedIn() && (privilege() === 'teacher' || privilege() === 'dppc' || privilege() === 'dupc' || privilege() == NULL)) {
         return 'Access Denied. No privilege.';
     }
     $this->_connect();
     $id = $this->_db->real_escape_string($id);
     $course_code = $this->_db->real_escape_string($course_code);
     $department = $this->_db->real_escape_string($department);
     $semester = $this->_db->real_escape_string($semester);
     $query = "DELETE FROM courses_appointed WHERE id='" . $id . "' AND course_code='" . $course_code . "' AND course_dep='" . $department . "' AND course_sem='" . $semester . "'AND timestamp>=' " . Session::get('semester_timestamp') . "'";
     $result = $this->_db->query($query);
     if ($this->_db->affected_rows) {
         if ($this->_db->error == '') {
             return 'Entry has been Deleted';
         } else {
             echo '1';
             die($this->_db->error);
         }
     } else {
         return 'Temporary Problem.';
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:26,代码来源:Course.php


示例14: deleteT

 public function deleteT($t_id = '', $privilege = 'teacher')
 {
     if (loggedIn() && ($privilege === 'director' && (privilege() === 'hod' || privilege() === 'dupc' || privilege() === 'dppc' || privilege() === 'teacher') || $privilege === 'dean' && (privilege() === 'hod' || privilege() === 'dupc' || privilege() === 'dppc' || privilege() === 'teacher') || $privilege === 'hod' && (privilege() === 'dupc' || privilege() === 'dppc' || privilege() === 'teacher') || $privilege === 'dppc' && privilege() === 'teacher' || $privilege === 'dupc' && privilege() === 'teacher')) {
         return 'No privilege';
     }
     if (loggedIn() && $this->deleteTeacherError($t_id)) {
         return "Sorry, cannot remove this teacher because he/she already has<br/>(<i>in this running session</i>)<br/>" . ($this->_tce != 0 ? " <b>{$this->_tce}</b> courses appointed.<br/>" : "") . ($this->_tae != 0 ? " <b>{$this->_tae}</b> subject results not fully approved." : "");
     }
     if (loggedIn()) {
         if (Session::exists('teacher_id')) {
             if (Session::get('teacher_id') == $t_id) {
                 return 'Can\'t delete yourself.';
             }
         }
         $this->_connect();
         $this->_id = $this->_db->real_escape_string(escape($t_id));
         $query = "DELETE FROM teachers WHERE teacher_id='" . $this->_id . "'";
         $result = $this->_db->query($query);
         if ($this->_db->affected_rows) {
             if ($this->_db->error == '') {
                 return 'Teacher removed.';
             } else {
                 die($this->_db->error);
             }
         } else {
             return 'Temporary Error';
         }
     }
     if (!loggedIn()) {
         return 'Temporary error';
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:32,代码来源:Teacher.php


示例15: Semester

<?php

require_once '../core/init.php';
if (Input::exists('get') && Input::get('a') != '' && (privilege() == 'dean' || privilege() == 'director' || privilege() == 'admin')) {
    $ab = Input::get('a');
    $s = new Semester();
    if ($ab == 1) {
        $a = $s->startRegistration();
        if ($a == 1) {
            echo '<div class="alert alert-success alert-dismissible" role="alert">';
            echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
            echo 'Registration process started.';
            echo '</div>';
        } else {
            if ($a == 2) {
                echo '<div class="alert alert-warning alert-dismissible" role="alert">';
                echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
                echo 'No changes made.';
                echo '</div>';
            } else {
                if ($a == 0) {
                    echo '<div class="alert alert-danger alert-dismissible" role="alert">';
                    echo '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
                    echo 'Invalid authentication. Please try again later or re-login.';
                    echo '</div>';
                }
            }
        }
    }
    if ($ab == 2) {
        $a = $s->stopRegistration();
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:registration_action.php


示例16: Course

<?php

require_once 'core/init.php';
include 'header.php';
if (!loggedIn()) {
    Redirect::to('index.php');
}
if (loggedIn() && !Session::exists('teacher_id') || privilege() == NULL) {
    Session::destroy();
    Redirect::to('includes/errors/unauthorized.php');
}
?>
<div id="update"></div>
<form id="import" method="post" action="import_excel.php">
<div class="box box-default">
	<div class="box-header">
		<h3 class="box-title">Import CSV/Excel file</h3>
	</div>
	<div class="box-body">
		<div class="form-group">
							      				<label for="course">Select course with respective department</label>
							      				<select name="course_id" class="form-control">
													<option value="" >Select your Course</option>
													<?php 
$i = 0;
$c = new Course();
$courses = $c->getAppointed(Session::get('teacher_id'));
while (!empty($courses) && ($course = $courses->fetch_object())) {
    ?>
													                    <option  value="<?php 
    echo $course->course_code . ',' . $course->course_dep;
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:import_excel.php


示例17: inj3ct_sql

        return false;
    }
}
if ($argv[5] == "normal") {
    $normal = inj3ct_sql($argv[1], $argv[2], $argv[3], $argv[4]);
    if (isset($normal[0])) {
        echo "[?] Password: {$normal['1']}\r\n";
        echo "[?] Username: {$normal['0']}\r\n";
        die;
    } else {
        echo "[?] Exploit Failed!\r\n";
        die;
    }
}
if ($argv[5] == "privilege") {
    if (privilege($argv[1], $argv[2], $argv[3], $argv[4])) {
        echo "[?] Added New Administrator\r\n";
        echo "[?] Username: {$argv['3']}\r\n";
        echo "[?] Password: {$argv['4']}\r\n";
        die;
    } else {
        echo "[?] Exploit Failed!\r\n";
        die;
    }
}
function http_request($conn, $path, $post)
{
    if (!preg_match('/\\w:[0-9]/i', $conn)) {
        usage();
    }
    $addr = explode(':', $conn);
开发者ID:SuperQcheng,项目名称:exploit-database,代码行数:31,代码来源:6764.php


示例18: Semester

<?php

require_once '../core/init.php';
if (privilege() == NULL || privilege() == 'teacher' || privilege() == 'hod' || privilege() == 'dupc' || privilege() == 'dppc') {
    die;
}
$sem = new Semester();
$new = $sem->startNewSession();
if ($new) {
    if (Session::exists('semester_session')) {
        ?>
        <table class="table">
										<tr>
											<th>Session (year)</th>
											<td><?php 
        echo Session::get('semester_session');
        ?>
</td>
										</tr>
										<tr>
											<th>Type</th>
											<td><?php 
        echo strtoupper(Session::get('semester_type'));
        ?>
</td>
										</tr>
										<tr>
											<th>Starting Date</th>
											<td>
												<?php 
        $date = Session::get('semester_timestamp');
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:new_session.php


示例19: Student

<?php

if (!loggedIn() || privilege() == NULL) {
    Redirect::to('logout.php');
}
$s = new Student();
$s->getInfo(Session::get('sn'));
?>
<section class="content-header">
                    <h1>
                        Public Profile
                        <small>Your Public Profile</small>
                        <b><small>http://nits.ac.in/s/<?php 
$username = explode('@', $s->getEmail())[0];
echo "{$username}";
?>
</small></b>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="home.php"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li class="active"><a href="#">Public Profile</a></li>
                    </ol>
</section>

<!-- Main content -->
<section class="content">
	<div class="row" id="preview">
		
	</div>
	<div class="row">
		<div class="col-md-12">
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:profile_page.php


示例20: Teacher

<?php

require_once '../core/init.php';
if (Input::exists('get') || !Input::exists() || privilege() == NULL) {
    die;
}
$type = Input::get('examtype');
$t = new Teacher();
$tt = $t->getInfo(Session::get('teacher_id'));
if (!Input::get('course_id')) {
    ?>
				<div class="box box-primary">
	
					<div class="box-header">
						<h3 class="box-title">Please Select Course</h3>
					</div> <!-- ./box header -->
				</div>
				<?php 
    die;
}
if (!Input::get('examtype')) {
    ?>
				<div class="box box-primary">
	
					<div class="box-header">
						<h3 class="box-title">Please Select Exam Type</h3>
					</div> <!-- ./box header -->
				</div>
				<?php 
    die;
}
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:31,代码来源:load_form.php



注:本文中的privilege函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP privmsg函数代码示例发布时间:2022-05-15
下一篇:
PHP privacy_update函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap