public function select() { $pagination = $this->_config['pagination']; $search = $this->_config['search']; $whereList = ''; if (ake('whereList', $this->_config)) { $whereList = $this->_config['whereList']; } $order = !strlen($this->_request->getCrudOrder()) ? $this->_config['defaultOrder'] : $this->_request->getCrudOrder(); $orderDirection = !strlen($this->_request->getCrudOrderDirection()) ? $this->_config['defaultOrderDirection'] : $this->_request->getCrudOrderDirection(); $export = !strlen($this->_request->getCrudTypeExport()) ? null : $this->_request->getCrudTypeExport(); $offset = !strlen($this->_request->getCrudNumPage()) ? 0 : $this->_request->getCrudNumPage() * $this->_config['itemsByPage']; $limit = $this->_config['itemsByPage']; $where = !strlen($this->_request->getCrudWhere()) ? '' : Project::makeQuery($this->_request->getCrudWhere(), $this->_type); $data = Project::query($this->_type, $where, 0, 0, $order, $orderDirection); $count = count($data); if (true === $pagination) { $pageNumber = $offset / $limit < 1 ? 1 : $offset / $limit; $paginator = Paginator::make($data, $count, $limit); $this->_items = $paginator->getItemsByPage($pageNumber); $this->_pagination = Crud::pagination($paginator); } else { $this->_items = $data; } if (0 < $count && null !== $export) { $method = 'export' . ucfirst(Inflector::lower($export)); return Crud::$method($data, $this->_em); } if (true === $search) { $this->makeSearch(); } return $this; }
$user_name = $us_obj->getFullName($user_id); //$text .= '<h2><u><b>'.$user_name.'</b>'.' Worklog </u></h2>'; $text .= '<h2>Dear ' . $user_name . ',</h2>'; $text .= '<h3><u>Your Notes For ' . date('jS F Y') . '</u></h3>'; //$text .= '<h3>by: <b>'.$user_name.'</b>'.'</h3>'; $text .= "<h3>Total Hours Entered : " . $proj_time->getData('total_hrs') . "</h3>"; //declare all instances of classes used $do_all_project = new Project(); $do_project = new Project(); //Get details of the project and notes they entered $do_all_project->query("SELECT pr.name,ptsk.idproject,usr.firstname,tsk.idtask,tsk.task_description,pd.discuss,pd.document,pd.hours_work from project_discuss pd \r\n inner join task tsk \r\n inner join user usr \r\n inner join project_task ptsk \r\n inner join project pr \r\n on ptsk.idtask =tsk.idtask and\r\n pd.iduser =usr.iduser and\r\n pd.idproject_task=ptsk.idproject_task and \r\n pr.idproject= ptsk.idproject \r\n \r\n where pd.iduser={$iduser} and DATE(date_added)=CURDATE() order by(pr.name)"); $last_task = 0; $last_desc = 0; while ($do_all_project->fetch()) { $project_id = $do_all_project->getdata('idproject'); $do_project->query('select name from project where idproject=' . $project_id); $do_project->fetch(); $name_prj = $do_project->getData('name'); $_SESSION['adm_project_discuss_idtask'] = $project_id; $project_name = $do_all_project->getdata('name'); $first_name = $do_all_project->getdata('firstname'); $task_desc = $do_all_project->getdata('task_description'); $discuss_text = $do_all_project->getdata('discuss'); $hours_work = $do_all_project->getdata('hours_work'); $idtask = $do_all_project->getdata('idtask'); $document = $do_all_project->getdata('document'); $_SESSION['adm_project_task_discuss'] = $idtask; if ($last_task != $_SESSION['adm_project_discuss_idtask']) { $text .= ' <div>'; $text .= '<b><span ><a href=' . $_SERVER[HTTP_HOST] . '/Project/' . $project_id . '>' . $name_prj . '</a></span></b>'; $text .= '<div>';