core/api/modules/order/class.php

41 lines
1.3 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
class main extends MySQL {
/* ----------------------------------------------------------------------
06.06.2022
Подсчет итога
---------------------------------------------------------------------- */
function get_itog(){
unset($a);
$a['user_id'] = ( $_SESSION['user_id'] ) ? $_SESSION['user_id'] : session_id();
$massiv=$this->get_massiv('cart', $a);
$count=count($massiv);
$itog=0;
for ( $i=0; $i < $count; $i++ ){
unset($a);
$a['id']=$massiv[$i]['pages_id'];
$cena = $this -> get_val( 'pages', $a, 'cena' );
$itog = $itog + ( $cena * $massiv[$i]['kolvo'] );
}
return $itog;
}
/* ----------------------------------------------------------------------
02.06.2022
Получаем информацию о пользователе
Понимаем что за организация
---------------------------------------------------------------------- */
function get_user_info(){
$a['id'] = $_SESSION['user_id'];
$user = $this -> from_j ( $this -> get_val( 'users', $a, 'json') );
//Понимаем что за организация
unset( $a );
$a['inn'] = $user['inn'];
$user['org'] = $this -> get_val( 'org', $a, 'txt' );
return $user;
}
}
?>