PHP Method User::getAllUser, codiad Code Examples

This page contains top rated real world PHP examples of method User::getAllUser from package codiad extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: UserController.php Project: laiello/vinhloi
0
 /**
  * Enter description here ...
  */
 public function showAction()
 {
     $user = new User();
     $list = $user->getAllUser();
     $paginator = Zend_Paginator::factory($list);
     $paginator->setItemCountPerPage($this->_getParam('limit', 15))->setPageRange(5)->setCurrentPageNumber($this->_getParam('page', 1));
     $this->view->pages = $paginator;
 }
Example #2
Show file File: AdminUserController.php Project: bugaydima/photogallery
0
 public function actionIndex($page = 1)
 {
     // Проверяем авторизирован ли пользователь и получаем его данные. Если нет, он будет переадресован
     $userId = self::checkAdmin();
     $users = User::getAllUser($count = Gallery::SHOW_BY_DEFAULT, $page);
     $total = User::getTotalUsers();
     // Создаем объект Pagination - постраничная навигация
     $pagination = new Pagination($total, $page, Gallery::SHOW_BY_DEFAULT, 'page-');
     $this->render('admin/admin_user/index', ['title' => 'Управление пользователями', 'users' => $users, 'pagination' => $pagination, 'user' => $userId['username']]);
     return true;
 }
Example #3
Show file File: index.php Project: juliobasito/videtonfrigo
0
--------------------------------------------------*/
$app->post('/updateSeeting', function () {
    //renvoi les seetings de l'utilisateur
    User::updateSeeting($_POST['complexite'], $_POST['temps'], $_POST['note'], $_POST['nbPersonne'], $_POST['userId']);
});
$app->get('/getSeeting/:userId', function ($userId) {
    //renvoi les seetings de l'utilisateur
    $seeting = User::getSeeting($userId);
});
$app->get('/getUser/:userId', function ($userId) {
    //renvoi les infos de l'utilisateur
    $user = User::getUser($userId);
});
$app->get('/getAllUser', function () {
    //renvoi toutes les infos de tous les utilisateurs
    $user = User::getAllUser();
});
$app->post('/AddUser', function () {
    //ajoute un utilisateur
    $user = User::AddUser($_POST["pseudo"], $_POST["email"], $_POST["password"], $_POST["birthdate"], $_POST["city"], $_POST["budget"]);
});
$app->get('/connexion/:pseudo/:password', function ($pseudo, $password) {
    User::connexion($pseudo, $password);
    //retourne userID si ok sinon retourne 0
});
$app->put('/modifUser', function () {
    //modifier utilisateur
    $user = User::UpdateUser($_POST["pseudo"], $_POST["email"], $_POST["password"], $_POST["birthdate"], $_POST["city"], $_POST["budget"], $_POST["id"]);
});
$app->delete('/delUser', function () {
    //modifier utilisateur
Example #4
Show file File: Note.php Project: JuanTrochez/enote
0
 public static function getCoutOfUser($bdd)
 {
     $allUser = User::getAllUser($bdd);
     $couts = [];
     foreach ($allUser as $user) {
         $userNotes = Note::getNotesByUser($bdd, $user['id']);
         $uDevise = Devise::getDeviseById($bdd, $user['devise_id']);
         $totalNote = 0;
         foreach ($userNotes as $note) {
             $totalNote += Note::getMontantTotal($bdd, $note['id'], $uDevise->getTaux());
         }
         $couts[] = ["username" => $user['login'], "total" => $totalNote];
     }
     usort($couts, function ($a, $b) {
         if ($a['total'] == $b['total']) {
             return 0;
         }
         return $a['total'] < $b['total'] ? 1 : -1;
     });
     return array_slice($couts, 0, 10);
 }
Example #5
Show file File: user_management.php Project: HCMPKenya/HCMP-ALPHA
0
 public function correct_current_password($pass)
 {
     $salt = '#*seCrEt!@-*%';
     $pass = md5($salt . $pass);
     $user_id = $this->session->userdata('user_id');
     $getdata = User::getAllUser($user_id);
     $currentpassword = $getdata[0]['password'];
     if ($currentpassword != $pass) {
         $this->form_validation->set_message('correct_current_password', 'The current password you provided is not correct.');
         return FALSE;
         //echo "Dont match";
     } else {
         return TRUE;
         //echo "Yes match";
     }
 }
Example #6
Show file File: adminController.php Project: JuanTrochez/enote
0
             $newuser = new User();
             $newuser->setName($nameuser);
             $newuser->setLogin($_POST['log']);
             $newuser->setPassword(sha1($_POST['pwd']));
             $newuser->setEmail($_POST['email']);
             $newuser->setRole($_POST['role']);
             $newuser->setDevise($_POST['devise']);
             $newuser->insertNewUser($bdd);
             echo '<div class="bg-success">L\'utilisateur à bien été ajoutée</div><br/><br/>';
         }
         include_once '/views/admin/adduser.php';
         break;
     }
     //on retourne la liste d'utilisateur en fonction du role
     if ($secu->isAdmin($bdd)) {
         $listUser = User::getAllUser($bdd);
     } else {
         $listUser = User::getUsersByManagerId($bdd, $sessionUser->getId());
     }
     include_once '/views/admin/user.php';
     break;
     //Statistiques
 //Statistiques
 case "statistique":
     include_once '/views/admin/statistique.php';
     break;
     //Gestion des notes
 //Gestion des notes
 case "note":
     //on retourne la liste des notes en fonction du role de l'utilisateur
     if ($secu->isAdmin($bdd)) {
Example #7
Show file File: postAction.php Project: laiello/dp-navigator
0
            $_SESSION["existEmailNewUser"] = false;
            $user = new User();
            $_SESSION['pseudo'] = $pseudoNewUser = $_POST['pseudoNewUser'];
            $user->setLogin($pseudoNewUser);
            $user->setEmail($emailNewUser);
            $passwordNewUser = User::passwordGenerate();
            $user->setPassword($passwordNewUser);
            $_SESSION['group'] = $groupNewUser = $_POST['groupNewUser'];
            $user->setGroup($groupNewUser);
            $user->newUser();
        } else {
            $_SESSION["existEmailNewUser"] = true;
        }
    }
} elseif (isset($_POST["pseudoUpdateUser"])) {
    $user = new User();
    $_SESSION['pseudo'] = $pseudoUpdateUser = $_POST['pseudoUpdateUser'];
    $user->setLogin($pseudoUpdateUser);
    $_SESSION['group'] = $groupUpdateUser = $_POST['groupUpdateUser'];
    $user->setGroup($groupUpdateUser);
    $id = $_SESSION["userId"];
    $user->updateUser($id);
}
$userList = User::getAllUser();
if ($userList == null) {
    $_SESSION["msgToAllUser"] = "Auncun utilisateur !";
    $_SESSION['userList'] = $userList;
} else {
    $_SESSION['userList'] = $userList;
    $_SESSION['msgToAllUser'] = "";
}
Example #8
Show file File: editer.php Project: SoufianeAr/lmpe-backend
0
        
             <thead>	
                 <tr>
                     <th>Nom</th>
                     <th>Prenom</th>
                     <th>Date naissance</th>
                     <th>E-mail</th>
                     <th>Operation</th>
                 </tr>
             </thead>
             
             
             <tbody style="color:#000;">
                 <?php 
 $user = new User();
 $result = $user->getAllUser();
 while ($data = $result->fetch()) {
     ?>
             	<?php 
     echo '
	          <tr >
                  	<td>' . $data['nom_user'] . '</td>
                      <td>' . $data['prenom_user'] . '</td>
                      <td>' . $data['datenaissance_user'] . '</td>
                      <td>' . $data['email_user'] . '</td>
                      <td><a href="../../actions/users/deleteUser?id=' . $data['code_user'] . '" class="btn-sm btn-danger">Supprimer</a></td>
                  </tr>
         	';
     ?>
             	<?php 
 }
