Example #1
0
 private function fillTheRest()
 {
     $logos = \App\Myclasses\Arrays::rankLogo();
     $ranks = \App\Myclasses\Arrays::rankList();
     $this->logo = $logos[$this->rankNumber];
     $this->rank = $ranks[$this->rankNumber];
 }
 public function mail(Request $request, $folder = 'inbox')
 {
     $letterId = $request->input('letter');
     if (isset($letterId)) {
         $letter = \App\Letter::find($letterId);
         if ($letter) {
             $id = Auth::user()->id;
             if ($letter->reciever == $id) {
                 $letter->status = 'read';
                 $letter->save();
                 return view($this->localeDir . 'cabinet.singleLetter', compact('letter'));
             } elseif ($letter->sender == $id) {
                 return view($this->localeDir . 'cabinet.singleLetter', compact('letter'));
             }
             return redirect('/cabinet/mail');
             //the letter does not belong to user
         } else {
             return redirect('/cabinet/mail');
         }
         //the letter does not exist
     } else {
         $navigation = Arrays::mailNav($folder);
         switch ($folder) {
             case 'inbox':
                 $letters = Auth::user()->hasInbox()->where('show_reciever', 'true')->orderBy('id', 'desc')->get();
                 return view($this->localeDir . 'cabinet.inbox', compact('letters', 'navigation'));
             case 'sent':
                 $letters = Auth::user()->hasSent()->where('show_sender', 'true')->orderBy('id', 'desc')->get();
                 return view($this->localeDir . 'cabinet.sent', compact('letters', 'navigation'));
             case 'new':
                 $users = \App\User::all();
                 return view($this->localeDir . 'cabinet.newmail', compact('users', 'navigation'));
         }
     }
 }
Example #3
0
 function changeLocale($locale)
 {
     $pairs = \App\Myclasses\Arrays::translate($locale);
     $array = [];
     foreach ($this->result as $key => $value) {
         $newKey = $pairs[$key];
         $array[$newKey] = $value;
     }
     $this->result = $array;
 }
Example #4
0
 public function ZeroChart()
 {
     $total = Planet::count();
     $planets = Arrays::planetTypeArray();
     for ($i = 0; $i < count($planets); $i++) {
         $totalType = Planet::where('planet', $i)->count();
         $result[$planets[$i]] = $totalType / $total * 100;
     }
     return $result;
 }
Example #5
0
 public function __construct($data)
 {
     parent::__construct();
     switch ($data['style']) {
         case 1:
             $this->planets = [0, 1, 2, 3];
             $this->chartSelection = 'life';
             break;
         case 2:
             $this->planets = [0];
             $this->chartSelection = 'metal';
             break;
         case 3:
             $this->planets = [1];
             $this->chartSelection = 'tw';
             break;
         case 4:
             $this->planets = [4];
             $this->chartSelection = 'w';
             break;
         case 5:
             $this->planets = [5];
             $this->chartSelection = 'aw';
             break;
         case 6:
             $this->planets = [3];
             $this->chartSelection = 'el';
             break;
     }
     $this->chartName($this->locale);
     $this->counter = new Counter();
     $this->sizeList = $this->counter->starSelect('size');
     $this->stopList = Arrays::stopList();
     $this->starsArray = Arrays::allStarsArray();
     $this->sizeArray = Arrays::sizeTypeArray();
     $this->total = $this->counter->planetSelect($this->planets);
     $this->starsList = $this->counter->starSelectExcluding($this->stopList);
     $this->searchNormal();
 }
Example #6
0
 public function giveBaryAdder(Request $request)
 {
     $addrId = $request->input('id');
     $stars = \App\Myclasses\Arrays::allStarsArray(true);
     $sizes = \App\Myclasses\Arrays::sizeTypeArray();
     if ($addrId > 0) {
         $converter = new \App\Myclasses\Insides\Converter($addrId);
         return view($this->localeDir . 'templates.addBary', compact('stars', 'sizes', 'addrId', 'converter'));
     }
 }
Example #7
0
 protected function makePlanetExtras(planetExtraInfo $extra)
 {
     $array = [];
     $atmosphere = [];
     $composition = [];
     $commonNames = \App\Myclasses\Arrays::commonExtraNames();
     $volcanism = \App\Myclasses\Arrays::volcanism();
     $atmType = \App\Myclasses\Arrays::atmosphereType();
     foreach ($extra->common as $key => $value) {
         if ($key == 'volcanism') {
             $value = $volcanism[$value];
         }
         if ($key == 'atm_type') {
             $value = $atmType[$value];
         }
         $newKey = $commonNames[$key];
         $array[$newKey] = $value;
     }
     $compName = \App\Myclasses\Arrays::planetComposition();
     foreach ($extra->composition as $key => $value) {
         $newKey = $compName[$key];
         $composition[$newKey] = $value . ' %';
     }
     $array['composition'] = $composition;
     $atmNames = \App\Myclasses\Arrays::atmosphereComposition();
     foreach ($extra->atmosphere as $key => $value) {
         if ($value == 0) {
             continue;
         }
         $newKey = $atmNames[$key];
         $atmosphere[$newKey] = $value . ' %';
     }
     $array['atmosphereC'] = $atmosphere;
     $orbitNames = \App\Myclasses\Arrays::orbitExtraNames();
     foreach ($extra->orbit as $key => $value) {
         $newKey = $orbitNames[$key];
         $array[$newKey] = $value;
     }
     return $array;
 }
