Пример #1
0
                        <i class="fa fa-angle-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-default">
                        <li>
                            <a href="<?php 
echo Url::toRoute('/admin/user/profile');
?>
">
                                <i class="icon-user"></i><?php 
echo Module::t('user.info');
?>
</a>
                        </li>
                        <li>
                            <a href="<?php 
echo Url::toRoute('/admin/default/logout');
?>
">
                                <i class="icon-key"></i><?php 
echo Module::t('user.logout');
?>
</a>
                        </li>
                    </ul>
                </li>
                <!-- END USER LOGIN DROPDOWN -->
            </ul>
        </div>
        <!-- END TOP NAVIGATION MENU -->
    </div>
    <!-- END HEADER INNER -->
Пример #2
0
 public static function beyondmenu($data, $plist, $mid)
 {
     $html = '';
     foreach ($data as $k => $v) {
         if (!empty($v['children'])) {
             $fa = 'fa-list-alt';
             $href = "javascript:;";
         } else {
             $fa = ' fa-chain';
             $href = Url::toRoute([strtolower($v['controller']), 'mid' => $v['id']]);
         }
         $active = $open = '';
         $html .= '<li id="beyondmenu' . $v['id'] . '"  class="">
                 <a href="' . $href . '" class="menu-dropdown">
                     <i class="menu-icon fa ' . $fa . '"></i>
                                     <span class="menu-text" alt="' . $v['title'] . '" title="' . $v['title'] . '">
                                         ' . StringHelper::truncate($v['title'], 6) . '
                                     </span>';
         if (!empty($v['children'])) {
             $html .= '<i class="menu-expand"></i>';
         }
         $html .= '</a>';
         if (!empty($v['children'])) {
             $html .= '<ul class="submenu">';
             $html .= self::beyondmenu($v['children'], $plist, $mid);
             $html .= '</ul>';
         }
         $html .= '</li>';
     }
     return $html;
 }
 /**
  * Deletes an existing Rrhh model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $desactiv = $this->findActiv($id);
     $desactiv->activate = 0;
     if ($desactiv->update() !== false) {
         return $this->redirect(['index']);
     } else {
         echo "Ha ocurrido un error al realizar el registro, redireccionando ...";
         echo "<meta http-equiv='refresh' content='8; " . Url::toRoute("rrhh") . "'>";
     }
 }
Пример #4
0
				show(jmore);
				show1(jmore);
			}
			var arr = [];
			for(var i=0;i</*items.length*/Math.min(items.length, 4);i++){
				arr.push(template(xml2obj(items[i])));
			}
			startnum = 0;
			var html = arr.join('');
			var newNode = document.createElement("div");
			newNode.innerHTML =html;
			jlist.insertBefore(newNode,null);
		}else{
			if(pagenum==1){
                window.location.href = '<?php 
echo Url::toRoute(['site/index', 'refresh' => true]);
?>
';
				var html = '<h4 class="zj-tit"><span>该公众号暂未发布文章</span></h4>';
				var newNode = document.createElement("div");
				newNode.innerHTML =html;
				jlist.insertBefore(newNode,null);
				show(jbox);
			}
		}
	}
	function more(){
		hide1(jmore);
		pagenum ++;
		ajaj(url+pagenum);
	}
 public function actionConfirm()
 {
     $table = new Users();
     if (Yii::$app->request->get()) {
         //Obtenemos el valor de los parámetros get
         $id = Html::encode($_GET["id"]);
         $authKey = $_GET["authKey"];
         if ((int) $id) {
             //Realizamos la consulta para obtener el registro
             $model = $table->find()->where("id=:id", [":id" => $id])->andWhere("authKey=:authKey", [":authKey" => $authKey]);
             //Si el registro existe
             if ($model->count() == 1) {
                 $activar = Users::findOne($id);
                 $activar->activate = 1;
                 if ($activar->update()) {
                     echo "Enhorabuena registro llevado a cabo correctamente, redireccionando ...";
                     echo "<meta http-equiv='refresh' content='8; " . Url::toRoute("site/login") . "'>";
                 } else {
                     echo "Ha ocurrido un error al realizar el registro, redireccionando ...";
                     echo "<meta http-equiv='refresh' content='8; " . Url::toRoute("site/login") . "'>";
                 }
             } else {
                 return $this->redirect(["site/login"]);
             }
         } else {
             return $this->redirect(["site/login"]);
         }
     }
 }