Example #9
Show file File: BiddingController.php Project: kuldeepro/playwin
0
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $dataProvider = new CActiveDataProvider('Bidding');
     $this->render('index', array('dataProvider' => $dataProvider, 'users' => User::getAllUser()));
 }
Example #10
Show file File: user.php Project: laiello/dp-navigator
0
            } elseif ($user['user_group'] == "user") {
                $smarty->assign("selectedadmin", "");
                $smarty->assign("selectedmanager", "");
                $smarty->assign("selecteduser", "selected");
            }
            $smarty->assign("menu", $_SESSION['user']->getGroup());
            $smarty->assign("content", $menu);
            break;
        case 'userSaveUpdate':
            $smarty->assign("title", "Modification enregistrée ");
            $smarty->assign("pseudo", $_SESSION['pseudo']);
            $smarty->assign("email", $_SESSION['email']);
            $smarty->assign("group", $_SESSION['group']);
            $smarty->assign("menu", $_SESSION['user']->getGroup());
            $smarty->assign("content", "userSave");
            break;
        case 'userDelete':
            $userId = $_GET["id"];
            User::deleteUser($userId);
            $_SESSION['userList'] = User::getAllUser();
            $smarty->assign("title", "Gestion des utilisateurs");
            $smarty->assign("menu", $_SESSION['user']->getGroup());
            $smarty->assign("content", "userList");
            $smarty->assign("userList", $_SESSION['userList']);
            $smarty->assign("size", $_SESSION['size']);
            break;
    }
    $smarty->display('homePage.tpl');
} else {
    Url::relocate('home.php');
}
Example #11
Show file File: test.php Project: pf5512/phpstudy
0
<?php

header("Content-Type:text/html; charset=utf8");
require_once "./user.class.php";
$user = new User("HelloWorld", "123456");
$user->insert();
$users = User::getAllUser();
foreach ($users as $u) {
    echo "<br/>" . $u->name . "<br/>" . $u->password . "<br/>";
}