当前位置: 首页>>代码示例>>PHP>>正文


PHP Jobs::getJobs方法代码示例

本文整理汇总了PHP中Jobs::getJobs方法的典型用法代码示例。如果您正苦于以下问题:PHP Jobs::getJobs方法的具体用法?PHP Jobs::getJobs怎么用?PHP Jobs::getJobs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Jobs的用法示例。


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

示例1: getJobs

 /**
  * Get job tuples
  * @return mixed[int] The jobs
  */
 private function getJobs()
 {
     $jobs = new Jobs();
     $jobList = $jobs->getJobs();
     Tools::usort($jobList);
     $smartyJobs = array();
     $jobsWithoutSupport = array();
     foreach ($jobList as $job) {
         $smartyJobs[$job->getId()] = array("name" => $job->getName(), "type" => $job->getType(), "typeName" => Job::$typeNames[$job->getType()], "color" => $job->getColor());
         if (Jobs::JOB_SUPPORT != $job->getId() && Jobs::JOB_NA != $job->getId()) {
             $jobsWithoutSupport[] = $job->getId();
             $smartyJobs[$job->getId()]["deletedJob"] = true;
         }
     }
     $formattedJobs = implode(", ", $jobsWithoutSupport);
     // if job already used for TimeTracking, delete forbidden
     $query2 = "SELECT jobid, COUNT(jobid) as count " . "FROM `codev_timetracking_table` " . "WHERE jobid IN ({$formattedJobs}) GROUP BY jobid;";
     $result2 = SqlWrapper::getInstance()->sql_query($query2);
     if (!$result2) {
         return NULL;
     }
     while ($row = SqlWrapper::getInstance()->sql_fetch_object($result2)) {
         $smartyJobs[$row->jobid]["deletedJob"] = 0 == $row->count;
     }
     return $smartyJobs;
 }
开发者ID:fg-ok,项目名称:codev,代码行数:30,代码来源:edit_jobs.php

示例2: function

 * Homepage
 * Front page controller
 */
$app->get('/(:page)', function ($page = null) use($app) {
    global $categories;
    if (isset($page) && $page != '') {
        $content = R::findOne('pages', ' url=:url ', array(':url' => $page));
        if ($content && $content->id) {
            // show page information
            $seo_title = $content->name . ' | ' . APP_NAME;
            $seo_desc = excerpt($content->description);
            $seo_url = BASE_URL . $page;
            $app->render(THEME_PATH . 'page.php', array('seo_url' => $seo_url, 'seo_title' => $seo_title, 'seo_desc' => $seo_desc, 'content' => $content));
        } else {
            $app->flash('danger', 'The page you are looking for could not be found.');
            $app->redirect(BASE_URL, 404);
        }
    } else {
        // show list of job
        $seo_title = APP_NAME;
        $seo_desc = APP_DESC;
        $seo_url = BASE_URL;
        $j = new Jobs();
        foreach ($categories as $cat) {
            $jobs[$cat->id] = $j->getJobs(ACTIVE, $cat->id, 0, HOME_LIMIT);
        }
        $app->render(THEME_PATH . 'home.php', array('seo_url' => $seo_url, 'seo_title' => $seo_title, 'seo_desc' => $seo_desc, 'jobs' => $jobs));
    }
});
// Run app
$app->run();
开发者ID:aescarcha,项目名称:jobskee-open-source-job-board,代码行数:31,代码来源:index.php

示例3: unset

     unset($_SESSION['email']);
     unset($_SESSION['is_admin']);
     $app->flash('success', 'Logout successful. Please login again.');
     $app->redirect('login');
 });
 /*
  * Manage group
  * Manage inactive jobs, categories list, cities list
  */
 $app->group('/manage', function () use($app) {
     // manage inactive jobs
     $app->get('/', 'validateUser', function () use($app) {
         global $categories;
         $j = new Jobs();
         foreach ($categories as $cat) {
             $jobs[$cat->id] = $j->getJobs(INACTIVE, $cat->id);
         }
         $app->render(ADMIN_THEME . 'home.php', array('jobs' => $jobs));
     });
     /*
      * Manage categories group
      */
     $app->group('/categories', function () use($app) {
         $app->post('/', 'isValidReferrer', 'validateUser', function () use($app) {
             $data = $app->request->post();
             $c = new Categories($data['id']);
             $c->addCategory($data);
             if ($data && $data['id'] != '') {
                 $message = 'Category was successfully updated.';
             } else {
                 $message = 'New category has been added.';
开发者ID:aescarcha,项目名称:jobskee-open-source-job-board,代码行数:31,代码来源:admin.php


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