<?php require_once 'init.php'; use Agil\Session\Session; $logado = Session::get('logado'); $id_admin = $logado['id_member']; $project = new Project(); $project->fields = array('id_project', 'title', 'slug'); $rs = $project->get(array('id_admin' => $id_admin, 'status' => '1')); $projectMember = new ProjectMemberSet(); $projectMember->fields = array('id_project_member_set', 'id_member', 'id_project'); $memberRow = $projectMember->get(array('id_member' => $id_admin, 'status' => '2')); foreach ($memberRow as $index => $member) { $response = $project->get(array('id_project' => $member['id_project'], 'status' => '1')); $rs[] = $response[0]; } ?> <div class="app-pane"> <div class="app-pane-header"> <div class="col-6 pull-left"> <div id="btn_group" class="btn-group"> <a href="javascript: void(0);" class="btn" onclick="boss.bookmark.set('tab', '/app/user/view_overview/');boss.ajax.load('/app/user/view_overview/', '#app_conteiner');">Visão Geral</a> <a href="javascript: void(0);" class="btn btn-primary" onclick="boss.bookmark.set('tab', '/app/project/view_project/');boss.ajax.load('/app/project/view_project/', '#app_conteiner');">Projetos</a> </div> </div> <div class="col-6 pull-left"> <div class="col-6 pull-left text-right"> <buttom id="btn_new_project" onclick="boss.ajax.load('/app/project/form_create/', '#modal_dialog', 'active');" class="btn btn-success"> <b>+</b> Novo projeto </buttom> </div>
$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"> <button class="close" onclick="boss.removeClass('modal_dialog', 'active')">x</button> <h3 class="modal-title font-open-sans">Adicionar membro a tarefa</h3> </div> <form action="/app/task/create_item_member/" method="post" target="iframesubmit"> <input type="hidden" id="pk" name="pk" value="<?php echo $pk; ?> "> <input type="hidden" id="pk_member" name="pk_member" value=""> <input type="hidden" id="remove" name="remove" value="0">
$project = new Project(); $count = $project->count($sql); if ($count == 1) { $project = $project->get($sql); $project = $project[0]; $sql = array('email' => $email); $member = new Member(); $member->fields = array('id_member', 'name', 'email'); $count = $member->count($sql); if ($count == 1) { $rs = $member->get($sql); $rs = $rs[0]; $id_project = $pk; $id_member = $rs['id_member']; $sql = array('id_project' => $id_project, 'id_member' => $id_member, 'status' => 1); $member_set = new ProjectMemberSet($sql); $countMemberSetSend = $member_set->count($sql); $sql = array('id_project' => $id_project, 'id_member' => $id_member, 'status' => 2); $countMemberSetRevoke = $member_set->count($sql); if ($countMemberSetSend == 0 && $countMemberSetRevoke == 0) { $member_set->save(); $name = explode(" ", $logado['name']); $name = $name[0]; $title = '<b>' . ucfirst($name) . '</b> convidou você para o projeto <b>' . $project['title'] . '</b>'; $sql = array('typing' => 1, 'title' => $title, 'id_sender' => $id_project, 'id_receiver' => $id_member); $notification = new NotificationGranttype($sql); $notification->save(); ?> <script> html = "<div style=\"padding:20px;text-align:center;\" title=\"<?php echo $rs['email'];
$member->update($sql); $project = new Project(); $project = $project->get(array("id_project" => $sender, "status" => 1)); $project = $project[0]; $name = explode(" ", $logado['name']); $name = $name[0]; $title = '<b>' . ucfirst($name) . '</b> aceitou seu convite para <b>' . $project['title'] . '</b>'; $sql = array('typing' => 2, 'title' => $title, 'id_sender' => $logado['id_member'], 'id_receiver' => $project['id_admin']); $notification = new NotificationGranttype($sql); $notification->save(); echo "<script>window.parent.\$('#modal_dialog').removeClass('active-lg')</script>"; die; } else { if ($reponse == 0) { $sql = array("id_project_member_set" => $pk); $member = new ProjectMemberSet(); $member->fields = array('status' => 0); $member->update($sql); die; } } throw new Exception('Error'); } catch (Exception $e) { echo "fdsfsdfads"; } } else { ?> <script> window.parent.location.href='/'; </script> <?php
<?php require_once 'init.php'; use Agil\Session\Session; $logado = Session::get('logado'); $model = new Project(); $sql = array('id_admin' => $logado['id_member'], 'status' => 1); $count = $model->count($sql); if ($count > 0) { $fields = array("id_project"); $model->fields = $fields; $projects = $model->get($sql); $project = $projects[0]; } else { $model = new ProjectMemberSet(); $sql = array('id_member' => $logado['id_member'], 'status' => 2); $count = $model->count($sql); if ($count > 0) { $fields = array("id_project"); $model->fields = $fields; $projects = $model->get($sql); } } ?> <div class="app-pane"> <div class="app-pane-header"> <div class="btn-group"> <a href="javascript: void(0);" class="btn btn-primary" onclick="boss.bookmark.set('tab', '/app/user/view_overview/');boss.ajax.load('/app/user/view_overview/', '#app_conteiner');">Visão Geral</a> <a href="javascript: void(0);" class="btn" onclick="boss.bookmark.set('tab', '/app/project/view_project/');boss.ajax.load('/app/project/view_project/', '#app_conteiner');">Projetos</a> </div> </div>