Пример #6
0
    <?php 
$form = ActiveForm::begin(['options' => ['id' => 'profile-form', 'enableAjaxValidation' => true]]);
?>
  
    <?php 
//    echo $form->field($model, 'profile_image')->widget(FileAPI::className(), [
//        'settings' => [
//            'url' => ['admin/fileapi-upload'],
//            'autoUpload' => true,
//        ],
//        'crop' => true,
//        'cropResizeWidth' => 200,
//        'cropResizeHeight' => 200
//    ]);
echo $form->field($model, 'profile_image')->widget(NewWidget::className(), ['uploadUrl' => Url::toRoute(['/user/user-profile/uploadphoto']), 'previewUrl' => $model->module->ImagePathPreview, 'tempPreviewUrl' => $model->module->ImageTempPathPreview, 'width' => 200, 'height' => 200]);
?>

    <?php 
echo $form->field($model, 'id')->textInput(['readonly' => true]);
?>

    <?php 
echo $form->field($model, 'first_name')->textInput(['maxlength' => 40]);
?>

    <?php 
echo $form->field($model, 'last_name')->textInput(['maxlength' => 40]);
?>

    <?php 
Пример #7
0
 /**
  * Creates a new TaskNote model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionTasknotecreate($projectid, $taskid)
 {
     $model = new TaskNote();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(Url::toRoute(['tasknoteview', 'projectid' => $projectid, 'taskid' => $taskid, 'id' => $model->id]));
     } else {
         $model->taskID = $taskid;
         return $this->render('tasknotecreate', ['model' => $model]);
     }
 }
Пример #8
0
<?php

use yii\helpers\url;
use yii\web\Session;
$menu = ['options' => ['class' => 'nav-pills'], 'items' => [['label' => 'Home', 'url' => Url::toRoute([' '])], ['label' => 'Projects', 'items' => [['label' => 'Project List', 'url' => Url::toRoute(['project/projectlist'])], '<li class="divider"></li>', ['label' => 'New Project', 'url' => Url::toRoute(['project/create'])]]]]];
if (isset(\Yii::$app->session['ProjectID'])) {
    array_push($menu['items'], ['label' => 'Tasks', 'items' => [['label' => 'Task List', 'url' => Url::toRoute(['project/tasklist', 'projectid' => \Yii::$app->session['ProjectID']])], '<li class="divider"></li>', ['label' => 'New Task', 'url' => Url::toRoute(['project/task-create'])], ['label' => 'TaskComments', 'url' => ['task-comment/index']]]]);
    array_push($menu['items'], ['label' => 'SRI', 'items' => [['label' => 'Task Statuses', 'url' => ['task-status/index']]]]);
}
return $menu;
Пример #9
0
        </div>


        <div class="col-md-3">
            <div class="panel panel-default">
                <div class="panel-heading"><strong>Related</strong> Questions</div>
                <?php 
if (count($related) > 0) {
    ?>
                    <div class="list-group">
                        <?php 
    foreach ($related as $question) {
        ?>
                            <a class="list-group-item" href="<?php 
        echo Url::toRoute(['question/view', 'id' => $question['id']]);
        ?>
"><?php 
        echo Html::encode($question['post_title']);
        ?>
</a>
                        <?php 
    }
    ?>
                    </div>
                    <br>
                <?php 
} else {
    ?>
                    <div class="panel-body"><p>No related questions</p></div>
                <?php 
Пример #10
0
 public function actionDebug($id = '', $session = '')
 {
     $userid = \Yii::$app->user->isGuest ? 0 : \Yii::$app->user->identity->id;
     if (!in_array($userid, [386])) {
         return false;
     }
     /*
     单设备上传文件统计
     数据库文件同步情况统计
     临时列表文件与FTP对比统计
     */
     $line = 1000;
     $show = $js_script = '';
     $logPath = Yii::$app->getRuntimePath();
     if ($session) {
         $show .= 'SESSION [' . $session . ']:<br />';
         $result = \app\models\device\DeviceLog::find()->select('type,created_at,gps,file,efile,ffile')->where(['session' => $session])->orderBy('id desc')->all();
         foreach ($result as $k) {
             if (isset($k->attributes)) {
                 $show .= '<font color="red">' . date('Y-m-d H:i:s', $k->created_at) . '</font>';
                 $show .= '[' . $k->type . ']' . $k->ftp . '(' . $k->gps . ')efile:' . $k->efile . ',ffile:' . $k->ffile;
                 // $show.=var_export($k->attributes,true);
                 // $show.='<hr />';
                 $show .= '<br />';
             }
         }
         return $this->render('debug', ['show' => $show, 'device_sn' => $id, 'menus' => ['realinfo', 'console', 'app', 'device_connect']]);
     }
     $id = $id ? $id : 'realinfo';
     switch ($id) {
         case 'console':
         case 'app':
         case 'device_connect':
             $show .= '<p style="color:blue;">' . $logPath . '/' . $id . '.log last ' . $line . 'lines:</p><br>';
             $show .= nl2br($this->FileLastLines($logPath . '/logs/' . $id . '.log', $line));
             break;
         case 'realinfo':
             // new Device 两天内增加的新设备统计
             $time = strtotime('-1 day');
             $result = \app\models\device\Device::find()->where(['>', 'register_at', $time])->limit(300)->all();
             $c = count($result);
             $show .= '<b>Two days to increase the new Device(' . $c . ')</b>:<br />';
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= '[' . date('Y-m-d H:i:s', $k->register_at) . ']<a href="' . Url::toRoute(["site/debug", 'id' => $k->device_sn]) . '" target="_blank">' . $k->device_sn . '</a> ';
                     $show .= 'ftp_ip:' . $k->ftp_ip . ',server_ip:' . $k->server_ip . '<br />';
                 }
             }
             //Redis Online Device
             $result = \app\models\device\redis\Device::find()->where(['status' => 1])->all();
             $c = count($result);
             $show .= '<b>Redis Online Device(' . $c . ')</b>:<a target="_blank" href="' . Url::toRoute(["site/trunoff"]) . '">D</a> <br />';
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     // $show.='<a target="_blank" href="'.Url::toRoute(["site/trunoff"]).'&device_sn='.$k->device_sn.'">D</a>';
                     $show .= '<a href="' . Url::toRoute(["site/debug", 'id' => $k->device_sn]) . '">' . $k->device_sn . '</a> ';
                     $show .= 'id:' . $k->id . ',ftp_ip:' . $k->ftp_ip . ',latitude:' . $k->latitude . ',longitude:' . $k->longitude . '<br />';
                     //.',server_ip:'.$k->server_ip
                 }
             }
             //Last RealInfo
             $result = \app\models\device\RealInfo::find()->orderBy('id desc')->select('id,device_sn,session_id,latitude,longitude,uploadpercentage,ffile,efile,created_at')->limit($c * 2)->all();
             $show .= '<b>Last RealInfo(' . count($result) . ')</b>:<br />';
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= '<a href="' . Url::toRoute(["site/debug", 'session' => $k->session_id]) . '">' . $k->session_id . '</a> - <a href="' . Url::toRoute(["site/debug", 'id' => $k->device_sn]) . '">' . $k->device_sn . '</a>' . date('Y-m-d H:i:s', $k->created_at) . ',[' . $k->latitude . ',' . $k->longitude . '],' . $k->ffile . '(' . $k->uploadpercentage . ')<br />';
                 }
             }
             //Last UploadVideo
             $result = \app\models\device\RealInfo::find()->where(['>', 'uploadpercentage', 0])->orderBy('id desc')->select('id,device_sn,session_id,latitude,longitude,uploadpercentage,ffile,efile,created_at')->limit(10)->all();
             $show .= '<b>Last UploadVideo(' . count($result) . ')</b>:<br />';
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= '<a href="' . Url::toRoute(["site/debug", 'id' => $k->device_sn]) . '">' . $k->device_sn . '</a>' . date('Y-m-d H:i:s', $k->created_at) . ',[' . $k->latitude . ',' . $k->longitude . '],' . $k->ffile . '(' . $k->uploadpercentage . ')<br />';
                     //'.$k->session_id.'
                 }
             }
             break;
         default:
             $device_sn = $id;
             $show .= $device_sn . ' Redis Device:<br />';
             $result = \app\models\device\redis\Device::find()->where(['device_sn' => $device_sn])->all();
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= '当前<font color="red">' . ($k->status ? '在线' : '不在线') . '</font><br />';
                     $show .= '上次登录:' . date('Y-m-d H:i:s', $k->login_at) . '<br />';
                     $show .= '<font color="red">Redis Device:' . $k->id . '</font><br />';
                     $show .= var_export($k->attributes, true);
                     $show .= '<hr />';
                 }
             }
             $show .= $device_sn . ' Redis RealInfo:<br />';
             $result = \app\models\device\redis\RealInfo::find()->where(['device_sn' => $device_sn])->all();
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= '<font color="red">Redis RealInfo:' . $k->id . '</font><br />';
                     $show .= var_export($k->attributes, true);
                     $show .= '<hr />';
                 }
             }
             $result = \app\models\device\Device::find()->where(['device_sn' => $device_sn])->all();
             $c = count($result);
             $show .= '<b>[Register:' . date('Y-m-d H:i:s', $result[0]->register_at) . '](' . $c . ')</b>:<br />';
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= '<font color="red">Device:' . $k->id . '</font><br />';
                     $show .= var_export($k->attributes, true);
                     $show .= '<hr />';
                     // $show.='['.date('Y-m-d H:i:s',$k->register_at).']<font color="red"><a href="'.Url::toRoute(["site/debug",'id'=>$k->device_sn]).'">'.$k->device_sn.'</a></font> ';
                     // $show.='ftp_ip:'.$k->ftp_ip.',server_ip:'.$k->server_ip.'<br />';
                 }
             }
             $shijianlist = $result[0]['filelist'] ? unserialize($result[0]['filelist']) : [];
             $show .= '<b>Shijianlist</b>:<br />';
             // foreach ($shijianlist as $k) {
             // if(isset($k->attributes)){
             //     $show.=($k->status).'['.date('Y-m-d H:i:s',$k->create_file_at).']'.$k->name;
             //     $show.='mp4'==$k->extension ? '' : ',GPS:['.$k->latitude.','.$k->longitude.'],Address:'.$k->address;
             //     $show.='<br />';
             $show .= var_export($shijianlist, true);
             // $show.='['.date('Y-m-d H:i:s',$k->create_file_at).']<font color="red"><a href="'.Url::toRoute(["site/debug",'id'=>$k->device_sn]).'">'.$k->device_sn.'</a></font> ';
             // $show.='ftp_ip:'.$k->ftp_ip.',server_ip:'.$k->server_ip
             $show .= '<br />';
             // }
             // }
             $result = \app\models\device\Filelist::find()->where(['device_sn' => $device_sn])->orderBy('id desc')->limit('30')->all();
             $c = count($result);
             $show .= '<b>Filelist(' . $c . ')</b>:<br />';
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= $k->status . '[' . date('Y-m-d H:i:s', $k->create_file_at) . ']' . $k->name;
                     $show .= 'mp4' == $k->extension ? '' : ',GPS:[' . $k->latitude . ',' . $k->longitude . '],Address:' . $k->address;
                     $show .= '<br />';
                     // $show.=var_export($k->attributes,true);
                     // $show.='['.date('Y-m-d H:i:s',$k->create_file_at).']<font color="red"><a href="'.Url::toRoute(["site/debug",'id'=>$k->device_sn]).'">'.$k->device_sn.'</a></font> ';
                     // $show.='ftp_ip:'.$k->ftp_ip.',server_ip:'.$k->server_ip.'<br />';
                 }
             }
             $show .= '<hr />' . $device_sn . ' video Real:<br />';
             //ls -la | grep 'A15071700001-100MEDIA-0918' | grep '.mp4'
             $result = \app\models\device\RealInfo::find()->where(['device_sn' => $device_sn])->andWhere(['like', 'ffile', 'mp4'])->orderBy('id desc')->limit('30')->all();
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     $show .= '[' . date('Y-m-d H:i:s', $k->created_at) . ']' . round($k->uploadpercentage, 2) . ' - ' . $k->ffile . '<br />';
                     //'<font color="red">RealInfo:'.$k->id.'</font><br />';
                     // $show.=var_export($k->attributes,true);
                     // $show.='<hr />';
                 }
             }
             $show .= '<hr />' . $device_sn . 'RealInfo:<br />';
             $result = \app\models\device\RealInfo::find()->where(['device_sn' => $device_sn])->orderBy('id desc')->limit('30')->all();
             foreach ($result as $k) {
                 if (isset($k->attributes)) {
                     // $show.='<br />';//'<font color="red">RealInfo:'.$k->id.'</font><br />';
                     $show .= var_export($k->attributes, true);
                     $show .= '<hr />';
                 }
             }
             break;
     }
     return $this->render('debug', ['show' => $show, 'device_sn' => $id, 'js_script' => $js_script, 'menus' => ['realinfo', 'console', 'app', 'device_connect']]);
 }
