PHP Method User::isCUrrentUserStudent, Code Examples

PHP User::isCUrrentUserStudent - 2 examples found. These are the top rated real world PHP examples of method User::isCUrrentUserStudent from package extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
0
 public function actionChangeSMSpref()
 {
     $username = Yii::app()->user->name;
     $model = User::model()->find("username=:username", array(':username' => $username));
     $info = BasicInfo::model()->find("userid=:userid", array('userid' => $model->id));
     $SMS = new SMS();
     $selection = $_POST['BasicInfo']['allowSMS'];
     $info->allowSMS = $selection;
     $info->save(false);
     if (User::isCUrrentUserStudent() && $info->validated == 1) {
         $this->render('verified', array('info' => $info));
         return;
     }
     $this->render('sendsms', array('info' => $info, 'SMS' => $SMS));
     //$this->actionSendsms();
 }
Example #2
0
		</form>';
    } else {
        if (User::isCurrentUserStudent(Yii::app()->user->name)) {
            $home = '/home/studenthome';
            $search = '<form class="navbar-search pull-left" method="get" action="/JobFair/index.php/job/search">' . $this->widget('zii.widgets.jui.CJuiAutoComplete', array('name' => 'keyword', 'id' => 'keyword', 'value' => $_GET['keyword'], 'htmlOptions' => array('class' => 'search-query span2', 'style' => 'width: 250px', 'placeholder' => 'Search by Position, Skills, Company, Type')), true) . '<button type="submit" style="background-color:transparent ; border:0" >
		<img src="/JobFair/images/ico/Search-icon.png"  height="25" width="25" style="margin:1px 0 0 5px"></button>
		</form>';
        } else {
            $home = '/site/index';
        }
    }
}
?>

<?php 
$this->widget('bootstrap.widgets.TbNavbar', array('htmlOptions' => array('role' => 'navigation'), 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array(array('label' => 'Home', 'url' => array($home), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Jobs', 'url' => array("/job/home"), 'visible' => User::isCUrrentUserStudent()), array('label' => 'Message', 'url' => array('/message'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Post Job', 'url' => "#", 'visible' => User::isCurrentUserEmployer()), array('label' => 'SMS', 'url' => array('/SMS/Sendsms'), 'visible' => !Yii::app()->user->isGuest & !User::isCurrentUserAdmin(Yii::app()->user->name)))), $search, array('class' => 'bootstrap.widgets.TbMenu', 'htmlOptions' => array('class' => 'pull-left'), 'items' => array('-', array('label' => '(' . Yii::app()->user->name . ')', 'url' => '#', 'items' => array(array('label' => 'My Profile', 'url' => array($profile), 'visible' => !Yii::app()->user->isGuest & !User::isCurrentUserAdmin(Yii::app()->user->name)), array('label' => 'Merge Accounts', 'visible' => User::isCurrentUserStudent(Yii::app()->user->name), 'url' => '/JobFair/index.php/user/MergeAccounts'), array('label' => 'Change Password', 'visible' => !Yii::app()->user->isGuest, 'url' => '/JobFair/index.php/user/ChangePassword'), '----', array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest), array('label' => 'Register', 'url' => array('/user/register'), 'visible' => Yii::app()->user->isGuest))))))));
?>

<div class="container-fluid" id="page">

<?php 
if (User::isCurrentUserAdmin(Yii::app()->user->name)) {
    echo "<div class=\"row-fluid\"><div class=\"span3\">";
    echo "<div class=\"well sidebar-nav affix\">";
    $actionid = $this->getUniqueId() . '/' . $this->getAction()->getId();
    $this->widget('bootstrap.widgets.TbMenu', array('type' => 'list', 'items' => array(array('label' => 'ADMINISTRATION'), array('label' => 'Users', 'icon' => 'user', 'url' => $this->createUrl('UserCrud/admin'), 'active' => in_array($actionid, array('userCrud/admin', 'userCrud/update', 'userCrud/index'))), array('label' => 'Skills', 'icon' => 'pencil', 'url' => $this->createUrl('Skillset/admin'), 'active' => in_array($actionid, array('skillset/admin', 'skillset/consolidate', 'skillset/create', 'skillset/update', 'skillset/index'))), array('label' => 'Postings', 'icon' => 'list', 'url' => $this->createUrl('PostingsAdmin/admin'), 'active' => in_array($actionid, array('postingsAdmin/admin', 'postingsAdmin/index'))), array('label' => 'CAREEPATH API'), array('label' => 'Authentication', 'icon' => 'lock', 'url' => $this->createUrl('ApiAuth/index'), 'active' => in_array($actionid, array('apiAuth/index', 'apiAuth/home', 'apiAuth/create', 'apiAuth/update'))), array('label' => 'Import Jobs', 'icon' => 'briefcase', 'url' => $this->createUrl('ApiConfig/home'), 'active' => in_array($actionid, array('apiConfig/home', 'apiConfig/index'))), array('label' => 'NOTIFICATIONS'), array('label' => 'Settings', 'icon' => 'cog', 'url' => $this->createUrl('home/notificationAdmin'), 'active' => in_array($actionid, array('home/notificationAdmin'))))));
    echo "</div></div>";
    echo "<div class=\"span9\">";
    //        echo $this->getUniqueId() . '<br>';
    //        echo $this->getAction()->getId();
    echo $content;