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


PHP MyDB::getAllProjects方法代码示例

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


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

示例1: getProjects

 public static function getProjects($Category)
 {
     if ($Category == 'all') {
         return MyDB::getAllProjects();
     } else {
         return MyDB::getProjectByCategory($Category);
     }
 }
开发者ID:JovanRis,项目名称:Demola2,代码行数:8,代码来源:Project.php

示例2: action_index

 public function action_index()
 {
     $session = Session::instance();
     $post = $this->request->post();
     $showLogin = true;
     $view = View::factory('admin')->bind('showLogin', $showLogin);
     if ($session->get('isAdminLoggedIn') == false) {
         if (isset($post['submit'])) {
             $user = $post['username'];
             $pass = $post['password'];
             $session->set('isAdminLoggedIn', false);
             $loginSuccess = false;
             if (Admin::login($user, $pass) == true) {
                 $loginSuccess = true;
                 $session->set('userType', 'admin');
                 $session->set('username', $user);
                 $session->set('isAdminLoggedIn', true);
                 $_SESSION['auth_user'] = $user;
             }
             if ($loginSuccess == true) {
                 echo '<script language="javascript">';
                 echo 'alert("Loggin successfully as Admin. ")';
                 echo '</script>';
                 header("Refresh:2; url=admin?p=null");
             } else {
                 echo '<script language="javascript">';
                 echo 'alert("Wrong  Username or Password, please try again.")';
                 echo '</script>';
             }
         }
     } else {
         $showLogin = false;
         if (HTTP_Request::POST == $this->request->method()) {
             if (isset($post['submit-approvecompany'])) {
                 if (isset($post['iCom'])) {
                     foreach ($post['iCom'] as $idCom) {
                         Admin::approveCompany($idCom);
                     }
                     echo '<script language="javascript">';
                     echo 'alert("Companies approved")';
                     echo '</script>';
                 } else {
                     echo '<script language="javascript">';
                     echo 'alert("Must select companies for approval ")';
                     echo '</script>';
                 }
                 header("Refresh:2; url=admin?p=null");
             } elseif (isset($post['submit-approveproject'])) {
                 if (isset($post['iPro'])) {
                     foreach ($post['iPro'] as $idPro) {
                         Admin::approveProject($idPro);
                     }
                     echo '<script language="javascript">';
                     echo 'alert("Projects approved")';
                     echo '</script>';
                 } else {
                     echo '<script language="javascript">';
                     echo 'alert("Must select project for approval ")';
                     echo '</script>';
                 }
                 header("Refresh:2; url=admin?p=null");
             } elseif (isset($post['submit-finishproject'])) {
                 if (isset($post['iPro'])) {
                     foreach ($post['iPro'] as $idPro) {
                         Admin::finishProject($idPro, $post['linkPro' . $idPro]);
                     }
                     echo '<script language="javascript">';
                     echo 'alert("Projects finished ")';
                     echo '</script>';
                 } else {
                     echo '<script language="javascript">';
                     echo 'alert("Must select project to be finished. ")';
                     echo '</script>';
                 }
                 header("Refresh:2; url=admin?p=null");
             }
         }
         $p = $this->request->query('p');
         if ($p == 'approvecompany') {
             $inactiveCompanies = Company::getInactiveCompanies();
             $view->inactiveCompanies = $inactiveCompanies;
         }
         if ($p == 'approveproject') {
             $inactiveProjects = Project::getInactiveProjects();
             $view->inactiveProjects = $inactiveProjects;
         }
         if ($p == 'finishproject') {
             $projects = MyDB::getAllProjects();
             $view->projects = $projects;
         }
         $view->p = $p;
     }
     $this->response->body(View::factory('header') . $view);
 }
开发者ID:JovanRis,项目名称:Demola2,代码行数:94,代码来源:Admin.php


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