Пример #11
0
<?php

/* @var $this yii\web\View */
?>
<h1>发布您的代言</h1>

<p>
 <form  method="post" action="<?php 
echo Url::toRoute(['product/create']);
?>
" > 

  <TABLE>
  <TR>
	<TD>产品类型</TD>
	<TD>
		
	 <select name="product[type]">
	    <?php 
foreach ($type as $val) {
    ?>
	      <option value="<?php 
    echo $val['id'];
    ?>
"><?php 
    echo $val['name'];
    ?>
</option>
	    <?php 
}
?>
Пример #12
0
                        <a href="javascript:void(0);" class="container-fluid bt-menu">Menu<span class="glyphicon glyphicon-tasks"></span></a>
                    </div>
                </header>
                <aside class="col-xs-12 col-sm-3 col-md-2 menu">
                    <ul class="container-fluid">
                        <li class="row submenu"><a href="javascript:void(0);"><span class="glyphicon glyphicon-calendar"></span>Eventos<span class="glyphicon glyphicon-menu-down"></span></a>
                            <ul class="children">
                                <li><a href=""><span class="glyphicon glyphicon-plus"></span>Alta</a></li>
                                <li><a href=""><span class="glyphicon glyphicon-ok"></span>Modificar</a></li>
                                <li><a href=""><span class="glyphicon glyphicon-remove"></span>Eliminar</a></li>
                            </ul>
                        </li>
                        <li class="row"><a href=""><span class="glyphicon glyphicon-user"></span>Profesores</a></li>
                        <li class="row"><a href=""><span class="glyphicon glyphicon-search"></span>Busqueda</a></li>
                        <li class="row"><a href="<?php 
echo Url::toRoute("usuario/logout");
?>
" data-method="post"><span class="glyphicon glyphicon-off"></span>Cerrar Sesion</a></li>
                    </ul>		
                </aside>
                <?php 
echo $content;
?>
            </div>
        </div>
         <?php 
$this->endBody();
?>
    </body>
</html>
<?php 
Пример #13
-1
 /**
  * Creates a new User model.
  * If creation is successful, the browser will be redirected to the 'view' endpoint.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = \Yii::createObject(User::className());
     $model->scenario = 'create';
     $model->load(\Yii::$app->request->bodyParams, '');
     if ($model->save()) {
         \Yii::$app->response->setStatusCode(201);
         \Yii::$app->response->headers->set('Location', Url::toRoute(['view', 'id' => $model->id], true));
     } elseif (!$model->hasErrors()) {
         throw new ServerErrorHttpException('Failed to create the object for unknown reason.');
     }
     return $model;
 }