本文整理汇总了PHP中User_Model::getUserID方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::getUserID方法的具体用法?PHP User_Model::getUserID怎么用?PHP User_Model::getUserID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_Model
的用法示例。
在下文中一共展示了User_Model::getUserID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validar
function validar()
{
if ($this->getParam('Login') == true) {
Sesion::obtenerInstancia()->crearSesion();
$user = $this->getParam('user');
$password = $this->getParam('pass');
$usuario = new User_Model();
if ($usuario->esValido($user, $password)) {
//Aqui va la pr<<óxima vista
$userID = $usuario->getUserID($user, $password);
// $usuario->won($userID);
$dataU = $usuario->getData($user, $password);
$content_view = $this->view->fetch('menu_view', array('data' => $dataU, 'msgerror' => ''));
} else {
$content_view = $this->view->fetch('user_view', array('msgerror' => 'Invalid User'));
}
} else {
if ($this->getParam('Register') == true) {
$this->view->assign('type', "user");
$content_view = $this->view->fetch('register_view', array('msgerror' => ''));
}
}
$this->view->display('layout_view', array('content' => $content_view));
}
示例2: index
public function index($userID = NULL)
{
$this->load->model('User_model', 'Curriculum_model');
$this->load->helper('url');
//Loader user from passed ID and advisor from session ID
// If the session id isn't the passed user or an advisor for the user, immediantly fail.
$user = new User_Model();
$user->loadPropertiesFromPrimaryKey($userID);
$advisor = new User_Model();
if (!isset($_SESSION["UserID"])) {
redirect('login');
}
$advisor->loadPropertiesFromPrimaryKey($_SESSION["UserID"]);
$flag = TRUE;
foreach ($advisor->getAdvisees() as $student) {
if ($student->getUserID() == $userID) {
$flag = FALSE;
}
}
if ($advisor->getUserID() == $user->getUserID()) {
$flag = FALSE;
}
if ($flag == TRUE) {
echo "YOU DON'T HAVE PERMISSION TO ACCESS THIS USER'S INFORMATION";
exit;
}
$curriculums = $user->getCurriculums();
$degree = FALSE;
foreach ($curriculums as $c) {
if ($c->getCurriculumType() == Curriculum_model::CURRICULUM_TYPE_DEGREE) {
$degree = TRUE;
}
}
if (!$degree) {
echo "ERROR NO CURRICULUM SET FOR USER";
exit;
}
//Create excel file
$Excel = new PHPExcel();
$Excel->getProperties()->setCreator("CSC 404 - 2015 App")->setLastModifiedBy("CSC 404 - 2015 App")->setTitle($user->getName() . " Checklist")->setSubject("Advising Checklist")->setDescription("Auto Generated Checklist")->setCategory("Advisee checklist file");
//Set global defaults
$Excel->getDefaultStyle()->getFont()->setSize(10)->setName('Arial');
$Excel->removeSheetByIndex(0);
//Generate course sheets
$sheetnumber = 0;
foreach ($curriculums as $c) {
if ($c->getCurriculumType() == Curriculum_model::CURRICULUM_TYPE_DEGREE) {
//Generate Checklist
$checklist = $Excel->createSheet(NULL, $sheetnumber++);
$checklist->setTitle("Checklist");
$this->generatechecklist($checklist, $user, $c, $curriculums);
//Generate Quarter View
$qview = $Excel->createSheet(NULL, $sheetnumber++);
$qview->setTitle("Quarter View");
$this->generate_quarter_view($qview, $user, $c);
break;
}
}
//Generate advisor checklist sheet
$advcheck = $Excel->createSheet(NULL, $sheetnumber++);
$advcheck->setTitle("Advisor Checklist");
$this->generateadvchecklist($advcheck);
//Download file object (PDF or XLS)
$Excel->setActiveSheetIndex(0);
$objWriter = PHPExcel_IOFactory::createWriter($Excel, 'Excel5');
header("Content-type: application/vnd.ms-exel");
header("Content-Disposition: attachment; filename=\"" . $user->getName() . " Checklist.xls\"");
$objWriter->save('php://output');
}