added user authorization
This commit is contained in:
parent
155b779408
commit
2dff38d6dc
|
|
@ -13,7 +13,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'single'),
|
||||
'default' => env('LOG_CHANNEL', 'info'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -42,6 +42,11 @@ return [
|
|||
'path' => storage_path('logs/system.log'),
|
||||
'level' => 'debug',
|
||||
],
|
||||
'info' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/info.log'),
|
||||
'level' => 'debug',
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ class User extends UserBase
|
|||
'groups' => [UserGroup::class, 'table' => 'users_groups']
|
||||
];
|
||||
|
||||
public $hasOne = [
|
||||
'shop' => [
|
||||
'Tps\Shops\Models\Shop',
|
||||
]
|
||||
];
|
||||
|
||||
public $attachOne = [
|
||||
'avatar' => \System\Models\File::class
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<?php namespace Tps\Shops;
|
||||
|
||||
use System\Classes\PluginBase;
|
||||
use Tps\Shops\Models\Report;
|
||||
use ZipArchive;
|
||||
|
||||
class Plugin extends PluginBase
|
||||
{
|
||||
|
|
@ -11,4 +13,44 @@ class Plugin extends PluginBase
|
|||
public function registerSettings()
|
||||
{
|
||||
}
|
||||
|
||||
// public function boot() {
|
||||
|
||||
// Report::extend(function($model) {
|
||||
// // for create time only
|
||||
// $model->bindEvent('model.beforeSave', function() use ($model) {
|
||||
|
||||
// $records = \October\Rain\Database\Models\DeferredBinding::where([
|
||||
// 'master_type' => 'Tps\Shops\Models\Report', // <- REPLACE WITH YOUR MODEL(ModelName)
|
||||
// "master_field" => "file", // <- REPLACE WITH ATTACHEMNT MODEL (gallery)
|
||||
// "slave_type" => "System\Models\File",
|
||||
// "session_key" => post('_session_key')
|
||||
// ])->get();
|
||||
|
||||
|
||||
// foreach($records as $record) {
|
||||
// $fileRecord = \System\Models\File::find($record->slave_id);
|
||||
|
||||
// // $fileRecord = \System\Models\File::find($this->id);
|
||||
|
||||
// $zip = new ZipArchive();
|
||||
// $status = $zip->open($fileRecord->getRealPath());
|
||||
// if ($status !== true) {
|
||||
// throw new \Exception($status);
|
||||
// }
|
||||
// else{
|
||||
// $storageDestinationPath= storage_path("app/uploads/unzip/");
|
||||
|
||||
// if (!\File::exists( $storageDestinationPath)) {
|
||||
// \File::makeDirectory($storageDestinationPath, 0755, true);
|
||||
// }
|
||||
// $zip->extractTo($storageDestinationPath);
|
||||
// $zip->close();
|
||||
// // return back()
|
||||
// // ->with('success','You have successfully extracted zip.');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
<?php namespace Tps\Shops\Classes;
|
||||
|
||||
use Hash;
|
||||
use Backend;
|
||||
use Config;
|
||||
use Url;
|
||||
use Backend\Controllers\Files;
|
||||
use Mail;
|
||||
use System\Models\File;
|
||||
|
||||
class FileAttachment extends File
|
||||
{
|
||||
|
||||
protected function getPartitionDirectory()
|
||||
{
|
||||
if (strpos($this->disk_name, 'hoto/'))
|
||||
return '';
|
||||
|
||||
return 'file/'. implode('/', array_slice(explode( "-", $this->disk_name), 0, 3)) . '/';
|
||||
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Generates a disk name from the supplied file name.
|
||||
// */
|
||||
protected function getDiskName()
|
||||
{
|
||||
if ($this->disk_name !== null) {
|
||||
return $this->disk_name;
|
||||
}
|
||||
|
||||
$ext = strtolower($this->getExtension());
|
||||
|
||||
// If file was uploaded without extension, attempt to guess it
|
||||
if (!$ext && $this->data instanceof UploadedFile) {
|
||||
$ext = $this->data->guessExtension();
|
||||
}
|
||||
|
||||
// $name = str_replace('.', '', uniqid(null, true));
|
||||
|
||||
$name = str_replace('.', '', date('Y-m-d-').uniqid(null, true));
|
||||
|
||||
return $this->disk_name = !empty($ext) ? $name.'.'.$ext : $name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php namespace Tps\Shops\Controllers;
|
||||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
|
||||
class Report extends Controller
|
||||
{
|
||||
public $implement = [ 'Backend\Behaviors\ListController', 'Backend\Behaviors\FormController' ];
|
||||
|
||||
public $listConfig = 'config_list.yaml';
|
||||
public $formConfig = 'config_form.yaml';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
BackendMenu::setContext('Tps.Shops', 'main-menu-item', 'side-menu-item6');
|
||||
}
|
||||
|
||||
public function onZipExtract(){
|
||||
dd("bcas");
|
||||
}
|
||||
|
||||
public function onSaveAndNew($context = null)
|
||||
{
|
||||
// parent::update_onSave($context);
|
||||
// dump("bcas");
|
||||
// dd("bcas");
|
||||
$aa = $this->name;
|
||||
echo '<script language="javascript">';
|
||||
echo '<script type="text/javascript">alert("' . $aa . '")</script>';
|
||||
echo 'alert("message successfully sent")';
|
||||
echo '</script>';
|
||||
// return \Backend::redirect('tps/shops/report');
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
use Backend\Classes\Controller;
|
||||
use BackendMenu;
|
||||
use Illuminate\Http\Request;
|
||||
use Tps\Shops\Models\Shop;
|
||||
|
||||
class Shops extends Controller
|
||||
{
|
||||
|
|
@ -16,4 +18,10 @@ class Shops extends Controller
|
|||
parent::__construct();
|
||||
BackendMenu::setContext('Tps.Shops', 'main-menu-item');
|
||||
}
|
||||
|
||||
public function updateShop(Request $request){
|
||||
Shop::where("id",$request->id)->first()->update($request->all());
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
<div data-control="toolbar">
|
||||
<a href="<?= Backend::url('tps/shops/report/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
|
||||
<button
|
||||
class="btn btn-default oc-icon-trash-o"
|
||||
disabled="disabled"
|
||||
onclick="$(this).data('request-data', {
|
||||
checked: $('.control-list').listWidget('getChecked')
|
||||
})"
|
||||
data-request="onDelete"
|
||||
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
|
||||
data-trigger-action="enable"
|
||||
data-trigger=".control-list input[type=checkbox]"
|
||||
data-trigger-condition="checked"
|
||||
data-request-success="$(this).prop('disabled', true)"
|
||||
data-stripe-load-indicator>
|
||||
<?= e(trans('backend::lang.list.delete_selected')) ?>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
name: Report
|
||||
form: $/tps/shops/models/report/fields.yaml
|
||||
modelClass: Tps\Shops\Models\Report
|
||||
defaultRedirect: tps/shops/report
|
||||
create:
|
||||
redirect: 'tps/shops/report/update/:id'
|
||||
redirectClose: tps/shops/report
|
||||
update:
|
||||
redirect: tps/shops/report
|
||||
redirectClose: tps/shops/report
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
list: $/tps/shops/models/report/columns.yaml
|
||||
modelClass: Tps\Shops\Models\Report
|
||||
title: Report
|
||||
noRecordsMessage: 'backend::lang.list.no_records'
|
||||
showSetup: true
|
||||
showCheckboxes: true
|
||||
recordsPerPage: 20
|
||||
toolbar:
|
||||
buttons: list_toolbar
|
||||
search:
|
||||
prompt: 'backend::lang.list.search_prompt'
|
||||
recordUrl: 'tps/shops/report/update/:id'
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('tps/shops/report') ?>">Report</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
|
||||
<?= Form::open(['class' => 'layout']) ?>
|
||||
|
||||
<div class="layout-row">
|
||||
<?= $this->formRender() ?>
|
||||
</div>
|
||||
|
||||
<div class="form-buttons">
|
||||
<div class="loading-indicator-container">
|
||||
<button
|
||||
type="submit"
|
||||
data-request="onSave"
|
||||
data-request-data="redirect:0"
|
||||
data-hotkey="ctrl+s, cmd+s"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving_name', ['name'=>$formRecordName])) ?>"
|
||||
class="btn btn-primary">
|
||||
<?= e(trans('backend::lang.form.save')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-request="onSave"
|
||||
data-request-data="close:1"
|
||||
data-hotkey="ctrl+enter, cmd+enter"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving_name', ['name'=>$formRecordName])) ?>"
|
||||
class="btn btn-default">
|
||||
<?= e(trans('backend::lang.form.save_and_close')) ?>
|
||||
</button>
|
||||
<span class="btn-text">
|
||||
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('tps/shops/report') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= Form::close() ?>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||
<p><a href="<?= Backend::url('tps/shops/report') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<?= $this->listRender() ?>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('tps/shops/report') ?>">Report</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<div class="form-preview">
|
||||
<?= $this->formRenderPreview() ?>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e($this->fatalError) ?></p>
|
||||
<?php endif ?>
|
||||
|
||||
<p>
|
||||
<a href="<?= Backend::url('tps/shops/report') ?>" class="btn btn-default oc-icon-chevron-left">
|
||||
<?= e(trans('backend::lang.form.return_to_list')) ?>
|
||||
</a>
|
||||
</p>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<?php Block::put('breadcrumb') ?>
|
||||
<ul>
|
||||
<li><a href="<?= Backend::url('tps/shops/report') ?>">Report</a></li>
|
||||
<li><?= e($this->pageTitle) ?></li>
|
||||
</ul>
|
||||
<?php Block::endPut() ?>
|
||||
|
||||
<?php if (!$this->fatalError): ?>
|
||||
|
||||
<?= Form::open(['class' => 'layout']) ?>
|
||||
|
||||
<div class="layout-row">
|
||||
<?= $this->formRender() ?>
|
||||
</div>
|
||||
|
||||
<div class="form-buttons">
|
||||
<div class="loading-indicator-container">
|
||||
<button
|
||||
type="submit"
|
||||
data-request="onSave"
|
||||
data-request-data="redirect:0"
|
||||
data-hotkey="ctrl+s, cmd+s"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-primary">
|
||||
<?= e(trans('backend::lang.form.save')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-request="onSave"
|
||||
data-request-data="close:1"
|
||||
data-hotkey="ctrl+enter, cmd+enter"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving')) ?>"
|
||||
class="btn btn-default">
|
||||
<?= e(trans('backend::lang.form.save_and_close')) ?>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-request="onSaveAndNew"
|
||||
data-request-data="close:1"
|
||||
data-hotkey="ctrl+n, cmd+n"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.saving_name', ['name'=>$formRecordName])) ?>"
|
||||
class="btn btn-default">
|
||||
Extract Zip
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="oc-icon-trash-o btn-icon danger pull-right"
|
||||
data-request="onDelete"
|
||||
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
|
||||
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
|
||||
</button>
|
||||
<span class="btn-text">
|
||||
<a href="{{route('zip.extract', '5')}}">Zip Extract</a>
|
||||
</span>
|
||||
<br>
|
||||
<span class="btn-text">
|
||||
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('tps/shops/report') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?= Form::close() ?>
|
||||
|
||||
<?php else: ?>
|
||||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p>
|
||||
<p><a href="<?= Backend::url('tps/shops/report') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
|
||||
<?php endif ?>
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
<?php namespace Tps\Shops\Models;
|
||||
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Model;
|
||||
use October\Rain\Exception\ApplicationException;
|
||||
use October\Rain\Support\Facades\Input;
|
||||
use ZipArchive;
|
||||
|
||||
/**
|
||||
* Model
|
||||
*/
|
||||
class Report extends Model
|
||||
{
|
||||
use \October\Rain\Database\Traits\Validation;
|
||||
|
||||
|
||||
public $implement = ['RainLab.Translate.Behaviors.TranslatableModel'];
|
||||
/*
|
||||
* Disable timestamps by default.
|
||||
* Remove this line if timestamps are defined in the database table.
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @var string The database table used by the model.
|
||||
*/
|
||||
public $table = 'tps_shops_reports';
|
||||
|
||||
/**
|
||||
* @var array Validation rules
|
||||
*/
|
||||
public $rules = [];
|
||||
|
||||
public $attachOne = [
|
||||
'file' => 'System\Models\File',
|
||||
// 'file' => 'Tps\Shops\Classes\FileAttachment',
|
||||
];
|
||||
|
||||
public $translatable = ['name'];
|
||||
|
||||
// public function afterSave()
|
||||
// public function beforeSave()
|
||||
public function formAfterSave($model)
|
||||
{
|
||||
// $this->name = $this->file;
|
||||
$filePath = \System\Models\File::find($model->id)->getLocalPath();
|
||||
|
||||
// $filePath = Input::file('file')->getPath();
|
||||
Log::error("FILE PATH IS ------------------------".$filePath);
|
||||
|
||||
// throw new ApplicationException("FILE PATH IS ------------------------".$filePath);
|
||||
// App::abort(403, "FILE PATH IS ------------------------".$filePath);
|
||||
// $fileRecord = Input::file('file');
|
||||
// $fileRecord = \System\Models\File::find($model->id);
|
||||
// $files = \System\Models\File::find($model->file);
|
||||
// $new = $this->file()->withDeferred($this->sessionKey)->first()->getPath();;
|
||||
// $fileRecord = \October\Rain\Database\Models\DeferredBinding::where([
|
||||
// 'master_type' => 'Tps\Shops\Models\Report', // <- REPLACE WITH YOUR MODEL(ModelName)
|
||||
// "master_field" => "file", // <- REPLACE WITH ATTACHEMNT MODEL (gallery)
|
||||
// "slave_type" => "System\Models\File",
|
||||
// "session_key" => post('_session_key')
|
||||
// ])->get()->first();
|
||||
|
||||
// $fileRecord = (new \System\Models\File)->fromData($model->file, 'logo.png');
|
||||
// $fileRecord = $model->file->getPath();;
|
||||
// $fileRecord = $model->file->getLocalPath();;
|
||||
// if($fileRecord){
|
||||
// echo "<script>console.log('Debug Objects: " . $fileRecord . "' );</script>";
|
||||
// dd($fileRecord);
|
||||
|
||||
// $zip = new ZipArchive();
|
||||
// $status = $zip->open($fileRecord);
|
||||
// if ($status !== true) {
|
||||
// throw new \Exception($status);
|
||||
// }
|
||||
// else{
|
||||
// $storageDestinationPath= storage_path("app/uploads/unzip/");
|
||||
|
||||
// if (!\File::exists( $storageDestinationPath)) {
|
||||
// \File::makeDirectory($storageDestinationPath, 0755, true);
|
||||
// }
|
||||
// $zip->extractTo($storageDestinationPath);
|
||||
// $zip->close();
|
||||
// // return back()
|
||||
// // ->with('success','You have successfully extracted zip.');
|
||||
// }
|
||||
// }else{
|
||||
// // dd("aaa");
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -21,6 +21,8 @@ class Shop extends Model
|
|||
public $rules = [
|
||||
];
|
||||
|
||||
public $fillable = ["name", "floor", "phone", "instagram_name", "instagram_link"];
|
||||
|
||||
public $attachOne = [
|
||||
'badge' => 'System\Models\File',
|
||||
'image' => 'System\Models\File',
|
||||
|
|
@ -30,6 +32,9 @@ class Shop extends Model
|
|||
'category' => [
|
||||
'Tps\Shops\Models\Category'
|
||||
],
|
||||
'user' => [
|
||||
'RainLab\User\Models\User'
|
||||
],
|
||||
];
|
||||
|
||||
public $translatable = ['name','description','open_time'];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
columns:
|
||||
date:
|
||||
label: date
|
||||
type: text
|
||||
name:
|
||||
label: name
|
||||
type: text
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
fields:
|
||||
date:
|
||||
label: Date
|
||||
mode: date
|
||||
span: auto
|
||||
type: datepicker
|
||||
name:
|
||||
label: Name
|
||||
span: auto
|
||||
type: text
|
||||
file:
|
||||
label: File
|
||||
span: auto
|
||||
mode: file
|
||||
useCaption: true
|
||||
thumbOptions:
|
||||
mode: crop
|
||||
extension: auto
|
||||
fileTypes: 'zip,rar'
|
||||
type: fileupload
|
||||
|
|
@ -9,6 +9,12 @@ fields:
|
|||
descriptionFrom: name
|
||||
span: auto
|
||||
type: relation
|
||||
user:
|
||||
label: User
|
||||
nameFrom: name
|
||||
descriptionFrom: name
|
||||
span: auto
|
||||
type: relation
|
||||
floor:
|
||||
label: Floor
|
||||
span: auto
|
||||
|
|
|
|||
|
|
@ -30,3 +30,7 @@ navigation:
|
|||
label: Sliders
|
||||
url: tps/shops/sliders
|
||||
icon: icon-square
|
||||
side-menu-item6:
|
||||
label: Report
|
||||
url: tps/shops/report
|
||||
icon: icon-file-pdf-o
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
use Tps\Shops\Controllers\Shops;
|
||||
|
||||
// Route::post('fatoni/generate/api', array('as' => 'fatoni.generate.api', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\ApiGeneratorController@generateApi'));
|
||||
// Route::post('fatoni/update/api/{id}', array('as' => 'fatoni.update.api', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\ApiGeneratorController@updateApi'));
|
||||
// Route::get('fatoni/delete/api/{id}', array('as' => 'fatoni.delete.api', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\ApiGeneratorController@deleteApi'));
|
||||
|
||||
// Route::resource('api/news', 'AhmadFatoni\ApiGenerator\Controllers\API\newsController', ['except' => ['destroy', 'create', 'edit']]);
|
||||
// Route::get('api/news/{id}/delete', ['as' => 'api/news.delete', 'uses' => 'AhmadFatoni\ApiGenerator\Controllers\API\newsController@destroy']);
|
||||
|
||||
|
||||
// Custom Routes
|
||||
Route::name('update.shop')->any('update/shop', 'Tps\Shops\Controllers\Shops@updateShop');
|
||||
Route::name('report.create')->any('add/report', 'Tps\Shops\Controllers\Reports@createReport');
|
||||
Route::name('zip.extract')->any('zip/extract/{id}', 'Tps\Shops\Controllers\Reports@createReport');
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php namespace Tps\Shops\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableCreateTpsShopsReports extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tps_shops_reports', function($table)
|
||||
{
|
||||
$table->engine = 'InnoDB';
|
||||
$table->increments('id')->unsigned();
|
||||
$table->date('date');
|
||||
$table->text('name');
|
||||
$table->text('file');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tps_shops_reports');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace Tps\Shops\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateTpsShops11 extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('tps_shops_', function($table)
|
||||
{
|
||||
$table->integer('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('tps_shops_', function($table)
|
||||
{
|
||||
$table->dropColumn('user_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -66,3 +66,9 @@
|
|||
1.0.23:
|
||||
- 'Created table tps_shops_sales'
|
||||
- builder_table_create_tps_shops_sales.php
|
||||
1.0.24:
|
||||
- 'Updated table tps_shops_'
|
||||
- builder_table_update_tps_shops__11.php
|
||||
1.0.25:
|
||||
- 'Created table tps_shops_reports'
|
||||
- builder_table_create_tps_shops_reports.php
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
description = "Default layout"
|
||||
|
||||
[localePicker]
|
||||
forceUrl = 0
|
||||
|
||||
[session]
|
||||
security = "all"
|
||||
|
||||
[account]
|
||||
paramCode = "code"
|
||||
forceSecure = 0
|
||||
requirePassword = 0
|
||||
|
||||
[localePicker]
|
||||
forceUrl = 0
|
||||
==
|
||||
<?php
|
||||
function onStart(){
|
||||
|
|
@ -88,6 +93,7 @@ function onStart(){
|
|||
{% page %}
|
||||
|
||||
{% partial 'site/footer' %}
|
||||
{% partial 'site/login' %}
|
||||
|
||||
<script src="{{ 'assets/js/jquery.js'|theme }}"></script>
|
||||
<script src="{{ 'assets/js/main.js'|theme }}"></script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,167 @@
|
|||
title = "profile"
|
||||
url = "/profile"
|
||||
layout = "default"
|
||||
is_hidden = 0
|
||||
|
||||
[session]
|
||||
security = "user"
|
||||
redirect = "home"
|
||||
==
|
||||
{% component 'session' %}
|
||||
|
||||
<!-- Breadcrumb ======================= -->
|
||||
<section class="crumb">
|
||||
<div class="auto_container">
|
||||
<div class="crumb_wrap">
|
||||
<div class="crumb_row">
|
||||
<a href="index.html" class="crumb_title">
|
||||
<span>
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M1.25 12.88V6.91459C1.25 6.33752 1.51642 5.79278 1.97193 5.4385L6.85193 1.64294C7.52721 1.11773 8.47279 1.11773 9.14807 1.64294L14.0281 5.4385C14.4836 5.79278 14.75 6.33752 14.75 6.91459V12.88C14.75 13.9128 13.9128 14.75 12.88 14.75H10.75C10.4739 14.75 10.25 14.5261 10.25 14.25V11.6487C10.25 11.3855 10.207 11.1193 10.0677 10.896C9.88545 10.6039 9.64228 10.3523 9.35303 10.1595C8.95253 9.89251 8.48167 9.75 8 9.75C7.51833 9.75 7.04747 9.89251 6.64697 10.1595C6.35772 10.3523 6.11455 10.6039 5.93234 10.896C5.79305 11.1193 5.75 11.3855 5.75 11.6487V14.25C5.75 14.5261 5.52614 14.75 5.25 14.75H3.12C2.08723 14.75 1.25 13.9128 1.25 12.88Z"
|
||||
stroke="#292929" stroke-width="1.5" stroke-linecap="round"
|
||||
stroke-linejoin="round" />
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
Главная
|
||||
</a>
|
||||
|
||||
<h4 class="crumb_title">
|
||||
Профиль
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Breadcrumb end =================== -->
|
||||
|
||||
<!-- Bills ============================= -->
|
||||
<section class="bill">
|
||||
<div class="auto_container">
|
||||
<div class="bill_wrap">
|
||||
<div class="bill_box">
|
||||
<div class="bill_aside wow fadeInLeft" data-wow-duration=".3s" data-wow-delay=".1s">
|
||||
<h4 class="bill_aside-title tabBtn active" data-tab="#bill-1">
|
||||
Счета
|
||||
</h4>
|
||||
|
||||
<h4 class="bill_aside-title tabBtn" data-tab="#bill-2">
|
||||
Контактная информация
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="bill_info tabItem active" id="bill-1">
|
||||
<div class="bill_item downloaded wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".1s">
|
||||
<div>
|
||||
<p>
|
||||
23.02.2023
|
||||
</p>
|
||||
<p>
|
||||
Счет за электричество
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<a href="#" download="#" class="bill_item-link">
|
||||
<span>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M19 18H5C4.44772 18 4 18.4477 4 19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19C20 18.4477 19.5523 18 19 18Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M4 17V19C4 19.5523 4.44772 20 5 20C5.55228 20 6 19.5523 6 19V17C6 16.4477 5.55228 16 5 16C4.44772 16 4 16.4477 4 17Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M18 17V19C18 19.5523 18.4477 20 19 20C19.5523 20 20 19.5523 20 19V17C20 16.4477 19.5523 16 19 16C18.4477 16 18 16.4477 18 17Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M11.9995 15C11.7921 15.0016 11.5895 14.9387 11.4195 14.82L7.41946 12C7.20387 11.8471 7.05761 11.615 7.01263 11.3545C6.96766 11.0941 7.02764 10.8264 7.17946 10.61C7.25525 10.5019 7.35171 10.4098 7.46327 10.3391C7.57483 10.2684 7.69928 10.2206 7.82945 10.1982C7.95961 10.1759 8.09291 10.1796 8.22164 10.2091C8.35037 10.2386 8.47198 10.2933 8.57946 10.37L11.9995 12.76L15.3995 10.2C15.6116 10.0409 15.8783 9.97255 16.1409 10.0101C16.4034 10.0476 16.6403 10.1878 16.7995 10.4C16.9586 10.6122 17.0269 10.8789 16.9894 11.1414C16.9519 11.404 16.8116 11.6409 16.5995 11.8L12.5995 14.8C12.4264 14.9298 12.2158 15 11.9995 15Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M12 13C11.7348 13 11.4804 12.8946 11.2929 12.7071C11.1054 12.5196 11 12.2652 11 12V4C11 3.73478 11.1054 3.48043 11.2929 3.29289C11.4804 3.10536 11.7348 3 12 3C12.2652 3 12.5196 3.10536 12.7071 3.29289C12.8946 3.48043 13 3.73478 13 4V12C13 12.2652 12.8946 12.5196 12.7071 12.7071C12.5196 12.8946 12.2652 13 12 13Z"
|
||||
fill="#292929" />
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
Скачать PDF файл
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bill_item downloaded wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".13s">
|
||||
<div>
|
||||
<p>
|
||||
23.02.2023
|
||||
</p>
|
||||
<p>
|
||||
Счет за свет
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<a href="#" download="#" class="bill_item-link">
|
||||
<span>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M19 18H5C4.44772 18 4 18.4477 4 19C4 19.5523 4.44772 20 5 20H19C19.5523 20 20 19.5523 20 19C20 18.4477 19.5523 18 19 18Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M4 17V19C4 19.5523 4.44772 20 5 20C5.55228 20 6 19.5523 6 19V17C6 16.4477 5.55228 16 5 16C4.44772 16 4 16.4477 4 17Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M18 17V19C18 19.5523 18.4477 20 19 20C19.5523 20 20 19.5523 20 19V17C20 16.4477 19.5523 16 19 16C18.4477 16 18 16.4477 18 17Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M11.9995 15C11.7921 15.0016 11.5895 14.9387 11.4195 14.82L7.41946 12C7.20387 11.8471 7.05761 11.615 7.01263 11.3545C6.96766 11.0941 7.02764 10.8264 7.17946 10.61C7.25525 10.5019 7.35171 10.4098 7.46327 10.3391C7.57483 10.2684 7.69928 10.2206 7.82945 10.1982C7.95961 10.1759 8.09291 10.1796 8.22164 10.2091C8.35037 10.2386 8.47198 10.2933 8.57946 10.37L11.9995 12.76L15.3995 10.2C15.6116 10.0409 15.8783 9.97255 16.1409 10.0101C16.4034 10.0476 16.6403 10.1878 16.7995 10.4C16.9586 10.6122 17.0269 10.8789 16.9894 11.1414C16.9519 11.404 16.8116 11.6409 16.5995 11.8L12.5995 14.8C12.4264 14.9298 12.2158 15 11.9995 15Z"
|
||||
fill="#292929" />
|
||||
<path
|
||||
d="M12 13C11.7348 13 11.4804 12.8946 11.2929 12.7071C11.1054 12.5196 11 12.2652 11 12V4C11 3.73478 11.1054 3.48043 11.2929 3.29289C11.4804 3.10536 11.7348 3 12 3C12.2652 3 12.5196 3.10536 12.7071 3.29289C12.8946 3.48043 13 3.73478 13 4V12C13 12.2652 12.8946 12.5196 12.7071 12.7071C12.5196 12.8946 12.2652 13 12 13Z"
|
||||
fill="#292929" />
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
Скачать PDF файл
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bill_info tabItem" id="bill-2">
|
||||
<form action="{{route('update.shop')}}" method="POST" class="bill_form">
|
||||
<div class="bill_input wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".1s">
|
||||
<label for="shop-name">Название магазина</label>
|
||||
<input type="text" id="shop-name" name="name" placeholder="Dap" value={{user.shop.name}}>
|
||||
</div>
|
||||
|
||||
<div class="bill_input wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".13s">
|
||||
<label for="shop-floor">Этаж</label>
|
||||
<input type="number" id="shop-floor" name="floor" placeholder="3" value={{user.shop.floor}}>
|
||||
</div>
|
||||
|
||||
<div class="bill_input wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".17s">
|
||||
<label for="shop-phone">Номер телефона</label>
|
||||
<input type="number" id="shop-phone" name="phone" placeholder="61616161" value={{user.shop.phone}}>
|
||||
</div>
|
||||
|
||||
<div class="bill_input wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".2s">
|
||||
<label for="shop-media">Instagram</label>
|
||||
<input type="text" id="shop-media" name="instagram_name" placeholder="@dap" value={{user.shop.instagram_name}}>
|
||||
</div>
|
||||
|
||||
<div class="bill_input wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".23s">
|
||||
<label for="shop-link">Ссылка на Instagram</label>
|
||||
<input type="text" id="shop-link" name="instagram_link" placeholder="https://instagram.com/name" value={{user.shop.instagram_link}}>
|
||||
</div>
|
||||
<input type="hidden" name="id" value={{user.shop.id}}>
|
||||
<div class="bill_btn wow fadeInUp" data-wow-duration=".3s" data-wow-delay=".27s">
|
||||
<button type="submit">
|
||||
Сохранить
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- Bills end ========================= -->
|
||||
|
|
@ -41,7 +41,12 @@ function onStart(){
|
|||
|
||||
<div class="header_item">
|
||||
{% if user %}
|
||||
<a data-request="onLogout" data-request-data="redirect: '/'" class="header_item-link modBtn">Выйти</a>
|
||||
<a href="{{ 'profile'|page}}"><h6 class="header_item-link modBtn">{{user.name}}</h6></a>
|
||||
|
||||
<a data-request="onLogout" data-request-data="redirect: '/'" class="header_item-link modBtn">
|
||||
Выйти
|
||||
</a>
|
||||
|
||||
{% else %}
|
||||
<h6 class="header_item-link modBtn" data-tab="#login">Вход</h6>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
==
|
||||
<!-- login modal ================ -->
|
||||
<div class="modal login mod" id="login">
|
||||
<div class="inner">
|
||||
<div class="modal_close modClose" data-mod="login">
|
||||
<svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<ellipse cx="20.4" cy="20" rx="20.4" ry="20" fill="white" />
|
||||
<path
|
||||
d="M21.8796 19.8865L27.6082 14.189C27.859 13.939 28 13.5998 28 13.2461C28 12.8924 27.859 12.5533 27.6082 12.3032C27.3573 12.0531 27.0171 11.9126 26.6623 11.9126C26.3075 11.9126 25.9673 12.0531 25.7164 12.3032L20.0011 18.0139L14.2858 12.3032C14.035 12.0531 13.6947 11.9126 13.34 11.9126C12.9852 11.9126 12.6449 12.0531 12.3941 12.3032C12.1432 12.5533 12.0023 12.8924 12.0023 13.2461C12.0023 13.5998 12.1432 13.939 12.3941 14.189L18.1227 19.8865L12.3941 25.584C12.2692 25.7074 12.1701 25.8543 12.1025 26.0162C12.0348 26.178 12 26.3516 12 26.5269C12 26.7022 12.0348 26.8758 12.1025 27.0376C12.1701 27.1995 12.2692 27.3464 12.3941 27.4698C12.5179 27.5943 12.6653 27.6931 12.8276 27.7605C12.99 27.828 13.1641 27.8627 13.34 27.8627C13.5158 27.8627 13.69 27.828 13.8523 27.7605C14.0147 27.6931 14.162 27.5943 14.2858 27.4698L20.0011 21.7591L25.7164 27.4698C25.8403 27.5943 25.9876 27.6931 26.15 27.7605C26.3123 27.828 26.4864 27.8627 26.6623 27.8627C26.8382 27.8627 27.0123 27.828 27.1746 27.7605C27.337 27.6931 27.4843 27.5943 27.6082 27.4698C27.7331 27.3464 27.8322 27.1995 27.8998 27.0376C27.9674 26.8758 28.0023 26.7022 28.0023 26.5269C28.0023 26.3516 27.9674 26.178 27.8998 26.0162C27.8322 25.8543 27.7331 25.7074 27.6082 25.584L21.8796 19.8865Z"
|
||||
fill="#292929" />
|
||||
</svg>
|
||||
</div>
|
||||
<form class="login_form" data-request="onSignin">
|
||||
<h4 class="login_title">
|
||||
Вход в личный кабинет владельца магазина
|
||||
</h4>
|
||||
<div class="login_input">
|
||||
<label>Login</label>
|
||||
<input type="text" name="login">
|
||||
</div>
|
||||
<div class="login_input">
|
||||
<label>Password</label>
|
||||
<input type="password" name="password">
|
||||
</div>
|
||||
<button class="login_btn" type="submit">
|
||||
Войти
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- login modal end ============ -->
|
||||
Loading…
Reference in New Issue