當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。