示例#1
0
function create($request)
{
    if ($request['METHOD'] == 'POST' && !empty($request['name']) && !empty($request['email']) && filter_var($request['email'], FILTER_SANITIZE_EMAIL) && !empty($request['subject']) && !empty($request['body']) && !empty($request['g-recaptcha-response'])) {
        $name = $request['name'];
        $email = $request['email'];
        $subject = $request['subject'];
        $body = $request['body'];
        $g_recaptcha_response = $request['g-recaptcha-response'];
        $REMOTE_ADDR = $request['REMOTE_ADDR'];
        $c = new ContactController();
        $resp = $c->create(compact('name', 'email', 'subject', 'body', 'g_recaptcha_response', 'REMOTE_ADDR'));
        return true;
    }
    return View::NotFound();
}
<?php

require_once 'init.php';
use Agil\View\View;
$request = View::route($_GET);
$pk = $request['pk'];
$sql = array('id_project_task_items' => $pk, 'status' => '1');
$fields = array('id_project_task_items', 'id_project_task');
$model = new ProjectTaskItems();
$model->fields = $fields;
$rs = $model->get($sql);
$rsItem = $rs[0];
$sql = array('id_project_task_items' => $rsItem['id_project_task_items'], 'status' => '1');
$fields = array('id_member');
$model = new ProjectTaskItemsMemberSet();
$model->fields = $fields;
$rsItemMembers = $model->get($sql);
$sql = array('id_project_task' => $rsItem['id_project_task'], 'status' => '1');
$fields = array('id_project');
$model = new ProjectTask();
$model->fields = $fields;
$rs = $model->get($sql);
$rs = $rs[0];
$sql = array('id_project' => $rs['id_project'], 'status' => '2');
$fields = array('id_member');
$model = new ProjectMemberSet();
$model->fields = $fields;
$rs = $model->get($sql);
?>
<div class="modal-content">
	<div class="modal-header">
<?php

require_once 'init.php';
use Agil\View\View;
use Agil\Config\Config;
use Agil\Session\Session;
$request = View::route($_POST);
if ($request['METHOD'] == 'POST' && Session::exist('logado') && (!empty($request['pk_member']) || !empty($request['remove']))) {
    $logado = Session::get('logado');
    $id_admin = $logado['id_member'];
    $pk = $request['pk'];
    $pk_members = explode("|", $request['pk_member']);
    unset($pk_members[0]);
    $remove = $request['remove'] ? $request['remove'] : 0;
    $model = new TeamMemberSet();
    if ($remove) {
        if (count($pk_members) > 0) {
            foreach ($pk_members as $index => $pk_member) {
                $sql = array('id_member' => $pk_member, 'status' => '1');
                $rs = $model->get($sql);
                if (count($rs) > 0) {
                    $model->fields = array('status' => '0');
                    $update = $model->update($sql);
                    if ($update) {
                        $model = new Team();
                        $sql = array('id_team' => $pk, 'id_admin' => $logado['id_member'], 'status' => 1);
                        $model->fields = array('id_project');
                        $rs = $model->get($sql);
                        $rs = $rs[0];
                        ?>
						<script>