first commit

This commit is contained in:
2024-10-25 23:02:37 +02:00
commit faeb2e52e8
7653 changed files with 1095335 additions and 0 deletions

View File

@@ -0,0 +1,153 @@
<script type="text/javascript" src="/libraries/framework/vendor/plugins/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/framework/vendor/plugins/ckeditor/adapters/jquery.js"></script>
<?
global $db;
$carrier_accounts[''] = '--- wybierz konto przewoźnika ---';
foreach ( $this -> apilo_carrier_account_list as $carrier_account )
{
$carrier_accounts[ $carrier_account['id'] ] = $carrier_account['name'];
}
// sellasist_shipments_methods
$sellasist_shipments_methods[''] = '--- wybierz metodę wysyłki ---';
foreach ( $this -> sellasist_shipments_methods as $sellasist_shipments_method )
{
$sellasist_shipments_methods[ $sellasist_shipments_method['id'] ] = $sellasist_shipments_method['title'];
}
ob_start();
?>
<div id="settings-tabs">
<ul class="resp-tabs-list settings-tabs">
<li><i class="fa fa-file"></i>Ogólne</li>
<li><i class="fa fa-wrench"></i>Powiązane metody płatności</li>
</ul>
<div class="resp-tabs-container settings-tabs">
<div>
<?= \Html::input(
array(
'label' => 'Nazwa',
'class' => 'require',
'name' => 'name',
'id' => 'name',
'readonly' => true,
'value' => $this -> transport_details['name']
)
);?>
<?= \Html::input(
array(
'label' => 'Nazwa widoczna',
'name' => 'name_visible',
'id' => 'name_visible',
'value' => $this -> transport_details['name_visible']
)
);?>
<?= \Html::input(
array(
'label' => 'Opis',
'name' => 'description',
'id' => 'description',
'value' => $this -> transport_details['description']
)
);?>
<?= \Html::input(
array(
'label' => 'Koszt (PLN)',
'class' => 'number-format require',
'name' => 'cost',
'id' => 'cost',
'value' => $this -> transport_details['cost']
)
);?>
<?= \Html::input(
array(
'label' => 'Maks. WP',
'class' => 'number-format require',
'name' => 'max_wp',
'id' => 'max_wp',
'value' => $this -> transport_details['max_wp']
)
);?>
<?= \Html::input_switch( [
'label' => 'Domyślna forma dostawy',
'name' => 'default',
'checked' => $this -> transport_details['default'] == 1 ? true : false
] );?>
<?= \Html::input_switch(
array(
'label' => 'Aktywny',
'name' => 'status',
'checked' => $this -> transport_details['status'] == 1 ? true : false
)
);?>
<?= \Html::input_switch( [
'label' => 'Darmowa dostawa',
'name' => 'delivery_free',
'checked' => $this -> transport_details['delivery_free'] == 1 ? true : false
] );?>
<?= \Html::select( [
'label' => 'Kurier z Apilo',
'name' => 'apilo_carrier_account_id',
'id' => 'apilo_carrier_account_id',
'values' => $carrier_accounts,
'value' => $this -> transport_details['apilo_carrier_account_id']
] );?>
<!-- sellasist_shipments_methods -->
<?= \Html::select( [
'label' => 'Metoda wysyłki z Sellasist',
'name' => 'sellasist_shipment_method_id',
'id' => 'sellasist_shipment_method_id',
'values' => $sellasist_shipments_methods,
'value' => $this -> transport_details['sellasist_shipment_method_id']
] );?>
</div>
<div>
<? if ( is_array( $this -> payments_list ) ): foreach ( $this -> payments_list as $payment_method ):?>
<div class="form-group">
<div class="col-lg-12">
<div class="list">
<input type="checkbox" class="g-checkbox" name="payment_methods[]" value="<?= $payment_method['id'];?>" <? if ( in_array( $payment_method['id'], $this -> transport_details['payment_methods'] ) ):?>checked="checked"<? endif;?> />
<span class="bold <? if ( !$payment_method['status'] ):?>text-muted<? endif;?>"><?= $payment_method['name'];?></span>
</div>
</div>
</div>
<? endforeach; endif;?>
</div>
</div>
</div>
<?
$out = ob_get_clean();
$grid = new \gridEdit;
$grid -> id = 'transport-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'Edycja rodzaju transportu';
$grid -> fields = [
[
'db' => 'id',
'type' => 'hidden',
'value' => $this -> transport_details['id']
]
];
$grid -> actions = [
'save' => [ 'url' => '/admin/shop_transport/transport_save/', 'back_url' => '/admin/shop_transport/view_list/' ],
'cancel' => [ 'url' => '/admin/shop_transport/view_list/' ]
];
$grid -> external_code = $out;
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript">
$( function()
{
disable_menu();
$( '#settings-tabs' ).easyResponsiveTabs({
width: 'auto',
fit: true,
tabidentify: 'settings-tabs',
type: 'vertical'
});
});
</script>

View File

@@ -0,0 +1,83 @@
<?php
global $gdb;
foreach ( $this -> apilo_carrier_account_list as $carrier_account )
{
$carrier_accounts[ $carrier_account['id'] ] = $carrier_account['name'];
}
// sellasist_shipments_methods
$sellasist_shipments_methods = [];
foreach ( $this -> sellasist_shipments_methods as $sellasist_shipments_method )
{
$sellasist_shipments_methods[ $sellasist_shipments_method['id'] ] = $sellasist_shipments_method['title'];
}
$grid = new \grid( 'pp_shop_transports' );
$grid -> gdb_opt = $gdb;
$grid -> debug = true;
$grid -> order = [ 'column' => 'name', 'type' => 'ASC' ];
$grid -> search = [
[ 'name' => 'Nazwa', 'db' => 'name', 'type' => 'text' ],
[ 'name' => 'Aktywny', 'db' => 'status', 'type' => 'select', 'replace' => [ 'array' => [ 0 => 'nie', 1 => 'tak' ] ] ]
];
$grid -> columns_view = [
[
'name' => 'Lp.',
'th' => [ 'class' => 'g-lp' ],
'td' => [ 'class' => 'g-center' ],
'autoincrement' => true
], [
'name' => 'Domyślna FT',
'db' => 'default',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'sort' => true
], [
'name' => 'Aktywny',
'db' => 'status',
'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ],
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'sort' => true
],
[
'name' => 'Koszt',
'db' => 'cost',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'php' => 'echo \\S::decimal( [cost] ) . " zł";',
'sort' => true
],
[
'name' => 'Maks. WP',
'db' => 'max_wp',
'td' => [ 'class' => 'g-center' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 150px;' ],
'sort' => true
],
[
'name' => 'Nazwa',
'db' => 'name',
'sort' => true,
'php' => 'echo "<a href=\'/admin/shop_transport/transport_edit/id=[id]\'>[name]</a>";'
], [
'name' => 'Typ kuriera Apilo',
'db' => 'apilo_carrier_account_id',
'th' => [ 'class' => 'g-center' ],
'td' => [ 'class' => 'g-center' ],
'replace' => [ 'array' => $carrier_accounts ],
], [
'name' => 'Typ kuriera Sellasist',
'db' => 'sellasist_shipment_method_id',
'th' => [ 'class' => 'g-center' ],
'td' => [ 'class' => 'g-center' ],
'replace' => [ 'array' => $sellasist_shipments_methods ],
], [
'name' => 'Edytuj',
'action' => [ 'type' => 'edit', 'url' => '/admin/shop_transport/transport_edit/id=[id]' ],
'th' => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
'td' => [ 'class' => 'g-center' ]
]
];
echo $grid -> draw();