Пример #1
0
 /**
  * ACTION CREATE note | $id=PrimaryKey -> TRIGER FROM VIEW  -ptr.nov-
  */
 public function actionCreate()
 {
     $model = new SignupForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($user = $model->signup()) {
             //if (Yii::$app->getUser()->login($user)) {  // user save signup return langsung login
             //    return $this->goHome();
             //}
             $searchModel_Userlogin = new UserloginSearch();
             $dataProvider_Userlogin = $searchModel_Userlogin->search(Yii::$app->request->queryParams);
             return $this->render('index', ['searchModel_Userlogin' => $searchModel_Userlogin, 'dataProvider_Userlogin' => $dataProvider_Userlogin]);
         }
     }
     return $this->render('signup', ['model' => $model]);
 }
Пример #2
0
 protected function gt_deptid()
 {
     $UserloginSearch = new UserloginSearch();
     $ModelUser = UserloginSearch::findUserAttr($this->gt_userid())->one();
     if (count($ModelUser) != 0) {
         /*RECORD TIDAK ADA*/
         $deptid = $ModelUser->emp->DEP_ID;
         return $deptid;
     } else {
         return 0;
     }
 }
Пример #3
0
 public function actionIndex()
 {
     /* Author: -ptr.nov- : Split Index Before/After Login */
     if (\Yii::$app->user->isGuest) {
         $model = new LoginForm();
         return $this->render('index_nologin', ['model' => $model]);
     } else {
         $ModelUser = UserloginSearch::findUserAttr(Yii::$app->user->id)->one();
         $model = $this->findModel1($ModelUser->emp->EMP_ID);
         $searchModel1 = new EmployeSearch();
         $dataProvider = $searchModel1->search_empid($ModelUser->emp->EMP_ID);
         // echo  \yii\helpers\Json::encode($dataProvider);
         //print_r($dataProvider->getModels());
         return $this->render('index', ['model' => $model, 'dataProvider' => $dataProvider->getModels()]);
     }
 }
Пример #4
0
$callback = function ($menu) {
    $data1 = $menu['data'];
    $data2 = str_replace("'", '', $data1);
    $data3 = str_replace(";", '', $data2);
    $data1 = $menu['data'];
    $data = eval($menu['data']);
    //echo $data;
    return ['label' => Icon::show($data3) . $menu['name'], 'url' => [$menu['route']], 'items' => $menu['children']];
};
/**
 * Validasi database Default EMP_ID =0 
 * note error : lost left join Field unn\known attribute properties
 * Author: -ptr.nov-, 
 */
if (!Yii::$app->user->isGuest) {
    $ModelUserAttr = UserloginSearch::findUserAttr(Yii::$app->user->id)->one();
    //print_r($ModelUserAttr);
    //echo $ModelUserAttr->emp->EMP_IMG;
    $MainAvatar = $ModelUserAttr->emp->EMP_IMG;
    $MainUserProfile = $ModelUserAttr->emp->EMP_NM . ' ' . $ModelUserAttr->emp->EMP_NM_BLK;
}
$corp = "<p class='pull-left'>&copy; LukisonGroup <?= date('Y') ?></p>";
?>
		
		<! - NOT LOGIN- Author : -ptr.nov- >
		<?php 
if (Yii::$app->user->isGuest) {
    ?>
			<?php 
    include '_front.php';
    ?>
Пример #5
0
 /**
  * GetDEP_ID from UserID UserloginSearch()
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 protected function getOptUser()
 {
     $UserloginSearch = new UserloginSearch();
     $ModelUser = UserloginSearch::findUserAttr(Yii::$app->user->identity->id)->one();
     if (count($ModelUser) != 0) {
         /*RECORD TIDAK ADA*/
         //$deptid=$ModelUser->user->id;
         //$deptid=$ModelUser->emp->DEP_ID;
         return $ModelUser;
     } else {
         return 0;
     }
 }