Example #8
0
 function changeLocale($locale)
 {
     $pairs = Arrays::translate($locale);
     $this->name = $this->thirdChartName($locale, $this->nameStyle);
     $array = [];
     foreach ($this->result as $key => $value) {
         $newKey = $pairs[$key];
         $array[$newKey] = $value;
     }
     $this->result = $array;
     $array2 = [];
     foreach ($this->total as $key => $value) {
         $newKey = $pairs[$key];
         $array2[$newKey] = $value;
     }
     $this->total = $array2;
     $this->planetTypeArray = Arrays::planetTypeArray();
 }
Example #9
0
 public function moderationCharts(Request $request)
 {
     $data = $request->all();
     $colors = Arrays::colorList();
     if (isset($data['step'])) {
         $data['planet'] = 543210;
         $chart = Charter::draw(1, $data);
         if ($chart->anything == 0) {
             return \App\Myclasses\Response::noData();
         } else {
             return view($this->localeDir . 'charts.firstModeration', compact('chart', 'colors'));
         }
     } else {
         $chart = Charter::draw(3, $data);
         if (!$chart->result) {
             return \App\Myclasses\Response::noData();
         }
         return view($this->localeDir . 'charts.threeModer', compact('chart', 'colors'));
     }
 }
Example #10
0
        <input type="hidden" value="delete" name="action">
        <button type="submit" class="btn btn-danger">Delete</button>
    </form>
@endif

@if($data['type'] == 'planet' || $data['type'] == 'bari')
    <?php 
switch ($data['type']) {
    case 'planet':
        $planetData = \App\Planet::find($data['id']);
        break;
    default:
        $planetData = \App\Bariplanet::find($data['id']);
        break;
}
$planets = \App\Myclasses\Arrays::planetsForCabinet();
?>
    <h5>Provided the data: <span class="white">{{$planetData->user->name}}</span></h5>
    <form class="form-inline" method="get" action="{{route('changeObject')}}">
        <input type="hidden" value="{{$data['id']}}" name="id">
        <input type="hidden" value="{{$data['type']}}" name="type">
        <input type="hidden" value="change" name="action">
        <label for="planetD">Planet</label>
        <select name="planet" id="planetD">
            <option value="{{$planetData->planet}}">{{$planets[$planetData->planet]}}</option>
            @foreach($planets as $key=>$value)
                <option value="{{$key}}">{{$value}}</option>
            @endforeach
        </select>
        <label for="distanceD">Distance</label>
        <input type="text" name="distance" value="{{$planetData->distance}}" id="distanceD">
Example #11
0
@extends('elite')
@section('title')
    Moderation panel|@parent
@stop
@section('content')
    <h2>Moderation panel</h2>
    <div class="cabmenu">
        <?php 
$admRouts = \App\Myclasses\Arrays::adminRouts();
$curRoute = \Route::currentRouteName();
?>
        @foreach($admRouts as $name =>$value)
            @if($name==$curRoute)
                <a href="{{route($name)}}" id="chosenOne">{{$value}}</a>
            @else
                <a href="{{route($name)}}">{{$value}}</a>
            @endif

        @endforeach
    </div>
    @yield('locale')
