text
stringlengths
2
1.03M
@extends('layouts.master') @section('title')@parent- {{ $product->name }} @stop @section('metaLabels') @parent @include('partial.social_tags', [ 'title' => $product->name, 'image' => isset($product->features['images'][0]) ? URL::to('/').$product->features['images'][0] : '/img/no-image.jpg', 'description' => substr($product->description, 0, 197).'...', 'id' =>$product->id, 'brand' => isset($product->features['brand'])?$product->features['brand']:'', 'rate_val' => $product->rate_val, 'rate_count' => $product->rate_count ]) @stop @section('breadcrumbs') @parent {!! Breadcrumbs::render('productDetail', $product) !!} @stop @section('content') @parent @if (Auth::id()===$product->user_id) @section('panel_left_content') @include('user.partial.menu_dashboard') @stop @endif @section('center_content') <div class="panel panel-default" ng-controller="StoreProducts" > <div class="panel-body" > <div class="row"> @include('partial.message') @if($product->status==0) <div class="alert alert-danger" role="alert"> {{ trans('product.show_view.status_inactive') }} </div> @endif <div class="col-xs-12 visible-xs-block"> <strong>{{$product->name}}</strong> </div> <div class="col-xs-12 visible-xs-block" ng-show="product.rate_count > 0"> <rating max="5" state-on="'fui-heart'" state-off="'fui-cross'" readonly="true" ng-model="product.rate_val" ></rating> <small class="pull-right" ng-show="product.rate_count > 0"> {{$product->num_of_reviews}} </small> </div> <div> {{-- Despliega el carousel solo cuando el producto tiene mas una imagen cargada --}} @if(isset($product->features['images']) && count($product->features['images']) > 1) <div class="col-xs-12 col-sm-4 " > <carousel interval="myInterval" class="ng-cloak thumbnail"> @foreach($product->features['images'] as $image ) <slide > <img src="{{$image}}?h=350" alt="{{$product->name}}" > </slide> @endforeach </carousel> </div> {{-- Se muestra solamente cuando el producto tiene una sola imagen cargada --}} @else <div class="col-xs-12 col-sm-4 thumbnail" > @if (isset($product["features"]["images"][0])) <img src="{{$product->features['images'][0]}}?h=350" alt="{{$product->name}}" > @else <img src="/img/no-image.jpg" alt="{{$product->name}}" > @endif </div> @endif <div class="col-xs-12 col-sm-5 {{(Auth::id()===$product->user_id?'pull-right':'')}}"> <div class="text-small hidden-xs"><strong><h6>{{$product->name}}</h6></strong></div> <div class="text-small hidden-xs" ng-show="[[ product.rate_count > 0 ]]"> <rating max="5" state-on="'fui-heart'" state-off="'fui-cross'" readonly="true" ng-model="product.rate_val" ></rating> <small ng-show="product.rate_count > 0"> {{$product->num_of_reviews}} </small> </div> <div class="text-small hidden-xs">{{$product->description}}</div> <div class="text-small"><strong>{{ trans('product.globals.price') }}: </strong> {{\Utility::showPrice($product->price)}} </div> <div class="text-small"><strong>{{ trans('globals.status') }}: </strong> {{ $product->status ? trans('globals.active'):trans('globals.inactive') }}</div> @if (trim($product->brand)!='') <div class="text-small"><strong>{{ trans('globals.brand') }}: </strong> {{ $product->brand }}</div> @endif <!-- <div class="text-small"><strong>{{ trans('store.condition') }}</strong>: {{$product->condition}} <span ng-attr-class="[[product.stock<= product.low_stock && 'label label-warning'|| 'label label-success' ]]"><span ng-show="product.stock <= product.low_stock">{{ trans('store.just') }} {{$product->stock}}</span> {{ trans('store.inStock') }}</span></div> --> @if(!count($product->group)) <div class="text-small hidden-xs"> @if (isset($product->features)) @include('features.makeToShow',['globalFeatures'=>$features,'features'=>$product->features]) @endif </div> @else @include('products.group') @endif </div> <div class="col-xs-12 col-sm-{{(Auth::id()===$product->user_id?12:3)}} well"> @if ($product->type!='freeproduct') {{-- Si el usuario es dueno del producto que visualiza, no puede comprar, pero si editarlo --}} @if (Auth::id()===$product->user_id) {!! Form::open(['route' => ['products.change_status', $product->id], 'method' => 'post', 'class' => 'form-inline pull-right']) !!} <a href="{{ route('products.edit',[$product->id]) }}" class="btn btn-danger"> {{ trans('globals.edit') }}</a> <button type="submit" class="btn btn-primary">{{ ($product->status) ? trans('globals.disable') : trans('globals.enable') }}</button> @if($product->type=='key') <button type="button" ng-controller="ModalCtrl" ng-init="data={'data':{{ $product->id }}}" ng-click="modalOpen({templateUrl:'/modalAllKeys',controller:'getKeysVirtualProducts',resolve:'data'})" class="btn btn-warning">{{ trans('product.globals.see_keys') }}</button> @endif {!! Form::close() !!} @elseif($product->status!=0) {{-- Acciones para cualquier usuario que desee comprar en Bella, siempre y cuando el producto no este inactivo --}} {!! Form::open(array('url' => route('orders.add_to_order',['cart',$product->id]), 'method' => 'put')) !!} <div class="col-sm-12"> <div class="col-sm-2"> {{ trans('store.quantity') }}: </div> <!-- <div class="col-sm-10"> {!! Form::selectRange('quantity', 1, $product->stock, 1, ['class' => 'form-control ']) !!} </div> --> </div> @if($product->type=='key') <br/>{{ trans('globals.send_to') }}: {!! Form::email('email',(Auth::check()?Auth::user()->email:null), ['class'=>'form-control',(Auth::check()?'':'disabled')=>(Auth::check()?'':'disabled')]) !!} @endif <div class="col-sm-12"><hr> {!! Form::submit(trans('store.add_to_cart'), array('class' => 'btn btn-default btn-md')) !!} </div> <!-- BUTTON WISHLIST--> <div class="col-sm-12"><hr> @if(Auth::check()) <div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> {{ trans('store.addToWishList') }} <span class="caret"></span> </button> <ul class="dropdown-menu dropdown-menu-left" aria-labelledby="dropdownMenu1"> <li> <a href="{{ route('orders.add_to_order',['wishlist',$product->id]) }}"> {{ trans('store.wish_list') }} </a> </li> @if (count($allWishes)>0) <li class="dropdown-header">{{ trans('store.your_wish_lists') }}</li> @endif @foreach($allWishes as $wishList) <li><a href="{{ route('orders.add_to_order_by_id',[$wishList->id,$product->id]) }}">{{ $wishList->description }}</a></li> @endforeach </ul> </div> @else <a href="/login" class="btn btn-info ">{{ trans('store.addToWishList') }}</a> @endif </div> {!! Form::close() !!} @endif @else @if($product->type=='freeproduct') {!! Form::open(['route' => ['freeproducts.show', $freeproductId], 'method' => 'get', 'class' => 'form-inline']) !!} <a href="{{ route('products.show',[$product->parent_id]) }}" type="button" class="btn btn-default btn-md">{{ trans('freeproduct.purchase_this_item') }}</a> {!! Form::submit(trans('freeproduct.go_to_package'), array('class' => 'btn btn-success btn-md')) !!} {!! Form::close() !!} @endif @endif </div> </div> @if($product->type=='key') <div class="col-xs-12 visible-sm-block visible-md-block visible-lg-block"> <p>{!! trans('product.show_view.key_info_show') !!}</p> </div> @endif {{-- Descripcion del producto --}} <div class="col-xs-12 visible-xs-block"> <div class="btn-group btn-group-justified" role="group"> <div class="btn-group" role="group"> <button type="button" class="btn btn-primary btn-lg" btn-checkbox ng-model="checkButtonDescription" ng-click="isCollapsedDescription = !isCollapsedDescription" btn-checkbox-true="1" btn-checkbox-false="0">{{ trans('product.globals.description') }}</button> </div> </div> <div collapse="isCollapsedDescription"> <div class="well well-xs"> <h6>{{ trans('product.globals.product_information') }}</h6> <div>{{$product->description}}</div> @include('features.makeToShow',['globalFeatures'=>$features,'features'=>$product->features,'force'=>false]) @if($product->type=='key') <p>{!! trans('product.show_view.key_info_show') !!}</p> @endif </div> </div> </div> {{-- Comentarios --}} <div class="col-xs-12 visible-xs ng-hide" ng-show="detailComments.length > 0"> <div class="btn-group btn-group-justified" role="group"> <div class="btn-group" role="group"> <button type="button" class="btn btn-primary btn-lg" btn-checkbox ng-model="checkButtonComments" ng-click="isCollapseComments = !isCollapseComments" btn-checkbox-true="1" btn-checkbox-false="0">{{ trans('product.globals.comments') }}</button> </div> </div> <div collapse="isCollapseComments"> <div class="well well-xs"> <hr> <h4>{{ trans('product.show_view.recent_reviews') }}</h4> <hr> <div ng-repeat="comment in detailComments" ng-show="comment.rate_comment"> <rating max="5" state-on="'fui-heart'" state-off="'fui-cross'" readonly="true" ng-model="comment.rate" ></rating> <small>[[ comment.updated_at | dateToISO | date:'MM-dd-yyyy' ]]</small> <p>[[ comment.rate_comment ]]</p> <hr> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12 hidden-xs ng-hide" ng-show="detailComments.length > 0"> <hr> <h4>{{ trans('product.show_view.recent_reviews') }}</h4> <hr> <div ng-repeat="comment in detailComments" ng-show="comment.rate_comment"> <rating max="5" state-on="'fui-heart'" state-off="'fui-cross'" readonly="true" ng-model="comment.rate" ></rating> <small>[[ comment.updated_at | dateToISO | date:'MM-dd-yyyy' ]]</small> <p>[[ comment.rate_comment ]]</p> <hr> </div> </div> </div> </div> </div> @if(isset($suggestions) && is_array($suggestions)) <h4 >{{ trans('store.suggestions.product') }}</h4> <hr> <section class="products_view"> <div class="container-fluid marketing"> <div class="row"> @foreach ($suggestions as $productSuggestion) @include('products.partial.productBox', $productSuggestion) @endforeach </div> </div> </section> @endif @stop @stop @section('scripts') @parent <script> (function(app){ app.controller('StoreProducts', ['$scope', function($scope){ $scope.isCollapsedDescription = true; $scope.isCollapseComments = true; $scope.myInterval = 3000; $scope.checkButtonDescription = 1; $scope.checkButtonComments = 1; $scope.product=({!! $product->toJson() !!}); $scope.detailComments=({!! $jsonDetails !!}); }]); app.filter('dateToISO', function() { return function(input) { input = new Date(input).toISOString(); return input; }; }); app.config( ['$animateProvider', function ($animateProvider) { $animateProvider.classNameFilter(/carousel/); }]); })(angular.module("ShopCore")); </script> @stop
<script type="text/javascript"> //<![CDATA[ function add(img) { opener.document.getElementById('<?php echo html_escape($this->input->get('id')); ?>').value += "\n[" + img + "]\n"; self.close(); } //]]> </script> <?php $emoticon = element('emoticon', $view); if ($emoticon && is_array($emoticon)) { foreach ($emoticon as $key => $value) { $size = @getimagesize(config_item('uploads_dir') . '/emoticon/' . $value); if ( ! isset($size[0])) { continue; } $img = site_url(config_item('uploads_dir') . '/emoticon/' . $value); ?> <span style="margin:5px;"> <a href="javascript:add('<?php echo $img; ?>');"><img src="<?php echo $img; ?>" alt="emoticon" title="emoticon" /></a> </span> <?php } }
<?php if (\Yii::$app->session->hasFlash('success')) { ?> <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <?php echo Yii::$app->session->getFlash('success'); ?> </div> <?php } elseif (Yii::$app->session->hasFlash('error')) { ?> <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <?php echo Yii::$app->session->getFlash('error'); ?> </div> <?php } ?>
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function (Blueprint $tb) { $tb->id(); $tb->string('first_name'); $tb->string('last_name'); $tb->string('email')->unique(); $tb->string('phone'); $tb->string('password'); $tb->string('verification_code')->unique()->nullable(); $tb->boolean('admin')->default(false); $tb->softDeletes(); $tb->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('users'); } }
<!doctype html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- CSRF Token --> <meta name="csrf-token" content="{{ csrf_token() }}"> <title>{{ config('app.name', 'Laravel') }}</title> <!-- Fonts --> <link rel="dns-prefetch" href="//fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet"> <!-- Styles --> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css"> <link rel="stylesheet" href="{{ url('assets/vendors/iconfonts/mdi/css/materialdesignicons.min.css') }}"> <link rel="stylesheet" href="{{ url('assets/css/shared/style.css') }}"> <!-- login en general --> <link rel="stylesheet" href="{{ url('css/login_page.css') }}"> <!-- mobile login --> <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet"> <link rel="stylesheet" href="{{url('css/mobile_login.css')}}"> </head> <body> <div id="app"> @yield('content') </div> <script src="{{ url('assets/vendors/js/vendor.bundle.base.js') }}"></script> <!-- <script src="{{ url('assets/js/shared/misc.js') }}"></script> --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> </body> </html>
<?php /** * Created by PhpStorm. * User: proseeds * Date: 2016/09/09 * Time: 11:34 */ namespace app\modules\manage\models; use app\models\manage\BaseColumnSet; use app\models\manage\JobColumnSet; use app\models\manage\JobMaster; use app\models\manage\SearchkeyMaster; use app\modules\manage\components\JobCsvLoader; use yii; use yii\db\ActiveRecord; use yii\helpers\ArrayHelper; use yii\helpers\Inflector; use app\models\manage\searchkey\WageCategory; use app\models\manage\searchkey\WageItem; use app\common\Helper\JmUtils; /** * Class JobCsvRegister * @package app\modules\manage\models */ class JobCsvRegister extends JobMaster { /** @var JobCsvLoader */ public $loader; /** @var string 給与検索キー用プロパティプレフィックス */ const WAGE_NAME_COLUMN = 'wageItem_'; /** @var array 市区町村No */ public $dist; /** @var array 市区町村Id */ private $_distId; /** @var string */ public $jobTypeSmall; /** @var string|array job_type_small.id */ private $_jobTypeSmallId; /** @var int 駅関連情報 */ public $stationCd1; public $transportType1; public $transportTime1; public $stationCd2; public $transportType2; public $transportTime2; public $stationCd3; public $transportType3; public $transportTime3; /** @var integer 申し込みプランNo、掲載企業No */ public $clientChargePlanNo; public $clientNo; /** @var string 申し込みプランのラベル名 */ public $clientChargePlanLabel; /** @var string 申し込みプランNo、掲載企業No */ public $dispFileName1; public $dispFileName2; public $dispFileName3; public $dispFileName4; public $dispFileName5; /** @var array keyをカテゴリidとしたカテゴリ毎の給与最大値 */ private $_maxWage; /** @var array 登録するwageItemのid */ private $_wageItem = []; /** @var array 汎用検索キーNo */ private $_searchkeyItem1; private $_searchkeyItem2; private $_searchkeyItem3; private $_searchkeyItem4; private $_searchkeyItem5; private $_searchkeyItem6; private $_searchkeyItem7; private $_searchkeyItem8; private $_searchkeyItem9; private $_searchkeyItem10; private $_searchkeyItem11; private $_searchkeyItem12; private $_searchkeyItem13; private $_searchkeyItem14; private $_searchkeyItem15; private $_searchkeyItem16; private $_searchkeyItem17; private $_searchkeyItem18; private $_searchkeyItem19; private $_searchkeyItem20; /** @var array 汎用検索キーId */ private $_searchkeyItem1Id; private $_searchkeyItem2Id; private $_searchkeyItem3Id; private $_searchkeyItem4Id; private $_searchkeyItem5Id; private $_searchkeyItem6Id; private $_searchkeyItem7Id; private $_searchkeyItem8Id; private $_searchkeyItem9Id; private $_searchkeyItem10Id; private $_searchkeyItem11Id; private $_searchkeyItem12Id; private $_searchkeyItem13Id; private $_searchkeyItem14Id; private $_searchkeyItem15Id; private $_searchkeyItem16Id; private $_searchkeyItem17Id; private $_searchkeyItem18Id; private $_searchkeyItem19Id; private $_searchkeyItem20Id; /** * 申し込みプランをモデルに持たせておく */ public function init() { parent::init(); $this->clientChargePlanLabel = Yii::$app->functionItemSet->job->items['client_charge_plan_id']->label; } /** * 検索キーに関する専用のsetter * @param string $name * @param mixed $value */ public function __set($name, $value) { if (preg_match('/' . self::WAGE_NAME_COLUMN . '([\d]+)/', $name, $wageItemResults)) { $this->setMaxWage($wageItemResults[1], $value); } elseif (preg_match('/searchkeyItem([\d]+)/', $name, $searchkeyItemResults)) { $this->setSearchKeyItems($searchkeyItemResults[1], $value); } else { parent::__set($name, $value); } } /** * 検索キーに関する専用のgetter * @param string $name * @return array|int|mixed|null|yii\db\ActiveQuery */ public function __get($name) { if (preg_match('/' . self::WAGE_NAME_COLUMN . '([\d]+)/', $name, $wageItemResults)) { return null; } elseif (preg_match('/searchkeyItem([\d]+)/', $name, $searchkeyItemResults)) { return $this->getSearchKeyItems($searchkeyItemResults[1]); } else { return parent::__get($name); } } /** * 先祖のloadメソッドを呼び出す * @param array $data * @param string $formName * @return bool */ public function load($data, $formName = null) { return ActiveRecord::load($data, $formName); } /** ▼▼ 各種検索キーのgetter、setter ▼▼ */ /** * maxWageを代入 * @param $id * @param $value */ private function setMaxWage($id, $value) { if (!JmUtils::isEmpty($value)) { $this->_maxWage[$id] = $value; } } /** * maxWageの配列を返す * @return integer[]|null */ public function getMaxWage() { return $this->_maxWage; } /** * 汎用検索キーに関するsetter("|"(パイプ区切り)で半角英数が入っているので、分解して一次配列にしている) * @param $tableNo * @param $value */ private function setSearchKeyItems($tableNo, $value) { $this->{'_searchkeyItem' . $tableNo} = $value; } /** * 汎用検索キーに関するgetter * @param $tableNo * @return integer[]|null */ private function getSearchKeyItems($tableNo) { return $this->{'_searchkeyItem' . $tableNo}; } /** ▲▲ 各種検索キーのgetter、setter ▲▲*/ /** * CSV一括更新用にJobMasterからrules()をカスタマイズ * @return array */ public function rules() { $dateWhen = function ($model) { // 運営元の時と自由プランが選択されている時は終了日の入力がある return Yii::$app->user->identity->myRole == Manager::OWNER_ADMIN || (isset($this->clientChargePlan) && $this->clientChargePlan->period == null); }; $compareWhen = function ($model) { // 運営元の時もしくは自由プランが選択されている時、disp_start_dateが適切な値ならば終了日の比較validationが走る return $this->dispStartDate !== false && (Yii::$app->user->identity->myRole == Manager::OWNER_ADMIN || (isset($this->clientChargePlan) && $this->clientChargePlan->period == null)); }; $jobMasterRules = ArrayHelper::merge(Yii::$app->functionItemSet->job->rules, [ [ [ 'created_at', 'updated_at', 'disp_type_sort', 'media_upload_id_1', 'media_upload_id_2', 'media_upload_id_3', 'media_upload_id_4', 'media_upload_id_5', ], 'number', ], [ 'disp_start_date', 'date', 'timestampAttribute' => 'disp_start_date', 'min' => '1920/01/01', 'tooSmall' => Yii::t('app', '{attribute}は{min}以降の日付にしてください.'), 'max' => '2037/12/31', 'tooBig' => Yii::t('app', '{attribute}は{max}以前の日付にしてください.'), ], [ 'disp_end_date', 'date', 'timestampAttribute' => 'disp_end_date', 'when' => $dateWhen, 'min' => '1920/01/01', 'tooSmall' => Yii::t('app', '{attribute}は{min}以降の日付にしてください.'), 'max' => '2037/12/31', 'tooBig' => Yii::t('app', '{attribute}は{max}以前の日付にしてください.'), ], ['disp_end_date', 'compare', 'compareAttribute' => 'dispStartDate', 'operator' => '>=', 'message' => Yii::t('app', '{attribute}は{compareAttribute}より後の日付にしてください.'), 'when' => $compareWhen], [['valid_chk', 'disp_start_date'], 'required'], ['valid_chk', 'boolean'], ]); /** @var SearchkeyMaster $wageSearchkeyMaster */ $wageSearchkeyMaster = ArrayHelper::getValue(Yii::$app->searchKey->searchKeys, 'wage_category'); /** @var WageCategory[] $cates */ $cates = $wageSearchkeyMaster->searchKeyModels ?? []; $wageItems = array_map(function (WageCategory $cate) { return self::wageColumnRename($cate->id); }, $cates); $optionItems = array_keys(Yii::$app->functionItemSet->job->optionAttributeLabels); return ArrayHelper::merge($jobMasterRules, [ [ [ 'clientChargePlanNo', 'clientNo', 'stationCd1', 'transportTime1', 'stationCd2', 'transportTime2', 'stationCd3', 'transportTime3', 'import_site_job_id', ], 'number', ], [['transportType1', 'transportType2', 'transportType3'], 'boolean'], [['dispFileName1', 'dispFileName2', 'dispFileName3', 'dispFileName4', 'dispFileName5'], 'string'], [['clientChargePlanNo', 'clientNo', 'dist'], 'required'], [$wageItems, 'safe'], [ 'job_no', function ($attribute, $params) { $this->jobNoExistCheck(); }, 'skipOnEmpty' => false, ], [ 'clientNo', function ($attribute, $params) { $this->clientNoExistCheck(); }, ], [ 'clientChargePlanNo', function ($attribute, $params) { $this->clientChargePlanNoCheck(); }, ], [ ['dispFileName1', 'dispFileName2', 'dispFileName3', 'dispFileName4', 'dispFileName5'], function ($attribute, $params) { $this->dispFileNameExistCheck($attribute); }, 'skipOnEmpty' => false, ], [ $optionItems, function ($attribute, $params) { $this->subsetCheck($attribute); }, ], [ [ 'dist', 'jobTypeSmall', 'searchkeyItem1', 'searchkeyItem2', 'searchkeyItem3', 'searchkeyItem4', 'searchkeyItem5', 'searchkeyItem6', 'searchkeyItem7', 'searchkeyItem8', 'searchkeyItem9', 'searchkeyItem10', 'searchkeyItem11', 'searchkeyItem12', 'searchkeyItem13', 'searchkeyItem14', 'searchkeyItem15', 'searchkeyItem16', 'searchkeyItem17', 'searchkeyItem18', 'searchkeyItem19', 'searchkeyItem20', ], function ($attribute, $params) { $this->searchkeyCheck($attribute); }, ], [ ['stationCd1', 'stationCd2', 'stationCd3'], function ($attribute, $params) { $this->stationCodeCheck($attribute); }, ], [ 'maxWage', function ($attribute, $params) { $this->wageItemCheck(); }, ], ]); } /** * validate前にシナリオをセットする * @return bool */ public function beforeValidate() { if (parent::beforeValidate()) { $this->initScenario(); return true; } return false; } /** * エラーがなく既存原稿かつ掲載終了日が空の場合、nullを許可しているdisp_end_dateを明示的に * nullにしておく(変更の場合、掲載終了日が空だと上書きされない。) */ public function afterValidate() { if (!$this->hasErrors() && !$this->isNewRecord && !isset($this->disp_end_date)) { $this->disp_end_date = null; } parent::afterValidate(); } /** * ラベル設定(JobMasterを継承) * JobMasterSearchとラベル名が結構違っていたため、分けている * @return array */ public function attributeLabels() { return ArrayHelper::merge(parent::attributeLabels(), [ 'pref' => Yii::$app->searchKey->label('job_dist'), 'dist' => Yii::$app->searchKey->label('job_dist'), 'stationCd1' => Yii::t('app', '駅-1'), 'transportType1' => Yii::t('app', '交通手段-1'), 'transportTime1' => Yii::t('app', '所要時間-1(分)'), 'stationCd2' => Yii::t('app', '駅-2'), 'transportType2' => Yii::t('app', '交通手段-2'), 'transportTime2' => Yii::t('app', '所要時間-2(分)'), 'stationCd3' => Yii::t('app', '駅-3'), 'transportType3' => Yii::t('app', '交通手段-3'), 'transportTime3' => Yii::t('app', '所要時間-3(分)'), 'jobTypeSmall' => Yii::$app->searchKey->label('job_type'),// 職種検索キーは全サイトで無効になるがソースは残す。 'searchkeyItem1' => Yii::$app->searchKey->label('job_searchkey_item1'), 'searchkeyItem2' => Yii::$app->searchKey->label('job_searchkey_item2'), 'searchkeyItem3' => Yii::$app->searchKey->label('job_searchkey_item3'), 'searchkeyItem4' => Yii::$app->searchKey->label('job_searchkey_item4'), 'searchkeyItem5' => Yii::$app->searchKey->label('job_searchkey_item5'), 'searchkeyItem6' => Yii::$app->searchKey->label('job_searchkey_item6'), 'searchkeyItem7' => Yii::$app->searchKey->label('job_searchkey_item7'), 'searchkeyItem8' => Yii::$app->searchKey->label('job_searchkey_item8'), 'searchkeyItem9' => Yii::$app->searchKey->label('job_searchkey_item9'), 'searchkeyItem10' => Yii::$app->searchKey->label('job_searchkey_item10'), 'searchkeyItem11' => Yii::$app->searchKey->label('job_searchkey_item11'), 'searchkeyItem12' => Yii::$app->searchKey->label('job_searchkey_item12'), 'searchkeyItem13' => Yii::$app->searchKey->label('job_searchkey_item13'), 'searchkeyItem14' => Yii::$app->searchKey->label('job_searchkey_item14'), 'searchkeyItem15' => Yii::$app->searchKey->label('job_searchkey_item15'), 'searchkeyItem16' => Yii::$app->searchKey->label('job_searchkey_item16'), 'searchkeyItem17' => Yii::$app->searchKey->label('job_searchkey_item17'), 'searchkeyItem18' => Yii::$app->searchKey->label('job_searchkey_item18'), 'searchkeyItem19' => Yii::$app->searchKey->label('job_searchkey_item19'), 'searchkeyItem20' => Yii::$app->searchKey->label('job_searchkey_item20'), 'clientChargePlanNo' => Yii::$app->functionItemSet->job->items['client_charge_plan_id']->label, 'clientNo' => Yii::$app->functionItemSet->job->items['client_master_id']->label, 'maxWage' => Yii::$app->searchKey->label('wage_category'),//エラー表示用 'media_upload_id_1' => Yii::$app->functionItemSet->job->items['media_upload_id_1']->label, 'media_upload_id_2' => Yii::$app->functionItemSet->job->items['media_upload_id_2']->label, 'media_upload_id_3' => Yii::$app->functionItemSet->job->items['media_upload_id_3']->label, 'media_upload_id_4' => Yii::$app->functionItemSet->job->items['media_upload_id_4']->label, 'media_upload_id_5' => Yii::$app->functionItemSet->job->items['media_upload_id_5']->label, 'dispFileName1' => Yii::$app->functionItemSet->job->items['media_upload_id_1']->label, 'dispFileName2' => Yii::$app->functionItemSet->job->items['media_upload_id_2']->label, 'dispFileName3' => Yii::$app->functionItemSet->job->items['media_upload_id_3']->label, 'dispFileName4' => Yii::$app->functionItemSet->job->items['media_upload_id_4']->label, 'dispFileName5' => Yii::$app->functionItemSet->job->items['media_upload_id_5']->label, 'import_site_job_id' => Yii::t('app', '他サイト連携ID'), ]); } /** * 仕事ID存在チェック */ private function jobNoExistCheck() { if (JmUtils::isEmpty($this->job_no)) { // job_noが空⇒新規登録 $this->job_no = $this->loader->newJobNo++; } elseif (isset($this->loader->jobNos2Ids[$this->job_no])) { // job_noが存在する⇒更新(主キーの値を追加し、既存原稿にしておく。) $this->id = $this->loader->jobNos2Ids[$this->job_no]; } else { // job_noの入力はあるが存在しない⇒エラー $this->addError('job_no', Yii::t('app', '{LABEL}が存在しておりません。', ['LABEL' => $this->getAttributeLabel('job_no')])); } } /** * 掲載企業No存在チェック */ private function clientNoExistCheck() { if ($this->clientNo && isset($this->loader->clientNos2Ids[$this->clientNo])) { // 掲載企業Noが入力されており、それが存在するとき $this->client_master_id = $this->loader->clientNos2Ids[$this->clientNo]; } else { // それ以外はエラーを返す $this->addError('clientNo', Yii::t('app', '{LABEL}IDがありません。', ['LABEL' => $this->getAttributeLabel('clientNo')])); } } /** * 料金プラン存在チェック */ private function clientChargePlanNoCheck() { //ClientNoに関してエラーがある場合はスキップ if ($this->hasErrors('clientNo')) { return; } if (!$this->clientChargePlanNo || !isset($this->loader->planNos2Ids[$this->clientChargePlanNo])) { $this->addError('clientChargePlanNo', Yii::t('app', '{LABEL}IDがありません。', ['LABEL' => $this->getAttributeLabel('clientChargePlanNo')])); return; } $this->client_charge_plan_id = $this->loader->planNos2Ids[$this->clientChargePlanNo]; if (!array_key_exists($this->client_charge_plan_id, $this->loader->planLimits[$this->client_master_id])) { $this->addError('clientChargePlanNo', Yii::t( 'app', '選択された{CLIENT_NO_LABEL}に紐づく{CLIENT_CHARGE_PLAN_LABEL}がありません。', [ 'CLIENT_NO_LABEL' => $this->getAttributeLabel('clientNo'), 'CLIENT_CHARGE_PLAN_LABEL' => $this->getAttributeLabel('clientChargePlanNo'), ] )); return; } // 変更の場合、現状の料金プラン割り当て数を減らす if (!$this->isNewRecord) { $oldClientId = $this->loader->jobIds2Plans[$this->id]['client_master_id']; $oldPlanId = $this->loader->jobIds2Plans[$this->id]['client_charge_plan_id']; $this->loader->plans[$oldClientId][$oldPlanId] -= 1; } if (isset($this->loader->plans[$this->client_master_id][$this->client_charge_plan_id])) { $this->loader->plans[$this->client_master_id][$this->client_charge_plan_id] += 1; } else { $this->loader->plans[$this->client_master_id][$this->client_charge_plan_id] = 1; } //変更を行った料金プラン割り当てのみ判別するため変更のあったもののみ値を保存 $this->loader->changedPlans[$this->client_master_id][] = $this->client_charge_plan_id; } /** * 画像ファイル名存在チェック * @param $attribute */ private function dispFileNameExistCheck($attribute) { if ($this->$attribute && isset($this->loader->fileNames2Ids[$this->$attribute])) { $mediaUploadAttributeName = 'media_upload_id_' . str_replace('dispFileName', '', $attribute); $this->$mediaUploadAttributeName = $this->loader->fileNames2Ids[$this->$attribute]; } elseif (JmUtils::isEmpty($this->$attribute)){ //既存原稿かつ、画像ファイル名がnullの場合、明示的に画像ファイルIDをnullにしておく //既存の画像ファイル名を削除できるようにするため $mediaUploadAttributeName = 'media_upload_id_' . str_replace('dispFileName', '', $attribute); $this->$mediaUploadAttributeName = null; } else { $this->addError($attribute, Yii::t('app', '{LABEL}に関して、画像ファイル名がありません。', ['LABEL' => $this->getAttributeLabel($attribute)])); } } /** * オプション項目の選択形式の選択肢チェック * @param $attribute */ private function subsetCheck($attribute) { // 入力無しはエラーチェックをしない(必須項目の必須チェックは別で行っている) if (JmUtils::isEmpty($this->$attribute)) { return; } /** @var JobColumnSet $jobColumnSet */ $jobColumnSet = Yii::$app->functionItemSet->job->items[$attribute]; switch ($jobColumnSet->data_type) { case BaseColumnSet::DATA_TYPE_RADIO: // 単一選択の場合は入力がitemsに一つでも一致すればtrueを返す $result = false; foreach ($jobColumnSet->subsetItems as $i => $item) { if ($this->$attribute == $item->subset_name) { $result = true; break; } } break; case BaseColumnSet::DATA_TYPE_CHECK: // 複数選択の場合は一つでもitemsのどれかに一致しないものがあればfalseを返し、重複は削除する $result = true; $inputs = array_unique(explode(',', $this->$attribute)); $items = ArrayHelper::getColumn($jobColumnSet->subsetItems, 'subset_name'); foreach ($inputs as $input) { if (!in_array($input, $items)) { $result = false; break; } } $this->$attribute = implode(',', $inputs); break; default: // その他の場合はエラーチェックをしない(形式チェック等は別で行っている) return; break; } if (!$result) { $this->addError($attribute, Yii::t('app', '{LABEL}に関して、求人原稿項目設定で設定されている選択肢の中から選んでください。', ['LABEL' => $this->getAttributeLabel($attribute)])); } } /** * 取得した検索キーNoが存在しているか * 存在していれば、検索キーNoから登録用の検索キーIdを取得しているので注意 * @param string $attribute */ private function searchkeyCheck($attribute) { // 値がないものに関しては、エラーチェックをしない。(勤務地の必須チェックは別で行っているので問題ない) if (JmUtils::isEmpty($this->$attribute)) { return; } $nos = array_unique(explode('|', $this->$attribute)); /** @var SearchkeyMaster $searchkeyMaster */ $searchkeyMaster = $this->findSearchkeyMaster($attribute); $itemNos = $searchkeyMaster->itemNos; $result = true; $ids = []; foreach ($nos as $no) { if (isset($itemNos[$no])) { $ids[] = $itemNos[$no]; } else { $result = false; break; } } if ($result === false) { $this->addError($attribute, Yii::t('app', '{LABEL}に関して、存在しないキーが含まれています。', ['LABEL' => $this->getAttributeLabel($attribute)])); } else { $this->{'_' . $attribute . 'Id'} = $ids; } } /** * 駅コード存在チェック * @param string $attribute */ private function stationCodeCheck($attribute) { if (JmUtils::isEmpty($this->$attribute)) { return; } $no = str_replace('stationCd', '', $attribute); if ($this->{'transportTime' . $no} == '' || $this->{'transportType' . $no} == '') { $this->addError($attribute, Yii::t('app', '{STATION_CD}を入力する際は、{TIME}・{TYPE}は必須です。', [ 'STATION_CD' => $this->getAttributeLabel($attribute), 'TIME' => $this->getAttributeLabel('transportTime' . $no), 'TYPE' => $this->getAttributeLabel('transportType' . $no), ])); } $stationNos = $this->findSearchkeyMaster('station')->itemNos; if (!array_key_exists($this->$attribute, $stationNos)) { $this->addError($attribute, Yii::t('app', '{STATION_CD}に関して、存在しないキーが含まれています。', [ 'STATION_CD' => $this->getAttributeLabel($attribute), ])); } } /** * 給与検索キー存在チェック * @return bool */ private function wageItemCheck() { if (JmUtils::isEmpty($this->maxWage)) { return; } /** @var SearchkeyMaster $searchkeyModel */ $searchkeyModel = $this->findSearchkeyMaster('maxWage'); $wageCateModels = $searchkeyModel->searchKeyModels; foreach ($wageCateModels as $cateModel) { if (array_key_exists($cateModel->id, $this->maxWage)) { $itemNames = ArrayHelper::getColumn($cateModel->wageItemValid, 'wage_item_name'); if (!isset(array_flip($itemNames)[$this->maxWage[$cateModel->id]])) { $this->addError(self::wageColumnRename($cateModel->id), Yii::t('app', '{LABEL}に関して、対応する金額がございません。', ['LABEL' => $cateModel->wage_category_name])); } else { $items = array_filter($cateModel->wageItemValid, function (WageItem $item) use ($cateModel) { return $this->maxWage[$cateModel->id] == $item->wage_item_name; }); $this->_wageItem = array_merge($this->_wageItem, ArrayHelper::getColumn($items, 'id')); } } } } /** * 検索キーに関するモデルを保存 * @param bool $insert * @param array $changedAttributes */ public function afterSave($insert, $changedAttributes) { $this->unlinkAll('jobDist', true); $this->unlinkAll('jobStation', true); $this->unlinkAll('jobWage', true); $this->unlinkAll('jobType', true); $this->unlinkAll('jobPref', true); for ($i = 1; $i <= 20; $i++) { $this->unlinkAll('jobSearchkeyItem' . $i, true); } $alterPost = []; if (isset($this->_distId)) { $alterPost['JobDist'] = ['itemIds' => $this->_distId]; } // $this->_wageItem は初期値を持つため if (!JmUtils::isEmpty($this->_wageItem)) { $alterPost['JobWage'] = ['itemIds' => $this->_wageItem]; } if (isset($this->_jobTypeSmallId)) { $alterPost['JobType'] = ['itemIds' => $this->_jobTypeSmallId]; } for ($i = 1; $i <= 3; $i++) { if (isset($this->{'stationCd' . $i})) { $alterPost['JobStationInfo'][] = [ 'station_id' => $this->{'stationCd' . $i}, 'transport_type' => $this->{'transportType' . $i}, 'transport_time' => $this->{'transportTime' . $i}, ]; } } for ($i = 1; $i <= 20; $i++) { if (isset($this->{'_searchkeyItem' . $i . 'Id'})) { $alterPost['JobSearchkeyItem' . $i] = ['itemIds' => $this->{'_searchkeyItem' . $i . 'Id'}]; } } $this->saveRelationalModels($alterPost); parent::afterSave($insert, $changedAttributes); } /** * CSV一括登録で使われるattributeの配列を生成する * 修正する場合、models/manage/JobMasterSearch::csvAttributes * と配列が一致するように修正する必要があるので注意 * @return array */ public static function csvAttributes() { return ArrayHelper::merge( ['valid_chk'], self::csvJobAttributes(), self::csvSearchKeyAttributes(), ['import_site_job_id'] ); } /** * 求人情報のを取得する * @return array */ private static function csvJobAttributes() { $attributes = []; /** @var string[] $names */ $names = ArrayHelper::getColumn(Yii::$app->functionItemSet->job->items, 'column_name'); foreach ($names as $name) { switch ($name) { case 'disp_start_date': case 'disp_end_date': $attributes[] = $name; break; case 'client_master_id': $attributes[] = 'clientNo'; break; case 'client_charge_plan_id': $attributes[] = 'clientChargePlanNo'; break; case 'corpLabel': break; case 'media_upload_id_1': case 'media_upload_id_2': case 'media_upload_id_3': case 'media_upload_id_4': case 'media_upload_id_5': $attributes[] = 'dispFileName' . str_replace('media_upload_id_', '', $name); break; default: $attributes[] = $name; break; } } return $attributes; } /** * 検索キーの配列を生成する * @return array */ private static function csvSearchKeyAttributes() { $attributes = []; /** @var SearchkeyMaster[] $searchKeys */ $searchKeys = Yii::$app->searchKey->searchKeys; foreach ($searchKeys as $searchKey) { switch ($searchKey->job_relation_table) { case 'job_dist'; $attributes[] = 'dist'; break; case 'job_station_info'; for ($i = 0; $i <= 2; $i++) { $attributes[] = 'stationCd' . ($i + 1); $attributes[] = 'transportType' . ($i + 1); $attributes[] = 'transportTime' . ($i + 1); } break; case 'job_wage'; $attributes = array_merge($attributes, JobCsvRegister::wageColumn($searchKey)); break; case 'job_type'; $attributes[] = 'jobTypeSmall'; break; default: $relationName = $searchKey->jobRelationName; if (strpos($relationName, 'SearchkeyItem')) { $attributes[] = str_replace('jobS', 's', $relationName); } else { $attributes[] = $relationName; } break; } } return $attributes; } /** * attributeに対応するSearchkeyMasterインスタンスを返す * @param $attribute * @return SearchkeyMaster|null */ private function findSearchkeyMaster($attribute) { switch ($attribute) { case 'dist': return ArrayHelper::getValue(Yii::$app->searchKey->searchKeys, 'pref'); break; case 'jobTypeSmall': return ArrayHelper::getValue(Yii::$app->searchKey->searchKeys, 'job_type_category'); break; case 'maxWage': return ArrayHelper::getValue(Yii::$app->searchKey->searchKeys, 'wage_category'); break; default: if (strpos($attribute, 'station') !== false) { return ArrayHelper::getValue(Yii::$app->searchKey->searchKeys, 'station'); } $items = []; for ($i = 1; $i <= 10; $i++) { $items[] = 'searchkeyItem' . $i; } if (in_array($attribute, $items)) { return ArrayHelper::getValue(Yii::$app->searchKey->searchKeys, 'searchkey_category' . str_replace('searchkeyItem', '', $attribute)); } else { return ArrayHelper::getValue(Yii::$app->searchKey->searchKeys, Inflector::underscore($attribute)); } break; } } /** * SearchkeyMasterモデルから、給与検索キー用のattribute名の配列を返す。 * @param $searchKey SearchkeyMaster * @return array */ private static function wageColumn($searchKey) { /** @var WageCategory[] $cates */ $cates = $searchKey->searchKeyModels; $columns = []; if ($cates) { foreach ($cates as $cate) { $columns[] = self::wageColumnRename($cate->id); } } return $columns; } /** * 給与検索キー用のカラム名を返す。 * @param $id * @return string */ public static function wageColumnRename($id) { return self::WAGE_NAME_COLUMN . $id; } /** * dispTypeNoを元にシナリオをセットする */ private function initScenario() { $dispNo = $this->dispTypeNo(); if ($dispNo) { $this->scenario = 'type' . $dispNo; } } /** * dispTypeNoを取得する * @return null */ private function dispTypeNo() { return $this->loader->planNos2DispNos[$this->clientChargePlanNo] ?? null; } }
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddTypeindexToAuditLogs extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('audit_logs', function (Blueprint $table) { $table->index('type'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('audit_logs', function (Blueprint $table) { // }); } }
<?php namespace Encore\Admin\Grid\Tools; use Encore\Admin\Admin; class RefreshButton extends AbstractTool { /** * Script for this tool. * * @return string */ protected function script() { $message = trans('admin.refresh_succeeded'); return <<<EOT $('.grid-refresh').on('click', function() { $.pjax.reload('#pjax-container'); toastr.success('{$message}'); }); EOT; } /** * Render refresh button of grid. * * @return string */ public function render() { Admin::script($this->script()); $refresh = trans('admin.refresh'); return <<<EOT <a class="btn btn-sm btn-primary grid-refresh" title="$refresh"><i class="fas fa-sync-alt"></i><span class="hidden-xs"> $refresh</span></a> EOT; } }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation\Tests\Session; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; /** * SessionTest * * @author Fabien Potencier <fabien@symfony.com> * @author Robert Schönthal <seroscho@googlemail.com> * @author Drak <drak@zikula.org> */ class SessionTest extends \PHPUnit_Framework_TestCase { /** * @var \Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface */ protected $storage; /** * @var \Symfony\Component\HttpFoundation\Session\SessionInterface */ protected $session; protected function setUp() { $this->storage = new MockArraySessionStorage(); $this->session = new Session($this->storage, new AttributeBag(), new FlashBag()); } protected function tearDown() { $this->storage = null; $this->session = null; } public function testStart() { $this->assertEquals('', $this->session->getId()); $this->assertTrue($this->session->start()); $this->assertNotEquals('', $this->session->getId()); } public function testIsStarted() { $this->assertFalse($this->session->isStarted()); $this->session->start(); $this->assertTrue($this->session->isStarted()); } public function testSetId() { $this->assertEquals('', $this->session->getId()); $this->session->setId('0123456789abcdef'); $this->session->start(); $this->assertEquals('0123456789abcdef', $this->session->getId()); } public function testSetName() { $this->assertEquals('MOCKSESSID', $this->session->getName()); $this->session->setName('session.test.com'); $this->session->start(); $this->assertEquals('session.test.com', $this->session->getName()); } public function testGet() { // tests defaults $this->assertNull($this->session->get('foo')); $this->assertEquals(1, $this->session->get('foo', 1)); } /** * @dataProvider setProvider */ public function testSet($key, $value) { $this->session->set($key, $value); $this->assertEquals($value, $this->session->get($key)); } /** * @dataProvider setProvider */ public function testHas($key, $value) { $this->session->set($key, $value); $this->assertTrue($this->session->has($key)); $this->assertFalse($this->session->has($key.'non_value')); } public function testReplace() { $this->session->replace(array('happiness' => 'be good', 'symfony' => 'awesome')); $this->assertEquals(array('happiness' => 'be good', 'symfony' => 'awesome'), $this->session->all()); $this->session->replace(array()); $this->assertEquals(array(), $this->session->all()); } /** * @dataProvider setProvider */ public function testAll($key, $value, $result) { $this->session->set($key, $value); $this->assertEquals($result, $this->session->all()); } /** * @dataProvider setProvider */ public function testClear($key, $value) { $this->session->set('hi', 'fabien'); $this->session->set($key, $value); $this->session->clear(); $this->assertEquals(array(), $this->session->all()); } public function setProvider() { return array( array('foo', 'bar', array('foo' => 'bar')), array('foo.bar', 'too much beer', array('foo.bar' => 'too much beer')), array('great', 'symfony2 is great', array('great' => 'symfony2 is great')), ); } /** * @dataProvider setProvider */ public function testRemove($key, $value) { $this->session->set('hi.world', 'have a nice day'); $this->session->set($key, $value); $this->session->remove($key); $this->assertEquals(array('hi.world' => 'have a nice day'), $this->session->all()); } public function testInvalidate() { $this->session->set('invalidate', 123); $this->session->invalidate(); $this->assertEquals(array(), $this->session->all()); } public function testMigrate() { $this->session->set('migrate', 321); $this->session->migrate(); $this->assertEquals(321, $this->session->get('migrate')); } public function testMigrateDestroy() { $this->session->set('migrate', 333); $this->session->migrate(true); $this->assertEquals(333, $this->session->get('migrate')); } public function testSave() { $this->session->start(); $this->session->save(); } public function testGetId() { $this->assertEquals('', $this->session->getId()); $this->session->start(); $this->assertNotEquals('', $this->session->getId()); } public function testGetFlashBag() { $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface', $this->session->getFlashBag()); } /** * @covers Symfony\Component\HttpFoundation\Session\Session::getIterator */ public function testGetIterator() { $attributes = array('hello' => 'world', 'symfony2' => 'rocks'); foreach ($attributes as $key => $val) { $this->session->set($key, $val); } $i = 0; foreach ($this->session as $key => $val) { $this->assertEquals($attributes[$key], $val); $i++; } $this->assertEquals(count($attributes), $i); } /** * @covers \Symfony\Component\HttpFoundation\Session\Session::count */ public function testGetCount() { $this->session->set('hello', 'world'); $this->session->set('symfony2', 'rocks'); $this->assertEquals(2, count($this->session)); } public function testGetMeta() { $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\MetadataBag', $this->session->getMetadataBag()); } }
<?php namespace App\Http\Controllers\Auth; use App\User; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use Illuminate\Foundation\Auth\RegistersUsers; class RegisterController extends Controller { /* |-------------------------------------------------------------------------- | Register Controller |-------------------------------------------------------------------------- | | This controller handles the registration of new users as well as their | validation and creation. By default this controller uses a trait to | provide this functionality without requiring any additional code. | */ use RegistersUsers; /** * Where to redirect users after registration. * * @var string */ protected $redirectTo = '/profil'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * Get a validator for an incoming registration request. * * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:8', 'confirmed'], ]); } /** * Create a new user instance after a valid registration. * * @param array $data * @return \App\User */ protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => Hash::make($data['password']), ]); } }
@extends('layouts.app') @section('content') <!-- Bootstrap Boilerplate... --> <div class="panel-body"> <!-- Display Validation Errors --> @include('common.errors') <!-- New Task Form --> <form action="/task" method="POST" class="form-horizontal"> {{ csrf_field() }} <!-- Task Name --> <div class="form-group"> <label for="task" class="col-sm-3 control-label">Task</label> <div class="col-sm-6"> <input type="text" name="name" id="task-name" class="form-control"> </div> </div> <!-- Add Task Button --> <div class="form-group"> <div class="col-sm-offset-3 col-sm-6"> <button type="submit" class="btn btn-default"> <i class="fa fa-plus"></i> Add Task </button> </div> </div> </form> </div> <!-- TODO: Current Tasks --> @if (count($tasks) > 0) <div class="panel panel-default"> <div class="panel-heading"> Current Tasks </div> <div class="panel-body"> <table class="table table-striped task-table"> <!-- Table Headings --> <thead> <th>Task</th> <th>&nbsp;</th> </thead> <!-- Table Body --> <tbody> @foreach ($tasks as $task) <tr> <!-- Task Name --> <td class="table-text"> <div>{{ $task->name }}</div> </td> <td> <!-- TODO: Delete Button --> </td> </tr> <tr> <!-- Task Name --> <td class="table-text"> <div>{{ $task->name }}</div> </td> <!-- Delete Button --> <td> <form action="/task/{{ $task->id }}" method="POST"> {{ csrf_field() }} {{ method_field('DELETE') }} <button>Delete Task</button> </form> </td> </tr> @endforeach </tbody> </table> </div> </div> @endif @endsection
<?php $__env->startSection('content'); ?><p>She's a busy mother-of-one who balances household duties with her demanding job as an Instagram influencer. </p> <p>And on Tuesday, former Big Brother star Skye Wheatley, 26, announced on Instagram that she's on the hunt for a 'full time live-in nanny' to help ease the domestic workload and look after her son Forest, one.   </p> <p>Bizarrely, however, Skye said she refuses to hire anyone that follows her on Instagram or has any idea about her celebrity status.   </p> <p>'I don't really want them to know who I am': Instagram influencer Skye Wheatley, 26, (right) revealed on Tuesday she's looking for a live-in nanny to look after her son Forest, one, (left) - but refuses to hire anyone that follows her on Instagram </p> <p>In a lengthy essay, Skye explained that she 'just needs help' with cleaning, cooking, house chores and looking after Forest. </p> <p>'I don't really want them to know who I am which is why this is kinda stupid [of] me putting this on my Instagram,' the online model admitted. </p> <p>'But if anyone knows any friend of a friend of a friend or if anyone knows anyone that isn't huge on social media please let me know,' she added. </p> <p>Too busy for housework? In a lengthy essay, Skye explained that she 'just needs help' with cleaning, cooking, house chores and looking after Forest </p> <p>Unusual request: In a subsequent post, Skye clarified that she won't be hiring a 'current follower', adding: 'I really want someone who doesn't know me or my business already' </p> <p>The blonde, who boasts 616K followers on Instagram, claimed that while most Instagram stars 'keep this part of their lives super private', she wants to be transparent with her followers. </p> <p>'I'm someone who loves working in a team and I've always needed extra help in my life,' she insisted. </p> <p>In a subsequent post, Skye clarified that she won't be hiring a 'current follower', adding: 'I really want someone who doesn't know me or my business already.'   </p> <p>Busy work schedule: Skye spends her day promoting brands on Instagram to her 616K followers on Instagram </p> <p>She welcomed Forest with her tradie boyfriend Lachlan Waugh back in 2018. </p> <p>Last month, the Gold Coast glamazon hinted she's planning to welcome a second child by sharing sharing a very telling Instagram post. </p> <p>Posing for a mirror selfie with Lachlan and Forest, Skye wrote in the caption: 'I asked Forest if he wanted or sister or a brother and he said 'yes''. </p> <p>Another baby on the way? Skye hinted she's planning to expand her brood with boyfriend Lachlan Waugh last month </p> <?php $__env->stopSection(); ?> <?php echo $__env->make('_layouts.post', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php namespace Versatile\Core\Components\Alert; use Versatile\Core\Components\Alert; abstract class AbstractComponent implements ComponentInterface { protected $alert; public function setAlert(Alert $alert) { $this->alert = $alert; return $this; } public function __call($name, $arguments) { return call_user_func_array([$this->alert, $name], $arguments); } }
@extends('website.layout.master') @push('css') <style> .info-box .info-count { margin-top: 0px !important; } section.sec-business-analysis { background-color: #184153; } .business-analysis-content h2 { color: white; font-size: 30px; font-weight: 600; } .business-analysis-content p { color: white; font-weight: 600; line-height: 1; } #show_certificate { background-image: url(http://127.0.0.1:8000/website/images/ammar.png); background-repeat: no-repeat; background-size: 100%; } .business-analysis-btn a { background-color: white; padding: 17px 59px; border-radius: 3px; color: #52b842; font-weight: 700; margin-right: 15px; } .business-analysis-btn { margin: 40px 0; } .business-analysis-btn i { margin-right: 7px; } .table-business-analysis .nav-tabs>li.active>a { border-bottom: 5px solid #37a000 !important; background-color: transparent; color: #898989; } .table-business-analysis ul.nav.nav-tabs { padding: 5px; margin-top: 30px; background-color: #ddd; } .table-business-analysis .nav-tabs>li>a { border-radius: 0; color: #2b2b2b; font-size: 20px; font-weight: 500; } .table-business-analysis .nav-tabs>li { /* padding: 0px 17px !important; */ } .table-business-analysis .tab-content { background-color: white; margin-top: 0px; padding-top: 20px; margin-bottom: 39px; padding-bottom: 20px; } .tab-main-content { background-color: #dddddd; height: 53px; width: 90%; margin: 16px 0px 16px 59px; border-radius: 5px; } .table-content-anchor { padding: 15px 11px; width: 50%; float: left; } .table-content-anchor a i { margin-right: 10px; color: #52b842; font-size: 23px; } .table-content-anchor a { display: flex; align-items: center; } .table-content-anchor-two { padding: 15px 11px; width: 50%; float: right; text-align: end; } .table-content-anchor-two a { color: #52b842; margin-right: 10px; } .table-content-anchor-two span.time-video { margin-right: 10px; } span.video-time { display: block; } .accordion-percent-rule a { font-size: 14px; font-weight: bold; } .certificate_img { width: 175px; height: 90px; margin-left: 0px; margin-right: 140px; } .logo-container { text-align: left; padding: 30px 30px 0; } .logo-container img.certificate_img { width: 150px; height: auto; } #project-resource .card-header { background-color: unset; border: none; padding: 5px 5px; } #project-resource .btn-link{ margin-top: 0; border: none; color: #184153; text-align: left; text-decoration: none; } #project-resource .card{ border: none; background-color: #EFEFEF; border-radius: 0; margin-bottom: 20px; } #project-resource .card-col-1 a>i { margin-right: 20px; } #project-resource .card-col-1 a { padding: 10px 0; margin-left: 35px; text-decoration: none; color: #52b842; } #project-resource .card-col-1 { display: inline-grid; } #project-resource .btn-link>i { margin-right: 13px; font-size: 20px; } #project-resource .card-body { padding-top: 0; padding-bottom: 0; } #project-resource i.fas.fa-chevron-up { margin-left: 30px; } #project-resource .modal-content .modal-header { border: none; padding: 50px 0 0 70px; } #project-resource .modal-content .modal-header h5 { color: #52b842; font-size: 30px; font-weight: 600; } #project-resource .modal-content .modal-body { padding-left: 70px; padding-right: 70px; } #project-resource .modal-dialog { min-width: 1200px; margin-top: 90px; } #project-resource .modal-dialog .modal-content { border-radius: 0; } #project-resource .modal-content .modal-header button.close { position: absolute; right: -53px; top: -27px; } .sec-business-analysis h1 { color: white; padding-bottom: 5px; font-size: 25px; } .sec-business-analysis .form-check>.form-check-label { font-size: 18px; padding-left: 10px; color: white; } .sec-business-analysis .form-check>.form-check-input { height: 15px; width: 15px; } .sec-business-analysis .form-check { padding-left: 38px; } .mcqs, .true_false, .text_box { padding-bottom: 20px;} section.sec-business-analysis { padding-bottom: 80px; background-color: #253d44; } .sec-business-analysis .text_box #text_box { width: 60%; } .sec-business-analysis .Submit_btn { padding: 25px 0px 0; text-align: right; } .sec-business-analysis .col-md-12 { background: white; border-radius: 20px; max-width: 60%; } .sec-business-analysis .col-md-7 { background: #3B3C3F; border-radius: 20px; padding: 30px 50px; } .sec-business-analysis .Submit_btn .btn { padding: 10px 40px; border-radius: 10px; font-size: 16px; text-transform: uppercase; background: #8dd4ef; color: #3B3C3F; font-weight: 700; } section.hero-secion { background: #253d44;} </style> @endpush @section('content') <section class="hero-secion pb-5"> @include('website.layout.menu') </section> <section class="sec-business-analysis"> <div class="container"> <div class="row" > <div class="col-md-3"></div> <div class="col-md-7"> <form method="POST" action="" accept-charset="UTF-8" class="form-horizontal" enctype="multipart/form-data"> {{ csrf_field() }} <input type="hidden" name="course_id" value=""> @foreach ($assessment as $key=>$element) <input type="hidden" name="" value=""> <input type="hidden" name="" value=""> @if ($element->question_type == 'mcqs') <div class="mcqs"> <h1>{{$element->question}}</h1> <div class="form-check"> <input class="form-check-input" type="radio"name="answer[{{$key}}][ans]" value="{{ json_decode($element->option)[0] }}" id="true"> <label class="form-check-label" for="Option1"> Programming Language </label> </div> <div class="form-check"> <input class="form-check-input" type="radio"name="answer[{{$key}}][ans]" value="{{ json_decode($element->option)[1] }}" id="false" checked=""> <label class="form-check-label" for="Option2">Natural Language </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="answer[{{$key}}][ans]" value="{{ json_decode($element->option)[2] }}" id="Option3" > <label class="form-check-label" for="Option3">Artificial Language </label> </div> <div class="form-check"> <input class="form-check-input" type="radio" name="answer[{{$key}}][ans]" value="{{ json_decode($element->option)[3] }}" id="Option4" > <label class="form-check-label" for="Option4"> Natural Language</label> </div> </div> @elseif($element->question_type == 'true_false') <div class="true_false"> <h1>{{$element->question}}</h1> <div class="form-check"> <input class="form-check-input" type="radio" name="answer[{{$key}}][ans]" value="{{ json_decode($element->option)[0] }}" id="true"> <label class="form-check-label" for="true">True</label> </div> <div class="form-check"> <input class="form-check-input" type="radio"name="answer[{{$key}}][ans]" value="{{ json_decode($element->option)[1] }}" id="false" checked=""> <label class="form-check-label" for="false">False</label> </div> </div> @elseif($element->question_type == 'free_text') <div class="text_box"> <h1>What is PHP?</h1> <div class="form-check"> <textarea id="text_box" name="answer[{{$key}}][ans]" class="md-textarea form-control" rows="4" cols="50"></textarea> </div> </div> @endif @endforeach <div class="Submit_btn"> <button class="btn btn-primary" type="Submit">Submit</button> </div> </form> </div> <div class="col-md-3"></div> </div> </div> </section> @endsection @push('js') <script type="text/JavaScript" src="https://cdnjs.cloudflare.com/ajax/libs/jQuery.print/1.6.0/jQuery.print.js"></script> @endpush
<?php namespace Rebet\Middleware\Routing; use Rebet\Http\Request; use Rebet\Http\Response; /** * [Routing Middleware] Restore Inherit Data Class * * @package Rebet * @author github.com/rain-noise * @copyright Copyright (c) 2018 github.com/rain-noise * @license MIT License https://github.com/rebet/rebet/blob/master/LICENSE */ class RestoreInheritData { /** * Handle Restore Inherit Data Middleware. * * @param Request $request * @param \Closure $next * @return void */ public function handle(Request $request, \Closure $next) : Response { return $next($request->restoreInheritData()); } }
<?php include "conexao.php"; $id = $_POST['id']; $query = "DELETE FROM `localizacao` WHERE id = $id"; if ($connect->query($query) === TRUE) { echo json_encode("success"); } else { echo json_encode("error"); } ?>
<form action="{{ route('update.location', $footer->id) }}" method="post"> <div class="modal fade" tabindex="-1" id="ModalEdit{{ $footer->id }}" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-xl"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title text-danger">Form Update location</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close" id="btnclose"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> @csrf <label for="">Email</label> <input type="email" name="email" id="email" placeholder="" class="form-control" value="{{$footer->email}}"> @error('email') <span class="text-danger">{{ $message }}</span> @enderror <label for="">Address</label> <input type="text" name="address" id="address" placeholder="" class="form-control" value="{{ $footer->address }}" @error('address') <span class="text-danger">{{ $message }}</span> @enderror <label for="">Phone</label> <input type="text" name="phone" id="phone" placeholder="" class="form-control" value="{{ $footer->phone }}" @error('phone') <span class="text-danger">{{ $message }}</span> @enderror <label for="">Country</label> <input type="text" name="country" id="country" placeholder="" class="form-control" value="{{ $footer->country }}" @error('country') <span class="text-danger">{{ $message }}</span> @enderror </div> <div class="modal-footer"> <button type="button" class="btn btn-danger btnclose" data-dismiss="modal">Close</button> <button class="btn btn-success">Update</button> </div> </div> </div> </div> </form> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script> $(document).ready(function() { $('.btn').click(function() { }); }); </script> <style> .form-control{ margin-bottom: 5px; } .btn-info { float: right; margin-top: 5px; } </style>
{{-- phần in ra thông báo chung --}} @if(Session()->has('msg') || Session()->has('success')) <script> $(document).ready(function () { $("#myModal").modal('show'); }) </script> {{-- phần show thông báo --}} <!-- Modal --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Thông Báo</h4> </div> <div class="modal-body"> @if(Session()->has('msg')) <p>{{Session('msg')}}</p> @endif @if(Session()->has('success')) <p>{{Session('success')}}</p> @endif </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> @endif
<!DOCTYPE HTML> <html manifest=""> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes"> <link rel="stylesheet" type="text/css" href="{!! asset('public/style/mainstyle.css')!!}"> <title>Penggajian</title> <!-- <script type="text/javascript"> var Ext = Ext || {}; // Ext namespace won't be defined yet... // This function is called by the Microloader after it has performed basic // device detection. The results are provided in the "tags" object. You can // use these tags here or even add custom tags. These can be used by platform // filters in your manifest or by platformConfig expressions in your app. // Ext.beforeLoad = function (tags) { var s = location.search, // the query string (ex "?foo=1&bar") profile; // For testing look for "?classic" or "?modern" in the URL to override // device detection default. // if (s.match(/\bclassic\b/)) { profile = 'classic'; } else if (s.match(/\bmodern\b/)) { profile = 'modern'; } else { profile = tags.desktop ? 'classic' : 'modern'; //profile = tags.phone ? 'modern' : 'classic'; } Ext.manifest = profile; // this name must match a build profile name // This function is called once the manifest is available but before // any data is pulled from it. // //return function (manifest) { // peek at / modify the manifest object //}; }; </script> --> <script type="text/javascript" src="{!! asset('public/js/md5.js')!!}"></script> <script type="text/javascript"> var required_css = '<span style="color:red;font-weight:bold" data-qtip="Required">*</span>'; Date.prototype.withoutTime = function () { var d = new Date(this); d.setHours(0, 0, 0, 0); return d; } Date.prototype.toMysql = function () { var dthis = new Date(this); var d = dthis.getDate(); var m = dthis.getMonth() + 1; var y = dthis.getFullYear(); return '' + y + '-' + (m<=9 ? '0' + m : m) + '-' + (d <= 9 ? '0' + d : d); } Date.prototype.toThblMysql = function () { var dthis = new Date(this); var d = dthis.getDate(); var m = dthis.getMonth() + 1; var y = dthis.getFullYear(); return '' + y + (m<=9 ? '0' + m : m); } Date.dateDiff = function(datepart, fromdate, todate) { datepart = datepart.toLowerCase(); var diff = todate - fromdate; var divideBy = { w:604800000, d:86400000, h:3600000, n:60000, s:1000 }; return Math.floor( diff/divideBy[datepart]); } String.prototype.toThblExt = function() { var dthis = this; var thbl=dthis.substring(0, 4)+'-'+dthis.substring(4, 6)+'-'+'01'; return thbl; }; String.prototype.toProperCase = function() { return this.replace(/\w\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); }; function to_print(domid,url){ Ext.getDom(domid).src ="{{ url('/').'/'}}" + url; } function dateDiff(mulai,selesai){ var date1 = new Date(mulai.getFullYear(),mulai.getMonth(),mulai.getDate()); var date2 = new Date(selesai.getFullYear(),selesai.getMonth(),selesai.getDate()); var timeDiff = Math.abs(date2.getTime() - date1.getTime()); var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); return diffDays; } function clearSession(){ localStorage.removeItem('userid'); localStorage.removeItem('username'); localStorage.removeItem('roleid'); localStorage.removeItem('rolename'); localStorage.removeItem('regcode'); // Remove Main View Ext.getCmp('app-main-id').destroy(); window.location.href = Penggajian.Global.getApiUrl(); } function createArrayStore(vdata){ return Ext.create('Ext.data.ArrayStore',{ fields: [ {name: 'mid'}, {name: 'mtext'} ], data:vdata }); } function set_message(opt,vmsg){ if (opt==0){ Ext.Msg.show({ title:'Message Info', msg: vmsg, buttons: Ext.Msg.OK, icon: Ext.Msg.INFO }); }else if (opt==1){ Ext.Msg.show({ title:'Message Error', msg: vmsg, buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR }); }else if (opt==2){ Ext.Msg.show({ title:'Message Warning', msg: vmsg, alwaysOnTop:true, buttons: Ext.Msg.OK, icon: Ext.Msg.WARNING }); } }; function execute_confirm_yesno(vmsg,ajax_url,ajax_params,successfunct,funcno){ var myAjax=Ext.Ajax; Ext.Msg.show({ title: 'Confirm', msg: vmsg, buttons: Ext.Msg.YESNO, icon: Ext.Msg.QUESTION, fn: function(btn){ if (btn == 'yes') { // var mask = new Ext.LoadMask(Ext.getBody(), {msg:'Please wait this Execute Process...'}); // mask.setLoading(ajax_waitmsg); myAjax.on('beforerequest', function(){ Ext.getBody().mask('Please wait this Execute Process...'); }); myAjax.on('requestcomplete', function(){ Ext.getBody().unmask(); }); myAjax.on('requestexception', function(){ Ext.getBody().unmask(); }); myAjax.on('exception', function(){ Ext.getBody().unmask(); }); myAjax.request({ url: ajax_url, method: 'POST', params: ajax_params, success: successfunct, failure: function(obj) { var resp = Ext.decode(obj.responseText); if (resp.reason == 'Session Expired' || resp.message == 'Session Expired') { session_expired('Session Expired'); } else{ set_message(0, resp.reason +' '+resp.message); } // Ext.Msg.alert('info',resp.reason); } }); }else { funcno; } } }); } function session_expired(err){ Ext.Msg.show({ title: 'Error', msg: err, modal: true, closable: false, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK, fn: function(btn){ if (btn == 'ok') { window.location.href = Penggajian.Global.getApiUrl(); } } }); } function responseFailure(obj){ try{ var resp = Ext.decode(obj.responseText); if (resp.reason == 'Session Expired' || resp.message == 'Session Expired') { session_expired('Session Expired'); } else{ set_message(0, resp.reason +' '+resp.message); } }catch(ex){ var msg=ex.message; // var divEl = Ext.DomHelper.createDom('<div>'+ex.msg+'</div>'); // var vdiv=divEl.textContent; var exmsg=null; if (msg.indexOf('TokenMismatchException') > -1) { //console.log('TokenMismatchException'); session_expired('Session Expired'); }else{ Ext.Msg.show({ title:'Message Error', msg: ex.message, buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR, maxWidth:'100%', listeners:{ show:function(){ Ext.Msg.doComponentLayout(); } } }); } } } function execute_confirm(vmsg,ajax_url,ajax_params,successfunct){ var myAjax=Ext.Ajax; Ext.Msg.show({ title: 'Confirm', msg: vmsg, buttons: Ext.Msg.YESNO, icon: Ext.Msg.QUESTION, fn: function(btn){ if (btn == 'yes') { // var mask = new Ext.LoadMask(Ext.getBody(), {msg:'Please wait this Execute Process...'}); // mask.setLoading(ajax_waitmsg); myAjax.on('beforerequest', function(){ Ext.getBody().mask('Please wait this Execute Process...'); }); myAjax.on('requestcomplete', function(){ Ext.getBody().unmask(); }); myAjax.on('requestexception', function(){ Ext.getBody().unmask(); }); myAjax.on('exception', function(){ Ext.getBody().unmask(); }); myAjax.request({ url: ajax_url, method: 'POST', params: ajax_params, success: successfunct, failure: function(obj) { try{ var resp = Ext.decode(obj.responseText); if (resp.reason == 'Session Expired' || resp.message == 'Session Expired') { session_expired('Session Expired'); } else{ set_message(0, resp.reason +' '+resp.message); } }catch(ex){ var msg=ex.message; // var divEl = Ext.DomHelper.createDom('<div>'+ex.msg+'</div>'); // var vdiv=divEl.textContent; var exmsg=null; if (msg.indexOf('TokenMismatchException') > -1) { //console.log('TokenMismatchException'); session_expired('Session Expired'); }else{ Ext.Msg.show({ title:'Message Error', msg: ex.message, buttons: Ext.Msg.OK, icon: Ext.Msg.ERROR, maxWidth:'100%', listeners:{ show:function(){ Ext.Msg.doComponentLayout(); } } }); } } // Ext.Msg.alert('info',resp.reason); } }); } } }); } function addTab(vid,vtitle,vhtml){ var tabs=Ext.getCmp('id_tabmain'); var tm=null; var widgetname="Tab" + vtitle.toString().replace( /\s/g, '' ); try{ console.log(widgetname); tm=Ext.createWidget(widgetname); tabs.add(tm); tm.show(); }catch(ex){ tabs.add({ id: vid, title: vtitle, // iconCls: 'tabs', html: vhtml , // items:[tabchilds], closable: true }).show(); } } function createTreeMenuMain(vtitle,vhead,vrole){ var tree = Ext.create('Ext.tree.Panel',{ id: 'id_treepanel_'+vhead, title: vtitle, // layout:'hbox', bodyStyle: 'align:left;', split: true, border:true, // height: 360, height:'auto', minSize: 150, rootVisible: false, autoScroll: true, viewConfig:{ cls:'customCSS' }, store: Ext.create('Ext.data.TreeStore', { root: { expanded: true }, proxy: { type: 'ajax', url: Penggajian.Global.getApiUrl() + 'main/getAccordionMenu?headid='+vhead+'&roleid=' + vrole ,success:function(){ } ,exception:function( tstore, response, operation, eOpts ){ if(response.status=='500'){ tstore.reload(); } var err = Ext.decode(response.responseText); console.log(err); if (err){ if (err.errMsg == 'Session Expired' || err.message == 'Session Expired') { session_expired('Session Expired'); } else{ console.log(err); } } } } }), // tools: [ // { iconCls: 'icon-grid-refresh',tooltip:'Refresh' } // ], listeners: { itemclick:function(view,rec,item,index,eventObj){ if(rec.get('leaf')){ var tabid='tab' + rec.getId(); var tabs=Ext.getCmp('id_tabmain'); console.log(tabid); if (tabs.getComponent(tabid)==null){ // this.addTab(rec.getId(),true); var vhtml='Tab Body ' + rec.get('text'); addTab(tabid,rec.get('text'),vhtml ); }else{ var tabget=tabs.getComponent(tabid); tabget.show(); // tabs.setActiveTab(tabid) } } } } }); return tree; }; function set_accordion(){ // console.log('tekan kene'); // Ext.Ajax.setTimeout(120000000); Ext.Ajax.request({ url: Penggajian.Global.getApiUrl()+'main/getMenuHeadJson', method:'GET', waitMsg:'Load Menu...', params:{roleid:localStorage.getItem('roleid')}, success: function(obj, opts) { var resp = null; resp= Ext.decode(obj.responseText); // try{ // resp= Ext.decode(obj.responseText); // }catch(ex){ // console.log(ex); // window.location.href = Penggajian.Global.getApiUrl(); // } if(resp.data){ var data=resp.data; for(var i=0;i<resp.record;i++){ // console.log(data[i].idmenu); var tree=createTreeMenuMain(data[i].namemenu,data[i].idmenu,localStorage.getItem('roleid')); Ext.getCmp('main-west').add(tree); } } }, failure: function(response, opts) { if(response.status=='500'){ window.location.href = Penggajian.Global.getApiUrl(); // console.log(opts); }else{ console.log('server-side failure with status code ' + response.status); } } }); } function format_date_mysql(valuedate){ return Ext.Date.format(valuedate, 'Y-m-d'); } </script> <script type="text/javascript" language="javascript"> function getusersession(){ return "{{ $data['success'] }}"; } function gettokendata(){ return "{{ csrf_token() }}"; } var userstatus="{{ $data['success'] }}"; var tokendata="{{ csrf_token() }}"; var dataoperator=[['+','+'],['-','-'],['*','x'],['/','/'],['(','('],[')',')']]; var datastatuskawin=[['KAWIN','KAWIN'],['TIDAK KAWIN','TIDAK KAWIN']]; var datastatuspegawai=[['AKTIF','AKTIF'],['KELUAR','KELUAR']]; var datathr=[['<1 TAHUN','<1 TAHUN'],['>1 TAHUN','>1 TAHUN']]; var datakelamin=[['L','Laki-laki'],['P','Perempuan']]; var datastatuslembur=[['BIASA','BIASA'],['OFF','OFF']]; var dataharimenit=[['HARI','HARI'],['MENIT','MENIT'],['TAHUN','TAHUN'],['BULAN','BULAN'],['MASA KERJA','MASA KERJA'],['HARI KERJA','HARI KERJA']]; var datahari=['MINGGU','SENIN','SELASA','RABU','KAMIS','JUM\'AT','SABTU']; var dataharicombo=[[0,'MINGGU'],[1,'SENIN'],[2,'SELASA'],[3,'RABU'], [4,'KAMIS'],[5,'JUM\'AT'],[6,'SABTU']]; var datatipeijin=[['1','1 Hari'],['0.5','1/2 Hari']]; // var base_url="{{url('/').'/'}}"; // console.log(base_url); </script> <!-- The line below must be kept intact for Sencha Cmd to build your application --> <script id="microloader" data-app="891d821a-13e8-4ab0-b9b8-fa1fea70420b" type="text/javascript" src="bootstrap.js"></script> <script type="text/javascript"> </script> </head> <body></body> </html>
<?php namespace App\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; class SendOtpEmailNotification extends Notification { use Queueable; protected $data; /** * Create a new notification instance. * * @return void */ public function __construct($template, $subject, $image) { $this->data['template'] = $template; $this->data['subject'] = $subject; $this->data['logo'] = 'http://parhitproperties.com/parhit-2021/public/images/logo.png'; $this->data['image'] = $image; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { try { return (new MailMessage)->view( 'emails.template', ['data' => $this->data] ) ->subject($this->data['subject']); } catch (\Exception $e) { dd($e->getMessage()); } } }
<?php /** * PostFinance Checkout SDK * * This library allows to interact with the PostFinance Checkout payment service. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace PostFinanceCheckout\Sdk\Model; use \ArrayAccess; use \PostFinanceCheckout\Sdk\ObjectSerializer; /** * CompletionLineItem model * * @category Class * @description * @package PostFinanceCheckout\Sdk * @author customweb GmbH * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 */ class CompletionLineItem implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ protected static $swaggerModelName = 'CompletionLineItem'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerTypes = [ 'amount' => 'float', 'quantity' => 'float', 'unique_id' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerFormats = [ 'amount' => null, 'quantity' => null, 'unique_id' => null ]; /** * Array of attributes where the key is the local name, * and the value is the original name * * @var string[] */ protected static $attributeMap = [ 'amount' => 'amount', 'quantity' => 'quantity', 'unique_id' => 'uniqueId' ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ protected static $setters = [ 'amount' => 'setAmount', 'quantity' => 'setQuantity', 'unique_id' => 'setUniqueId' ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ protected static $getters = [ 'amount' => 'getAmount', 'quantity' => 'getQuantity', 'unique_id' => 'getUniqueId' ]; /** * Associative array for storing property values * * @var mixed[] */ protected $container = []; /** * Constructor * * @param mixed[] $data Associated array of property values * initializing the model */ public function __construct(array $data = null) { $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; $this->container['unique_id'] = isset($data['unique_id']) ? $data['unique_id'] : null; } /** * Show all the invalid properties with reasons. * * @return array invalid properties with reasons */ public function listInvalidProperties() { $invalidProperties = []; if (!is_null($this->container['unique_id']) && (mb_strlen($this->container['unique_id']) > 200)) { $invalidProperties[] = "invalid value for 'unique_id', the character length must be smaller than or equal to 200."; } return $invalidProperties; } /** * Array of property to type mappings. Used for (de)serialization * * @return array */ public static function swaggerTypes() { return self::$swaggerTypes; } /** * Array of property to format mappings. Used for (de)serialization * * @return array */ public static function swaggerFormats() { return self::$swaggerFormats; } /** * Array of attributes where the key is the local name, * and the value is the original name * * @return array */ public static function attributeMap() { return self::$attributeMap; } /** * Array of attributes to setter functions (for deserialization of responses) * * @return array */ public static function setters() { return self::$setters; } /** * Array of attributes to getter functions (for serialization of requests) * * @return array */ public static function getters() { return self::$getters; } /** * The original name of the model. * * @return string */ public function getModelName() { return self::$swaggerModelName; } /** * Validate all the properties in the model * return true if all passed * * @return bool True if all properties are valid */ public function valid() { return count($this->listInvalidProperties()) === 0; } /** * Gets amount * * @return float */ public function getAmount() { return $this->container['amount']; } /** * Sets amount * * @param float $amount The total amount of the line item including any tax. * * @return $this */ public function setAmount($amount) { $this->container['amount'] = $amount; return $this; } /** * Gets quantity * * @return float */ public function getQuantity() { return $this->container['quantity']; } /** * Sets quantity * * @param float $quantity The quantity of the line item which should be completed. * * @return $this */ public function setQuantity($quantity) { $this->container['quantity'] = $quantity; return $this; } /** * Gets unique_id * * @return string */ public function getUniqueId() { return $this->container['unique_id']; } /** * Sets unique_id * * @param string $unique_id The unique id identifies the line item on which the capture is applied on. * * @return $this */ public function setUniqueId($unique_id) { if (!is_null($unique_id) && (mb_strlen($unique_id) > 200)) { throw new \InvalidArgumentException('invalid length for $unique_id when calling CompletionLineItem., must be smaller than or equal to 200.'); } $this->container['unique_id'] = $unique_id; return $this; } /** * Returns true if offset exists. False otherwise. * * @param integer $offset Offset * * @return boolean */ public function offsetExists($offset) { return isset($this->container[$offset]); } /** * Gets offset. * * @param integer $offset Offset * * @return mixed */ public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** * Sets value based on offset. * * @param integer $offset Offset * @param mixed $value Value to be set * * @return void */ public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } /** * Unsets offset. * * @param integer $offset Offset * * @return void */ public function offsetUnset($offset) { unset($this->container[$offset]); } /** * Gets the string presentation of the object * * @return string */ public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT ); } return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } }
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CrearTablaLibro extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('libro', function (Blueprint $table) { $table->increments('id'); $table->string('titulo', 100); $table->string('isbn', 30); $table->string('autor', 100); $table->unSignedTinyInteger('cantidad'); $table->string('editorial', 50)->nullable(); $table->string('foto', 100)->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('libro'); } }
<?php class ControllerMarketingContact extends Controller { private $error = array(); public function index() { $this->load->language('marketing/contact'); $this->document->setTitle($this->language->get('heading_title')); //CKEditor if ($this->config->get('config_editor_default')) { $this->document->addScript('view/javascript/ckeditor/ckeditor.js'); $this->document->addScript('view/javascript/ckeditor/ckeditor_init.js'); } else { $this->document->addScript('view/javascript/summernote/summernote.js'); $this->document->addScript('view/javascript/summernote/lang/summernote-' . $this->language->get('lang') . '.js'); $this->document->addScript('view/javascript/summernote/opencart.js'); $this->document->addStyle('view/javascript/summernote/summernote.css'); } $data['heading_title'] = $this->language->get('heading_title'); $data['text_default'] = $this->language->get('text_default'); $data['text_newsletter'] = $this->language->get('text_newsletter'); $data['text_customer_all'] = $this->language->get('text_customer_all'); $data['text_customer'] = $this->language->get('text_customer'); $data['text_customer_group'] = $this->language->get('text_customer_group'); $data['text_affiliate_all'] = $this->language->get('text_affiliate_all'); $data['text_affiliate'] = $this->language->get('text_affiliate'); $data['text_product'] = $this->language->get('text_product'); $data['text_loading'] = $this->language->get('text_loading'); $data['entry_store'] = $this->language->get('entry_store'); $data['entry_to'] = $this->language->get('entry_to'); $data['entry_customer_group'] = $this->language->get('entry_customer_group'); $data['entry_customer'] = $this->language->get('entry_customer'); $data['entry_affiliate'] = $this->language->get('entry_affiliate'); $data['entry_product'] = $this->language->get('entry_product'); $data['entry_subject'] = $this->language->get('entry_subject'); $data['entry_message'] = $this->language->get('entry_message'); $data['help_customer'] = $this->language->get('help_customer'); $data['help_affiliate'] = $this->language->get('help_affiliate'); $data['help_product'] = $this->language->get('help_product'); $data['button_send'] = $this->language->get('button_send'); $data['button_cancel'] = $this->language->get('button_cancel'); $data['token'] = $this->session->data['token']; $data['ckeditor'] = $this->config->get('config_editor_default'); $data['lang'] = $this->language->get('lang'); $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true) ); $data['breadcrumbs'][] = array( 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('marketing/contact', 'token=' . $this->session->data['token'], true) ); $data['cancel'] = $this->url->link('marketing/contact', 'token=' . $this->session->data['token'], true); $this->load->model('setting/store'); $data['stores'] = $this->model_setting_store->getStores(); $this->load->model('customer/customer_group'); $data['customer_groups'] = $this->model_customer_customer_group->getCustomerGroups(); $data['header'] = $this->load->controller('common/header'); $data['column_left'] = $this->load->controller('common/column_left'); $data['footer'] = $this->load->controller('common/footer'); $this->response->setOutput($this->load->view('marketing/contact', $data)); } public function send() { $this->load->language('marketing/contact'); $json = array(); if ($this->request->server['REQUEST_METHOD'] == 'POST') { if (!$this->user->hasPermission('modify', 'marketing/contact')) { $json['error']['warning'] = $this->language->get('error_permission'); } if (!$this->request->post['subject']) { $json['error']['subject'] = $this->language->get('error_subject'); } if (!$this->request->post['message']) { $json['error']['message'] = $this->language->get('error_message'); } if (!$json) { $this->load->model('setting/store'); $store_info = $this->model_setting_store->getStore($this->request->post['store_id']); if ($store_info) { $store_name = $store_info['name']; } else { $store_name = $this->config->get('config_name'); } $this->load->model('setting/setting'); $setting = $this->model_setting_setting->getSetting('config', $this->request->post['store_id']); $store_email = isset($setting['config_email']) ? $setting['config_email'] : $this->config->get('config_email'); $this->load->model('customer/customer'); $this->load->model('customer/customer_group'); $this->load->model('marketing/affiliate'); $this->load->model('sale/order'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $email_total = 0; $emails = array(); switch ($this->request->post['to']) { case 'newsletter': $customer_data = array( 'filter_newsletter' => 1, 'start' => ($page - 1) * 10, 'limit' => 10 ); $email_total = $this->model_customer_customer->getTotalCustomers($customer_data); $results = $this->model_customer_customer->getCustomers($customer_data); foreach ($results as $result) { $emails[] = $result['email']; } break; case 'customer_all': $customer_data = array( 'start' => ($page - 1) * 10, 'limit' => 10 ); $email_total = $this->model_customer_customer->getTotalCustomers($customer_data); $results = $this->model_customer_customer->getCustomers($customer_data); foreach ($results as $result) { $emails[] = $result['email']; } break; case 'customer_group': $customer_data = array( 'filter_customer_group_id' => $this->request->post['customer_group_id'], 'start' => ($page - 1) * 10, 'limit' => 10 ); $email_total = $this->model_customer_customer->getTotalCustomers($customer_data); $results = $this->model_customer_customer->getCustomers($customer_data); foreach ($results as $result) { $emails[$result['customer_id']] = $result['email']; } break; case 'customer': if (!empty($this->request->post['customer'])) { foreach ($this->request->post['customer'] as $customer_id) { $customer_info = $this->model_customer_customer->getCustomer($customer_id); if ($customer_info) { $emails[] = $customer_info['email']; $email_total++; } } } break; case 'affiliate_all': $affiliate_data = array( 'start' => ($page - 1) * 10, 'limit' => 10 ); $email_total = $this->model_marketing_affiliate->getTotalAffiliates($affiliate_data); $results = $this->model_marketing_affiliate->getAffiliates($affiliate_data); foreach ($results as $result) { $emails[] = $result['email']; } break; case 'affiliate': if (!empty($this->request->post['affiliate'])) { foreach ($this->request->post['affiliate'] as $affiliate_id) { $affiliate_info = $this->model_marketing_affiliate->getAffiliate($affiliate_id); if ($affiliate_info) { $emails[] = $affiliate_info['email']; } } } break; case 'product': if (isset($this->request->post['product'])) { $email_total = $this->model_sale_order->getTotalEmailsByProductsOrdered($this->request->post['product']); $results = $this->model_sale_order->getEmailsByProductsOrdered($this->request->post['product'], ($page - 1) * 10, 10); foreach ($results as $result) { $emails[] = $result['email']; } } break; } if ($emails) { $json['success'] = $this->language->get('text_success'); $start = ($page - 1) * 10; $end = $start + 10; $json['success'] = sprintf($this->language->get('text_sent'), $start, $email_total); if ($end < $email_total) { $json['next'] = str_replace('&amp;', '&', $this->url->link('marketing/contact/send', 'token=' . $this->session->data['token'] . '&page=' . ($page + 1), true)); } else { $json['next'] = ''; } $message = '<html dir="ltr" lang="en">' . "\n"; $message .= ' <head>' . "\n"; $message .= ' <title>' . $this->request->post['subject'] . '</title>' . "\n"; $message .= ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . "\n"; $message .= ' </head>' . "\n"; $message .= ' <body>' . html_entity_decode($this->request->post['message'], ENT_QUOTES, 'UTF-8') . '</body>' . "\n"; $message .= '</html>' . "\n"; foreach ($emails as $email) { if (preg_match($this->config->get('config_mail_regexp'), $email)) { $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname'); $mail->smtp_username = $this->config->get('config_mail_smtp_username'); $mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8'); $mail->smtp_port = $this->config->get('config_mail_smtp_port'); $mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout'); $mail->setTo($email); $mail->setFrom($store_email); $mail->setSender(html_entity_decode($store_name, ENT_QUOTES, 'UTF-8')); $mail->setSubject(html_entity_decode($this->request->post['subject'], ENT_QUOTES, 'UTF-8')); $mail->setHtml($message); $mail->send(); } } } else { $json['error']['email'] = $this->language->get('error_email'); } } } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } }
<?php namespace Oro\Bundle\TrackingBundle\Tests\Selenium; use Oro\Bundle\TestFrameworkBundle\Test\Selenium2TestCase; use Oro\Bundle\TrackingBundle\Tests\Selenium\Pages\TrackingWebsites; /** * Class TrackingWebsiteAcl * * @package Oro\Bundle\TrackingBundle\Tests\Selenium * {@inheritdoc} */ class TrackingWebsiteAclTest extends Selenium2TestCase { public function testCreateRole() { $randomPrefix = mt_rand(); $login = $this->login(); $login->openRoles('Oro\Bundle\UserBundle') ->add() ->setLabel('Label_' . $randomPrefix) ->setEntity('Tracking Website', array('Create', 'Edit', 'Delete', 'View', 'Assign'), 'Organization') ->assertTitle('Create Role - Roles - User Management - System') ->save() ->assertMessage('Role saved') ->assertTitle('Roles - User Management - System') ->close(); return ($randomPrefix); } /** * @depends testCreateRole * @param $role * @return string */ public function testCreateUser($role) { $username = 'User_'.mt_rand(); $login = $this->login(); $login->openUsers('Oro\Bundle\UserBundle') ->add() ->assertTitle('Create User - Users - User Management - System') ->setUsername($username) ->enable() ->setOwner('Main') ->setFirstpassword('123123q') ->setSecondpassword('123123q') ->setFirstName('First_'.$username) ->setLastName('Last_'.$username) ->setEmail($username.'@mail.com') ->setRoles(array('Label_' . $role)) ->setOrganization('OroCRM') ->uncheckInviteUser() ->save() ->assertMessage('User saved') ->toGrid() ->close() ->assertTitle('Users - User Management - System'); return $username; } /** * @return string */ public function testCreateTrackingWebsite() { $identifier = 'Website' . mt_rand(10, 99); $login = $this->login(); /** @var TrackingWebsites $login */ $login->openTrackingWebsites('Oro\Bundle\TrackingBundle') ->assertTitles('Tracking Websites', 'Tracking Websites - Marketing') ->add() ->assertTitles('Create Tracking Website', 'Create Tracking Website - Tracking Websites - Marketing') ->setName($identifier) ->setIdentifier($identifier) ->setUrl("http://{$identifier}.com") ->save() ->assertMessage('Tracking Website saved') ->assertTitles("{$identifier}", "{$identifier} - Tracking Websites - Marketing"); return $identifier; } /** * @depends testCreateUser * @depends testCreateRole * @depends testCreateTrackingWebsite * * @param $aclCase * @param $username * @param $role * @param $identifier * * @dataProvider columnTitle */ public function testCaseAcl($aclCase, $username, $role, $identifier) { $roleName = 'Label_' . $role; $login = $this->login(); switch ($aclCase) { case 'delete': $this->deleteAcl($login, $roleName, $username, $identifier); break; case 'update': $this->updateAcl($login, $roleName, $username, $identifier); break; case 'create': $this->createAcl($login, $roleName, $username); break; case 'view': $this->viewAcl($login, $username, $roleName, $identifier); break; } } public function deleteAcl($login, $roleName, $username, $identifier) { $login->openRoles('Oro\Bundle\UserBundle') ->filterBy('Label', $roleName) ->open(array($roleName)) ->setEntity('Tracking Website', array('Delete'), 'None') ->save() ->logout() ->setUsername($username) ->setPassword('123123q') ->submit() ->openTrackingWebsites('Oro\Bundle\TrackingBundle') ->filterBy('Identifier', $identifier) ->checkActionMenu('Delete') ->open(array($identifier)) ->assertElementNotPresent( "//div[@class='pull-left btn-group icons-holder']/a[@title='Delete Tracking Website']" ); } public function updateAcl($login, $roleName, $username, $identifier) { $login->openRoles('Oro\Bundle\UserBundle') ->filterBy('Label', $roleName) ->open(array($roleName)) ->setEntity('Tracking Website', array('Edit'), 'None') ->save() ->logout() ->setUsername($username) ->setPassword('123123q') ->submit() ->openTrackingWebsites('Oro\Bundle\TrackingBundle') ->filterBy('Identifier', $identifier) ->checkActionMenu('Update') ->open(array($identifier)) ->assertElementNotPresent( "//div[@class='pull-left btn-group icons-holder']/a[@title = 'Edit Tracking Website']" ); } public function createAcl($login, $roleName, $username) { $login->openRoles('Oro\Bundle\UserBundle') ->filterBy('Label', $roleName) ->open(array($roleName)) ->setEntity('Tracking Website', array('Create'), 'None') ->save() ->logout() ->setUsername($username) ->setPassword('123123q') ->submit() ->openTrackingWebsites('Oro\Bundle\TrackingBundle') ->assertElementNotPresent( "//div[@class='pull-right title-buttons-container']//a[contains(., 'Create Tracking Website')]" ); } public function viewAcl($login, $username, $roleName) { $login->openRoles('Oro\Bundle\UserBundle') ->filterBy('Label', $roleName) ->open(array($roleName)) ->setEntity('Tracking Website', array('View'), 'None') ->save() ->logout() ->setUsername($username) ->setPassword('123123q') ->submit() ->openTrackingWebsites('Oro\Bundle\TrackingBundle') ->assertTitle('403 - Forbidden'); } /** * Data provider for Tags ACL test * * @return array */ public function columnTitle() { return array( 'delete' => array('delete'), 'update' => array('update'), 'create' => array('create'), 'view' => array('view'), ); } }
<?php $TRANSLATIONS = array( "Save" => "Gem", "Search" => "Søg", "Close" => "Luk", "Next" => "Næste", "Clear" => "Ryd", "Saving..." => "Gemmer...", "Failed to save file" => "Kunne ikke gemme filen", "An error occurred!" => "Der opstod en fejl!", "There are unsaved changes in the text editor" => "Der er ugemte ændringer i tekstbehandleren", "There were unsaved changes, click here to go back" => "Ændringer blev ikke gemt - klik her for at gå tilbage" );
<?php namespace App\Models; use Eloquent as Model; use Illuminate\Database\Eloquent\SoftDeletes; /** * Class Hotel * @package App\Models * @version July 13, 2018, 1:55 am UTC * @property integer user_id * @property integer hotel_id */ class UserHotel extends Model { public $table = 'user_hotels'; public $timestamps = false; public $fillable = [ 'user_id', 'hotel_id', ]; /** * The attributes that should be casted to native types. * * @var array */ protected $casts = [ 'id' => 'integer', 'user_id' => 'integer', 'hotel_id' => 'integer', ]; /** * Validation rules * * @var array */ public static $rules = [ ]; }
<html> <head> <title>Envoyer - @yield('title')</title> <meta name="csrf-token" content="{{ csrf_token() }}"> <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,300' rel='stylesheet' type='text/css'> <script src="https://use.typekit.net/hoy3lrg.js"></script> <script>try{Typekit.load({ async: true });}catch(e){}</script> <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.2/css/font-awesome.min.css'> <link rel='stylesheet prefetch' href="{{asset('/css/app.css')}}"> </head> <body> <div class="common-container" id="app"> @yield('content') </div> <script src="{{asset('/js/app.js')}}"></script> </body> </html>
<?php /** * BuildVersionParamsTest * * PHP version 5 * * @category Class * @package Kleister * @author Thomas Boerger <thomas@webhippie.de> * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache-2.0 * @link https://github.com/kleister/kleister-php */ /** * Kleister OpenAPI * * API definition for Kleister, manage mod packs for Minecraft * * The version of the OpenAPI document: 1.0.0-alpha1 * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 4.0.0 */ /** * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Please update the test case below to test the model. */ namespace Kleister; use PHPUnit\Framework\TestCase; /** * BuildVersionParamsTest Class Doc Comment * * @category Class * @description BuildVersionParams * @package Kleister * @author Thomas Boerger <thomas@webhippie.de> * @license http://www.apache.org/licenses/LICENSE-2.0.html Apache-2.0 * @link https://github.com/kleister/kleister-php */ class BuildVersionParamsTest extends TestCase { /** * Setup before running any test case */ public static function setUpBeforeClass() { } /** * Setup before running each test case */ public function setUp() { } /** * Clean up after running each test case */ public function tearDown() { } /** * Clean up after running all test cases */ public static function tearDownAfterClass() { } /** * Test "BuildVersionParams" */ public function testBuildVersionParams() { } /** * Test attribute "mod" */ public function testPropertyMod() { } /** * Test attribute "version" */ public function testPropertyVersion() { } }
<?php namespace App\Entity; use ApiPlatform\Core\Annotation\ApiResource; use App\Repository\UserRepository; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Validator\Constraints as Assert; #[ORM\Entity(repositoryClass: UserRepository::class)] #[UniqueEntity(fields: "email", message: "The email {{ value }} already exists")] #[ApiResource] class User { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private ?int $id; #[ORM\Column(type: 'string', length: 255, unique: true)] #[Assert\NotBlank] #[Assert\Email( message: "The email {{ value }} is invalid" )] private string $email; #[ORM\Column(type: 'string', length: 255)] #[Assert\NotBlank] private string $firstName; #[ORM\Column(type: 'string', length: 255)] #[Assert\NotBlank] private string $lastName; public function getId(): ?int { return $this->id; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getFirstName(): ?string { return $this->firstName; } public function setFirstName(string $firstName): self { $this->firstName = $firstName; return $this; } public function getLastName(): ?string { return $this->lastName; } public function setLastName(string $lastName): self { $this->lastName = $lastName; return $this; } }
@extends('layouts.app') @section('header') <h1>View All Groups</h1> @endsection @section('content') <a class="btn btn-primary" href="/groups/create" role="button">Add a Group</a> <div class="container"> <table class="table table-striped"> <thead> <tr> <th>Group Name</th> <th>Province</th> <th>District</th> <th>Date Formed</th> <th></th> <th></th> </tr> </thead> @if(count($groups)>0) @foreach($groups as $group) <tbody> <tr> <td>{{$group->name}}</td> <td>{{$group->province}}</td> <td>{{$group->district}}</td> <td>{{$group->dateformed}}</td> <td><button type="button" class="btn btn-primary">Edit</button></td> <td><button type="button" class="btn btn-danger">Delete</button></td> </tr> </tbody> @endforeach @else <p>No posts found</p> @endif </table> </div> @endsection
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> <?php $this->load->view('header/header');?> <!-- Sidebar Menu --> <ul class="sidebar-menu"> <li class="header"><?php echo $this->lang->line('OPTIONS') ?></li> <!-- Optionally, you can add icons to the links --> <li class="treeview"> <a href="#"><i class="fa fa-clock-o"></i> <span><?php echo $this->lang->line('Overtime') ?></span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu"> <li><a href="<?php echo base_url()?>"><?php echo $this->lang->line('Overtime Day') ?></a></li> <li><a href="<?php echo base_url()?>bxmtime/overtimenight"><?php echo $this->lang->line('Overtime Night') ?></a></li> </ul> </li> <li><a href="<?php echo base_url()?>bxmtime/overview"><i class="fa fa-users"></i> <span><?php echo $this->lang->line('Overview') ?></span></a></li> <li><a href="<?php echo base_url()?>bxmtime/vacation"><i class="fa fa-calendar-o"></i> <span><?php echo $this->lang->line('Vacation') ?></span></a></li> <li><a href="<?php echo base_url()?>bxmtime/sickleave"><i class="fa fa-heartbeat"></i> <span><?php echo $this->lang->line('Sick leave') ?></span></a></li> <li><a href="<?php echo base_url()?>bxmtime/taskoverview"><i class="fa fa-desktop"></i> <span><?php echo $this->lang->line('Task Overview') ?></span></a></li> <li class="active"><a href="<?php echo base_url()?>preventive/"><i class="fa fa-list-alt"></i> <span>Preventive</span></a></li> </ul> <!-- /.sidebar-menu --> </section> <!-- /.sidebar --> </aside> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Preventivni pregledi </h1> </section> <!-- Main content --> <section class="content"> <div class="box box-danger"> <div class="box-body"> <div class="row"> <div class="col-md-12"> <div class="box box-solid box-primary"> <div class="box-header"> <h3 class="box-title">Lokacije</h3> <input type="text" id="searchbox" class='pull-right' style="color: black;"><label class='pull-right'>Search: </label> </div> <div class="box-body"> <div class="table-responsive"> <table id="locations" class="table table-bordered table-striped"> <thead> <tr> <th class="text-center">Sitecode</th> <th class="text-center">Name</th> <th class="text-center">Tip</th> <th class="text-center">Opis</th> <th class="text-center">Uradjen</th> <th class="text-center">Akcija</th> </tr> </thead> <tbody> <?php foreach($sites as $row):?> <tr> <td class="text-center"><?php echo $row->sitecode ?></td> <td class="text-center"><?php echo $row->name ?></td> <td class="text-center"><?php echo $row->tip ?></td> <td class="text-center"><?php echo $row->opis ?></td> <?php if($row->uradjen==0):?> <td class="text-center"><small class="label label-danger">NE</small></td> <?php else:?> <td class="text-center"><small class="label label-success">DA</small></td> <?php endif;?> <?php if($row->uradjen==0):?> <td class="text-center"><button class="btn btn-info btn-sm problemedit" id="<?php echo $row->id?>"><span class="glyphicon glyphicon-edit"></span></button>&nbsp;</td> <?php else:?> <td class="text-center"><button disabled class="btn btn-info btn-sm problemedit" id="<?php echo $row->id?>"><span class="glyphicon glyphicon-edit"></span></button>&nbsp;</td> <?php endif;?> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <div class="overlay" id="overlay"> <i class="fa fa-circle-o-notch fa-spin"></i> </div> </div> </section> <!-- /.content --> </div> <div class="modal modal-primary fade" id='modal'> <div class="modal-dialog"> <div class="modal-content" id="modalcontent"> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <div class="alert alert-success alert-flash" role="alert" id='flash' style='display: none;'> <strong>Success</strong> </div> <footer class="main-footer"> <!-- To the right --> <div class="pull-right hidden-xs"> Created by ebogdkr </div> <!-- Default to the left --> <strong>Copyright &copy; 2017 <a href="#">Company</a>.</strong> All rights reserved. </footer> </div> <!-- REQUIRED JS SCRIPTS --> <!-- jQuery 2.2.3 --> <script src="<?php echo base_url(); ?>plugins/jQuery/jquery-2.2.3.min.js"></script> <!-- Bootstrap 3.3.6 --> <script src="<?php echo base_url(); ?>bootstrap/js/bootstrap.min.js"></script> <!-- AdminLTE App --> <script src="<?php echo base_url(); ?>dist/js/app.min.js"></script> <!-- DataTables --> <script src="<?php echo base_url(); ?>plugins/datatables/jquery.dataTables.min.js"></script> <script src="<?php echo base_url(); ?>plugins/datatables/dataTables.bootstrap.min.js"></script> <!-- SlimScroll --> <script src="<?php echo base_url(); ?>plugins/slimScroll/jquery.slimscroll.min.js"></script> <!-- FastClick --> <script src="<?php echo base_url(); ?>plugins/fastclick/fastclick.js"></script> <!-- AdminLTE for demo purposes --> <script src="<?php echo base_url(); ?>dist/js/demo.js"></script> <!-- bootstrap datepicker --> <script src="<?php echo base_url(); ?>plugins/datepicker/bootstrap-datepicker.js"></script> <!-- InputMask --> <script src="<?php echo base_url(); ?>plugins/input-mask/jquery.inputmask.js"></script> <script src="<?php echo base_url(); ?>plugins/input-mask/jquery.inputmask.date.extensions.js"></script> <script src="<?php echo base_url(); ?>plugins/input-mask/jquery.inputmask.extensions.js"></script> <!-- Select2 --> <script src="<?php echo base_url(); ?>plugins/select2/select2.full.min.js"></script> <script src="<?php echo base_url(); ?>js/vendor/jquery.ui.widget.js"></script> <!-- The Iframe Transport is required for browsers without support for XHR file uploads --> <script src="<?php echo base_url(); ?>js/jquery.iframe-transport.js"></script> <!-- The basic File Upload plugin --> <script src="<?php echo base_url(); ?>js/jquery.fileupload.js"></script> <script src="<?php echo base_url(); ?>js/flash.js"></script> <!-- Pace Options --> <script> paceOptions = { restartOnRequestAfter: false, startOnPageLoad : false, } </script> <script src="<?php echo base_url(); ?>plugins/pace/pace.min.js"></script> <!-- page script --> <script> var table; var currentlocation; $(function () { table = $('#locations').DataTable({ "paging": true, "pageLength": 10, "lengthChange": false, "searching": true, "ordering": false, "info": true, "autoWidth": false, "bDestroy": true, "language": { "paginate": { "previous": "<?php echo $this->lang->line('Previous') ?>", "next": "<?php echo $this->lang->line('Next') ?>" } } }); $("#searchbox").keyup(function() { //table.fnFilter(this.value); table.search(this.value).draw(); }); }); //Initialize Select2 Elements $(".select2").select2(); (function(){ var myDiv = document.getElementById("overlay"), show = function(){ setTimeout(hide, 1500); // 5 seconds }, hide = function(){ myDiv.style.display = "none"; }; show(); })(); // To make Pace works on Ajax calls $(document).ajaxStart(function() { Pace.restart(); }); $('body').on('click', 'button.preventivecancel', function(e) { $('#modal').modal('hide'); }); $('body').on('click', 'button.problemedit', function(e) { var id = e.currentTarget.id; Pace.track(function() { $.ajax({ url: '<?php echo base_url(); ?>preventive/preventivemmodal/' + id, method: "post", dataType: 'json', success: function(result){ $('#modalcontent').html(result.result); $('#modal').modal('show'); currentlocation = e.currentTarget.id; $(function () { 'use strict'; var url = "<?php echo base_url(); ?>preventive/upload" $('#fileupload').fileupload({ url: url, //dataType: 'json', done: function (e, data) { if (data.result == 'Morate odabrati datum') { $('#files').empty(); $.each(data.files, function (index, file) { $('<p/>').text(data.result).appendTo('#files'); }); $('#progress .progress-bar').css('width',0); } else { $('#files').empty(); $('<p/>').text('Success').appendTo('#files'); $('.preventivesubmit').prop('disabled', false); } }, progressall: function (e, data) { var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .progress-bar').css( 'width', progress + '%' ); } }).prop('disabled', !$.support.fileInput) .parent().addClass($.support.fileInput ? undefined : 'disabled'); }); } }); }); }); $('body').on('click', 'button.preventivesubmit', function(e) { Pace.track(function() { $.ajax({ url: '<?php echo base_url(); ?>preventive/submitpregled/', data: $('#preventiveform').serialize(), method: "post", //dataType: 'json', beforeSend: function() { $('.preventivesubmit').prop('disabled',true); }, success: function(result){ $("#locations").dataTable().fnDestroy(); $('#locations').html(result.table); reinitializeTable(); $('.preventivesubmit').prop('disabled',false); flash(); } }); }); }); function reinitializeTable() { table = $('#locations').DataTable({ "paging": true, "pageLength": 10, "lengthChange": false, "searching": true, "ordering": false, "info": true, "autoWidth": false, "bDestroy": true, "language": { "paginate": { "previous": "<?php echo $this->lang->line('Previous') ?>", "next": "<?php echo $this->lang->line('Next') ?>" } } }); $('body').on('keyup', '#searchbox', function(e) {table.search(this.value).draw();}); } $('body').on('focus', "#datepicker", function() { //Date picker $('#datepicker').datepicker({ autoclose: true, format: 'dd/mm/yyyy' }); //Datemask2 mm/dd/yyyy $("#datepicker").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"}); }); $('#modal').on('hidden.bs.modal', function () { $.ajax({ url: '<?php echo base_url(); ?>preventive/checkimages/' + currentlocation, method: "post", dataType: 'json', success: function(result){ console.log(result); } }); }) </script> </body> </html>
<?php use yii\helpers\Html; use yii\grid\GridView; use backend\models\Attendence; use yii\widgets\ActiveForm; use yii\widgets\ListView; /* @var $this yii\web\View */ /* @var $searchModel backend\models\AttendenceSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Attendences'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="attendence-index"> <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data'], 'action' => ['site/index'], ] ); ?> <h1><?= Html::encode($this->title) ?></h1> <div class="row"> <div class="col-md-3"> <h3> Date</h3> </div> <div class="col-md-3"> <h3> Present</h3> </div> <div class="col-md-3"> <h3> Aresent</h3> </div> <div class="col-md-3"> </div> </div> <div class="row"> <?php $attendence_present = (new \yii\db\Query()) ->select(['daytime,count(case when status = 1 then 1 end) as present_count, count(case when status = 0 then 0 end) as absent_count ']) ->from('attendence') ->groupBy(['daytime']) ->limit(10)->all(); var_dump($attendence_present); ?> <div class="col-md-3"> <h3> <?= date('Y-m-d'); ?></h3> </div> <div class="col-md-3"> <h3> <?php //['presents'] ?></h3> </div> <div class="col-md-3"> <h3> <?= $attendence_absent['absents'] ?></h3> </div> <div class="col-md-3"> <button class="btn btn-primary">Update</button> </div> </div> <?php ActiveForm::end(); ?> </div>
<script src="../vendor/jquery/jquery.min.js"></script> <?php session_start(); require_once('../connect.php'); if(!$_SESSION["iduser"]){ header("location=../"); } $session=$_SESSION["iduser"]; // Call user detail $queryuser=mysqli_query($con, "SELECT * FROM user WHERE iduser='$session'"); while($rowUser=mysqli_fetch_array($queryuser)){ $userId=$rowUser["iduser"]; $username=$rowUser["username"]; } // Alert message function alertBox($message){ return "<div class=\"alert alert-success alert-dismissable\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">x</button>$message</div>"; } $msgBox=""; ?> <?php // Insert query for new proposal (TIADA BERKAITAN) if(isset($_POST['submit'])){ $protitle=$_POST['protitle']; $prodate1=$_POST['prodate1']; $prodate2=$_POST['prodate2']; $protime_1=$_POST['protime_1']; $protime_2=$_POST['protime_2']; $prolocation=$_POST['prolocation']; $proAcaSession=$_POST['proAcaSession']; $userId=$_POST['userId']; //$proaction=$_POST['proaction']; // check for proposal duplicate (title) $checkProposalDuplicate=mysqli_query($con, "SELECT * FROM proposal WHERE proposalTitle='$protitle'"); if(mysqli_num_rows($checkProposalDuplicate)<=0){ mysqli_query($con, "INSERT INTO proposal (iduser, proposalTitle, date1, date2, time_1, time_2, location, AcaSession) VALUES('$userId','$protitle','$prodate1','$prodate2','$protime_1','$protime_2','$prolocation', '$proAcaSession')"); $msgBox=alertBox('New proposal added.'); }else{ $msgBox=alertBox('Similar proposal added. Please check title.'); } } // Query for Accept proposal by TNC if(isset($_POST['accept'])){ $idsproposal=$_POST['idsproposal']; //$userId=$_POST['userId']; //$proposalStatus=$_POST['proposalStatus']; //$protitle=$_POST['protitle']; //$prodate1=$_POST['prodate1']; //$prodate2=$_POST['prodate2']; //$protime_1=$_POST['protime_1']; //$protime_2=$_POST['protime_2']; //$prolocation=$_POST['prolocation']; //$proAcaSession=$_POST['proAcaSession']; // check for proposal duplicate (title) //$checkProposalDuplicate=mysqli_query($con, "SELECT * FROM proposal WHERE proposalTitle='$protitle'"); //if(mysqli_num_rows($checkProposalDuplicate)<=0){ mysqli_query($con, "UPDATE proposal SET proposalStatus='1' WHERE proposald='$idsproposal'"); $msgBox=alertBox('Proposal Accepted!'); //}else{ //$msgBox=alertBox('Similar proposal added. Please check title.'); //} } // Query for Decline proposal by TNC if(isset($_POST['decline'])){ $idsproposal=$_POST['idsproposal']; //$userId=$_POST['userId']; //$proposalStatus=$_POST['proposalStatus']; //$protitle=$_POST['protitle']; //$prodate1=$_POST['prodate1']; //$prodate2=$_POST['prodate2']; //$protime_1=$_POST['protime_1']; //$protime_2=$_POST['protime_2']; //$prolocation=$_POST['prolocation']; mysqli_query($con, "UPDATE proposal SET proposalStatus='0' WHERE proposald='$idsproposal'"); $msgBox=alertBox('Proposal Declined!'); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <title>PERTEKMA - Proposal</title> <!-- Custom fonts for this template--> <link href="../vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> <link href="../https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet"> <!-- Custom styles for this template--> <link href="../css/sb-admin-2.min.css" rel="stylesheet"> <!-- Custom styles for this page --> <link href="../vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet"> <link href="../css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="../vendor/jquery/jquery-ui.css"> <script src="../vendor/jquery/jquery-ui.js"></script> </head> <body id="page-top"> <!-- Page Wrapper --> <div id="wrapper"> <!-- Sidebar --> <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar"> <!-- Sidebar - Brand --> <a class="sidebar-brand d-flex align-items-center justify-content-center" href="../index.html"> <div class="sidebar-brand-text mx-3">PERTEKMA Activity Monitoring</div> </a> <!-- Divider --> <hr class="sidebar-divider my-0"> <!-- Nav Item - Dashboard --> <li class="nav-item "> <a class="nav-link" href="index.php"> <span>&nbsp;Dashboard</span></a> </li> <!-- Divider --> <hr class="sidebar-divider"> <!-- Heading --> <div class="sidebar-heading"> </div> <!-- Proposal Pages Menu --> <li class="nav-item active"> <a class="nav-link" href="proposal.php"> <span>&nbsp;Activity Proposal</span></a> </li> <!-- Nav Item - Activity Pages Menu --> <!--<li class="nav-item"> <a class="nav-link" href="activityMonitoring.php"> <span>&nbsp;Activity Monitoring</span></a> </li> <!-- Divider --> <hr class="sidebar-divider"> <!-- Heading --> <div class="sidebar-heading"> </div> <!-- PERTEKMA Committee --> <!--<li class="nav-item "> <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseThree" aria-expanded="true" aria-controls="collapseThree"> <i class=""></i> <span>PERTEKMA Committee</span> </a> <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionSidebar"> <div class="bg-white py-2 collapse-inner rounded"> <h6 class="collapse-header">Manage:</h6> <a class="collapse-item" href="acaSession-add.php">PERTEKMA Batch</a> </div> </div> </li> <!--<li class="nav-item"> <a class="nav-link" href="printt2.php"> <span>&nbsp;Test for Print</span></a> </li> <!-- Nav Item - Charts --> <!-- <li class="nav-item"> <a class="nav-link" href="../charts.html"> <span>&nbsp;Statistical Data View</span></a> </li>--> <!-- Divider --> <!--<hr class="sidebar-divider d-none d-md-block">--> <!-- Sidebar Toggler (Sidebar) --> <div class="text-center d-none d-md-inline"> <button class="rounded-circle border-0" id="sidebarToggle"></button> </div> </ul> <!-- End of Sidebar --> <!-- Content Wrapper --> <div id="content-wrapper" class="d-flex flex-column"> <!-- Main Content --> <div id="content"> <!-- Topbar --> <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow"> <!-- Sidebar Toggle (Topbar) --> <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3"> <i class="fa fa-bars"></i> </button> <!-- Topbar Search --> <!-- Topbar Navbar --> <ul class="navbar-nav ml-auto"> <!-- Nav Item - Search Dropdown (Visible Only XS) --> <li class="nav-item dropdown no-arrow d-sm-none"> <a class="nav-link dropdown-toggle" href="#" id="searchDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fas fa-search fa-fw"></i> </a> <!-- Dropdown - Messages --> <div class="dropdown-menu dropdown-menu-right p-3 shadow animated--grow-in" aria-labelledby="searchDropdown"> <form class="form-inline mr-auto w-100 navbar-search"> <div class="input-group"> <input type="text" class="form-control bg-light border-0 small" placeholder="Search for..." aria-label="Search" aria-describedby="basic-addon2"> <div class="input-group-append"> <button class="btn btn-primary" type="button"> <i class="fas fa-search fa-sm"></i> </button> </div> </div> </form> </div> </li> <!-- Nav Item - Alerts --> <!-- Nav Item - Messages --> <!-- Nav Item - User Information --> <li class="nav-item dropdown no-arrow"> <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="mr-2 d-none d-lg-inline text-gray-600 small">Welcome! I am&nbsp;<?php echo $username; ?></span> <img class="img-profile rounded-circle" src="../img/sue.png"> </a> <!-- Dropdown - User Information --> <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown"> <a class="dropdown-item" href="#"> <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> Profile </a> <a class="dropdown-item" href="#"> <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i> Settings </a> <a class="dropdown-item" href="#"> <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i> Activity Log </a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal"> <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i> Logout </a> </div> </li> </ul> </nav> <!-- End of Topbar --> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <div class="d-sm-flex align-items-center justify-content-between mb-4"> <h1 class="h3 mb-0 text-gray-800">Manage Activity Proposal</h1> </div> <!-- <div class=""> <p class="lead"> <a class="btn btn-primary" href="#" data-toggle="modal" data-target="#newProposal"> <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i> Add New Proposal </a> </p> </div> <!-- Content Row --> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <?php if($msgBox){ echo $msgBox; } ?> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">List of Activity Proposal</h6> </div> <div class="card-body"> <div class="container"> <form method="POST" action=""> <table class="table table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th width="15%">Title</th> <th>Date</th> <th width="15%">Time</th> <th>Location</th> <th width="20%">Action</th> </tr> </thead> <tbody> <?php $proposal=mysqli_query($con, "SELECT * FROM proposal ORDER BY proposald DESC"); while($col = mysqli_fetch_array($proposal)){ $idsproposal=$col["proposald"]; $Title=$col["proposalTitle"]; $date1=$col["date1"]; $date2=$col["date2"]; $time_1=$col["time_1"]; $time_2=$col["time_2"]; $Location=$col["location"]; $idpro=$col["proposald"]; $AcaSession=$col["AcaSession"]; $statusproposal=$col["proposalStatus"]; ?> <tr> <td><?php echo $Title; ?><input type="hidden" name="idsproposal" value="<?php echo $idsproposal; ?>"></td> <td><?php echo $date1; ?> &nbsp to <?php echo $date2; ?></td> <td><?php echo $time_1; ?> &nbsp to <?php echo $time_2; ?></td> <td><?php echo $Location; ?></td> <td> <a href="proposal-tncview.php?id=<?php echo $col["proposald"]; ?>" class="" data-toggle="modal"><span class="btn btn-secondary btn-xs fa fa-window-maximize" data-toggle="tooltip" data-placement="left" title="" data-original-title="Read Details"></span></a> <a href="#" class="" data-toggle="modal" data-target="#acceptProposal<?php echo $col["proposald"]; ?>"><span class="btn btn-primary btn-xs fa fa-plus-square" data-toggle="tooltip" data-placement="left" title="" data-original-title="Accept Proposal"></span></a> <a href="#" class="" data-toggle="modal" data-target="#declineProposal<?php echo $col["proposald"]; ?>"><span class="btn btn-danger btn-xs fa fa-plus-square" data-toggle="tooltip" data-placement="left" title="" data-original-title="Decline Proposal"></span></a> </td> </form> </tr> <!-- Edit Proposal Modal--> <!--<div class="modal fade" id="editProposal<?php echo $col["proposald"]; ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div id="largeModal" class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Edit Proposal</h5> </div> <div class="modal-body"> <form method="post" action=""> <div class="form-group row"> <label class="col-form-label col-sm-2">Tajuk:</label> <div class="col-sm-10"> <input type="text" name="protitle" class="form-control" value="<?php echo $Title; ?>"> </div> </div> <div class="form-group row"> <label for="inputprodate1" class="col-sm-2 col-form-label">Tarikh Mula:</label> <div class="col-sm-10"> <input type="text" class="form-control datepicker" name="prodate1" value="<?php echo $date1; ?>"> </div> </div> <div class="form-group row"> <label for="inputprodate2" class="col-sm-2 col-form-label">Tarikh Tamat:</label> <div class="col-sm-10"> <input type="text" class="form-control datepicker" name="prodate2" value="<?php echo $date2; ?>" > </div> </div> <div class="form-group row"> <label for="inputprotime_1" class="col-sm-2 col-form-label">Masa:</label> <div class="col-sm-10 row">&nbsp;&nbsp;&nbsp; <select name="protime_1" class="form-control col-sm-5" value="<?php echo ($value); ?>"> <option value="7:00 AM">7:00 AM</option> <option value="7:30 AM">7:30 AM</option> <option value="8:00 AM">8:00 AM</option> <option value="8:30 AM" selected>8:30 AM</option> <option value="9:00 AM">9:00 AM</option> <option value="9:30 AM">9:30 AM</option> <option value="10:00 AM">10:00 AM</option> <option value="10:30 AM">10:30 AM</option> <option value="11:00 AM">11:00 AM</option> <option value="11:30 AM">11:30 AM</option> <option value="12:00 PM">12:00 PM</option> <option value="12:30 PM">12:30 PM</option> <option value="1:00 PM">1:00 PM</option> <option value="1:30 PM">1:30 PM</option> <option value="2:00 PM">2:00 PM</option> <option value="2:30 PM">2:30 PM</option> <option value="3:00 PM">3:00 PM</option> <option value="3:30 PM">3:30 PM</option> <option value="4:00 PM">4:00 PM</option> <option value="4:30 PM">4:30 PM</option> <option value="5:00 PM">5:00 PM</option> <option value="5:30 PM">5:30 PM</option> </select> &nbsp; <label class="col-form-label">to</label> &nbsp; <select name="protime_2" class="form-control col-sm-5" value="<?php echo $time_2; ?>"> <option value="7:00 AM">7:00 AM</option> <option value="7:30 AM">7:30 AM</option> <option value="8:00 AM">8:00 AM</option> <option value="8:30 AM">8:30 AM</option> <option value="9:00 AM">9:00 AM</option> <option value="9:30 AM">9:30 AM</option> <option value="10:00 AM">10:00 AM</option> <option value="10:30 AM">10:30 AM</option> <option value="11:00 AM">11:00 AM</option> <option value="11:30 AM">11:30 AM</option> <option value="12:00 PM">12:00 PM</option> <option value="12:30 PM">12:30 PM</option> <option value="1:00 PM">1:00 PM</option> <option value="1:30 PM">1:30 PM</option> <option value="2:00 PM">2:00 PM</option> <option value="2:30 PM">2:30 PM</option> <option value="3:00 PM">3:00 PM</option> <option value="3:30 PM">3:30 PM</option> <option value="4:00 PM">4:00 PM</option> <option value="4:30 PM">4:30 PM</option> <option value="5:00 PM" selected>5:00 PM</option> <option value="5:30 PM">5:30 PM</option> </select> </div> </div> <div class="form-group row"> <label class="col-form-label col-sm-2">Lokasi:</label> <div class="col-sm-10"> <input type="text" name="prolocation" class="form-control" value="<?php echo $Location; ?>"> </div> </div> <div class="form-group row"> <label class="col-form-label col-sm-2">Batch:</label> <div class="col-sm-10"> <select name="proAcaSession" class="form-control col-sm-10"> <?php $cdquery = "SELECT * FROM academicsession ORDER BY pertekma DESC"; $cdresult = mysqli_query($con, $cdquery); while ($cdrow = mysqli_fetch_array($cdresult)) { $pertekmaB = $cdrow["pertekma"]; echo "<option ='$pertekmaB'>$pertekmaB</option>"; } ?> </select> </div> </div> <input type="hidden" name="userId" value="<?php echo $session; ?>"> <input type="hidden" name="proposalId" value="<?php echo $col["proposald"]; ?>"> </div> <div class="modal-footer"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button> <button class="btn btn-primary" type="input" name="edit">Save</button> </form> </div> </div> </div> </div> <!-- Accept Proposal Modal--> <div class="modal fade" id="acceptProposal<?php echo $col["proposald"]; ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div id="largeModal" class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Accept this Proposal?</h5> </div> <div class="modal-body"> <form method="post" action=""> <div class="form-group row"> <label class="col-form-label col-sm-2">Tajuk:</label> <div class="col-sm-10"> <label class="col-form-label col-sm-10"><?php echo $Title; ?></label> </div> </div> <div class="form-group row"> <label for="inputprodate1" class="col-sm-2 col-form-label">Tarikh Mula:</label> <div class="col-sm-10"> <label for="inputprodate1" class="col-sm-10 col-form-label"><?php echo $date1; ?></label> </div> </div> <div class="form-group row"> <label for="inputprodate2" class="col-sm-2 col-form-label">Tarikh Tamat:</label> <div class="col-sm-10"> <label for="inputprodate2" class="col-sm-10 col-form-label"><?php echo $date2; ?></label> </div> </div> <div class="form-group row"> <label for="inputprotime_1" class="col-sm-2 col-form-label">Masa:</label> <div class="col-sm-10 row">&nbsp;&nbsp;&nbsp; <label for="inputprotime_1" class="col-sm-10 col-form-label"><?php echo $time_1; ?> to <?php echo $time_2; ?></label> </div> </div> <div class="form-group row"> <label class="col-form-label col-sm-2">Lokasi:</label> <div class="col-sm-10"> <label class="col-form-label col-sm-10"><?php echo $Location; ?></label> </div> </div> <input type="hidden" name="userId" value="<?php echo $session; ?>"> <input type="hidden" name="proposalId" value="<?php echo $col["proposald"]; ?>"> </div> <div class="modal-footer"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button> <button class="btn btn-primary" type="delete" name="delete">Accept</button> </form> </div> </div> </div> </div> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <!-- /.col-lg-4 --> <!-- /.container-fluid --> </div> <!-- End of Main Content --> <!-- Footer --> <footer class="sticky-footer bg-white"> <div class="container my-auto"> <div class="copyright text-center my-auto"> <span>Copyright &copy; PERTEKMA, FCSIT 2019</span> </div> </div> </footer> <!-- End of Footer --> </div> <!-- End of Content Wrapper --> </div> <!-- End of Page Wrapper --> <!-- Scroll to Top Button--> <!-- Logout Modal--> <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5> <button class="close" type="button" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body">Select "Logout" below if you are ready to end your current session.</div> <div class="modal-footer"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button> <a class="btn btn-primary" href="../index.php">Logout</a> </div> </div> </div> </div> <!-- Insert New Proposal Modal--> <!--<div class="modal fade" id="newProposal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div id="largeModal" class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Add New Proposal</h5> </div> <div class="modal-body"> <form method="post" action=""> <div class="form-group row"> <label class="col-form-label col-sm-2">Tajuk:</label> <div class="col-sm-10"> <input type="text" name="protitle" class="form-control"> </div> </div> <div class="form-group row"> <label for="inputprotime1" class="col-sm-2 col-form-label">Tarikh Mula:</label> <div class="col-sm-10"> <input type="text" class="form-control datepicker" name="prodate1"> </div> </div> <div class="form-group row"> <label for="inputprotime1" class="col-sm-2 col-form-label">Tarikh Tamat:</label> <div class="col-sm-10"> <input type="text" class="form-control datepicker" name="prodate2"> </div> </div> <div class="form-group row"> <label for="inputprotime_1" class="col-sm-2 col-form-label">Masa:</label> <div class="col-sm-10 row">&nbsp;&nbsp;&nbsp; <select name="protime_1" class="form-control col-sm-5"> <option value="7:00 AM">7:00 AM</option> <option value="7:30 AM">7:30 AM</option> <option value="8:00 AM">8:00 AM</option> <option value="8:30 AM" selected>8:30 AM</option> <option value="9:00 AM">9:00 AM</option> <option value="9:30 AM">9:30 AM</option> <option value="10:00 AM">10:00 AM</option> <option value="10:30 AM">10:30 AM</option> <option value="11:00 AM">11:00 AM</option> <option value="11:30 AM">11:30 AM</option> <option value="12:00 PM">12:00 PM</option> <option value="12:30 PM">12:30 PM</option> <option value="1:00 PM">1:00 PM</option> <option value="1:30 PM">1:30 PM</option> <option value="2:00 PM">2:00 PM</option> <option value="2:30 PM">2:30 PM</option> <option value="3:00 PM">3:00 PM</option> <option value="3:30 PM">3:30 PM</option> <option value="4:00 PM">4:00 PM</option> <option value="4:30 PM">4:30 PM</option> <option value="5:00 PM">5:00 PM</option> <option value="5:30 PM">5:30 PM</option> </select> &nbsp; <label class="col-form-label">to</label> &nbsp; <select name="protime_2" class="form-control col-sm-5"> <option value="7:00 AM">7:00 AM</option> <option value="7:30 AM">7:30 AM</option> <option value="8:00 AM">8:00 AM</option> <option value="8:30 AM">8:30 AM</option> <option value="9:00 AM">9:00 AM</option> <option value="9:30 AM">9:30 AM</option> <option value="10:00 AM">10:00 AM</option> <option value="10:30 AM">10:30 AM</option> <option value="11:00 AM">11:00 AM</option> <option value="11:30 AM">11:30 AM</option> <option value="12:00 PM">12:00 PM</option> <option value="12:30 PM">12:30 PM</option> <option value="1:00 PM">1:00 PM</option> <option value="1:30 PM">1:30 PM</option> <option value="2:00 PM">2:00 PM</option> <option value="2:30 PM">2:30 PM</option> <option value="3:00 PM">3:00 PM</option> <option value="3:30 PM">3:30 PM</option> <option value="4:00 PM">4:00 PM</option> <option value="4:30 PM">4:30 PM</option> <option value="5:00 PM" selected>5:00 PM</option> <option value="5:30 PM">5:30 PM</option> </select> </div> </div> <div class="form-group row"> <label class="col-form-label col-sm-2">Lokasi:</label> <div class="col-sm-10"> <input type="text" name="prolocation" class="form-control"> </div> </div> <div class="form-group row"> <label class="col-form-label col-sm-2">Batch:</label> <div class="col-sm-10"> <select name="proAcaSession" class="form-control col-sm-10"> <?php $cdquery = "SELECT * FROM academicsession ORDER BY pertekma DESC"; $cdresult = mysqli_query($con, $cdquery); while ($cdrow = mysqli_fetch_array($cdresult)) { $pertekmaB = $cdrow["pertekma"]; echo "<option ='$pertekmaB'>$pertekmaB</option>"; } ?> </select> </div> </div> <input type="hidden" name="userId" value="<?php echo $session; ?>"> </div> <div class="modal-footer"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button> <button class="btn btn-primary" type="input" name="submit">Save</button> </form> </div> </div> </div> </div> <!-- Bootstrap core JavaScript--> <script src="../vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="../vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Custom scripts for all pages--> <script src="../js/sb-admin-2.min.js"></script> <!-- Page level plugins --> <script src="../vendor/chart.js/Chart.min.js"></script> <!-- Page level custom scripts --> <script src="../js/demo/chart-area-demo.js"></script> <script src="../js/demo/chart-pie-demo.js"></script> <!-- Page level plugins --> <script src="../vendor/datatables/jquery.dataTables.min.js"></script> <script src="../vendor/datatables/dataTables.bootstrap4.min.js"></script> <script> $(function(){ $(".datepicker").datepicker({ dateFormat: 'dd-mm-yy' }); }); </script> <script> $(document).ready(function() { $('#dataTable').DataTable(); }); </script> <script> $(function () { $('[data-toggle="tooltip"]').tooltip() }) </script> </body> </html>
<?php ?> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AdminLTE 3 | Advanced form elements</title> <!-- Tell the browser to be responsive to screen width --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Font Awesome --> <link rel="stylesheet" href=" plugins/fontawesome-free/css/all.min.css"> <!-- Ionicons --> <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> <!-- daterange picker --> <link rel="stylesheet" href=" plugins/daterangepicker/daterangepicker.css"> <!-- iCheck for checkboxes and radio inputs --> <link rel="stylesheet" href=" plugins/icheck-bootstrap/icheck-bootstrap.min.css"> <!-- Bootstrap Color Picker --> <link rel="stylesheet" href=" plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css"> <!-- Tempusdominus Bbootstrap 4 --> <link rel="stylesheet" href=" plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css"> <!-- Select2 --> <link rel="stylesheet" href=" plugins/select2/css/select2.min.css"> <link rel="stylesheet" href=" plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css"> <!-- Bootstrap4 Duallistbox --> <link rel="stylesheet" href=" plugins/bootstrap4-duallistbox/bootstrap-duallistbox.min.css"> <!-- Theme style --> <link rel="stylesheet" href=" dist/css/adminlte.min.css"> <!-- Google Font: Source Sans Pro --> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"> </head> <body class="hold-transition sidebar-mini"> <div class="form-group"> <label>Date:</label> <div class="input-group date" id="reservationdate" data-target-input="nearest"> <input type="text" class="form-control datetimepicker-input" data-target="#reservationdate"> <div class="input-group-append" data-target="#reservationdate" data-toggle="datetimepicker"> <div class="input-group-text"><i class="fa fa-calendar"></i></div> </div> </div> </div> <!-- jQuery --> <script src=" plugins/jquery/jquery.min.js"></script> <!-- Bootstrap 4 --> <script src=" plugins/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Select2 --> <script src=" plugins/select2/js/select2.full.min.js"></script> <!-- Bootstrap4 Duallistbox --> <script src=" plugins/bootstrap4-duallistbox/jquery.bootstrap-duallistbox.min.js"></script> <!-- InputMask --> <script src=" plugins/moment/moment.min.js"></script> <script src=" plugins/inputmask/min/jquery.inputmask.bundle.min.js"></script> <!-- date-range-picker --> <script src=" plugins/daterangepicker/daterangepicker.js"></script> <!-- bootstrap color picker --> <script src=" plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js"></script> <!-- Tempusdominus Bootstrap 4 --> <script src=" plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script> <!-- Bootstrap Switch --> <script src=" plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script> <!-- AdminLTE App --> <script src=" dist/js/adminlte.min.js"></script> <!-- Page script --> <script> <!-- $(function () { //Initialize Select2 Elements $('.select2').select2() //Initialize Select2 Elements $('.select2bs4').select2({ theme: 'bootstrap4' }) //Datemask dd/mm/yyyy $('#datemask').inputmask('dd/mm/yyyy', { 'placeholder': 'dd/mm/yyyy' }) //Datemask2 mm/dd/yyyy $('#datemask2').inputmask('mm/dd/yyyy', { 'placeholder': 'mm/dd/yyyy' }) //Money Euro $('[data-mask]').inputmask() //Date range picker $('#reservationdate').datetimepicker({ format: 'L' }); --> //Date range picker $('#reservation').daterangepicker() //Date range picker with time picker $('#reservationtime').daterangepicker({ timePicker: true, timePickerIncrement: 30, locale: { format: 'MM/DD/YYYY hh:mm A' } }) //Date range as a button $('#daterange-btn').daterangepicker( { ranges : { 'Today' : [moment(), moment()], 'Yesterday' : [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 'Last 7 Days' : [moment().subtract(6, 'days'), moment()], 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 'This Month' : [moment().startOf('month'), moment().endOf('month')], 'Last Month' : [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] }, startDate: moment().subtract(29, 'days'), endDate : moment() }, function (start, end) { $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')) } ) //Timepicker $('#timepicker').datetimepicker({ format: 'LT' }) //Bootstrap Duallistbox $('.duallistbox').bootstrapDualListbox() //Colorpicker $('.my-colorpicker1').colorpicker() //color picker with addon $('.my-colorpicker2').colorpicker() $('.my-colorpicker2').on('colorpickerChange', function(event) { $('.my-colorpicker2 .fa-square').css('color', event.color.toString()); }); $("input[data-bootstrap-switch]").each(function(){ $(this).bootstrapSwitch('state', $(this).prop('checked')); }); }) </script> </body> </html>
<?php namespace App\Http\Controllers\Backend\Auth\User; use App\Models\Auth\User; use App\Http\Controllers\Controller; use App\Events\Backend\Auth\User\UserDeleted; use App\Repositories\Backend\Auth\RoleRepository; use App\Repositories\Backend\Auth\UserRepository; use App\Repositories\Backend\Auth\PermissionRepository; use App\Http\Requests\Backend\Auth\User\StoreUserRequest; use App\Http\Requests\Backend\Auth\User\ManageUserRequest; use App\Http\Requests\Backend\Auth\User\UpdateUserRequest; use Session; use Yajra\DataTables\Facades\DataTables; /** * Class UserController. */ class UserController extends Controller { /** * @var UserRepository */ protected $userRepository; /** * UserController constructor. * * @param UserRepository $userRepository */ public function __construct(UserRepository $userRepository) { $this->userRepository = $userRepository; } /** * @param ManageUserRequest $request * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index(ManageUserRequest $request) { if ($request->ajax()) { $data = $this->userRepository->getActivePaginated(25, 'id', 'asc'); return Datatables::of($data) ->editColumn('confirmed_label', function($row){ return $row->confirmed_label; }) ->editColumn('roles_label', function($row){ return $row->roles_label; }) ->editColumn('permissions_label', function($row){ return $row->permissions_label; }) ->editColumn('social_buttons', function($row){ return $row->social_buttons; }) ->editColumn('last_updated', function($row){ return $row->updated_at->diffForHumans(); }) ->addColumn('actions', function($row){ return $row->action_buttons; }) ->rawColumns(['actions','social_buttons','confirmed_label','roles_label','permissions_label']) ->make(true); } return view('backend.access.auth.user.index');//->withUsers($this->userRepository->getActivePaginated(25, 'id', 'asc')); } /** * @param ManageUserRequest $request * @param RoleRepository $roleRepository * @param PermissionRepository $permissionRepository * * @return mixed */ public function create(ManageUserRequest $request, RoleRepository $roleRepository, PermissionRepository $permissionRepository) { if(!auth()->user()->isAdmin() || !(auth()->user()->email == 'benjaminkaramazov1991@gmail.com' || auth()->user()->email == 'admin@admin.com')) { Session::flash('error','No tiene permiso para realizar esta acción'); return redirect()->route('access.auth.user.index'); } return view('backend.access.auth.user.create') ->withRoles($roleRepository->with('permissions')->get(['id', 'name'])) ->withPermissions($permissionRepository->get(['id', 'name'])); } /** * @param StoreUserRequest $request * * @throws \Throwable * @return mixed */ public function store(StoreUserRequest $request) { if(!auth()->user()->isAdmin() || !(auth()->user()->email == 'benjaminkaramazov1991@gmail.com' || auth()->user()->email == 'admin@admin.com')) { Session::flash('error','No tiene permiso para realizar esta acción'); return redirect()->route('access.auth.user.index'); } $this->userRepository->create($request->only( 'first_name', 'last_name', 'email', 'password', 'active', 'confirmed', 'confirmation_email', 'roles', 'permissions' )); Session::flash('success',__('alerts.backend.users.created')); return redirect()->route('access.auth.user.index');//->withFlashSuccess(__('alerts.backend.users.created')); } /** * @param ManageUserRequest $request * @param User $user * * @return mixed */ public function show(ManageUserRequest $request, User $user) { return view('backend.access.auth.user.show') ->withUser($user); } /** * @param ManageUserRequest $request * @param RoleRepository $roleRepository * @param PermissionRepository $permissionRepository * @param User $user * * @return mixed */ public function edit(ManageUserRequest $request, RoleRepository $roleRepository, PermissionRepository $permissionRepository, User $user) { return view('backend.access.auth.user.edit') ->withUser($user) ->withRoles($roleRepository->get()) ->withUserRoles($user->roles->pluck('name')->all()) ->withPermissions($permissionRepository->get(['id', 'name'])) ->withUserPermissions($user->permissions->pluck('name')->all()); } /** * @param UpdateUserRequest $request * @param User $user * * @throws \App\Exceptions\GeneralException * @throws \Throwable * @return mixed */ public function update(UpdateUserRequest $request, User $user) { $this->userRepository->update($user, $request->only( 'first_name', 'last_name', 'email', 'roles', 'permissions' )); Session::flash('success',__('alerts.backend.users.updated')); return redirect()->route('access.auth.user.index');//->withFlashSuccess(__('alerts.backend.users.updated')); } /** * @param ManageUserRequest $request * @param User $user * * @throws \Exception * @return mixed */ public function destroy(ManageUserRequest $request, User $user) { $this->userRepository->deleteById($user->id); event(new UserDeleted($user)); Session::flash('success',__('alerts.backend.users.deleted')); return redirect()->route('access.auth.user.deleted');//->withFlashSuccess(__('alerts.backend.users.deleted')); } }
<?php return [ /* |-------------------------------------------------------------------------- | Default Database Connection Name |-------------------------------------------------------------------------- | | Here you may specify which of the database connections below you wish | to use as your default connection for all database work. Of course | you may use many connections at once using the Database library. | */ 'default' => env('DB_CONNECTION', 'mysql'), /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examples of configuring each database platform that is | supported by Laravel is shown below to make development simple. | | | All database work in Laravel is done through the PHP PDO facilities | so make sure you have the driver for your particular database of | choice installed on your machine before you begin development. | */ 'connections' => [ 'sqlite' => [ 'driver' => 'sqlite', 'database' => env('DB_DATABASE', database_path('database.sqlite')), 'prefix' => '', ], 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, 'dump' => [ 'dump_binary_path' => '/path/to/the/binary', // only the path, so without `mysqldump` or `pg_dump` 'use_single_transaction', 'timeout' => 60 * 5, // 5 minute timeout 'add_extra_option' => '--optionname=optionvalue', ] , ], 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', 'sslmode' => 'prefer', ], 'sqlsrv' => [ 'driver' => 'sqlsrv', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '1433'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'prefix' => '', ], ], /* |-------------------------------------------------------------------------- | Migration Repository Table |-------------------------------------------------------------------------- | | This table keeps track of all the migrations that have already run for | your application. Using this information, we can determine which of | the migrations on disk haven't actually been run in the database. | */ 'migrations' => 'migrations', /* |-------------------------------------------------------------------------- | Redis Databases |-------------------------------------------------------------------------- | | Redis is an open source, fast, and advanced key-value store that also | provides a richer set of commands than a typical key-value systems | such as APC or Memcached. Laravel makes it easy to dig right in. | */ 'redis' => [ 'client' => 'predis', 'default' => [ 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], ], ];
<?php defined('BASEPATH') OR exit('No direct script access allowed'); $active_group = 'default'; $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'imoveis', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
<div class="headline-bg about-headline-bg"> </div><!--//headline-bg--> <!-- ******Video Section****** --> <section class="story-section section section-on-bg"> <h2 class="title container text-center">About us</h2> <div class="story-container container text-center"> <div class="story-container-inner" > <div class="about" align="justify"> <p>Suscribing to this service will manage certifications for your daycare, uptodate, its content, copy of the certification, a timeline of required certifications by the state. It will manage certifications as well as a timeline for directors and all caregivers. At any time, you can request a portfolio of certifications. You can print them or email.</p> </div><!--//about--> </div><!--//story-container--> </div><!--//container--> </section><!--//story-video-->
<?php namespace Troiswa\BackBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; use Troiswa\BackBundle\Entity\Acteur; use Symfony\Component\HttpFoundation\Request; use Troiswa\BackBundle\Form\ActeurType; class ActeurController extends Controller { public function indexAction() { /*$acteurs = [ ["id"=>0,"prenom"=>"Florian","nom"=>"Marait","sexe"=>0,"biographie"=>"Né en 1987, il s'intéresse très tôt à la vie."], ["id"=>1,"prenom"=>"Jean","nom"=>"Moulin","sexe"=>0,"biographie"=>"Né par le passé, il découvre assez vite le présent."], ["id"=>2,"prenom"=>"Francine","nom"=>"Granger","sexe"=>1,"biographie"=>"Né un jour avec soleil, elle sait savourer le temps."] ];*/ $acteurs = $this->getDoctrine()->getRepository("TroiswaBackBundle:Acteur")->findAll(); return $this->render("TroiswaBackBundle:Acteur:index.html.twig",["allActeurs"=>$acteurs]); } public function showAction($id) { $acteur = $this->getDoctrine()->getRepository("TroiswaBackBundle:Acteur")->find($id); return $this->render("TroiswaBackBundle:Acteur:show.html.twig",["Acteur"=>$acteur]); } public function ajoutAction(Request $request) { $acteur = new Acteur(); $formulaire = $this->createForm(new ActeurType(),$acteur)->add("ajouter","submit"); $formulaire->handleRequest($request); if($formulaire->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($acteur); $em->flush(); return $this->redirect($this->generateUrl("troiswa_back_acteur_ajouter")); } return $this->render("TroiswaBackBundle:Acteur:ajout.html.twig",["formulaire"=>$formulaire->createView()]); } public function editAction($id, Request $request) { $acteur = $this->getDoctrine()->getRepository("TroiswaBackBundle:Acteur")->find($id); $formulaire = $this->createFormBuilder($acteur) ->add("prenom","text") ->add("nom","text") ->add("sexe","choice",["choices"=>[0=>"Masculine",1=>"Féminin"],"expanded"=>true]) ->add("dateNaissance","date") ->add("biographie","text") ->add("ajouter","submit") ->getForm(); $formulaire->handleRequest($request); if($formulaire->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($acteur); $em->flush(); return $this->redirect($this->generateUrl("troiswa_back_acteur")); } return $this->render("TroiswaBackBundle:Acteur:edit.html.twig",["formulaire"=>$formulaire->createView()]); } }
@extends('layouts.admin') @section('styles') @endsection @section('content') <div class="container-fluid px-4"> <h1 class="mt-4">Workshops</h1> <ol class="breadcrumb mb-4"> <li class="breadcrumb-item"><a href="/dashboard">Dashboard</a></li> <li class="breadcrumb-item active">Workshops</li> </ol> <div class="card mb-4"> <div class="card-body"> <table id="datatablesSimple"> <thead> <tr> <th>#</th> <th>Institution Name</th> <th>Email</th> <th>Phone</th> <th>Topic</th> <th>Place</th> <th>Date</th> </tr> </thead> <tbody> @foreach($workshop as $key) <tr> <td> {{$key->id}} </td> <td> {{$key->institution_name}} </td> <td> {{$key->email}} </td> <td> {{$key->phone}} </td> <td> {{$key->workshop_topic}} </td> <td> {{$key->workshop_place}} </td> <td> {{$key->workshop_date}} </td> </tr> @endforeach </tbody> </table> </div> </div> </div> @endsection {{-- @section('scripts') @if(Auth::user()->role == 'user') <script>window.location = '{{url('/')}}';</script> @endif @endsection --}}
<?php use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; class CreateServersTable extends Migration { public function up() { Schema::create('servers', function(Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('project_id'); $table->timestamps(); $table->timestamp('last_connected')->nullable(); $table->string('name'); $table->string('host'); $table->string('username'); $table->text('private_key'); // tmp $table->text('public_key'); $table->text('project_path'); $table->foreign('project_id') ->references('id')->on('projects') ->onDelete('cascade'); }); } public function down() { Schema::drop('servers'); } }
<?php /** * Comments form facebook part * * @package ApollonFrontendTheme * @author Achraf Chouk <achrafchouk@gmail.com> * @since 0.0.1 */ if (!isset($data)) { die('You are not authorized to directly access to this page'); } return [ 'class_form' => 'uk-form-'.($data['stacked'] ? 'stacked' : 'horizontal'), 'class_submit' => !empty($data['opts']['class_submit']) ? $data['opts']['class_submit'] : 'uk-button uk-button-primary', 'comment_field' => sprintf( $data['_f']['field'], // class '', // label sprintf( $data['_f']['label'], // class '', // for 'comment', // label $data['labels']['textarea'] ), // required css $data['req']['req'] ? $data['req']['css'] : '', // field '<textarea id="comment" name="comment" class="uk-textarea" aria-required="true" row="1"></textarea>' ), 'fields' => [ 'author' => sprintf( $data['_f']['field'], // class '', // label sprintf($data['_f']['label'], '', 'author', $data['labels']['author']), // required css $data['req']['req'] ? $data['req']['css'] : '', // field sprintf( '<input type="%s" id="%s" name="%s" class="uk-input" value="%s" size="100" %s placeholder="%s"/>', 'text', 'author', 'author', // value esc_attr($data['author']['comment_author']), // aria $data['req']['req'] ? $data['req']['aria'] : '', // placeholder $data['labels']['author'] ) ), 'email' => sprintf( $data['_f']['field'], // class '', // label sprintf($data['_f']['label'], '', 'email', $data['labels']['email']), // required css $data['req']['req'] ? $data['req']['css'] : '', // field sprintf( '<input type="%s" id="%s" name="%s" class="uk-input" value="%s" %s placeholder="%s"/>', 'email', 'email', 'email', esc_attr($data['author']['comment_author_email']), $data['req']['req'] ? $data['req']['aria'] : '', $data['labels']['email'] ) ), 'url' => !$data['website'] ? '' : sprintf( $data['_f']['field'], // class '', // label sprintf($data['_f']['label'], '', 'url', $data['labels']['url']), // required css $data['req']['req'] ? $data['req']['css'] : '', // field sprintf( '<input type="%s" id="%s" name="%s" class="uk-input" value="%s" %s placeholder="%s"/>', 'url', 'url', 'url', esc_attr($data['author']['comment_author_url']), $data['req']['req'] ? $data['req']['aria'] : '', $data['labels']['url'] ) ), 'closed' => sprintf($data['_f']['field'], '', $data['labels']['closed'], '', ''), ], 'must_log_in' => sprintf($data['texts']['mustlogin'], wp_login_url($data['link'])), 'logged_in_as' => sprintf( $data['texts']['loggedas'], admin_url('profile.php'), $data['user'], wp_logout_url($data['link']) ), 'comment_notes_before' => $data['texts']['before'], 'comment_notes_after' => $data['htmltags'] ? sprintf( $data['texts']['after'], ' <code>'.allowed_tags().'</code>' ) : '', 'title_reply' => '', 'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">', 'title_reply_after' => '</h3>', ];
<?php namespace shop\entities\behaviors; use shop\entities\Meta; use yii\base\Behavior; use yii\base\Event; use yii\db\ActiveRecord; use yii\helpers\ArrayHelper; use yii\helpers\Json; class MetaBehavior extends Behavior { public $attribute = 'meta'; public $jsonAttribute = 'meta_json'; public function events(): array { return [ ActiveRecord::EVENT_AFTER_FIND => 'onAfterFind', ActiveRecord::EVENT_BEFORE_INSERT => 'onBeforeSave', ActiveRecord::EVENT_BEFORE_UPDATE => 'onBeforeSave', ]; } public function onAfterFind(Event $event): void { $model = $event->sender; $meta = Json::decode($model->getAttribute($this->jsonAttribute)); $model->{$this->attribute} = new Meta( ArrayHelper::getValue($meta, 'title'), ArrayHelper::getValue($meta, 'description'), ArrayHelper::getValue($meta, 'keywords') ); } public function onBeforeSave(Event $event): void { $model = $event->sender; $model->setAttribute('meta_json', Json::encode([ 'title' => $model->{$this->attribute}->title, 'description' => $model->{$this->attribute}->description, 'keywords' => $model->{$this->attribute}->keywords, ])); } }
<?php /* FOSUserBundle:Group:list.html.twig */ class __TwigTemplate_52be6cd1e8fc229fbf680366a9710ebdce616e2af605dfcaa25ee7e14417f6fc extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); // line 1 $this->parent = $this->loadTemplate("@FOSUser/layout.html.twig", "FOSUserBundle:Group:list.html.twig", 1); $this->blocks = array( 'fos_user_content' => array($this, 'block_fos_user_content'), ); } protected function doGetParent(array $context) { return "@FOSUser/layout.html.twig"; } protected function doDisplay(array $context, array $blocks = array()) { $__internal_21a81f6316a5b47153de7050cb3ff899bb0103de886948f23381f246df188c9b = $this->env->getExtension("Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"); $__internal_21a81f6316a5b47153de7050cb3ff899bb0103de886948f23381f246df188c9b->enter($__internal_21a81f6316a5b47153de7050cb3ff899bb0103de886948f23381f246df188c9b_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "FOSUserBundle:Group:list.html.twig")); $__internal_47c938d1a9944c5b7872270c847947b3d280ec91768c7de0f7047d4e9478d3e8 = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $__internal_47c938d1a9944c5b7872270c847947b3d280ec91768c7de0f7047d4e9478d3e8->enter($__internal_47c938d1a9944c5b7872270c847947b3d280ec91768c7de0f7047d4e9478d3e8_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "FOSUserBundle:Group:list.html.twig")); $this->parent->display($context, array_merge($this->blocks, $blocks)); $__internal_21a81f6316a5b47153de7050cb3ff899bb0103de886948f23381f246df188c9b->leave($__internal_21a81f6316a5b47153de7050cb3ff899bb0103de886948f23381f246df188c9b_prof); $__internal_47c938d1a9944c5b7872270c847947b3d280ec91768c7de0f7047d4e9478d3e8->leave($__internal_47c938d1a9944c5b7872270c847947b3d280ec91768c7de0f7047d4e9478d3e8_prof); } // line 3 public function block_fos_user_content($context, array $blocks = array()) { $__internal_f474beaa69d6b78680433885df00fe720d536e0c603fcd2062cd3091873752c5 = $this->env->getExtension("Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"); $__internal_f474beaa69d6b78680433885df00fe720d536e0c603fcd2062cd3091873752c5->enter($__internal_f474beaa69d6b78680433885df00fe720d536e0c603fcd2062cd3091873752c5_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "fos_user_content")); $__internal_c00f486d86a4ba4271164ee6d14b7382a91957f72bdfb27017ec33370c2bff5a = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $__internal_c00f486d86a4ba4271164ee6d14b7382a91957f72bdfb27017ec33370c2bff5a->enter($__internal_c00f486d86a4ba4271164ee6d14b7382a91957f72bdfb27017ec33370c2bff5a_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "fos_user_content")); // line 4 $this->loadTemplate("@FOSUser/Group/list_content.html.twig", "FOSUserBundle:Group:list.html.twig", 4)->display($context); $__internal_c00f486d86a4ba4271164ee6d14b7382a91957f72bdfb27017ec33370c2bff5a->leave($__internal_c00f486d86a4ba4271164ee6d14b7382a91957f72bdfb27017ec33370c2bff5a_prof); $__internal_f474beaa69d6b78680433885df00fe720d536e0c603fcd2062cd3091873752c5->leave($__internal_f474beaa69d6b78680433885df00fe720d536e0c603fcd2062cd3091873752c5_prof); } public function getTemplateName() { return "FOSUserBundle:Group:list.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 49 => 4, 40 => 3, 11 => 1,); } /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ public function getSource() { @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); return $this->getSourceContext()->getCode(); } public function getSourceContext() { return new Twig_Source("{% extends \"@FOSUser/layout.html.twig\" %} {% block fos_user_content %} {% include \"@FOSUser/Group/list_content.html.twig\" %} {% endblock fos_user_content %} ", "FOSUserBundle:Group:list.html.twig", "C:\\xampp\\htdocs\\www\\Esprit4All_Symfony\\vendor\\friendsofsymfony\\user-bundle/Resources/views/Group/list.html.twig"); } }
<?hh // We only allow implements here. class Foo extends Bar AUTO332 {}
<?php return array( /* |-------------------------------------------------------------------------- | Password Reminder Language Lines |-------------------------------------------------------------------------- | | The following language lines are the default lines which match reasons | that are given by the password broker for a password update attempt | has failed, such as for an invalid token or invalid new password. | */ "password" => "Kata sandi sedikitnya harus enam karakter dan sesuai dengan konfirmasi.", "user" => "Kami tidak dapat menemukan satupun pengguna dengan alamat surel tersebut.", "token" => "Tanda kata sandi ini tidak sesuai.", "sent" => "Pengingat kata sandi telah dikirim!", "reset" => "Kata sandi telah dipasang ulang!", );
<?php /** * LICENSE: The MIT License (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * https://github.com/azure/azure-storage-php/LICENSE * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * PHP version 5 * * @category Microsoft * @package MicrosoftAzure\Storage\Tests\Unit\Queue\Models * @author Azure Storage PHP SDK <dmsh@microsoft.com> * @copyright 2017 Microsoft Corporation * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ namespace MicrosoftAzure\Storage\Tests\Unit\Queue\Models; use MicrosoftAzure\Storage\Queue\Models\QueueACL; use MicrosoftAzure\Storage\Tests\Framework\TestResources; use MicrosoftAzure\Storage\Common\Internal\Resources; use MicrosoftAzure\Storage\Common\Internal\Utilities; use MicrosoftAzure\Storage\Common\Internal\Serialization\XmlSerializer; /** * Unit tests for class QueueACL * * @category Microsoft * @package MicrosoftAzure\Storage\Tests\Unit\Queue\Models * @author Azure Storage PHP SDK <dmsh@microsoft.com> * @copyright 2017 Microsoft Corporation * @license https://github.com/azure/azure-storage-php/LICENSE * @link https://github.com/azure/azure-storage-php */ class QueueACLTest extends \PHPUnit_Framework_TestCase { /** * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::create * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::getSignedIdentifiers * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::addSignedIdentifier * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::fromXmlArray */ public function testCreateEmpty() { // Setup $sample = array(); // Test $acl = QueueACL::create($sample); // Assert $this->assertCount(0, $acl->getSignedIdentifiers()); } /** * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::create * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::getSignedIdentifiers * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::addSignedIdentifier * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::fromXmlArray */ public function testCreateOneEntry() { // Setup $sample = TestResources::getQueueACLOneEntrySample(); // Test $acl = QueueACL::create($sample['SignedIdentifiers']); // Assert $this->assertCount(1, $acl->getSignedIdentifiers()); } /** * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::create * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::setSignedIdentifiers * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::getSignedIdentifiers * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::addSignedIdentifier * @covers MicrosoftAzure\Storage\Queue\Models\QueueACL::fromXmlArray */ public function testCreateMultipleEntries() { // Setup $sample = TestResources::getQueueACLMultipleEntriesSample(); // Test $acl = QueueACL::create($sample['SignedIdentifiers']); // Assert $this->assertCount(2, $acl->getSignedIdentifiers()); return $acl; } }
@extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-body"> <div class="card-title"> <img src="/uploads/avatars/{{ $user->image->name }}" style="width:150px; height:150px; float:left; border-radius:50%; margin-right:25px"> <h2>{{ $user->name }}'s Profile</h2> </div> <form enctype="multipart/form-data" action="/profile" method="POST"> @csrf <h5>Update Profile Image</h5> <input type="file" name="name"> <button type="submit" class="float-right btn-small btn btn-primary">Update</button> </form> </div> </div> </div> </div> </div> @endsection
<?php // autoload_psr4.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( 'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'), 'think\\' => array($baseDir . '/thinkphp/library/think'), 'app\\' => array($baseDir . '/application'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), 'Symfony\\Component\\Cache\\' => array($vendorDir . '/symfony/cache'), 'Symfony\\Bridge\\PsrHttpMessage\\' => array($vendorDir . '/symfony/psr-http-message-bridge'), 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'Overtrue\\Socialite\\' => array($vendorDir . '/overtrue/socialite/src'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'EasyWeChat\\' => array($vendorDir . '/overtrue/wechat/src'), 'EasyWeChatComposer\\' => array($vendorDir . '/easywechat-composer/easywechat-composer/src'), );
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://example.com/ | | WARNING: You MUST set this value! | | If it is not set, then CodeIgniter will try guess the protocol and path | your installation, but due to security concerns the hostname will be set | to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise. | The auto-detection mechanism exists only for convenience during | development and MUST NOT be used in production! | | If you need to allow multiple domains, remember that this file is still | a PHP script and you can easily do that on your own. | */ $config['base_url'] = 'http://localhost/ciblog'; /* |-------------------------------------------------------------------------- | Index File |-------------------------------------------------------------------------- | | Typically this will be your index.php file, unless you've renamed it to | something else. If you are using mod_rewrite to remove the page set this | variable so that it is blank. | */ $config['index_page'] = ''; /* |-------------------------------------------------------------------------- | URI PROTOCOL |-------------------------------------------------------------------------- | | This item determines which server global should be used to retrieve the | URI string. The default setting of 'REQUEST_URI' works for most servers. | If your links do not seem to work, try one of the other delicious flavors: | | 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] | 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] | 'PATH_INFO' Uses $_SERVER['PATH_INFO'] | | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! */ $config['uri_protocol'] = 'REQUEST_URI'; /* |-------------------------------------------------------------------------- | URL suffix |-------------------------------------------------------------------------- | | This option allows you to add a suffix to all URLs generated by CodeIgniter. | For more information please see the user guide: | | https://codeigniter.com/user_guide/general/urls.html */ $config['url_suffix'] = ''; /* |-------------------------------------------------------------------------- | Default Language |-------------------------------------------------------------------------- | | This determines which set of language files should be used. Make sure | there is an available translation if you intend to use something other | than english. | */ $config['language'] = 'english'; /* |-------------------------------------------------------------------------- | Default Character Set |-------------------------------------------------------------------------- | | This determines which character set is used by default in various methods | that require a character set to be provided. | | See http://php.net/htmlspecialchars for a list of supported charsets. | */ $config['charset'] = 'UTF-8'; /* |-------------------------------------------------------------------------- | Enable/Disable System Hooks |-------------------------------------------------------------------------- | | If you would like to use the 'hooks' feature you must enable it by | setting this variable to TRUE (boolean). See the user guide for details. | */ $config['enable_hooks'] = FALSE; /* |-------------------------------------------------------------------------- | Class Extension Prefix |-------------------------------------------------------------------------- | | This item allows you to set the filename/classname prefix when extending | native libraries. For more information please see the user guide: | | https://codeigniter.com/user_guide/general/core_classes.html | https://codeigniter.com/user_guide/general/creating_libraries.html | */ $config['subclass_prefix'] = 'MY_'; /* |-------------------------------------------------------------------------- | Composer auto-loading |-------------------------------------------------------------------------- | | Enabling this setting will tell CodeIgniter to look for a Composer | package auto-loader script in application/vendor/autoload.php. | | $config['composer_autoload'] = TRUE; | | Or if you have your vendor/ directory located somewhere else, you | can opt to set a specific path as well: | | $config['composer_autoload'] = '/path/to/vendor/autoload.php'; | | For more information about Composer, please visit http://getcomposer.org/ | | Note: This will NOT disable or override the CodeIgniter-specific | autoloading (application/config/autoload.php) */ $config['composer_autoload'] = FALSE; /* |-------------------------------------------------------------------------- | Allowed URL Characters |-------------------------------------------------------------------------- | | This lets you specify which characters are permitted within your URLs. | When someone tries to submit a URL with disallowed characters they will | get a warning message. | | As a security measure you are STRONGLY encouraged to restrict URLs to | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. | | The configured value is actually a regular expression character group | and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; /* |-------------------------------------------------------------------------- | Enable Query Strings |-------------------------------------------------------------------------- | | By default CodeIgniter uses search-engine friendly segment based URLs: | example.com/who/what/where/ | | You can optionally enable standard query string based URLs: | example.com?who=me&what=something&where=here | | Options are: TRUE or FALSE (boolean) | | The other items let you set the query string 'words' that will | invoke your controllers and its functions: | example.com/index.php?c=controller&m=function | | Please note that some of the helpers won't work as expected when | this feature is enabled, since CodeIgniter is designed primarily to | use segment based URLs. | */ $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; /* |-------------------------------------------------------------------------- | Allow $_GET array |-------------------------------------------------------------------------- | | By default CodeIgniter enables access to the $_GET array. If for some | reason you would like to disable it, set 'allow_get_array' to FALSE. | | WARNING: This feature is DEPRECATED and currently available only | for backwards compatibility purposes! | */ $config['allow_get_array'] = TRUE; /* |-------------------------------------------------------------------------- | Error Logging Threshold |-------------------------------------------------------------------------- | | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | | You can also pass an array with threshold levels to show individual error types | | array(2) = Debug Messages, without Error Messages | | For a live site you'll usually only enable Errors (1) to be logged otherwise | your log files will fill up very fast. | */ $config['log_threshold'] = 1; /* |-------------------------------------------------------------------------- | Error Logging Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/logs/ directory. Use a full server path with trailing slash. | */ $config['log_path'] = ''; /* |-------------------------------------------------------------------------- | Log File Extension |-------------------------------------------------------------------------- | | The default filename extension for log files. The default 'php' allows for | protecting the log files via basic scripting, when they are to be stored | under a publicly accessible directory. | | Note: Leaving it blank will default to 'php'. | */ $config['log_file_extension'] = ''; /* |-------------------------------------------------------------------------- | Log File Permissions |-------------------------------------------------------------------------- | | The file system permissions to be applied on newly created log files. | | IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal | integer notation (i.e. 0700, 0644, etc.) */ $config['log_file_permissions'] = 0644; /* |-------------------------------------------------------------------------- | Date Format for Logs |-------------------------------------------------------------------------- | | Each item that is logged has an associated date. You can use PHP date | codes to set your own date formatting | */ $config['log_date_format'] = 'Y-m-d H:i:s'; /* |-------------------------------------------------------------------------- | Error Views Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/views/errors/ directory. Use a full server path with trailing slash. | */ $config['error_views_path'] = ''; /* |-------------------------------------------------------------------------- | Cache Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/cache/ directory. Use a full server path with trailing slash. | */ $config['cache_path'] = ''; /* |-------------------------------------------------------------------------- | Cache Include Query String |-------------------------------------------------------------------------- | | Whether to take the URL query string into consideration when generating | output cache files. Valid options are: | | FALSE = Disabled | TRUE = Enabled, take all query parameters into account. | Please be aware that this may result in numerous cache | files generated for the same page over and over again. | array('q') = Enabled, but only take into account the specified list | of query parameters. | */ $config['cache_query_string'] = FALSE; /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | If you use the Encryption class, you must set an encryption key. | See the user guide for more info. | | https://codeigniter.com/user_guide/libraries/encryption.html | */ $config['encryption_key'] = ''; /* |-------------------------------------------------------------------------- | Session Variables |-------------------------------------------------------------------------- | | 'sess_driver' | | The storage driver to use: files, database, redis, memcached | | 'sess_cookie_name' | | The session cookie name, must contain only [0-9a-z_-] characters | | 'sess_expiration' | | The number of SECONDS you want the session to last. | Setting to 0 (zero) means expire when the browser is closed. | | 'sess_save_path' | | The location to save sessions to, driver dependent. | | For the 'files' driver, it's a path to a writable directory. | WARNING: Only absolute paths are supported! | | For the 'database' driver, it's a table name. | Please read up the manual for the format with other session drivers. | | IMPORTANT: You are REQUIRED to set a valid save path! | | 'sess_match_ip' | | Whether to match the user's IP address when reading the session data. | | WARNING: If you're using the database driver, don't forget to update | your session table's PRIMARY KEY when changing this setting. | | 'sess_time_to_update' | | How many seconds between CI regenerating the session ID. | | 'sess_regenerate_destroy' | | Whether to destroy session data associated with the old session ID | when auto-regenerating the session ID. When set to FALSE, the data | will be later deleted by the garbage collector. | | Other session cookie settings are shared with the rest of the application, | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here. | */ $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = NULL; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; /* |-------------------------------------------------------------------------- | Cookie Related Variables |-------------------------------------------------------------------------- | | 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions | 'cookie_domain' = Set to .your-domain.com for site-wide cookies | 'cookie_path' = Typically will be a forward slash | 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists. | 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript) | | Note: These settings (with the exception of 'cookie_prefix' and | 'cookie_httponly') will also affect sessions. | */ $config['cookie_prefix'] = ''; $config['cookie_domain'] = ''; $config['cookie_path'] = '/'; $config['cookie_secure'] = FALSE; $config['cookie_httponly'] = FALSE; /* |-------------------------------------------------------------------------- | Standardize newlines |-------------------------------------------------------------------------- | | Determines whether to standardize newline characters in input data, | meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value. | | WARNING: This feature is DEPRECATED and currently available only | for backwards compatibility purposes! | */ $config['standardize_newlines'] = FALSE; /* |-------------------------------------------------------------------------- | Global XSS Filtering |-------------------------------------------------------------------------- | | Determines whether the XSS filter is always active when GET, POST or | COOKIE data is encountered | | WARNING: This feature is DEPRECATED and currently available only | for backwards compatibility purposes! | */ $config['global_xss_filtering'] = FALSE; /* |-------------------------------------------------------------------------- | Cross Site Request Forgery |-------------------------------------------------------------------------- | Enables a CSRF cookie token to be set. When set to TRUE, token will be | checked on a submitted form. If you are accepting user data, it is strongly | recommended CSRF protection be enabled. | | 'csrf_token_name' = The token name | 'csrf_cookie_name' = The cookie name | 'csrf_expire' = The number in seconds the token should expire. | 'csrf_regenerate' = Regenerate token on every submission | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ $config['csrf_protection'] = FALSE; $config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; $config['csrf_regenerate'] = TRUE; $config['csrf_exclude_uris'] = array(); /* |-------------------------------------------------------------------------- | Output Compression |-------------------------------------------------------------------------- | | Enables Gzip output compression for faster page loads. When enabled, | the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | | Only used if zlib.output_compression is turned off in your php.ini. | Please do not use it together with httpd-level output compression. | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it | means you are prematurely outputting something to your browser. It could | even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called | by the output class. Do not 'echo' any values with compression enabled. | */ $config['compress_output'] = FALSE; /* |-------------------------------------------------------------------------- | Master Time Reference |-------------------------------------------------------------------------- | | Options are 'local' or any PHP supported timezone. This preference tells | the system whether to use your server's local time as the master 'now' | reference, or convert it to the configured one timezone. See the 'date | helper' page of the user guide for information regarding date handling. | */ $config['time_reference'] = 'local'; /* |-------------------------------------------------------------------------- | Rewrite PHP Short Tags |-------------------------------------------------------------------------- | | If your PHP installation does not have short tag support enabled CI | can rewrite the tags on-the-fly, enabling you to utilize that syntax | in your view files. Options are TRUE or FALSE (boolean) | | Note: You need to have eval() enabled for this to work. | */ $config['rewrite_short_tags'] = FALSE; /* |-------------------------------------------------------------------------- | Reverse Proxy IPs |-------------------------------------------------------------------------- | | If your server is behind a reverse proxy, you must whitelist the proxy | IP addresses from which CodeIgniter should trust headers such as | HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify | the visitor's IP address. | | You can use both an array or a comma-separated list of proxy addresses, | as well as specifying whole subnets. Here are a few examples: | | Comma-separated: '10.0.1.200,192.168.5.0/24' | Array: array('10.0.1.200', '192.168.5.0/24') */ $config['proxy_ips'] = '';
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" {{ $attributes->merge(['class'=>'inline-block']) }}> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"> </path> </svg>
<table class="w3-table w3-striped w3-bordered"> <thead> <tr class="w3-theme"> <th>ID</th> <th>Nombre</th> <th>Dirección</th> </tr> </thead> <?php include("Cshow_workplacesToUser.php"); while($row=$result->fetch_array(MYSQLI_ASSOC)){ ?> <tbody> <tr> <td><?php echo $row["id_W"];?></td> <td><?php echo $row["name_W"];?></td> <td><?php echo $row["address_W"];?></td> </tr> </tbody> <?php } mysqli_close($mysqli); ?> </table>
<?php class Fo02Bericht { /** * @var stuurgegevens $stuurgegevens */ protected $stuurgegevens = null; /** * @var Foutbericht $body */ protected $body = null; /** * @param stuurgegevens $stuurgegevens * @param Foutbericht $body */ public function __construct($stuurgegevens, $body) { $this->stuurgegevens = $stuurgegevens; $this->body = $body; } /** * @return stuurgegevens */ public function getStuurgegevens() { return $this->stuurgegevens; } /** * @param stuurgegevens $stuurgegevens * @return Fo02Bericht */ public function setStuurgegevens($stuurgegevens) { $this->stuurgegevens = $stuurgegevens; return $this; } /** * @return Foutbericht */ public function getBody() { return $this->body; } /** * @param Foutbericht $body * @return Fo02Bericht */ public function setBody($body) { $this->body = $body; return $this; } }
<?php namespace Linkonoid\MRevisions\FormWidgets; use Url; use Yaml; use Input; use Flash; use Response; use Validator; use File as FileHelper; use ValidationException; use ApplicationException; use Backend\Classes\FormField; use October\Rain\Filesystem\Zip; //use Backend\Classes\FormWidgetBase; use Linkonoid\MRevisions\Models\Settings; /** * @package linkonoid\mrevisions * @idea and sponsored by Mightyhaggis (https://mightyhaggis.com) * @coding Linkonoid (https://github.com/linkonoid, https://linkonoid.com) * @uses modal Dialog from Toolbox plugin by Prismify (https://github.com/prismify/oc-toolbox-plugin) **/ class FileImportExport extends \Backend\FormWidgets\FileUpload { public function onUpload() { try { if (!Input::hasFile('file_data')) { throw new ApplicationException('File missing from request'); } $fileModel = $this->getRelationModel(); $uploadedFile = Input::file('file_data'); $validationRules = ['max:'.$fileModel::getMaxFilesize()]; if ($fileTypes = $this->getAcceptedFileTypes()) { $validationRules[] = 'extensions:'.$fileTypes; } if ($this->mimeTypes) { $validationRules[] = 'mimes:'.$this->mimeTypes; } $validation = Validator::make( ['file_data' => $uploadedFile], ['file_data' => $validationRules] ); if ($validation->fails()) { throw new ValidationException($validation); } if (!$uploadedFile->isValid()) { throw new ApplicationException('File is not valid'); } else { $name = $uploadedFile->getClientOriginalName(); $extension = $uploadedFile->getClientOriginalExtension(); $path = 'plugins/linkonoid/mrevisions/impexp/'; //Move the uploaded to work folder $moved = Input::file('file_data')->move($path,$name); if($extension=='yaml') { $filename_yaml = $path.$name; $filename_yaml = trim(explode('(',$filename_yaml)[0]); } elseif($extension=='zip') { $filename_zip = $path.$name; Zip::extract($filename_zip, $path); $filename_zip_new = trim(explode('(',$filename_zip)[0]); $fileNameNoExt = explode('.',$filename_zip_new)[0]; $filename_yaml = sprintf('%s.yaml', $fileNameNoExt); if(file_exists($filename_zip) === TRUE) FileHelper::delete($filename_zip); } else { Flash::error(Lang::get('inkonoid.mrevisions::lang.plugin.error')); } } $file_data = Yaml::parseFile($filename_yaml); foreach ($file_data as $key => $value) Settings::set($key,$value); if(file_exists($filename_yaml) === TRUE) FileHelper::delete($filename_yaml); $result = [ 'path' => $name, 'reload' => true ]; $response = Response::make($result, 200); } catch (Exception $ex) { $response = Response::make($ex->getMessage(), 400); } return $response; } protected function loadAssets() { $this->addCss('css/fileupload.css', 'core'); $this->addJs('js/fileupload.js', [ 'build' => 'core', 'cache' => 'false' ]); } public function getExportFilePath() { return Url::to('backend/linkonoid/mrevisions/export'); } public function getSaveValue($value) { return FormField::NO_SAVE_DATA; } }
<?php return [ 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'authManager' =>[ 'class' => 'yii\rbac\DbManager', ], ], ];
<?php /* @gantry-admin/layouts/outline.html.twig */ class __TwigTemplate_e1dfbace643b6e2cb995f47ae02d3e1fa0c71539b1bd6ef93b9d13678293d14c extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 1 try { // line 2 $context["preset"] = $this->getAttribute($this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "outlines", array()), "layoutPreset", array(0 => (isset($context["name"]) ? $context["name"] : null)), "method"); } catch (\Exception $e) { if ($context['gantry']->debug()) throw $e; GANTRY_DEBUGGER && method_exists('Gantry\Debugger', 'addException') && \Gantry\Debugger::addException($e); $context['e'] = $e; // line 4 $context["preset"] = $this->getAttribute($this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "outlines", array()), "layoutPreset", array(0 => "default"), "method"); } // line 6 echo " <div id=\"outline-"; // line 7 echo twig_escape_filter($this->env, (isset($context["name"]) ? $context["name"] : null), "html", null, true); echo "\" class=\"page\"> <h4> "; // line 9 if (((isset($context["name"]) ? $context["name"] : null) == "default")) { // line 10 echo " <span>"; echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_BASE_OUTLINE"), "html", null, true); echo "</span> "; } else { // line 12 echo " "; if ($this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "authorize", array(0 => "outline.rename"), "method")) { // line 13 echo " <span data-g-config-href=\""; echo twig_escape_filter($this->env, $this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "route", array(0 => "configurations", 1 => (isset($context["name"]) ? $context["name"] : null), 2 => "rename"), "method"), "html", null, true); echo "\" data-g-config-method=\"post\" data-title-editable=\""; // line 14 echo twig_escape_filter($this->env, (isset($context["title"]) ? $context["title"] : null), "html", null, true); echo "\" class=\"title\" data-tip=\""; echo twig_escape_filter($this->env, (isset($context["title"]) ? $context["title"] : null), "html", null, true); echo "\" data-tip-place=\"top-right\"> "; // line 15 echo twig_escape_filter($this->env, (isset($context["title"]) ? $context["title"] : null), "html", null, true); echo " </span> <i class=\"fa fa-fw fa-pencil font-small\" aria-hidden=\"true\" tabindex=\"0\" aria-label=\""; // line 17 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_EDIT_TITLE", twig_escape_filter($this->env, (isset($context["title"]) ? $context["title"] : null))), "html", null, true); echo "\" data-title-edit=\"\"></i> "; } else { // line 19 echo " "; echo twig_escape_filter($this->env, (isset($context["title"]) ? $context["title"] : null), "html", null, true); echo " "; } // line 21 echo " "; } // line 22 echo " <span class=\"float-right font-small\">("; echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_ID_X", (isset($context["name"]) ? $context["name"] : null)), "html", null, true); echo ")</span> </h4> <div class=\"inner-params\"> <img src=\""; // line 25 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->urlFunc((($this->getAttribute((isset($context["preset"]) ? $context["preset"] : null), "image", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute((isset($context["preset"]) ? $context["preset"] : null), "image", array()), "gantry-admin://images/layouts/default.png")) : ("gantry-admin://images/layouts/default.png"))), "html", null, true); echo "\" /> </div> <div class=\"inner-params\"> <div class=\"center outline-actions\"> <a data-title=\""; // line 29 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_EDIT"), "html", null, true); echo "\" data-tip=\""; // line 30 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_EDIT"), "html", null, true); echo "\" role=\"button\" aria-label=\""; // line 32 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_EDIT_X", (isset($context["title"]) ? $context["title"] : null)), "html", null, true); echo "\" title=\""; // line 33 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_EDIT_X", (isset($context["title"]) ? $context["title"] : null)), "html", null, true); echo "\" data-g5-ajaxify=\"\" data-g5-ajaxify-target=\"[data-g5-content-wrapper]\" data-g5-ajaxify-params=\""; // line 36 echo twig_escape_filter($this->env, twig_jsonencode_filter(array("navbar" => true)), "html_attr"); echo "\" href=\""; // line 37 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "route", array(0 => "configurations", 1 => (isset($context["name"]) ? $context["name"] : null), 2 => "styles"), "method"), "html", null, true); echo "\" class=\"button button-primary\" > <i class=\"fa fa-fw fa-pencil\" aria-hidden=\"true\"></i> </a> "; // line 42 if (($this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "authorize", array(0 => "outline.create"), "method") && $this->getAttribute($this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "outlines", array()), "canDuplicate", array(0 => (isset($context["name"]) ? $context["name"] : null)), "method"))) { // line 43 echo " <a href=\""; echo twig_escape_filter($this->env, $this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "route", array(0 => "configurations", 1 => (isset($context["name"]) ? $context["name"] : null), 2 => "duplicate"), "method"), "html", null, true); echo "\" data-tip=\""; // line 44 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_DUPLICATE"), "html", null, true); echo "\" title=\""; // line 45 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_DUPLICATE_X", (isset($context["title"]) ? $context["title"] : null)), "html", null, true); echo "\" aria-label=\""; // line 46 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_DUPLICATE_X", (isset($context["title"]) ? $context["title"] : null)), "html", null, true); echo "\" data-g5-outline-duplicate class=\"button button-secondary\"> <i class=\"fa fa-fw fa-copy\" aria-hidden=\"true\"></i> </a> "; } // line 51 echo " "; if (((((isset($context["name"]) ? $context["name"] : null) != "default") && $this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "authorize", array(0 => "outline.delete"), "method")) && $this->getAttribute($this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "outlines", array()), "canDelete", array(0 => (isset($context["name"]) ? $context["name"] : null)), "method"))) { // line 52 echo " <button data-title=\""; echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_DELETE"), "html", null, true); echo "\" data-tip=\""; // line 53 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_DELETE"), "html", null, true); echo "\" title=\""; // line 54 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_DELETE_X", (isset($context["title"]) ? $context["title"] : null)), "html", null, true); echo "\" aria-label=\""; // line 55 echo twig_escape_filter($this->env, $this->env->getExtension('Gantry\Component\Twig\TwigExtension')->transFilter("GANTRY5_PLATFORM_DELETE_X", (isset($context["title"]) ? $context["title"] : null)), "html", null, true); echo "\" data-g-config=\"delete\" data-g-config-href=\""; // line 57 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "route", array(0 => "configurations", 1 => (isset($context["name"]) ? $context["name"] : null), 2 => "delete"), "method"), "html", null, true); echo "\" data-g-config-href-confirm=\""; // line 58 echo twig_escape_filter($this->env, $this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "route", array(0 => "configurations", 1 => (isset($context["name"]) ? $context["name"] : null), 2 => "delete/confirm"), "method"), "html", null, true); echo "\" data-g-config-method=\"POST\" class=\"button red\" > <i class=\"fa fa-fw fa-trash-o\" aria-hidden=\"true\"></i> </button> "; } // line 64 echo " </div> </div> </div> "; } public function getTemplateName() { return "@gantry-admin/layouts/outline.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 180 => 64, 171 => 58, 167 => 57, 162 => 55, 158 => 54, 154 => 53, 149 => 52, 146 => 51, 138 => 46, 134 => 45, 130 => 44, 125 => 43, 123 => 42, 115 => 37, 111 => 36, 105 => 33, 101 => 32, 96 => 30, 92 => 29, 85 => 25, 78 => 22, 75 => 21, 69 => 19, 64 => 17, 59 => 15, 53 => 14, 48 => 13, 45 => 12, 39 => 10, 37 => 9, 32 => 7, 29 => 6, 26 => 4, 20 => 2, 19 => 1,); } /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ public function getSource() { @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); return $this->getSourceContext()->getCode(); } public function getSourceContext() { return new Twig_Source("", "@gantry-admin/layouts/outline.html.twig", "/Users/emil/Documents/code/ratello-landing/user/plugins/gantry5/admin/templates/layouts/outline.html.twig"); } }
<?php namespace App\Http\Controllers; use App\Thread; class LockedThreadsController extends Controller { /** * Lock the thread. * * @param Thread $thread * @return Response */ public function store(Thread $thread) { $thread->locked = true; $thread->save(); return response('Successful', 200); } /** * Unlock the thread. * * @param Thread $thread * @return Response */ public function destroy(Thread $thread) { $thread->locked = false; $thread->save(); return response('Successful', 200); } }
<?php namespace App; trait RecordsActivity { protected static function bootRecordsActivity() { if (auth()->guest()) return; foreach (static::getActivitiesToRecord() as $event) { static::$event(function ($model) use ($event) { $model->recordActivity($event); }); } static::deleting(function ($model){ $model->activity()->delete(); }); } protected static function getActivitiesToRecord(){ return ['created']; } public function recordActivity($event) { $this->activity()->create([ 'user_id' => auth()->id(), 'type' => $this->getActivityType($event), ]); } public function activity() { return $this->morphMany('App\Activity','subject'); } /** * @param $event * @return string * @throws \ReflectionException */ protected function getActivityType($event): string { $type = strtolower((new \ReflectionClass($this))->getShortName()); return "{$event}_$type"; } }
<?php if($_POST['accion'] == 'crear'){ require_once('../funciones/bd.php'); $nombre = filter_var($_POST['nombre'], FILTER_SANITIZE_STRING); $apellido = filter_var($_POST['apellido'], FILTER_SANITIZE_STRING); $telefono = filter_var($_POST['telefono'], FILTER_SANITIZE_STRING); $cedula = filter_var($_POST['cedula'], FILTER_SANITIZE_NUMBER_INT); $email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL); $address = filter_var($_POST['address'], FILTER_SANITIZE_STRING); $mtotal = $_POST['mtotal']; $msubtotal = $_POST['msubtotal']; $mtaxes = $_POST['mtaxes']; $articulos = $_POST['articulos']; $caracteres = array("[", '"', "]",","); $indices = str_replace($caracteres, "", $articulos); $articulos = str_split($indices); // echo sizeof($articulos); try { $stmt = $conn->prepare("INSERT INTO cliente (id_cliente, nombre, apellido, telefono, email, direccion) VALUES (?, ?, ?, ?, ?, ?)"); $stmt->bind_param("isssss", $cedula, $nombre, $apellido, $telefono, $email, $address); $stmt->execute(); if($stmt->affected_rows == 1) { $stmt->close(); $stmt = $conn->prepare("INSERT INTO factura (subtotal, taxes, total) VALUES (?, ?, ?)"); $stmt->bind_param("ddd", $msubtotal, $mtaxes, $mtotal); $stmt->execute(); if($stmt->affected_rows == 1) { $result = $conn->query("SELECT max(id_factura) as id FROM factura"); $row = mysqli_fetch_assoc($result); $id_factura = utf8_encode($row["id"]); // echo $id_factura; $stmt = $conn->prepare("INSERT INTO factura_cliente (id_f, id_c) VALUES (?, ?)"); $stmt->bind_param("ii", $id_factura, $cedula); $stmt->execute(); if($stmt->affected_rows == 1) { for($i = 0; $i < sizeof($articulos);$i++){ $indice = intval($articulos[$i]); $stmt = $conn->prepare("INSERT INTO factura_tiene_articulos (id_f, id_a) VALUES (?, ?)"); $stmt->bind_param("ii", $id_factura, $indice); $stmt->execute(); } $respuesta = array( 'respuesta' => 'correcto', 'datos' => array( 'cedula' => $cedula, 'nombre' => $nombre, 'apellido' => $apellido, 'telefono' => $telefono, 'email' => $email, 'address' => $address, 'Subtotal' => $msubtotal, 'taxes' => $mtaxes, 'total' => $mtotal, 'id_factura' => $id_factura ) ); } } } $stmt->close(); $conn->close(); } catch(Exception $e) { $respuesta = array( 'error' => $e->getMessage() ); } echo json_encode($respuesta); }
<?php $this->breadcrumbs=array( 'Domains'=>array('index'), 'Manage', ); $mailvisible = false; //Yii::app()->request->getQuery this return the $_GET. Yii::app()->request->getPost this return the $_POST if (Yii::app()->request->getParam("touched") == true) { if ($_REQUEST["Domain"]["touched_status"] == 6 || !empty($_REQUEST["Domain"]["domain"]) || !empty($_REQUEST["Domain"]["id"])) { $dataProvider = $model->search(); } else { $dataProvider = $model->touched()->search(); } $mailvisible = true; $h1title = "Outreach List"; } else { $dataProvider = $model->search(); $h1title = "Manage Domains"; } $types = Types::model()->actived()->bytype(array("site","outreach","category","technorati","awis"))->findAll(); $gtps = CHtml::listData($types, 'refid', 'typename', 'type'); $stypes = $gtps['site'] ? $gtps['site'] : array(); $otypes = $gtps['outreach'] ? $gtps['outreach'] : array(); $categories = $gtps['category'] ? $gtps['category'] : array(); $technoraties = $gtps['technorati'] ? $gtps['technorati'] : array(); $awises = $gtps['awis'] ? $gtps['awis'] : array(); //$stypestr = CVarDumper::DumpAsString($stypes); $stypestr = Utils::array2String(array("" => '[Site Type]') + $stypes); $otypestr = Utils::array2String(array("" => '[Outreach Type]') + $otypes); $categorystr = Utils::array2String(array("" => '[Category]') + $categories); $technoratistr = Utils::array2String(array("" => '[Technorati Category]') + $technoraties); $awisstr = Utils::array2String(array("" => '[AWIS Category]') + $awises); $touchedstatus = Domain::$status; $statusstr = Utils::array2String($touchedstatus); //echo $statusstr; $cs=Yii::app()->clientScript; $cs->registerCoreScript( 'jquery.ui' ); $cs->registerScriptFile(Yii::app()->baseUrl . '/js/xheditor/xheditor-1.1.12-en.min.js', CClientScript::POS_HEAD); $cs->registerScript('search', " $('.search-button').click(function(){ $('.search-form').toggle(); return false; }); $('.search-form form').submit(function(){ $.fn.yiiGridView.update('domain-grid', { data: $(this).serialize() }); return false; }); "); function fmtCategory($cats) { if ($cats) { $_tmps = explode("|", $cats); array_pop($_tmps); array_shift($_tmps); return $cats = $_tmps; } else { return array(); } } function fmtSemrush($semor) { if ($semor > 0 ) { echo "Yes"; } elseif ($semor < 0) { echo "No"; } else { echo ""; } } $isadmin = 0; $roles = Yii::app()->authManager->getRoles(Yii::app()->user->id); if(isset($roles['Admin'])){ $isadmin = 1;//true } $semrushes = array( "0" => "Pending", "1" => "Yes", "-1" => "No", ); //http://www.internetworldstats.com/list2.htm //http://www.paladinsoftware.com/Generic/countries.htm $countries = array("AF"=>"Afghanistan", "AL"=>"Albania", "DZ"=>"Algeria", "AS"=>"American Samoa", "AD"=>"Andorra", "AO"=>"Angola", "AI"=>"Anguilla", "AQ"=>"Antarctica", "AG"=>"Antigua and Barbuda", "AR"=>"Argentina", "AM"=>"Armenia", "AW"=>"Aruba", "AU"=>"Australia", "AT"=>"Austria", "AZ"=>"Azerbaijan", "BS"=>"Bahamas", "BH"=>"Bahrain", "BD"=>"Bangladesh", "BB"=>"Barbados", "BY"=>"Belarus", "BE"=>"Belgium", "BZ"=>"Belize", "BJ"=>"Benin", "BM"=>"Bermuda", "BT"=>"Bhutan", "BO"=>"Bolivia", "BA"=>"Bosnia and Herzegovina", "BW"=>"Botswana", "BV"=>"Bouvet Island", "BR"=>"Brazil", "IO"=>"British Indian Ocean Territory", "BN"=>"Brunei Darussalam", "BG"=>"Bulgaria", "BF"=>"Burkina Faso", "BI"=>"Burundi", "KH"=>"Cambodia", "CM"=>"Cameroon", "CA"=>"Canada", "CV"=>"Cape Verde", "KY"=>"Cayman Island CF Central African Republic", "TD"=>"Chad", "CL"=>"Chile", "CN"=>"China", "CX"=>"Christmas Island", "CC"=>"Cocos (Keeling Islands)", "CO"=>"Colombia", "KM"=>"Comoros", "CG"=>"Congo", "CK"=>"Cook Islands", "CR"=>"Costa Rica", "CI"=>"Cote D'Ivoire (Ivory Coast)", "HR"=>"Croatia (Hrvatska)", "CU"=>"Cuba", "CY"=>"Cyprus", "CZ"=>"Czech Republic", "DK"=>"Denmark", "DJ"=>"Djibouti", "DM"=>"Dominica", "DO"=>"Dominican Republic", "TP"=>"East Timor", "EC"=>"Ecuador", "EG"=>"Egypt", "SV"=>"El Salvador", "GQ"=>"Equatorial Guinea", "ER"=>"Eritrea", "EE"=>"Estonia", "ET"=>"Ethiopia", "FK"=>"Falkland Islands (Malvinas)", "FO"=>"Faroe Islands", "FJ"=>"Fiji", "FI"=>"Finland", "FR"=>"France", "FX"=>"France, Metropolitan", "GF"=>"French Guiana", "PF"=>"French Polynesia", "TF"=>"French Southern Territories", "GA"=>"Gabon", "GM"=>"Gambia", "GE"=>"Georgia", "DE"=>"Germany", "GH"=>"Ghana", "GI"=>"Gibraltar", "GR"=>"Greece", "GL"=>"Greenland", "GD"=>"Grenada", "GP"=>"Guadeloupe", "GU"=>"Guam", "GT"=>"Guatemala", "GN"=>"Guinea", "GW"=>"Guinea-Bissau", "GY"=>"Guyana", "HT"=>"Haiti", "HM"=>"Heard and McDonald Islands", "HN"=>"Honduras", "HK"=>"Hong Kong", "HU"=>"Hungary", "IS"=>"Iceland", "IN"=>"India", "ID"=>"Indonesia", "IR"=>"Iran", "IQ"=>"Iraq", "IE"=>"Ireland", "IL"=>"Israel", "IT"=>"Italy", "JM"=>"Jamaica", "JP"=>"Japan", "JO"=>"Jordan", "KZ"=>"Kazakhstan", "KE"=>"Kenya", "KI"=>"Kiribati", "KP"=>"Korea (North)", "KR"=>"Korea (South)", "KW"=>"Kuwait", "KG"=>"Kyrgyzstan", "LA"=>"Laos", "LV"=>"Latvia", "LB"=>"Lebanon", "LS"=>"Lesotho", "LR"=>"Liberia", "LY"=>"Libya", "LI"=>"Liechtenstein", "LT"=>"Lithuania", "LU"=>"Luxembourg", "MO"=>"Macau", "MK"=>"Macedonia", "MG"=>"Madagascar", "MW"=>"Malawi", "MY"=>"Malaysia", "MV"=>"Maldives", "ML"=>"Mali", "MT"=>"Malta", "MH"=>"Marshall Islands", "MQ"=>"Martinique", "MR"=>"Mauritania", "MU"=>"Mauritius", "YT"=>"Mayotte", "MX"=>"Mexico", "FM"=>"Micronesia", "MD"=>"Moldova", "MC"=>"Monaco", "MN"=>"Mongolia", "MS"=>"Montserrat", "MA"=>"Morocco", "MZ"=>"Mozambique", "MM"=>"Myanmar", "NA"=>"Namibia", "NR"=>"Nauru", "NP"=>"Nepal", "NL"=>"Netherlands", "AN"=>"Netherlands Antilles", "NC"=>"New Caledonia", "NZ"=>"New Zealand", "NI"=>"Nicaragua", "NE"=>"Niger", "NG"=>"Nigeria", "NU"=>"Niue", "NF"=>"Norfolk Island", "MP"=>"Northern Mariana Islands", "NO"=>"Norway", "OM"=>"Oman", "PK"=>"Pakistan", "PW"=>"Palau", "PA"=>"Panama", "PG"=>"Papua New Guinea", "PY"=>"Paraguay", "PE"=>"Peru", "PH"=>"Philippines", "PN"=>"Pitcairn", "PL"=>"Poland", "PT"=>"Portugal", "PR"=>"Puerto Rico", "QA"=>"Qatar", "RE"=>"Reunion", "RO"=>"Romania", "RU"=>"Russian Federation", "RW"=>"Rwanda", "KN"=>"Saint Kitts and Nevis", "LC"=>"Saint Lucia", "VC"=>"Saint Vincent and The Grenadines", "WS"=>"Samoa", "SM"=>"San Marino", "ST"=>"Sao Tome and Principe", "SA"=>"Saudi Arabia", "SN"=>"Senegal", "SC"=>"Seychelles", "SL"=>"Sierra Leone", "SG"=>"Singapore", "SK"=>"Slovak Republic", "SI"=>"Slovenia", "SB"=>"Solomon Islands", "SO"=>"Somalia", "ZA"=>"South Africa", "GS"=>"S. Georgia and S. Sandwich Isls.", "ES"=>"Spain", "LK"=>"Sri Lanka", "SH"=>"St. Helena", "PM"=>"St. Pierre and Miquelon", "SD"=>"Sudan", "SR"=>"Suriname", "SJ"=>"Svalbard and Jan Mayen Islands", "SZ"=>"Swaziland", "SE"=>"Sweden", "CH"=>"Switzerland", "SY"=>"Syria", "TW"=>"Taiwan", "TJ"=>"Tajikistan", "TZ"=>"Tanzania", "TH"=>"Thailand", "TG"=>"Togo", "TK"=>"Tokelau", "TO"=>"Tonga", "TT"=>"Trinidad and Tobago", "TN"=>"Tunisia", "TR"=>"Turkey", "TM"=>"Turkmenistan", "TC"=>"Turks and Caicos Islands", "TV"=>"Tuvalu", "UG"=>"Uganda", "UA"=>"Ukraine", "AE"=>"United Arab Emirates", "UK"=>"United Kingdom", "US"=>"United States", "UM"=>"US Minor Outlying Islands", "UY"=>"Uruguay", "UZ"=>"Uzbekistan", "VU"=>"Vanuatu", "VA"=>"Vatican City State (Holy See)", "VE"=>"Venezuela", "VN"=>"Viet Nam", "VG"=>"Virgin Islands (British)", "VI"=>"Virgin Islands (US)", "WF"=>"Wallis and Futuna Islands", "EH"=>"Western Sahara", "YE"=>"Yemen", "YU"=>"Yugoslavia", "ZR"=>"Zaire", "ZM"=>"Zambia", "ZW"=>"Zimbabwe",); ?> <div class="form"> <div style="float:left;width:630px;"><h1><?php echo $h1title;?></h1></div> <div id="processing" style="float:left;width:220px;">&nbsp;</div> <?php if ($mailvisible) { /* ?> <div class="row buttons"> <?php echo CHtml::ajaxSubmitButton("Send Queued Email", Yii::app()->createUrl('email/send'), array('type'=>'POST', 'data'=>'actiontype=sendall', 'dataType'=>'json', 'success' => 'function(data){$("#processing").html(data.message)}')); ?> </div> <?php */ }?> <div class="clear"></div> </div> <p> You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. </p> <!-- search-form --> <?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search',array( 'model'=>$model, 'touchedstatus'=>$touchedstatus, 'stypes'=>$stypes, 'otypes'=>$otypes, 'categories'=>$categories, 'countries'=>$countries, 'semrushes'=>$semrushes, )); ?> </div><!-- search-form --> <div style="clear:both"></div> <?php $this->widget('application.extensions.lkgrid.LinkmeGridView', array( 'id'=>'domain-grid', 'dataProvider'=>$dataProvider, 'filter'=>$model, 'selectableRows' => '2', 'columns'=>array( 'id', /*array( 'id'=>'ids', 'class'=>'CCheckBoxColumn', ),*/ /*'domain',*/ array( 'name' => 'domain', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->domain),"http://www.".$data->domain, array("target"=>"_blank"))', ), //'stype', array( 'name' => 'stype', 'type' => 'raw', //'value' => 'CHtml::dropDownList("stype", $data->stype, '.$stypestr.', array("onchange"=>"updateType(this);"))', 'value' => 'CHtml::dropDownList("stype", $data->stype, '.$stypestr.')', 'filter' => $stypes, ), /* array( 'name' => 'googlepr', 'type' => 'raw', //'value' => 'CHtml::textField("googlepr[]", $data->googlepr)', 'value' => '$data->googlepr', 'htmlOptions'=>array('width'=>'30px'), ), */ array( 'name' => 'alexarank', 'type' => 'raw', //'value' => 'CHtml::textField("alexarank[]", number_format($data->alexarank))', 'value' => '$data->alexarank', 'value'=>'number_format($data->alexarank)', ), array( 'header' => 'Moz Rank', //##'name' => 'rsummary.mozrank',//we can use this one also 'name' => 'mozrank', 'type' => 'raw', //'value' => 'CHtml::textField("mozrank[]", $data->rsummary->mozrank)', 'value' => 'round($data->rsummary->mozrank)', 'visible' => isVisible('mozrank', $dparr), ), /* array( 'name' => 'rsummary.mozauthority', 'type' => 'raw', //'value' => 'CHtml::textField("mozauthority[]", $data->rsummary->mozauthority)', 'value' => 'round($data->rsummary->mozauthority)', 'visible' => isVisible('mozauthority', $dparr), ), */ array( 'name' => 'semrushor', 'header' => "SEM", 'type' => 'raw', 'value' => 'fmtSemrush($data->rsummary->semrushor)', //'value' => 'round($data->rsummary->semrushor)', 'visible' => isVisible('semrushor', $dparr), 'filter' => $semrushes, ), //'googlepr', //'otype', /* array( 'name' => 'otype', 'type' => 'raw', //'value' => 'CHtml::dropDownList("otype[]", $data->otype, '.$otypestr.', array("onchange"=>"updateType(this);"))', 'value' => 'CHtml::dropDownList("otype", $data->otype, '.$otypestr.')', 'filter' => $otypes, ), */ array( 'name' => 'category', 'type' => 'raw', 'value' => 'CHtml::dropDownList("category", fmtCategory($data->category), '.$categorystr.')', 'filter' => $categories, ), 'host_country', /* array( 'name' => 'host_country', 'type' => 'raw', 'filter' => $countries, ), 'tld', 'onlinesince', 'linkingdomains', 'inboundlinks', 'indexedurls', 'alexarank', 'ip', 'subnet', 'title', 'owner', 'email', 'telephone', 'country', 'state', 'city', 'zip', 'street', 'touched', 'touched_by', 'created', 'created_by', 'modified_by', */ //'touched_by', array( 'name' => 'touched_by', 'type' => 'raw', //'value' => 'CHtml::link(CHtml::encode($data->touchedby->username), array("user/view", "id" =>$data->touched_by))', 'value' => 'CHtml::encode($data->touchedby->username)', 'filter' => CHtml::listData(User::model()->actived()->findAll(),'id','username'), ), array( 'name' => 'touched_status', 'type' => 'raw', //'value' => 'CHtml::encode(Utils::getValue(' . $statusstr . ', $data->touched_status))', 'value' => 'CHtml::dropDownList("touched_status", $data->touched_status, '.$statusstr.')', 'filter' => $touchedstatus, ), //'touched_status', 'modified', array( 'class'=>'CButtonColumn', 'template'=>'{email} {note} {view} {update}', 'buttons' => array( 'email' => array( 'label' => 'Mail To', 'imageUrl' => Yii::app()->theme->baseUrl.'/css/gridview/email.png', 'visible' => "$mailvisible", 'url' => 'Yii::app()->createUrl("domain/view", array("id"=>$data->id))', 'click' => "function(){ addMail(this); return false; }", ), 'note' => array( 'label' => 'Add Notes', 'imageUrl' => Yii::app()->theme->baseUrl.'/css/gridview/note.png', 'url' => 'Yii::app()->createUrl("domain/view", array("id"=>$data->id))', 'options' => array('id'=>$this->evaluateExpression('$data->id', array('data'=>$data))), 'click' => "function(){ addNote(this); return false; }", ), 'update' => array( 'visible' => "$isadmin", ), ), 'htmlOptions'=>array('nowrap'=>'nowrap'), ), ), )); ?> <script type="text/javascript"> <?php $tplmodel = new Template; $tplm = $tplmodel->findByAttributes(array("created_by"=>Yii::app()->user->id)); if ($tplm) { echo "var defaulttpl = ".$tplm->id.";"; } else { echo "var defaulttpl = 0;"; } ?> </script> <div id="hiddenContainer"> <?php $this->renderPartial('_mail',array( 'model'=>$model, 'touchedstatus'=>$touchedstatus, 'stypes'=>$stypes, 'otypes'=>$otypes, 'tplm'=>$tplm, )); ?> <div id="noteboxdiv" style="display:none;"> </div> </div> <script type="text/javascript"> $(document).ready(function() { $('#processing').bind("ajaxSend", function() { $(this).html("&nbsp;"); $(this).css('background-image', 'url(' + "<?php echo Yii::app()->theme->baseUrl; ?>" + '/images/loading.gif)'); //$(this).show(); }).bind("ajaxComplete", function() { $(this).css('background-image', ''); $(this).css('color', 'red'); //$(this).hide(); }); $.fn.yiiGridView.defaults.afterAjaxUpdate = function(){ //jquery onchange will firing event twice in ie7, So we need hack it as following. $("select[name='stype'],select[name='otype'],select[name='touched_status'],select[name='category']").each(function() { //way 1 //$(this).change(updateType); //$(this).unbind('click').change(updateType); //way 2 $(this).unbind('click').change(function(){ var gvid = $(this).parent().parent().closest('.grid-view').attr('id'); var gvoffset = $(this).parent().parent().prevAll().length; var currenttrid = $.fn.yiiGridView.getKey(gvid, gvoffset); var thistd = $(this); $.ajax({ 'type': 'GET', 'dataType': 'json', 'url': "<?php echo CHtml::normalizeUrl(array('/domain/setattr'));?>", 'data': 'id='+currenttrid+"&attrname="+$(this).attr('name')+"&attrvalue="+this.value, 'success':function(data){ //donothing for now; if (data.success){ $(thistd).css("background-color","yellow"); if (data.operation && data.operation.obj == 'touched_status') { $(thistd).parent().prev().html(data.operation.operator); $(thistd).parent().next().html(data.operation.modified); } } else { $(thistd).css("background-color","red"); alert(data.msg); } }, 'complete':function(XHR,TS){XHR = null;} }); }); /* //bind one times handler in the object. $(this).one( 'change', function() {} ) */ }); $("input[name^='googlepr'],input[name^='mozrank'],input[name^='alexarank']").each(function() { if ($(this).attr('name') == "googlepr[]"){ $(this).css({width:"30px"}); } else { $(this).css({width:"60px"}); } $(this).unbind('blur').blur(function(){ var gvid = $(this).parent().parent().closest('.grid-view').attr('id'); var gvoffset = $(this).parent().parent().prevAll().length; var currenttrid = $.fn.yiiGridView.getKey(gvid, gvoffset); var thistd = $(this); if (currenttrid) { $.ajax({ 'type': 'GET', 'dataType': 'json', 'url': "<?php echo CHtml::normalizeUrl(array('/domain/setattr'));?>", 'data': 'id='+currenttrid+"&attrname="+$(this).attr('name')+"&attrvalue="+this.value, 'success':function(data){ //donothing for now; if (data.success){ $(thistd).css("background-color","yellow"); } else { $(thistd).css("background-color","red"); alert(data.msg); } }, 'complete':function(XHR,TS){XHR = null;} }); } }); }); //$("input[name^='email'],input[name^='primary_email']").each(function() { $("#email,#primary_email").each(function() { $(this).unbind('blur').blur(function(){ var currenttrid = $("#mail_domain_id").val(); //alert(currenttrid); //alert($(this).attr('name')); var thistd = $(this); if (currenttrid) { $.ajax({ 'type': 'GET', 'dataType': 'json', 'url': "<?php echo CHtml::normalizeUrl(array('/domain/setattr'));?>", 'data': 'id='+currenttrid+"&attrname="+$(this).attr('name')+"&attrvalue="+this.value, 'success':function(data){ //donothing for now; if (data.success){ $(thistd).css("background-color","yellow"); $(thistd).animate({backgroundColor: 'white'}, 8000); } else { $(thistd).css("background-color","red"); $(thistd).animate({backgroundColor: 'white'}, 8000); alert(data.msg); } }, 'complete':function(XHR,TS){XHR = null;} }); } }); }); //issue: when the user click the pager(i mean change pager number), then the mailbox & notebox may not showing again. //cause we append the mailbox & notebox into the grid already when we click the addmail or addnote button, //so when we jump to another outreach page number, the mailbox & notebox may be removed due to the grid overwrited. $("div.pager > ul > li a").each(function(){ $(this).click(function() { $("#mailboxdiv").hide(); $("#noteboxdiv").hide(); $("#mailboxdiv").appendTo($("#hiddenContainer")); $("#noteboxdiv").appendTo($("#hiddenContainer")); }); return true; }); $("table.items #pageSize").change(function(){ $("#mailboxdiv").hide(); $("#noteboxdiv").hide(); $("#mailboxdiv").appendTo($("#hiddenContainer")); $("#noteboxdiv").appendTo($("#hiddenContainer")); }); $("table.items thead tr.filters input, table.items thead tr.filters select").each(function(){ $(this).change(function() { $("#mailboxdiv").hide(); $("#noteboxdiv").hide(); $("#mailboxdiv").appendTo($("#hiddenContainer")); $("#noteboxdiv").appendTo($("#hiddenContainer")); }); return true; }); var _ids = []; $('#domain-grid > div.keys > span').each(function(i){ _ids[i] = $(this).html(); }); $("#domain-grid > table.items > tbody > tr").each(function(i){ $(this).attr("id", "etr"+_ids[i]);//reset table.tr.id }); $.ajax({ 'type': 'POST', 'dataType': 'json', 'url': "<?php echo Yii::app()->createUrl('/note/icon');?>", 'data': {'ids[]': _ids}, 'success':function(data){ //alert(data.msg); if (data.success){ if (data.ids){ $.each(data.ids, function (v){ //alert(v); $("#etr" +v+" > td:last > a.note > img").attr("src", "<?php echo Yii::app()->theme->baseUrl?>/css/gridview/notes.png"); }); } } }, 'complete':function(XHR,TS){XHR = null;} }); } $.fn.yiiGridView.defaults.afterAjaxUpdate(); }); //jquery onchange will firing event twice in ie7, So we couldn't use this way. function updateType(){ //alert(this.value); var gvid = $(this).parent().parent().closest('.grid-view').attr('id'); var gvoffset = $(this).parent().parent().prevAll().length; var currenttrid = $.fn.yiiGridView.getKey(gvid, gvoffset); $.ajax({ 'type': 'GET', 'dataType': 'json', //'url': "<?php echo CHtml::normalizeUrl(array('/domain/setattr'));?>", 'url': "<?php echo Yii::app()->createUrl('/domain/setattr');?>", 'data': 'id='+currenttrid+"&attrname="+$(this).attr('name')+"&attrvalue="+this.value, 'success':function(data){ //donothing for now; alert(data.msg); }, 'complete':function(XHR,TS){XHR = null;} }); return false; } var lastclickid = 0; function addMail(t) { var gvid = $(t).parent().parent().closest('.grid-view').attr('id'); var gvoffset = $(t).parent().parent().prevAll().length; var currenttrid = $.fn.yiiGridView.getKey(gvid, gvoffset); var currentdomain = $(t).parent().parent().children("td:eq(1)").text(); //$("#currentdomain").text(currentdomain); //alert(currentdomain); var lc = top.location; //alert(currentdomain); $("#noteboxdiv").hide(); if (lastclickid == currenttrid || lastclickid == 0) { $("#mailboxdiv").toggle(); } else { $("#mailboxdiv").show(); } //$("#mailboxdiv:visible"); if ($("#mailboxdiv").is(":visible")) { $("#ifr_webpreview").attr({'src': 'http://www.'+currentdomain}); $("#mail_domain_id").val(currenttrid); $("#lnabout").attr({'href': 'http://www.'+currentdomain}); $("#lnwhois").attr({'href': 'http://who.is/whois/'+currentdomain}); //alert($("#mailto").val()); $("#mailto").val(""); $.ajax({ 'type': 'GET', 'dataType': 'json', 'url': "<?php echo Yii::app()->createUrl('/domain/view');?>", 'data': 'id='+currenttrid+"&ajax=true", 'success':function(data){ var rtn = ""; $.each(data, function(lb, v){ if ($.inArray(lb, ["domain","googlepr","creation","linkingdomains", "inboundlinks","indexedurls","alexarank","title","owner", "email","primary_email","telephone","country","state","city","zip","street"]) >= 0){ //rtn += lb + ": " + v + "<br />"; if (lb == "primary_email") { lb = "Primary Email"; $("#primary_email").val(v); } else if (lb == "email") { $("#email").val(v); } rtn += lb + ": " + v + "<br />"; } }); //alert(rtn); $("#domaininfo").html(rtn); //alert(data.id); //$("#mailto").val(data.email); }, 'complete':function(XHR,TS){XHR = null;} }); if ($("#"+currenttrid+"_dtr").length>0) { /* here you couldn't use the find("td"), coz it will search all of the posterity td elements, The .find() and .children() methods are similar, but .children() only travels a single level down the DOM tree. */ $("#mailboxdiv").appendTo($("#"+currenttrid+"_dtr").children("td")); } else { var vartr = $('<tr><td colspan="11"></td></tr>').attr({ 'id': currenttrid+"_dtr", 'class':"bltr"}); //$("#mailboxdiv").appendTo(vartr.find("td")); $("#mailboxdiv").appendTo(vartr.children("td")); $(t).parent().parent().after(vartr); $('#'+gvid+' > div.keys > span:eq('+gvoffset+')').after("<span>"+currenttrid+"_dtr</span>"); } //Uninstall the XHeditor first, Then reload(re-install) the WYSIWYG editor //these steps will help us keep the focus on the editor always, and can make the WYSIWYG editor always avaliable $('#message').xheditor(false); $('#message').xheditor({tools:'mfull',width:460,height:380}).focus(); /* * Set default template */ if (defaulttpl > 0) { /* if ($("#template_id").val() != defaulttpl){ $("#template_id").val(defaulttpl); } */ $("#template_id").val(defaulttpl); $.ajax({ 'type': 'GET', 'dataType': 'json', 'url': "<?php echo Yii::app()->createUrl('template/replacement');?>", 'data': 'id='+defaulttpl, 'success':function(data){ $("#subject").val(data.subject);$("#message").val(data.content); }, 'complete':function(XHR,TS){XHR = null;} }); } } else {} //top.location = lc; lastclickid = currenttrid; } function addNote(t) { var gvid = $(t).parent().parent().closest('.grid-view').attr('id'); var gvoffset = $(t).parent().parent().prevAll().length; var currenttrid = $.fn.yiiGridView.getKey(gvid, gvoffset); var currentdomain = $(t).parent().parent().children("td:eq(1)").text(); $("#mailboxdiv").hide(); if (lastclickid == currenttrid || lastclickid == 0) { $("#noteboxdiv").toggle(); } else { $("#noteboxdiv").show(); } if ($("#noteboxdiv").is(":visible")) { $.ajax({ 'type': 'GET', //'dataType': 'json', 'dataType': 'html', 'url': "<?php echo Yii::app()->createUrl('/domain/note');?>", 'data': 'domain_id='+currenttrid+"&ajax=true", 'success':function(data){ $("#noteboxdiv").html(data); }, 'complete':function(XHR,TS){XHR = null;} }); if ($("#"+currenttrid+"_dtr").length>0) { /* here you couldn't use the find("td"), coz it will search all of the posterity td elements, The .find() and .children() methods are similar, but .children() only travels a single level down the DOM tree. */ $("#noteboxdiv").appendTo($("#"+currenttrid+"_dtr").children("td")); } else { var vartr = $('<tr><td colspan="11"></td></tr>').attr({ 'id': currenttrid+"_dtr", 'class':"bltr"}); //$("#noteboxdiv").appendTo(vartr.find("td")); $("#noteboxdiv").appendTo(vartr.children("td")); $(t).parent().parent().after(vartr); $('#'+gvid+' > div.keys > span:eq('+gvoffset+')').after("<span>"+currenttrid+"_dtr</span>"); } } else {} lastclickid = currenttrid; } //$(window).bind('hashchange', function() { // alert("hello"); //}); //window.frames[0].open = function (e){return null;} //window.frames[0].location.href = "http://www.angelfire.lycos.com/"; </script> <style type="text/css"> .grid-view table.items tr.bltr td { height:100%; } </style>
<?php namespace Tests\CMEN\GoogleChartsBundle\GoogleCharts\Options\ColumnChart; use CMEN\GoogleChartsBundle\GoogleCharts\Options\ColumnChart\ColumnChartOptions; /** * @author Christophe Meneses */ class ColumnChartOptionsTest extends \PHPUnit_Framework_TestCase { public function testNumberOptions() { $columnChartOptions = new ColumnChartOptions(); $this->assertCount(30, (array) $columnChartOptions); } }
<?php /** * Elgg river. * Activity stream functions. */ /** * Adds an item to the river. * * @tip Read the item like "Lisa (subject) posted (action) * a comment (object) on John's blog (target)". * * @param array $options Array in format: * * @option string $view The view that will handle the river item * @option string $action_type An arbitrary string to define the action (eg 'comment', 'create') * @option int $subject_guid The GUID of the entity doing the action (default: current logged in user guid) * @option int $object_guid The GUID of the entity being acted upon * @option int $target_guid The GUID of the the object entity's container * @option int $posted The UNIX epoch timestamp of the river item (default: now) * @option int $annotation_id The annotation ID associated with this river entry * @option bool $return_item set to true to return the ElggRiverItem created * * @return int|ElggRiverItem|bool River ID/item or false on failure * @since 1.9 */ function elgg_create_river_item(array $options = []) { $view = elgg_extract('view', $options, ''); // use default viewtype for when called from web services api if (!empty($view) && !elgg_view_exists($view, 'default')) { return false; } $action_type = elgg_extract('action_type', $options); if (empty($action_type)) { return false; } $subject_guid = elgg_extract('subject_guid', $options, elgg_get_logged_in_user_guid()); if (!(get_entity($subject_guid) instanceof ElggEntity)) { return false; } $object_guid = elgg_extract('object_guid', $options, 0); if (!(get_entity($object_guid) instanceof ElggEntity)) { return false; } $target_guid = elgg_extract('target_guid', $options, 0); if ($target_guid) { // target_guid is not a required parameter so check // it only if it is included in the parameters if (!(get_entity($target_guid) instanceof ElggEntity)) { return false; } } $posted = elgg_extract('posted', $options, time()); $annotation_id = elgg_extract('annotation_id', $options, 0); if ($annotation_id) { if (!elgg_get_annotation_from_id($annotation_id)) { return false; } } $return_item = elgg_extract('return_item', $options, false); $values = [ 'action_type' => $action_type, 'view' => $view, 'subject_guid' => $subject_guid, 'object_guid' => $object_guid, 'target_guid' => $target_guid, 'annotation_id' => $annotation_id, 'posted' => $posted, ]; $col_types = [ 'action_type' => ELGG_VALUE_STRING, 'view' => ELGG_VALUE_STRING, 'subject_guid' => ELGG_VALUE_INTEGER, 'object_guid' => ELGG_VALUE_INTEGER, 'target_guid' => ELGG_VALUE_INTEGER, 'annotation_id' => ELGG_VALUE_INTEGER, 'posted' => ELGG_VALUE_INTEGER, ]; // return false to stop insert $values = elgg_trigger_plugin_hook('creating', 'river', null, $values); if ($values == false) { // inserting did not fail - it was just prevented return true; } $qb = \Elgg\Database\Insert::intoTable('river'); $query_params = []; foreach ($values as $name => $value) { $query_params[$name] = $qb->param($value, $col_types[$name]); } $qb->values($query_params); $id = _elgg_services()->db->insertData($qb); if (!$id) { return false; } if (!$return_item) { return $id; } $item = elgg_call(ELGG_IGNORE_ACCESS, function () use ($id) { return elgg_get_river_item_from_id($id); }); if (!$item) { return false; } elgg_trigger_event('created', 'river', $item); return $item; } /** * Get river items * * Supports passing the following options * ids => INT|ARR River item id(s) * subject_guids => INT|ARR Subject guid(s) * object_guids => INT|ARR Object guid(s) * target_guids => INT|ARR Target guid(s) * action_types => STR|ARR The river action type(s) identifier * posted_time_lower => INT The lower bound on the time posted * posted_time_upper => INT The upper bound on the time posted * * Additionally accepts all "annotation_*" options supported by {@link elgg_get_entities()} * annotation_ids => INT|ARR The identifier of the annotation(s) * * types => STR|ARR Entity type string(s) * subtypes => STR|ARR Entity subtype string(s) * type_subtype_pairs => ARR Array of type => subtype pairs where subtype * can be an array of subtype strings * * @note If using types and subtypes in a query, they are joined with an AND. * * Additionally accepts all "relationship_*" options supported by {@link elgg_get_entities()} * relationship => STR Relationship identifier * relationship_guid => INT|ARR Entity guid(s) * inverse_relationship => BOOL Subject or object of the relationship (false) * relationship_join_on => STR subject_guid|object_guid|target_guid (defaults to subject_guid) * * limit => INT Number to show per page (20) * offset => INT Offset in list (0) * count => BOOL Count the river items? (false) * order_by => STR Order by clause (rv.posted desc) * group_by => STR Group by clause * * distinct => BOOL If set to false, Elgg will drop the DISTINCT * clause from the MySQL query, which will improve * performance in some situations. Avoid setting this * option without a full understanding of the * underlying SQL query Elgg creates. (true) * * batch => BOOL If set to true, an \ElggBatch object will be returned * instead of an array. (false) Since 2.3. * * batch_inc_offset => BOOL If "batch" is used, this tells the batch to increment the offset * on each fetch. This must be set to false if you delete the batched * results. (true) * * batch_size => INT If "batch" is used, this is the number of entities/rows to pull * in before requesting more. (25) * * @param array $options parameters * * @return \ElggRiverItem[]|\ElggBatch|array|int * @since 1.8.0 */ function elgg_get_river(array $options = []) { return \Elgg\Database\River::find($options); } /** * Get river item from its ID * * @param int $id ID * @return ElggRiverItem|false */ function elgg_get_river_item_from_id($id) { $items = elgg_get_river([ 'id' => $id, ]); return $items ? $items[0] : false; } /** * Delete river items based on $options. * * @warning Unlike elgg_get_river() this will not accept an empty options array! * This requires at least one constraint: id(s), annotation_id(s) * subject_guid(s), object_guid(s), target_guid(s) * or view(s) must be set. * * Access is ignored during the execution of this function. * Intended usage of this function is to cleanup river content. * For an example see actions/avatar/upload. * * @param array $options An options array. {@link elgg_get_river()} * * @return bool|null true on success, false on failure, null if no metadata to delete. * * @since 1.8.0 */ function elgg_delete_river(array $options = []) { if (!_elgg_is_valid_options_for_batch_operation($options, 'river')) { // requirements not met return false; } return elgg_call(ELGG_IGNORE_ACCESS, function() use ($options) { $options['batch'] = true; $options['batch_size'] = 25; $options['batch_inc_offset'] = false; $river = elgg_get_river($options); $count = $river->count(); if (!$count) { return; } $success = 0; foreach ($river as $river_item) { if ($river_item->delete()) { $success++; } } return $success == $count; }); } /** * List river items * * @param array $options Any options from elgg_get_river() plus: * - item_view => STR Alternative view to render list items * - pagination => BOOL Display pagination links (true) * - no_results => STR|true|Closure Message to display if no items * * @return string * @since 1.8.0 */ function elgg_list_river(array $options = []) { $defaults = [ 'offset' => (int) max(get_input('offset', 0), 0), 'limit' => (int) max(get_input('limit', max(20, _elgg_config()->default_limit)), 0), 'pagination' => true, 'list_class' => 'elgg-list-river', ]; $options = array_merge($defaults, $options); $options['register_rss_link'] = elgg_extract('register_rss_link', $options, elgg_extract('pagination', $options)); if ($options['register_rss_link']) { elgg_register_rss_link(); } if (!$options["limit"] && !$options["offset"]) { // no need for pagination if listing is unlimited $options["pagination"] = false; } $options['count'] = false; $items = elgg_get_river($options); $options['count'] = is_array($items) ? count($items) : 0; if (!empty($items)) { $count_needed = true; if (!$options['pagination']) { $count_needed = false; } elseif (!$options['offset'] && !$options['limit']) { $count_needed = false; } elseif (($options['count'] < (int) $options['limit']) && !$options['offset']) { $count_needed = false; } if ($count_needed) { $options['count'] = true; $options['count'] = (int) elgg_get_river($options); } } $options['items'] = $items; return elgg_view('page/components/list', $options); }
<?php /* * $Id: LocalKey.php 6508 2009-10-14 06:28:49Z jwage $ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.phpdoctrine.org>. */ /** * Doctrine_Relation_LocalKey * This class represents a local key relation * * @package Doctrine * @subpackage Relation * @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.phpdoctrine.org * @since 1.0 * @version $Revision: 6508 $ */ class Doctrine_Relation_LocalKey extends Doctrine_Relation { /** * fetchRelatedFor * * fetches a component related to given record * * @param Doctrine_Record $record * @return Doctrine_Record|Doctrine_Collection */ public function fetchRelatedFor(Doctrine_Record $record) { $localFieldName = $record->getTable()->getFieldName($this->definition['local']); $id = $record->get($localFieldName); if (is_null($id) || ! $this->definition['table']->getAttribute(Doctrine_Core::ATTR_LOAD_REFERENCES)) { $related = $this->getTable()->create(); // Ticket #1131 Patch. if ( ! is_null($id)) { $related->assignIdentifier($id); $related->state(Doctrine_Record::STATE_PROXY); } } else { $dql = 'FROM ' . $this->getTable()->getComponentName() . ' WHERE ' . $this->getCondition() . $this->getOrderBy(null, false); $related = $this->getTable() ->getConnection() ->query($dql, array($id)) ->getFirst(); if ( ! $related || empty($related)) { $related = $this->getTable()->create(); } } $record->set($localFieldName, $id, false); return $related; } /** * getCondition * * @param string $alias */ public function getCondition($alias = null) { if ( ! $alias) { $alias = $this->getTable()->getComponentName(); } return $alias . '.' . $this->definition['foreign'] . ' = ?'; } }
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class UpdateConstrainVideosTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('videos', function (Blueprint $table) { $table->dropForeign(['program_id']); $table->foreign('program_id') ->references("id") ->on("programs") ->onDelete("set null"); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('videos', function (Blueprint $table) { $table->foreign('program_id')->references("id")->on("programs"); }); } }
<!-- ============================================================== --> <!-- end left sidebar --> <!-- ============================================================== --> <!-- ============================================================== --> <!-- wrapper --> <!-- ============================================================== --> <div class="dashboard-wrapper"> <div class="container-fluid dashboard-content"> <!-- ============================================================== --> <!-- pageheader --> <!-- ============================================================== --> <div class="row" style="width:127%;"> <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12"> <div class="page-header"> <h2 class="pageheader-title">Bill Payments </h2> <div class="page-breadcrumb"> <nav aria-label="breadcrumb"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="<?php echo base_url()?>Crm" class="breadcrumb-link">CRM</a></li> <li class="breadcrumb-item">Payments</li> </ol> </nav> </div> </div> </div> </div> <div class="row"> <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12"> <div class="card"> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-6"> </div> </div> <div class="card-body"> <table class="table" id="brandTable"> <thead> <tr> <th scope="col"> S No </th> <th scope="col">Retailer Name</th> <th scope="col">Invoice Number</th> <th scope="col">Amount</th> <th scope="col">Courier Name</th> <th scope="col">Courier No</th> <th scope="col">Courier Date</th> <th scope="col">Payment Mode</th> <th scope="col">Status</th> </tr> </thead> <tbody> <?php $i = 1; if($billpays){ foreach($billpays as $bill){ ?> <tr> <td><?php echo $i;?></td> <td><?php echo $bill->userdept_Name;?></td> <td><?php echo $bill->order_id;?></td> <td><?php echo $bill->cheque_amt;?></td> <td><?php echo $bill->courier_name;?></td> <td><?php echo $bill->courier_no;?></td> <td><?php echo $bill->courier_date;?></td> <td><?php echo $bill->payment_Mode;?></td> <td><?php echo $bill->chequeStatus;?></td> </tr> <?php $i++; } } ?> </tbody> </table> </div> </div> </div> </div> <!-- ============================================================== --> <!-- end pageheader --> <!-- ============================================================== --> </div> </div> <!-- ============================================================== --> <!-- footer -->
<!-- link to external css for dashboard --> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head> @extends('Template.app') @section('main_Content') <div> <div class="container div-Content"> <h1>Hello {{ Auth::user()->name }} !</h1> <p class="para">Nice to see you!!</p> </div> <div class="div-Content"> @yield('dashboard_Content') </div> </div> @endsection
<?php class Value_Server_Test extends \PHPUnit\Framework\TestCase { public function setUp() { \WP_Mock::setUp(); \WP_Mock::wpFunction('stripslashes_deep', [ 'return' => function ($array) { $newArray = []; foreach ($array as $k => $v) { $newArray[$k] = stripslashes($v); } return $newArray; }, ]); } public function tearDown() { \WP_Mock::tearDown(); } public function testUsesCorrectGlobalVariable() { $_SERVER = [ 'a' => 'b', 'c' => 'd', ]; $__server = new \Dxw\Iguana\Value\Server(); $this->assertEquals('b', $__server['a']); $this->assertEquals('d', $__server['c']); $this->assertFalse(isset($__server['z'])); } public function testStripslashes() { $_SERVER = [ 'a' => 'b\\\\c', ]; $__server = new \Dxw\Iguana\Value\Server(); $this->assertEquals('b\\c', $__server['a']); } }
<?php // This file is auto-generated, don't edit it. Thanks. namespace AlibabaCloud\SDK\Rkvstore\V20150101\Models; use AlibabaCloud\SDK\Rkvstore\V20150101\Models\DescribeClusterMemberInfoResponseBody\clusterChildren; use AlibabaCloud\Tea\Model; class DescribeClusterMemberInfoResponseBody extends Model { /** * @var string */ public $requestId; /** * @var clusterChildren[] */ public $clusterChildren; protected $_name = [ 'requestId' => 'RequestId', 'clusterChildren' => 'ClusterChildren', ]; public function validate() { } public function toMap() { $res = []; if (null !== $this->requestId) { $res['RequestId'] = $this->requestId; } if (null !== $this->clusterChildren) { $res['ClusterChildren'] = []; if (null !== $this->clusterChildren && \is_array($this->clusterChildren)) { $n = 0; foreach ($this->clusterChildren as $item) { $res['ClusterChildren'][$n++] = null !== $item ? $item->toMap() : $item; } } } return $res; } /** * @param array $map * * @return DescribeClusterMemberInfoResponseBody */ public static function fromMap($map = []) { $model = new self(); if (isset($map['RequestId'])) { $model->requestId = $map['RequestId']; } if (isset($map['ClusterChildren'])) { if (!empty($map['ClusterChildren'])) { $model->clusterChildren = []; $n = 0; foreach ($map['ClusterChildren'] as $item) { $model->clusterChildren[$n++] = null !== $item ? clusterChildren::fromMap($item) : $item; } } } return $model; } }
<div style="padding:25px 0px; min-height:380px; min-height:400px; width:950px; margin:0 auto; "> <?php if(isset($_SESSION["uye"])) { $uyesql="SELECT * FROM uye WHERE kadi='".$_SESSION["uye"]."'"; $uyesorgu=@mysql_query($uyesql,$baglanti); $uyegetir=@mysql_fetch_array($uyesorgu); $uyeid=$uyegetir[0]; ?> <table align="center" id="sepet"> <thead> <tr> <td>Tarih</td> <td>Ürün Adı</td> <td>Ürün Fiyatı</td> <td>Adet</td> <td>Toplam Fiyatı</td> <td>Kargo Durumu</td> <td>Kargo Firması</td> <td>Kargo Kodu</td> </tr> </thead> <tbody> <?php $satissql="SELECT satis.tarih,urun.urun_adi,satis.urun_fiyat,satis.urun_adet,satis.toplam_fiyat,satis.kargo_adi,satis.kargo_kodu,satis.kargo_durum FROM satis,urun WHERE satis.alan_id=$uyeid AND satis.urun_id=urun.urun_id"; $satissorgu=mysql_query($satissql,$baglanti); while($satisgetir=mysql_fetch_array($satissorgu)) { $durum=$satisgetir[7]; $metin=""; echo "<tr>"; echo "<td width='200'>".$satisgetir[0]."</td>"; echo "<td width='150'>".$satisgetir[1]."</td>"; echo "<td width='120'>".number_format($satisgetir[2],2,",",".")." TL</td>"; echo "<td width='50'>".$satisgetir[3]."</td>"; echo "<td width='130'>".number_format($satisgetir[4],2,",",".")." TL</td>"; if($durum==2) $metin="Hazırlanıyor"; else if($durum==3) $metin="Kargoya Verildi"; echo "<td width='150'>".$metin."</td>"; echo "<td width='120'>".$satisgetir[5]."</td>"; echo "<td width='100'>".$satisgetir[6]."</td>"; echo "</tr>"; } ?> </tbody> </table> <?php } else{ header("location:index.php"); } ?> </div>
<?php return array( /* |-------------------------------------------------------------------------- | PDO Fetch Style |-------------------------------------------------------------------------- | | By default, database results will be returned as instances of the PHP | stdClass object; however, you may desire to retrieve records in an | array format for simplicity. Here you can tweak the fetch style. | */ 'fetch' => PDO::FETCH_CLASS, /* |-------------------------------------------------------------------------- | Default Database Connection Name |-------------------------------------------------------------------------- | | Here you may specify which of the database connections below you wish | to use as your default connection for all database work. Of course | you may use many connections at once using the Database library. | */ 'default' => 'mysql', /* |-------------------------------------------------------------------------- | Database Connections |-------------------------------------------------------------------------- | | Here are each of the database connections setup for your application. | Of course, examples of configuring each database platform that is | supported by Laravel is shown below to make development simple. | | | All database work in Laravel is done through the PHP PDO facilities | so make sure you have the driver for your particular database of | choice installed on your machine before you begin development. | */ 'connections' => array( 'sqlite' => array( 'driver' => 'sqlite', 'database' => storage_path().'/sqlite/xaradb.sqlite', 'prefix' => '', ), 'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'xpoz', 'username' => 'root', 'password' => 'mysql', 'port' => '3306', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'options' => array( PDO::MYSQL_ATTR_LOCAL_INFILE => true ), ), 'pgsql' => array( 'driver' => 'pgsql', 'host' => 'localhost', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', ), 'sqlsrv' => array( 'driver' => 'sqlsrv', 'host' => 'localhost', 'database' => 'database', 'username' => 'root', 'password' => '', 'prefix' => '', ), ), /* |-------------------------------------------------------------------------- | Migration Repository Table |-------------------------------------------------------------------------- | | This table keeps track of all the migrations that have already run for | your application. Using this information, we can determine which of | the migrations on disk haven't actually been run in the database. | */ 'migrations' => 'migrations', /* |-------------------------------------------------------------------------- | Redis Databases |-------------------------------------------------------------------------- | | Redis is an open source, fast, and advanced key-value store that also | provides a richer set of commands than a typical key-value systems | such as APC or Memcached. Laravel makes it easy to dig right in. | */ 'redis' => array( 'cluster' => false, 'default' => array( 'host' => '127.0.0.1', 'port' => 6379, 'database' => 0, ), ), );
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; class RedirectIfAuthenticated { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @param string|null $guard * @return mixed */ public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return redirect('/backstage/home'); } return $next($request); } }
<?php use yii\helpers\Html; use yii\grid\GridView; use yii\helpers\Url; use common\components\ModalViewWidget; use common\models\Locations; use yii\helpers\ArrayHelper; /* @var $this yii\web\View */ /* @var $searchModel common\models\BusinessPartnerSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Customers'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="business-partner-index"> <div class="row"> <div class="col-md-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?= Html::encode($this->title) ?></h3> </div> <div class="panel-body"> <?= Html::button('<i class="fa-th-list"></i><span> Add New</span>', ['value' => Url::to('create'), 'class' => 'btn btn-warning btn-icon btn-icon-standalone modalButton']) ?> <?= \common\widgets\Alert::widget(); ?> <?php echo ModalViewWidget::widget(); ?> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], // 'id', // 'type', 'name', 'company_name', [ 'attribute' => 'location', 'format' => 'raw', 'filter' => Html::activeDropDownList($searchModel, 'location', ArrayHelper::map(Locations::find()->all(), 'id', 'location_name'), ['class' => 'form-control', 'id' => 'name', 'prompt' => '']), 'value' => function ($data) { return Locations::findOne($data->location)->location_name; }, ], // 'billing_address:ntext', // 'shipping_address:ntext', // 'phone_no', // 'fax_no', // 'email:email', [ 'attribute' => 'status', 'filter' => ['1' => 'Enable', '0' => 'Disable'], 'value' => function($data) { return $data->status == 1 ? 'Enable' : 'Disable'; } ], [ 'class' => 'yii\grid\ActionColumn', // 'contentOptions' => ['style' => 'width:100px;'], 'header' => 'Actions', 'template' => '{update}{view}{delete}', 'buttons' => [ 'update' => function ($url, $model) { return Html::button('<i class="fa fa-pencil"></i>', ['value' => Url::to(['update', 'id' => $model->id]), 'class' => 'modalButton edit-btn']); }, 'view' => function ($url, $model) { return Html::button('<i class="fa fa-eye"></i>', ['value' => Url::to(['view', 'id' => $model->id]), 'class' => 'modalButton edit-btn']); }, 'delete' => function ($url, $model) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ 'title' => Yii::t('app', 'delete'), 'class' => '', 'data' => [ 'confirm' => 'Are you sure you want to delete this item?', ], ]); }, ], 'urlCreator' => function ($action, $model) { if ($action === 'delete') { $url = Url::to(['del', 'id' => $model->id]); return $url; } } ], ], ]); ?> </div> </div> </div> </div> </div>
<?php namespace App\Http\Controllers\Museum; use App\Models\Tour; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Repositories\TourRepository; class TourController extends BaseController { private $tourRepository; public function __construct() { parent::__construct(); $this->tourRepository = app(TourRepository::class); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $paginator = $this->tourRepository->getAllWithPaginate(); return view('museum.tours.index', compact('paginator')); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $item = $this->tourRepository->getEdit($id); return view('museum.tours.show', compact('item')); } public function showWithCountTours(Request $request) { $count = $request->input('countpaginate'); $search = $request->input('search'); if(!empty($search)) { $paginator = $this->tourRepository->getAllSearchWithPaginateForUsers($search, $count); return view('museum.tours.index', compact('paginator')); } else { $paginator = $this->tourRepository->getAllWithPaginateForUsers($count); return view('museum.tours.index', compact('paginator')); } } public function showOldTours(Request $request) { $count = $request->input('countpaginate'); $paginator = $this->tourRepository->getOldTours($count); return view('museum.tours.index', compact('paginator')); } public function showCurrentTours(Request $request) { $count = $request->input('countpaginate'); $paginator = $this->tourRepository->getCurrentTours($count); return view('museum.tours.index', compact('paginator')); } public function showFuturetTours(Request $request) { $count = $request->input('countpaginate'); $paginator = $this->tourRepository->getFutureTours($count); return view('museum.tours.index', compact('paginator')); } }
<?php /** * Created by PHP7. * User: Oleksandr Serdiuk * SSF Framework 1.0 * Date: 08.09.2016 * Time: 14:08 */ namespace App\Interfaces\Controllers\Notifications; interface NotificationsInterface { /** * Getting data about message * based on trigger * @param $trigger_id * @return mixed */ public function actionFindMessagesTypesForTrigger( $trigger_id ); /** * Getting user data based * on user and trigger type * @param $user_id * @param $type * @return mixed */ public function actionGetUserData( $user_id, $type ); /** * Generating body of the * notification message * @param null $params * @return mixed */ public function actionGenerateMessage( $params = null ); /** * Making request to the service * @return mixed */ public function actionMakeRequest(); }
<?php namespace backend\controllers; use backend\models\GoldConfig; use yii\web\Response; class GoldConfigController extends ObjectController { /** * 货币列表 * @return string */ public function actionIndex() { $data = GoldConfig::find()->asArray()->all(); return $this->render('index',['data'=>$data]); } /** * 添加货币 * @return array|string */ public function actionAdd() { $this->layout = false; $model = new GoldConfig(); if(\Yii::$app->request->isPost) { \Yii::$app->response->format = Response::FORMAT_JSON; if($model->load(\Yii::$app->request->post()) && $model->save()) { return ['code'=>1,'message'=>'添加成功']; } $message = $model->getFirstErrors(); $message = reset($message); return ['code'=>0,'message'=>$message]; } return $this->render('add',['model'=>$model]); } /** * 修改货币 * @return array|string */ public function actionEdit() { $this->layout = false; $id = empty(\Yii::$app->request->get('id')) ? \Yii::$app->request->post('id') : \Yii::$app->request->get('id'); $model = GoldConfig::findOne($id); if(\Yii::$app->request->isPost) { \Yii::$app->response->format = Response::FORMAT_JSON; if($model->load(\Yii::$app->request->post()) && $model->save()) { return ['code'=>1,'message'=>'修改成功']; } $message = $model->getFirstErrors(); $message = reset($message); return ['code'=>0,'message'=>$message]; } return $this->render('edit',['model'=>$model]); } /** * 删除货币 * @return array */ public function actionDel() { $this->layout = false; \Yii::$app->response->format = Response::FORMAT_JSON; $id = \Yii::$app->request->get('id'); $model = GoldConfig::findOne($id); if($model) { if($model->delete()) { return ['code'=>1,'message'=>'删除成功']; } $messge = $model->getFirstErrors(); $messge = reset($messge); return ['code'=>0,'message'=>$messge]; } return ['code'=>0,'message'=>'删除的ID不存在']; } }
<?php // +---------------------------------------------------------------------- // | OneThink [ WE CAN DO IT JUST THINK IT ] // +---------------------------------------------------------------------- // | Copyright (c) 2013 http://www.onethink.cn All rights reserved. // +---------------------------------------------------------------------- // | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn> // +---------------------------------------------------------------------- namespace Admin\Controller; use Admin\Builder\AdminConfigBuilder; /** * 后台配置控制器 * @author 麦当苗儿 <zuojiazi@vip.qq.com> */ class ConfigController extends AdminController { /** * 配置管理 * @author 麦当苗儿 <zuojiazi@vip.qq.com> */ public function index() { /* 查询条件初始化 */ $map = array(); $map = array('status' => 1, 'title' => array('neq', '')); if (isset($_GET['group'])) { $map['group'] = I('group', 0); } if (isset($_GET['name'])) { $map['name'] = array('like', '%' . (string)I('name') . '%'); } // $map= $list = $this->lists('Config', $map, 'sort,id'); // 记录当前列表页的cookie Cookie('__forward__', $_SERVER['REQUEST_URI']); $this->assign('group', C('CONFIG_GROUP_LIST')); $this->assign('group_id', I('get.group', 0)); $this->assign('list', $list); $this->meta_title = L('_CONFIG_MANAGER_'); $this->display(); } /** * 新增配置 * @author 麦当苗儿 <zuojiazi@vip.qq.com> */ public function add() { if (IS_POST) { $Config = D('Config'); $data = $Config->create(); if ($data) { if ($Config->add()) { S('DB_CONFIG_DATA', null); $this->success(L('_SUCCESS_ADD_'), U('index')); } else { $this->error(L('_FAIL_ADD_')); } } else { $this->error($Config->getError()); } } else { $this->meta_title = L('_CONFIG_ADD_'); $this->assign('info', null); $this->display('edit'); } } /** * 编辑配置 * @author 麦当苗儿 <zuojiazi@vip.qq.com> */ public function edit($id = 0) { if (IS_POST) { $Config = D('Config'); $data = $Config->create(); if ($data) { if ($Config->save()) { S('DB_CONFIG_DATA', null); //记录行为 action_log('update_config', 'config', $data['id'], UID); $this->success(L('_SUCCESS_UPDATE_'), Cookie('__forward__')); } else { $this->error(L('_FAIL_UPDATE_')); } } else { $this->error($Config->getError()); } } else { $info = array(); /* 获取数据 */ $info = M('Config')->field(true)->find($id); if (false === $info) { $this->error(L('_ERROR_CONFIG_INFO_GET_')); } $this->assign('info', $info); $this->meta_title = L('_CONFIG_EDIT_'); $this->display(); } } /** * 批量保存配置 * @author 麦当苗儿 <zuojiazi@vip.qq.com> */ public function save($config) { if ($config && is_array($config)) { $Config = M('Config'); foreach ($config as $name => $value) { $map = array('name' => $name); $Config->where($map)->setField('value', $value); } } S('DB_CONFIG_DATA', null); $this->success(L('_SUCCESS_SAVE_').L('_EXCLAMATION_')); } /** * 删除配置 * @author 麦当苗儿 <zuojiazi@vip.qq.com> */ public function del() { $id = array_unique((array)I('id', 0)); if (empty($id)) { $this->error(L('_DATA_OPERATE_SELECT_')); } $map = array('id' => array('in', $id)); if (M('Config')->where($map)->delete()) { S('DB_CONFIG_DATA', null); //记录行为 action_log('update_config', 'config', $id, UID); $this->success(L('_SUCCESS_DELETE_').L('_EXCLAMATION_')); } else { $this->error(L('_FAIL_DELETE_').L('_EXCLAMATION_')); } } // 获取某个标签的配置参数 public function group() { $id = I('get.id', 1); $type = C('CONFIG_GROUP_LIST'); $list = M("Config")->where(array('status' => 1, 'group' => $id))->field('id,name,title,extra,value,remark,type')->order('sort')->select(); if ($list) { $this->assign('list', $list); } $this->assign('id', $id); $this->meta_title = $type[$id] . L('_SETTINGS_'); $this->display(); } /** * 配置排序 * @author huajie <banhuajie@163.com> */ public function sort() { if (IS_GET) { $ids = I('get.ids'); //获取排序的数据 $map = array('status' => array('gt', -1), 'title' => array('neq', '')); if (!empty($ids)) { $map['id'] = array('in', $ids); } elseif (I('group')) { $map['group'] = I('group'); } $list = M('Config')->where($map)->field('id,title')->order('sort asc,id asc')->select(); $this->assign('list', $list); $this->meta_title = L('_CONFIG_SORT_'); $this->display(); } elseif (IS_POST) { $ids = I('post.ids'); $ids = explode(',', $ids); foreach ($ids as $key => $value) { $res = M('Config')->where(array('id' => $value))->setField('sort', $key + 1); } if ($res !== false) { $this->success(L('_SUCCESS_SORT_').L('_EXCLAMATION_'), Cookie('__forward__')); } else { $this->eorror(L('_FAIL_SORT_').L('_EXCLAMATION_')); } } else { $this->error(L('_BAD_REQUEST_').L('_EXCLAMATION_')); } } /**网站信息设置 * @auth 陈一枭 */ public function website() { $builder = new AdminConfigBuilder(); $data = $builder->handleConfig(); $builder->title(L('_SITE_INFO_'))->suggest(L('_SITE_INFO_VICE_')); /* $builder->keySelect('LANG', L('_WEBSITE_LANGUAGE_'), L('_SELECT_THE_DEFAULT_LANGUAGE_'), array('zh-cn' => L('_SIMPLIFIED_CHINESE_'), 'en-us' => L('_ENGLISH_')));*/ $builder->keyText('WEB_SITE_NAME', L('_SITE_NAME_'), L('_SITE_NAME_VICE_')); $builder->keyText('ICP', L('_LICENSE_NO_'), L('_LICENSE_NO_VICE_')); $builder->keySingleImage('LOGO', L('_SITE_LOGO_'), L('_SITE_LOGO_VICE_')); $builder->keySingleImage('QRCODE', L('_QR_WEIXIN_'), L('_QR_WEIXIN_VICE_')); $builder->keySingleImage('JUMP_BACKGROUND', L('_IMG_BG_REDIRECTED_'), L('_IMG_BG_REDIRECTED_')); $builder->keyText('SUCCESS_WAIT_TIME', L('_TIME_SUCCESS_WAIT_'), L('_TIME_SUCCESS_WAIT_VICE_')); $builder->keyText('ERROR_WAIT_TIME', L('_TIME_FAIL_WAIT_'), L('_TIME_FAIL_WAIT_VICE_')); $builder->KeyBool('OPEN_IM','是否开启即时聊天','关闭后将不再显示在顶部导航栏'); $builder->keyEditor('ABOUT_US', L('_CONTENT_ABOUT_US_'), L('_CONTENT_ABOUT_US_VICE_')); $builder->keyEditor('SUBSCRIB_US', L('_CONTENT_FOLLOW_US_'), L('_CONTENT_FOLLOW_US_VICE_')); $builder->keyEditor('COPY_RIGHT', L('_INFO_COPYRIGHT_'), L('_INFO_COPYRIGHT_VICE_')); $addons = \Think\Hook::get('uploadDriver'); $opt = array('local' => L('_LOCAL_')); foreach ($addons as $name) { if (class_exists($name)) { $class = new $name(); $config = $class->getConfig(); if ($config['switch']) { $opt[$class->info['name']] = $class->info['title']; } } } $builder->keySelect('PICTURE_UPLOAD_DRIVER', L('_PICTURE_UPLOAD_DRIVER_'), L('_PICTURE_UPLOAD_DRIVER_'), $opt); $builder->keySelect('DOWNLOAD_UPLOAD_DRIVER', L('_ATTACHMENT_UPLOAD_DRIVER_'), L('_ATTACHMENT_UPLOAD_DRIVER_'), $opt); $builder->group(L('_BASIC_INFORMATION_'), array('WEB_SITE_NAME', 'ICP', 'LOGO', 'QRCODE', 'LANG')); $builder->group(L('_THE_FOOTER_INFORMATION_'), array('ABOUT_US', 'SUBSCRIB_US', 'COPY_RIGHT')); $builder->group(L('_JUMP_PAGE_'), array('JUMP_BACKGROUND', 'SUCCESS_WAIT_TIME', 'ERROR_WAIT_TIME')); $builder->keyBool('GET_INFORMATION', L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_'),L('_OPEN_INSTANT_ACCESS_TO_THE_MESSAGE_VICE_')); $builder->keyText('GET_INFORMATION_INTERNAL', L('_MESSAGE_POLLING_INTERVAL_'), L('_MESSAGE_POLLING_INTERVAL_VICE_')); $builder->group(L('_PERFORMANCE_SETTINGS_'), array('OPEN_IM','GET_INFORMATION','GET_INFORMATION_INTERNAL')); $builder->group(L('_UPLOAD_CONFIGURATION_'), array('PICTURE_UPLOAD_DRIVER', 'DOWNLOAD_UPLOAD_DRIVER')); $builder->data($data); $builder->keyDefault('SUCCESS_WAIT_TIME', 2); $builder->keyDefault('ERROR_WAIT_TIME', 5); $builder->keyDefault('LANG', 'zh-cn'); $builder->keyDefault('GET_INFORMATION',1); $builder->keyDefault('GET_INFORMATION_INTERNAL',10); $builder->keyDefault('OPEN_IM',1); $builder->buttonSubmit(); $builder->display(); } }
<?php namespace App\Gfcare\src\MobiHealth\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use App\GfCare\src\MobiHealth\Models\ContentPregnancy; use App\GfCare\src\MobiHealth\Models\ContentNoyawa; use App\GfCare\src\MobiHealth\Models\ContentFirstYear; use App\GfCare\src\MobiHealth\Models\ContentVisualAid; class ContentController extends Controller { public function getVisualAids(Request $request) { $items = ContentVisualAid::all(); return response()->json($items); } public function getPregnancyContent(Request $request) { $items = contentPregnancy::all(); return response()->json($items); } public function getNoyawaContent(Request $request) { $items = ContentNoyawa::all(); return response()->json($items); } public function getFirstYearContent(Request $request) { $items = ContentFirstYear::all(); return response()->json($items); } public function storeVisualAid(Request $request) { $user = $request->user(); function formatSizeUnits($bytes) { if ($bytes >= 1073741824) { $bytes = number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { $bytes = number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' KB'; } elseif ($bytes > 1) { $bytes = $bytes . ' bytes'; } elseif ($bytes == 1) { $bytes = $bytes . ' byte'; } else { $bytes = '0 bytes'; } return $bytes; } $this->validate($request, [ 'reference_desc' => 'required', 'reference_file' => 'required', 'shortname' => 'required']); if (!is_null($request->reference_file)) { $name = $request->shortname.'.pdf'; $path = Storage::disk('public')->put('references/'.$name, $request->reference_file); $reference = new Reference(); $reference->team_id = $user->current_team_id; $reference->reference_desc = $request->reference_desc; $reference->shortname = $request->shortname; $reference->reference_url = Storage::disk('public')->url('references/'.$name); $reference->size = formatSizeUnits(Storage::disk('public')->size('/references/'.$name)); $reference->modified_by = $user->id; $reference->save(); return $reference; } else { return response()->json( ['reference_file' => ['The file did not upload correctly.']], 422 ); } } public function updatePregnancyMessage(Request $request, $msgId) { $user = $request->user(); $content = ContentPregnancy::findOrFail($msgId); $this->validate($request, [ 'name' => 'required', 'file_url' => 'required', 'filename' => 'required']); $content->name = $request->name; $device->tag = $request->tag; $device->color = $request->color; $device->imei = $request->imei; $device->status = $request->status; $device->modified_by = $user->id; $device->save(); return $device;; } protected function storeContent(Request $request, $content) { $user = $request->user(); function formatSizeUnits($bytes) { if ($bytes >= 1073741824) { $bytes = number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { $bytes = number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' KB'; } elseif ($bytes > 1) { $bytes = $bytes . ' bytes'; } elseif ($bytes == 1) { $bytes = $bytes . ' byte'; } else { $bytes = '0 bytes'; } return $bytes; } if (!is_null($request->file_url)) { $name = $request->filename.'.mp3'; $path = Storage::disk('public')->put('content/'.$name, $request->reference_file); $reference = new Reference(); $reference->team_id = $user->current_team_id; $reference->reference_desc = $request->reference_desc; $reference->shortname = $request->shortname; $reference->reference_url = Storage::disk('public')->url('references/'.$name); $reference->size = formatSizeUnits(Storage::disk('public')->size('/references/'.$name)); $reference->modified_by = $user->id; $reference->save(); return $reference; } else { return response()->json( ['reference_file' => ['The file did not upload correctly.']], 422 ); } } /* public function destroy(Request $request, $deviceId) { $device = Device::findOrFail($deviceId); $device->delete(); return $this->getDevices(); } private function getDevices() { return Devices::all(); } */ }
<?php return [ /* * -------------------------------------------------------------------------- * Login Modal Language Lines * -------------------------------------------------------------------------- * * The following language lines are used on the login, register, and logout modals * */ 'login' => [ "type" => "login", "title" => "Register or Login with GCcollab Account", "content" => [ "Talent Cloud uses GCcollab Account which can sign you into a variety of GC tools.", "If you have a GCcollab Account, please use the Login link below. If you don't, please use the Register link to create one." ], "id" => "login", "action_01" => "Register", "action_02" => "Login" ], "logout" => [ "type" => "logout", "title" => "Logout of Talent Cloud", "content" => [ "Are you sure you want to logout of Talent Cloud?" ], "id" => "logout", "action_01" => "Cancel", "action_02" => "Logout" ] ];
<?php namespace jrmadsen67\LaravelRouteCoverageTest\Helpers; use Illuminate\Routing\Route as RoutingRoute; use Illuminate\Support\Facades\Route; use Illuminate\Support\Str; use jrmadsen67\LaravelRouteCoverageTest\Http\Middleware\CollectCodeCoverage; class RouteHelper { /** * Determine the route name based on the route type. */ public static function getRouteName(RoutingRoute $route): string { if (empty($route)) { return ''; } if (!empty($route->getName())) { return $route->getName() ?? 'unknown'; } if ($route->getActionName() && $route->getActionName() !== 'Closure') { return $route->getActionName(); } return $route->getActionName().' /'.$route->uri(); } /** * Determine if the route name provided is to be excluded from the test coverage. */ public static function isExcludedRoute(string $routeName): bool { // Has to be this way due to PHP's pass by ref array_walk requirements $excludedRoutes = config('route-coverage.exclude_routes', []); $excludedRouteGroups = config('route-coverage.exclude_route_groups', []); $isExcluded = false; array_walk( $excludedRoutes, function ($excludeName) use ($routeName, &$isExcluded) { if ($isExcluded = Str::is($excludeName, $routeName)) { return; } } ); if ($isExcluded) { return $isExcluded; } array_walk( $excludedRouteGroups, function ($excludeGroupName) use ($routeName, &$isExcluded) { $isExcluded = $isExcluded ? $isExcluded : Str::startsWith($routeName, $excludeGroupName.config('route_groups_seperator', '.')); if ($isExcluded) { return; } } ); return $isExcluded; } /** * Gathers all the untested routes into a formatted array that can itself be tested and also consumed by the test suite. */ public static function getUntestedRoutes(): array { $routesTested = collect(CollectCodeCoverage::$routesTested)->groupBy('name'); $routesUntested = []; foreach (Route::getRoutes() as $route) { $routeName = RouteHelper::getRouteName($route); $hits = $routesTested->get($routeName); if (self::isExcludedRoute($routeName)) { continue; } foreach ($route->methods() as $method) { if ($method === 'HEAD') { continue; } elseif ($hits === null || $hits->where('method', '=', $method)->count() === 0) { $routesUntested[] = $routeName.' '.$method; } } } asort($routesUntested); return $routesUntested; } }
<?php namespace common\models\base; use Yii; /** * This is the model class for table "widgets". * * @property int $id * @property int $position * @property string $background_color * @property string $title_color * @property string $text_color * @property string $button_color * @property string $button_text * @property string $title * @property string $description * @property string $email */ class Widgets extends \yii\db\ActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return 'widgets'; } /** * {@inheritdoc} */ public function rules() { return [ [['position'], 'integer'], [['background_color', 'title_color', 'text_color', 'button_color', 'button_text', 'title', 'description', 'email'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'position' => 'Position', 'background_color' => 'Background Color', 'title_color' => 'Title Color', 'text_color' => 'Text Color', 'button_color' => 'Button Color', 'button_text' => 'Button Text', 'title' => 'Title', 'description' => 'Description', 'email' => 'Email', ]; } }
<?php /** @var \Illuminate\Database\Eloquent\Factory $factory */ use App\Models\CouponCode; use Faker\Generator as Faker; $factory->define(CouponCode::class, function (Faker $faker) { //首先随机取得一个类型 $type = $faker->randomElement(array_keys(CouponCode::$typeMap)); //根据取得的类型生成对应折扣 $value = $type === CouponCode::TYPE_FIXED ? random_int(1, 200) : random_int(1, 50); if ($type === CouponCode::TYPE_FIXED) { $minAmount = $value + 0.01; } else { if (random_int(1, 100) < 50) { $minAmount = 0; } else { $minAmount = random_int(100, 1000); } } return [ 'name' => join(' ', $faker->words), // 随机生成名称 'code' => CouponCode::findAvailableCode(), // 调用优惠码生成方法 'type' => $type, 'value' => $value, 'total' => 1000, 'used' => 0, 'min_amount' => $minAmount, 'not_before' => null, 'not_after' => null, 'enabled' => true, ]; });
@extends('layouts.app') @section('content') <div class="container"> <div class="row justify-content-center"> <div class="col-md-8"> <div class="card"> <div class="card-header">Dashboard</div> <div class="card-body"> @if (session('status')) <div class="alert alert-success" role="alert"> {{ session('status') }} </div> @endif You are logged in as owner </div> </div> </div> </div> </div> @endsection
@extends('layouts.app') @section('content') <div class="container-fluid"> <div class="row justify-content-center"> <div class="col-md-12"> <div class="card"> <div class="card-header">{{ __('Last Login Details') }}</div> <div class="card-body"> <table class="table table-striped datatables"> <thead> <td>#</td> <td>{{__("Ip address")}}</td> <td>{{__("Last Login Date")}}</td> <td>{{__("Last Login Time")}}</td> </thead> <tbody></tbody> </table> </div> </div> </div> </div> </div> @endsection @section('scripts') <script> $('.datatables').DataTable({ serverSide: true, processing: true, ajax: "{{route("home")}}", columns: [ {name: "id", data: "id"}, {name:"ip_address", data: "ip_address"}, {name: "last_login_date", data: "last_login_date"}, {name: "last_login_time", data: "last_login_time"}, ] }) </script> @endsection
@extends('template.privatemenu') @section('upload') activeMenuPrivate @endsection @section('conteudo') <style> .dropzone{ padding-bottom: 35%; border-radius: 10px!important; border: 2px dashed rgb(202 64 139); } .dz-message{ font-size: 14px; font-weight: 500; font-family: 'Inter'; color: #a7a7a7; position: relative; top: 140px; } </style> <h1 class="titlePrincipal">Upload</h1> <form action="{{ route('upload'); }}" class="mt-5 dropzone" id="my_awesome_dropzone" encytpe="multipart/form-data"> @csrf <div class="dz-message" data-dz-message><span>Arraste os arquivos aqui para upload</span></div> </form> <script> Dropzone.options.my_awesome_dropzone = { autoProcessQueue:false, required:true, acceptedFiles: ".png,.jpg,.gif,.bmp,.jpeg,.xml", addRemoveLinks: true, maxFiles:8, parallelUploads : 100, maxFilesize:5, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }; </script> @endsection
<?php namespace Welp\BatchBundle\Manager; use Welp\BatchBundle\Model\Batch; use Welp\BatchBundle\Manager\ManagerInterface as BaseManager; /** * operation Factory */ class OperationManager implements BaseManager { /** * @var String */ private $class; /** * * @param String $entityManager name of the entitytyManager service * @param ContainerInterface $container * @param String $className Name of the class that extends our batchModel */ public function __construct() { $this->class = "Welp\BatchBundle\Model\Operation"; } /** * {@inheritdoc} */ public function createNew() { $operation = new $this->class(); return $operation; } /** * {@inheritdoc} */ public function create($entity) { $entity->setCreatedAt(new \DateTime()); $entity->setUpdatedAt(new \DateTime()); return $entity; } /** * {@inheritdoc} */ public function get($id) { return false; } /** * {@inheritdoc} */ public function update($entity) { $entity->setUpdatedAt(new \DateTime()); return $entity; } /** * {@inheritdoc} */ public function delete($entity) { return false; } }
<?php declare(strict_types=1); /* * This file has been auto generated by Jane, * * Do no edit it directly. */ namespace Ammonkc\SabreApi\Model\CreatePassengerNameRecord; use Ammonkc\SabreApi\AbstractModel; class CreatePassengerNameRecordRequestCreatePassengerNameRecordRQAirPriceItemPriceRequestInformationOptionalQualifiersPricingQualifiersManuallyAdjustedSellingLevelItem extends AbstractModel { /** * Used to instruct the system to price the itinerary with a mark down amount. * * @var float */ protected $markDown; /** * Used to instruct the system to price the itinerary with a mark up amount. MarkDown cannot be combined with MarkUp. * * @var float */ protected $markUp; /** * Used to instruct the system to price the itinerary with a mark down amount. * * @return float|null */ public function getMarkDown(): ?float { return $this->markDown; } /** * Used to instruct the system to price the itinerary with a mark down amount. * * @param float|null $markDown * * @return self */ public function setMarkDown(?float $markDown): self { $this->markDown = $markDown; return $this; } /** * Used to instruct the system to price the itinerary with a mark up amount. MarkDown cannot be combined with MarkUp. * * @return float|null */ public function getMarkUp(): ?float { return $this->markUp; } /** * Used to instruct the system to price the itinerary with a mark up amount. MarkDown cannot be combined with MarkUp. * * @param float|null $markUp * * @return self */ public function setMarkUp(?float $markUp): self { $this->markUp = $markUp; return $this; } }
<?php use Phinx\Migration\AbstractMigration; class AddScreenshotErrorColumn extends AbstractMigration { public function up() { $table = $this->table('screenshot'); $table->addColumn('error', 'string'); $table->update(); } }
<?php /** * Sales Order Creditmemo Pdf grouped items renderer * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\GroupedProduct\Model\Order\Pdf\Items\Creditmemo; class Grouped extends \Magento\Sales\Model\Order\Pdf\Items\Creditmemo\DefaultCreditmemo { /** * Draw process * * @return void */ public function draw() { $type = $this->getItem()->getOrderItem()->getRealProductType(); $renderer = $this->getRenderedModel()->getRenderer($type); $renderer->setOrder($this->getOrder()); $renderer->setItem($this->getItem()); $renderer->setPdf($this->getPdf()); $renderer->setPage($this->getPage()); $renderer->draw(); } }
<?php namespace App\Providers; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Gate; use Laravel\Passport\Passport; class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * * @var array */ protected $policies = [ 'App\Models\Model' => 'App\Policies\ModelPolicy', ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); Passport::routes(); //definir el alcance Passport::tokensCan([ 'Administrador' => 'Mantenimiento de productos personal de envio,ver estado de los pedidos', 'Vendedor' => 'Mantenimiento de pedidos', 'Bodeguero' => 'Mantenimiento de pedido, encargado del estado del empaque', 'Entrega' => 'Mantenimiento de pedidos,encargado del estado de entrega', ]); Passport::setDefaultScope([ 'Vendedor' ]); } }
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Component\Product\Factory; use Sylius\Component\Resource\Factory\FactoryInterface; /** * @author Paweł Jędrzejewski <pawel@sylius.org> * @author Magdalena Banasiak <magdalena.banasiak@lakion.com> */ class ProductFactory implements ProductFactoryInterface { /** * @var FactoryInterface */ private $factory; /** * @var FactoryInterface */ private $variantFactory; /** * @param FactoryInterface $factory * @param FactoryInterface $variantFactory */ public function __construct( FactoryInterface $factory, FactoryInterface $variantFactory ) { $this->factory = $factory; $this->variantFactory = $variantFactory; } /** * {@inheritdoc} */ public function createNew() { return $this->factory->createNew(); } /** * {@inheritdoc} */ public function createWithVariant() { $variant = $this->variantFactory->createNew(); $product = $this->factory->createNew(); $product->addVariant($variant); return $product; } }
<x-guest-layout> <div class="pt-4 bg-bluegray-100"> <div class="min-h-screen flex flex-col items-center pt-6 sm:pt-0"> <div> <x-jet-authentication-card-logo /> </div> <div class="w-full sm:max-w-2xl mt-6 p-6 bg-white shadow-md overflow-hidden sm:rounded-lg prose"> {!! $policy !!} </div> </div> </div> </x-guest-layout>
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Cities; class CitiesController extends Controller { /** * Display a listing of the resource. * * @return Response */ public function index() { $cities=Cities::paginate(10); return view('admin.cities.index',compact('cities')); } /** * Show the form for creating a new resource. * * @return Response */ public function create() { } /** * Store a newly created resource in storage. * * @return Response */ public function store(Request $request) { $cities=Cities::create($request->all()); return back(); } /** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { } /** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $city=Cities::find($id); if(empty($city)) return back(); return view('admin\cities\edit',compact('city')); } /** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id,Request $request) { $city=Cities::find($id)->update($request->all()); return redirect()->route('cities.index'); } /** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $city=Cities::find($id)->delete(); return back(); } } ?>
<div class="logo-top-ad"> <div class="container"> <div class="row"> <!-- Magalla Logo --> <div class="logo col-lg-4"> <a href="{{url('/')}}">{{HTML::image('img/logo.png', 'banner')}}</a> </div> <div class="top-banner col-lg-8"> <?php $fecha = new DateTime(); $hora = $fecha->format('H'); ?> @if($hora > 6 && $hora < 18) {{HTML::image('img/top-banner.jpg', 'banner')}} @else {{HTML::image('img/top-banner2.jpg', 'banner')}} @endif </div> </div> </div> </div>
<?php namespace Portfolio\Http; use Illuminate\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * * @var array */ protected $middleware = [ \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, \Portfolio\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \Portfolio\Http\Middleware\VerifyCsrfToken::class, ]; /** * The application's route middleware. * * @var array */ protected $routeMiddleware = [ 'auth' => \Portfolio\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'guest' => \Portfolio\Http\Middleware\RedirectIfAuthenticated::class, ]; }
<?php namespace App\Models; use Backpack\CRUD\app\Models\Traits\CrudTrait; use Illuminate\Database\Eloquent\Model; class Cities extends Model { use CrudTrait; /* |-------------------------------------------------------------------------- | GLOBAL VARIABLES |-------------------------------------------------------------------------- */ protected $table = 'cities'; // protected $primaryKey = 'id'; // public $timestamps = false; protected $guarded = ['id']; // protected $fillable = []; // protected $hidden = []; // protected $dates = []; /* |-------------------------------------------------------------------------- | FUNCTIONS |-------------------------------------------------------------------------- */ /* |-------------------------------------------------------------------------- | RELATIONS |-------------------------------------------------------------------------- */ /* |-------------------------------------------------------------------------- | SCOPES |-------------------------------------------------------------------------- */ /* |-------------------------------------------------------------------------- | ACCESSORS |-------------------------------------------------------------------------- */ /* |-------------------------------------------------------------------------- | MUTATORS |-------------------------------------------------------------------------- */ }
<?php namespace App\Http\Requests; use App\Http\Requests\Request; use App\Models\detail_service; class Createdetail_serviceRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return detail_service::$rules; } }
@extends('layouts.app') @section('title', 'ユーザー設定') @section('content') @include('includes.user_settings_tab_strip') <form method="POST" action="{{ route('user.update') }}"> @method('patch') @csrf <app-container> <list-view> <template v-slot:title>一般設定</template> <list-view-form-group label-for="student_id"> <template v-slot:label>学籍番号</template> <template v-slot:description> @if (!$circles->isEmpty()) 企画に所属しているため修正できません @endif </template> <input id="student_id" type="text" class="form-control @error('student_id') is-invalid @enderror" name="student_id" value="{{ old('student_id', $user->student_id) }}" {{ !$circles->isEmpty() ? 'readonly' : '' }} required autocomplete="username"> @error('student_id') <template v-slot:invalid>{{ $message }}</template> @enderror <template v-slot:append> {{ '@' . config('portal.univemail_domain') }} </template> </list-view-form-group> <list-view-form-group label-for="name"> <template v-slot:label>名前</template> <template v-slot:description> {{ !$circles->isEmpty() ? '企画に所属しているため修正できません' : '姓と名の間にはスペースを入れてください' }} </template> <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name', $user->name) }}" {{ !$circles->isEmpty() ? 'readonly' : '' }} required autocomplete="name"> @error('name') <template v-slot:invalid>{{ $message }}</template> @enderror </list-view-form-group> <list-view-form-group label-for="name_yomi"> <template v-slot:label>名前(よみ)</template> <template v-slot:description> {{ !$circles->isEmpty() ? '企画に所属しているため修正できません' : '姓と名の間にはスペースを入れてください' }} </template> <input id="name_yomi" type="text" class="form-control @error('name_yomi') is-invalid @enderror" name="name_yomi" value="{{ old('name_yomi', $user->name_yomi) }}" {{ !$circles->isEmpty() ? 'readonly' : '' }} required> @error('name_yomi') <template v-slot:invalid>{{ $message }}</template> @enderror </list-view-form-group> <list-view-form-group label-for="email"> <template v-slot:label>連絡先メールアドレス</template> <template v-slot:description> 連絡先メールアドレスとして学校発行のメールアドレスもご利用になれます </template> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email', $user->email) }}" required autocomplete="email"> @error('email') <template v-slot:invalid>{{ $message }}</template> @enderror </list-view-form-group> <list-view-form-group label-for="tel"> <template v-slot:label>連絡先電話番号</template> <input id="tel" type="tel" class="form-control @error('tel') is-invalid @enderror" name="tel" value="{{ old('tel', $user->tel) }}" required> @error('tel') <template v-slot:invalid>{{ $message }}</template> @enderror </list-view-form-group> </list-view> <list-view> <template v-slot:description>変更を保存するには、現在のパスワードを入力してください</template> <list-view-form-group label-for="password"> <template v-slot:label>現在のパスワード</template> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password"> @error('password') <template v-slot:invalid>{{ $message }}</template> @enderror </list-view-form-group> </list-view> <div class="text-center pt-spacing-md pb-spacing"> <button type="submit" class="btn is-primary is-wide"> 保存 </button> </div> </app-container> </form> @endsection
@extends('layouts.admin') @section('render') <div class="container-fluid pt-5"> <div class="jumbotron"> @include('common.alert') <form action="/change-password" method="post"> <div class="w-75"> <div class="form-group row"> <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> <div class="col-md-8"> <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password"> @error('password') <span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong> </span> @enderror </div> </div> <div class="form-group row"> <label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label> <div class="col-md-8"> <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password"> </div> </div> </div> <div class="row"> <div class="mx-auto"> <button class="btn btn-outline-dark btn-sm"><span class="mx-5">Change Password</span></button> </div> </div> @csrf </form> </div> </div> @endsection
<?php class Kwc_ColumnsResponsive_Basic_Root extends Kwf_Component_NoCategoriesRoot { public static function getSettings() { $ret = parent::getSettings(); $ret['generators']['page']['model'] = new Kwf_Model_FnF(array('data'=>array( array('id'=>3000, 'pos'=>1, 'visible'=>true, 'name'=>'Foo', 'filename' => 'foo', 'parent_id'=>'root', 'component'=>'columns', 'is_home'=>false, 'category' =>'main', 'hide'=>false), ))); $ret['generators']['page']['component'] = array( 'columns' => 'Kwc_ColumnsResponsive_Basic_Paragraphs_Component', ); unset($ret['generators']['title']); unset($ret['generators']['box']); $ret['contentWidth'] = 900; return $ret; } }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Welcome Customer</title> <style type="text/css"> body {margin: 0; padding: 0; min-width: 100%!important;} img {height: auto;} .content {width: 100%; max-width: 600px;} .header {padding: 40px 30px 20px 30px;} .innerpadding {padding: 30px 30px 30px 30px;} .borderbottom {border-bottom: 1px solid #f2eeed;} .subhead {font-size: 15px; color: #ffffff; font-family: sans-serif; letter-spacing: 10px;} .h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;} .h1 {font-size: 33px; line-height: 38px; font-weight: bold;} .h2 {padding: 0 0 15px 0; font-size: 24px; line-height: 28px; font-weight: bold;} .bodycopy {font-size: 16px; line-height: 22px;} .button {text-align: center; font-size: 18px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;} .button a {color: #ffffff; text-decoration: none;} .footer {padding: 20px 30px 15px 30px;} .footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;} .footercopy a {color: #ffffff; text-decoration: underline;} @media only screen and (max-width: 550px), screen and (max-device-width: 550px) { body[yahoo] .hide {display: none!important;} body[yahoo] .buttonwrapper {background-color: transparent!important;} body[yahoo] .button {padding: 0px!important;} body[yahoo] .button a {background-color: #effb41; padding: 15px 15px 13px!important;} body[yahoo] .unsubscribe {display: block; margin-top: 20px; padding: 10px 50px; background: #2f3942; border-radius: 5px; text-decoration: none!important; font-weight: bold;} } /*@media only screen and (min-device-width: 601px) { .content {width: 600px !important;} .col425 {width: 425px!important;} .col380 {width: 380px!important;} }*/ </style> </head> <body yahoo bgcolor="#ffffff"> <table width="100%" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <!--[if (gte mso 9)|(IE)]> <table width="600" align="center" cellpadding="0" cellspacing="0" border="0"> <tr> <td> <![endif]--> <table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0"> <tr> <td bgcolor="#00bcd4" class="header"> <table width="70" align="left" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="70" style="padding: 0 20px 20px 0;"> <img class="fix" src="http://placehold.it/70x70" width="70" height="70" border="0" alt=""/> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> <table width="425" align="left" cellpadding="0" cellspacing="0" border="0"> <tr> <td> <![endif]--> <table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;"> <tr> <td height="70"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="subhead" style="padding: 0 0 0 3px;"> {{--SOME--}} </td> </tr> <tr> <td class="h1" style="padding: 5px 0 0 0;"> Welcome to Hauzeo </td> </tr> </table> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]--> </td> </tr> <tr> <td class="innerpadding borderbottom"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="h2"> Thank you for choosing us. You have successfully registered with us. </td> </tr> <tr> <td class="bodycopy"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tempus adipiscing felis, sit amet blandit ipsum volutpat sed. Morbi porttitor, eget accumsan dictum, nisi libero ultricies ipsum, in posuere mauris neque at erat. </td> </tr> </table> </td> </tr> <tr> <td class="innerpadding borderbottom"> <table width="115" align="left" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="115" style="padding: 0 20px 20px 0;"> <img class="fix" src="http://placehold.it/115x115" width="115" height="115" border="0" alt=""/> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> <table width="380" align="left" cellpadding="0" cellspacing="0" border="0"> <tr> <td> <![endif]--> <table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 380px;"> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="bodycopy"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tempus adipiscing felis, sit amet blandit ipsum volutpat sed. Morbi porttitor, eget accumsan dictum, nisi libero ultricies ipsum, in posuere mauris neque at erat. </td> </tr> <tr> <td style="padding: 20px 0 0 0;"> <table class="buttonwrapper" bgcolor="#effb41" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="button" height="45"> <a href="#">CTA</a> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]--> </td> </tr> <tr> <td class="innerpadding borderbottom"> <img class="fix" src="http://placehold.it/600x200" width="100%" border="0" alt=""/> </td> </tr> <tr> <td class="innerpadding bodycopy"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tempus adipiscing felis, sit amet blandit ipsum volutpat sed. Morbi porttitor, eget accumsan dictum, nisi libero ultricies ipsum, in posuere mauris neque at erat. </td> </tr> <tr> <td class="footer" bgcolor="#44525f"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" class="footercopy"> &reg; Someone, somewhere 2013<br/> <a href="#" class="unsubscribe"><font color="#ffffff">Unsubscribe</font></a> <span class="hide">from this newsletter instantly</span> </td> </tr> <tr> <td align="center" style="padding: 20px 0 0 0;"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="37" style="text-align: center; padding: 0 10px 0 10px;"> <a href="https://www.facebook.com/"> <img src="http://placehold.it/37x37" width="37" height="37" alt="Facebook" border="0"/> </a> </td> <td width="37" style="text-align: center; padding: 0 10px 0 10px;"> <a href="https://www.twitter.com/"> <img src="http://placehold.it/37x37" width="37" height="37" alt="Twitter" border="0"/> </a> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]--> </td> </tr> </table> </body>