This commit is contained in:
Alan
2026-02-14 19:34:54 +03:00
commit 5c3329238b
867 changed files with 214778 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<?PHP
require_once('api/Simpla.php');
########################################
class PaymentMethodsAdmin extends Simpla
{
public function fetch()
{
// Обработка действий
if($this->request->method('post'))
{
// Сортировка
$positions = $this->request->post('positions');
$ids = array_keys($positions);
sort($positions);
foreach($positions as $i=>$position)
$this->payment->update_payment_method($ids[$i], array('position'=>$position));
// Действия с выбранными
$ids = $this->request->post('check');
if(is_array($ids))
switch($this->request->post('action'))
{
case 'disable':
{
$this->payment->update_payment_method($ids, array('enabled'=>0));
break;
}
case 'enable':
{
$this->payment->update_payment_method($ids, array('enabled'=>1));
break;
}
case 'delete':
{
foreach($ids as $id)
$this->payment->delete_payment_method($id);
break;
}
}
}
// Отображение
$payment_methods = $this->payment->get_payment_methods();
$this->design->assign('payment_methods', $payment_methods);
return $this->design->fetch('payment_methods.tpl');
}
}
?>