@stop
@section('scripts')
    @parent

    <script type="text/javascript" src="/js/modercharts.js"></script>
    <script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
    <script type="text/javascript" src="/js/gray.js"></script>
    <script type="text/javascript" src="/js/drilldown.js"></script>
    <script type="text/javascript" src="/js/someAction.js"></script>
    <script type="text/javascript" src="/js/navigation.js"></script>
 public function unitePost(Request $request)
 {
     $data = $request->except('_token');
     $planets = \App\Planet::where('planet', $data['planet'])->wherePlandataPrice()->get();
     $array = [];
     $name = '';
     $axis = '';
     $axisNames = [];
     foreach ($planets as $planet) {
         $param = '';
         switch ($data['type']) {
             case 'g':
                 $param = \App\Myclasses\Counter::gravity($planet->mass, $planet->radius);
                 $name = 'Цена от гравитации';
                 $axis = 'G';
                 break;
             case 's':
                 $param = $planet->radius;
                 $name = 'Цена от радиуса';
                 $axis = 'радиус км';
                 break;
             case 't':
                 $param = $planet->temperature;
                 $name = 'Цена от температуры';
                 $axis = 'температура K';
                 break;
             case 'm':
                 $param = $planet->mass;
                 $name = 'Цена от массы';
                 $axis = 'Массы Земли';
                 break;
             case 'p':
                 $param = $planet->pressure;
                 $name = 'Цена от давления';
                 $axis = 'Атмосферы';
                 break;
             case 'a':
                 $param = $planet->atm_type;
                 $name = 'Цена от типа атмосферы';
                 $axis = 'Тип атмосферы';
                 $axisNames = \App\Myclasses\Arrays::atmosphereType();
                 break;
             case 'sg':
                 $param = $planet->{$data}['gas'];
                 $name = 'Цена от состава атмосферы';
                 $axis = 'Концентрация %';
                 break;
             case 'so':
                 $param = $planet->{$data}['orbit'];
                 $name = 'Цена от параметров орбиты';
                 $axis = 'Значение';
                 break;
             case 'v':
                 $param = $planet->volcanism;
                 $name = 'Цена от вулканизма';
                 $axis = 'Тип вулканизма';
                 $axisNames = \App\Myclasses\Arrays::volcanism();
                 break;
         }
         $array[] = ['param' => $param, 'price' => $planet->price];
     }
     return view('moderation.graph', compact('array', 'name', 'axis', 'axisNames'));
 }
Example #13
0
@extends('eliteRu')
@section('title')
    Кабинет|@parent
@stop
@section('styles')
    @parent
    <link href="/time/styles/glDatePicker.default.css" rel="stylesheet" type="text/css">
@stop
@section('content')
    <h2>Личный кабинет</h2>
    <div class="cabmenu">
        <?php 
$cabRouts = \App\Myclasses\Arrays::cabinetRouts();
$curRoute = \Route::currentRouteName();
?>
        @foreach($cabRouts as $name =>$value)
            @if($name==$curRoute)
                    <a href="{{route($name)}}" id="chosenOne">{{$value}}</a>
                @else
                    <a href="{{route($name)}}">{{$value}}</a>
                @endif

        @endforeach
    </div>
    @yield('local')
@stop
@section('scripts')
    @parent
    <script type="text/javascript" src="/js/cabinetselect.js"></script>
    <script type="text/javascript" src="/js/someAction.js"></script>
    <script src="/time/glDatePicker.min.js"></script>
Example #14
0
				<ul class="nav navbar-nav navbar-right">
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">{{ Auth::user()->name }} <span class="caret"></span></a>
							<ul class="dropdown-menu" role="menu">
								<li><a href="{{ url('/auth/logout') }}">Logout</a></li>
							</ul>
						</li>
				</ul>
			</div>
		</div>
	</nav>
    <div class="row">
        <div class="col-md-2">
            <ul class="nav nav-pills nav-stacked">
                <?php 
$moderRouts = \App\Myclasses\Arrays::moderRouts();
$curRoute = \Route::currentRouteName();
?>
                    @foreach($moderRouts as $name =>$value)
                        @if($name==$curRoute)
                            <li role="presentation" class="active"><a href="{{route($name)}}">{{$value}}</a></li>
                        @else
                            <li role="presentation"><a href="{{route($name)}}">{{$value}}</a></li>
                        @endif

                    @endforeach
            </ul>
        </div>
        <div class="col-md-10">
            @yield('content')
        </div>
 public function mail(Request $request, $folder = 'inbox')
 {
     $letterId = $request->input('letter');
     if (isset($letterId)) {
         $letter = \App\Letter::find($letterId);
         if ($letter) {
             if ($letter->reciever == 1) {
                 $letter->status = 'read';
                 $letter->save();
                 return view($this->localeDir . 'administration.singleLetter', compact('letter'));
             } elseif ($letter->sender == 1) {
                 return view($this->localeDir . 'administration.singleLetter', compact('letter'));
             }
             return redirect('/administration/mail');
         } else {
             return redirect('/administration/mail');
         }
     } else {
         $navigation = \App\Myclasses\Arrays::mailNav($folder);
         switch ($folder) {
             case 'inbox':
                 $letters = \App\User::find(1)->hasInbox()->where('show_reciever', 'true')->orderBy('id', 'desc')->get();
                 return view($this->localeDir . 'administration.inbox', compact('letters', 'navigation'));
             case 'sent':
                 $letters = \App\User::find(1)->hasSent()->where('show_sender', 'true')->orderBy('id', 'desc')->get();
                 return view($this->localeDir . 'administration.sent', compact('letters', 'navigation'));
             case 'new':
                 $users = \App\User::all();
                 return view($this->localeDir . 'administration.newmail', compact('users', 'navigation'));
         }
         return view($this->localeDir . 'administration.adminmail');
     }
 }
Example #16
0
 function changeLocale($locale)
 {
     $this->headerName($locale);
     $this->planetTypeArray = Arrays::planetTypeArray();
 }