[Redizajn 1KA] - Naročila - v1

1. fieldset s podatki aktivnega paketa
This commit is contained in:
tejagerjovic 2022-01-26 12:04:16 +01:00
parent 935dffff6b
commit ae93768b65
7 changed files with 1496 additions and 1400 deletions

View File

@ -10104,7 +10104,7 @@ class SurveyAdminSettings {
echo '<fieldset><legend>'.$lang['edit_data'].'</legend>';
//Prijavljeni kot, status, zadnja prijava, aktivni paket
echo '<div id="user_info_segment">';
echo '<div id="user_info_segment" class="bottom0">';
if($row['type'] == '0')
$type = $lang['admin_admin'];

View File

@ -560,6 +560,10 @@ class CrossRoad {
$hide_header = 'hide_header';
}
if ($_GET['a'] == 'narocila') {
$layout_width = 'narrow';
}
break;
}

View File

@ -318,16 +318,71 @@ class UserNarocila{
$ua = UserAccess::getInstance($global_user_id);
$user_access = $ua->getAccess();
// Ce ni polja v bazi oz je nastavljen paket na 1 ima osnovni paket
if(!$user_access || $user_access['package_id'] == '1'){
echo '<p>'.$lang['srv_narocila_current_package'].':</span> <span class="bold">1KA</span></p>';
$sqlA = sisplet_query("SELECT ua.time_activate, ua.time_expire, uap.id AS package_id, uap.name AS package_name
FROM user_access ua, user_access_paket uap
WHERE ua.usr_id='$global_user_id' AND uap.id=ua.package_id
");
$rowA = mysqli_fetch_array($sqlA);
echo '<div id="user_info_segment_narocila">';
echo '<div class="user_info text">';
if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
echo '<div class="setting_holder">'.$lang['srv_access_package'].':</div>';
if($rowA['package_id'] == '2' || $rowA['package_id'] == '3'){
echo '<div class="setting_holder">'.$lang['srv_narocila_current_start'].':</div>';
echo '<div class="setting_holder">'.$lang['srv_narocila_current_expire'].':</div>';
}
}
echo '</div>';
echo '<div class="user_info data bold">';
// Trenutni paket funkcionalnosti
$drupal_url = ($lang['id'] == '2') ? $site_url.'d/en/' : $site_url.'d/';
// Ni nobenega paketa
if(mysqli_num_rows($sqlA) == 0){
$package_string = $lang['paket_opis_1ka'].' ('.$lang['srv_access_package_free'].')</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.''.$lang['srv_narocila_buyurl'].'\';">'.$lang['srv_narocila_buy'].'</button>';
}
// Imamo aktiviran paket - izpisemo podatke
else{
echo '<div class="data"><span class="setting_title">'.$lang['srv_narocila_current_package'].':</span> <span class="bold">'.$user_access['package_name'],'</span></div>';
echo '<div class="data"><span class="setting_title">'.$lang['srv_narocila_current_start'].':</span> <span class="bold">'.date( 'd.m.Y', strtotime($user_access['time_activate'])).'</span></div>';
echo '<div class="data"><span class="setting_title">'.$lang['srv_narocila_current_expire'].':</span> <span class="bold">'.date( 'd.m.Y', strtotime($user_access['time_expire'])),'</span></div>';
$userAccess = UserAccess::getInstance($global_user_id);
$package_name = $userAccess->getPackageName($rowA['package_id']);
// Ce ima paket 2 ali 3
if($rowA['package_id'] == '2' || $rowA['package_id'] == '3'){
// Ce je paket ze potekel
if(strtotime($rowA['time_expire']) < time()){
$package_string = '<span>';
$package_string .= $package_name;
$package_string .= ' ('.$lang['srv_access_package_expire'].' '.date("d.m.Y", strtotime($rowA['time_expire'])).')';
$package_string .= '</span>';
$package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.'izvedi-nakup/'.$rowA['package_id'].'/podatki/\';">'.$lang['srv_narocila_extend'].'</button>';
}
else{
$package_string = '<div class="setting_holder">'.$package_name.'</div>';
$package_string .= '<div class="setting_holder">'.date("d.m.Y", strtotime($rowA['time_activate'])).'</div>';
$package_string .= '<div class="setting_holder">'.date("d.m.Y", strtotime($rowA['time_expire'])).'</div>';
$package_string .= '<div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.'izvedi-nakup/'.$rowA['package_id'].'/podatki/\';">'.$lang['srv_narocila_extend'].'</button></div>';
}
}
else{
$package_string = $package_name;
$package_string .= ' ('.$lang['srv_access_package_free'].')';
$package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.''.$lang['srv_narocila_buyurl'].'\';">'.$lang['srv_narocila_buy'].'</button>';
}
}
echo $package_string;
echo '</div>';
echo '</div>';
echo '</fieldset>';

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
div#user_info_segment_narocila {
background-color: $light-gray;
border: 1px solid $gray;
box-sizing: border-box;
padding: 32px 20px;
display: flex;
flex-direction: row;
.user_info {
display: flex;
flex-direction: column;
&.text {
margin-right: 50px;
}
}
}

View File

@ -14,4 +14,6 @@
@import "settings/settings";
//New survey
@import "new_survey_page/new_survey_page";
@import "new_survey_page/new_survey_page";
@import "narocila"

View File

@ -16,7 +16,7 @@ div {
padding: 32px 20px;
margin-bottom: 16px;
display: flex;
flex-direction: row;