Upload files to "ui/ui"

Signed-off-by: nestict <icttechnest@gmail.com>
This commit is contained in:
nestict 2025-05-24 12:24:38 +02:00
parent 5242f5a262
commit dc570270a5
5 changed files with 384 additions and 0 deletions

15
ui/ui/user-pages.tpl Normal file
View File

@ -0,0 +1,15 @@
{include file="sections/user-header.tpl"}
<!-- user-pages -->
<div class="row">
<div class="col-sm-12">
<div class="card mb20 card-primary card-hovered">
<div class="card-header">{$_L[$pageHeader]}</div>
<div class="card-body">
{include file="$_path/../pages/$PageFile.html"}
</div>
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}

View File

@ -0,0 +1,80 @@
{include file="sections/user-header.tpl"}
<!-- user-phone-update -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{Lang::T('Change Phone Number')}</h3>
</div>
<div class="box-body">
<div class="form-horizontal">
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Current Number')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">+</span>
<input type="text" class="form-control" name="phonenumber" id="phonenumber"
value="{$d['phonenumber']}" readonly placeholder="{Lang::T('Phone Number')}">
</div>
</div>
</div>
<form method="post" role="form" action="{$_url}accounts/phone-update-otp">
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('New Number')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">+</span>
<input type="number" class="form-control" name="phone" id="phone" value="" required
placeholder="{Lang::T('Input your phone number')}">
<span class="input-group-btn">
<button type="submit" class="btn btn-info btn-flat">{Lang::T('Request OTP')}</button>
</span>
</div>
</div>
</div>
</form>
<form method="post" role="form" action="{$_url}accounts/phone-update-post">
<!-- Form 2 -->
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('OTP')}</label>
<div class="col-md-6">
<input type="number" class="form-control" id="otp" name="otp"
placeholder="{Lang::T('Enter OTP that was sent to your phone')}" required>
</div>
</div>
<!-- Hidden field to store the phone number value -->
<input type="hidden" name="phone" id="hidden_phone" required>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success" type="submit"
onclick="return validateForm()">{Lang::T('Update')}</button>
Or <a href="{$_url}home">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
<script>
function validateForm() {
var phoneNumber = document.getElementById("phone").value;
var otp = document.getElementById("otp").value;
if (phoneNumber.trim() === "") {
alert("Phone number is required.");
return false; // Prevent form submission
}
if (otp.trim() === "") {
alert("OTP code is required.");
return false; // Prevent form submission
}
// Set the phone number value in the hidden field
document.getElementById("hidden_phone").value = phoneNumber;
}
</script>
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}

85
ui/ui/user-profile.tpl Normal file
View File

@ -0,0 +1,85 @@
{include file="sections/user-header.tpl"}
<!-- user-profile -->
<div class="row">
<div class="col-xl-6 col-xxl-12">
<div class="card card-primary card-hovered card-stacked mb30">
<div class="card-header">
<div class="card-title mb-2">{Lang::T('Edit User')}</div>
</div>
<div class="card-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}accounts/edit-profile-post">
<input type="hidden" name="id" value="{$d['id']}">
<div class="form-group">
<label class="control-label">{Lang::T('Username')}</label>
<div class="">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">+</span>
<input type="text" class="form-control" name="username" id="username" readonly
value="{$d['username']}"
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
</div>
</div>
</div>
<div class="form-group">
<label class="control-label">{Lang::T('Full Name')}</label>
<div class="input-group mb-2">
<input type="text" class="form-control" id="fullname" name="fullname"
value="{$d['fullname']}">
</div>
</div>
<div class="form-group">
<label class="control-label">{Lang::T('Address')}</label>
<div class="input-group mb-2">
<textarea name="address" id="address" class="form-control">{$d['address']}</textarea>
</div>
</div>
{if $_c['allow_phone_otp'] != 'yes'}
<div class="form-group">
<label class="control-label">{Lang::T('Phone Number')}</label>
<div class="mb-2">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">+</span>
<input type="text" class="form-control" name="phonenumber" id="phonenumber"
value="{$d['phonenumber']}"
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
</div>
</div>
</div>
{else}
<div class="form-group">
<label class="control-label">{Lang::T('Phone Number')}</label>
<div class="mb-2">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">+</span>
<input type="text" class="form-control" name="phonenumber" id="phonenumber"
value="{$d['phonenumber']}" readonly
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
<span class="input-group-text">
<a href="{$_url}accounts/phone-update" type="button"
class="">{Lang::T('Change')}</a>
</span>
</div>
</div>
</div>
{/if}
<div class="form-group">
<label class="control-label">{Lang::T('Email')}</label>
<div class="input-group mb-2">
<input type="text" class="form-control" id="email" name="email" value="{$d['email']}">
</div>
</div>
<div class="form-group">
<div class="">
<button class="btn btn-success" type="submit">
{Lang::T('Save Changes')}</button>
Or <a href="{$_url}home" class="btn btn-primary">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}

123
ui/ui/users-add.tpl Normal file
View File

@ -0,0 +1,123 @@
{include file="sections/header.tpl"}
<!-- user-edit -->
<div class="container-fluid">
<form class="form-horizontal" method="post" role="form" action="{$_url}settings/users-post">
<div class="row">
<div class="col-sm-6 col-md-6">
<div class="card card-primary card-hovered card-stacked mb30">
<div class="card-header">{Lang::T('Profile')}</div>
<div class="card-body">
<div class="form-group">
<label class="control-label">{Lang::T('Full Name')}</label>
<div class="">
<input type="text" class="form-control" id="fullname" name="fullname">
</div>
</div>
<div class="form-group">
<label class=" control-label">{Lang::T('Phone')}</label>
<div class="">
<input type="number" class="form-control" id="phone" name="phone">
</div>
</div>
<div class="form-group">
<label class="control-label">{Lang::T('Email')}</label>
<div class="">
<input type="text" class="form-control" id="email" name="email">
</div>
</div>
<div class="form-group row">
<label class="control-label">{Lang::T('Location')}</label>
<div class="col-md-4">
<input type="text" class="form-control" id="city" name="city" placeholder="{Lang::T('City')}">
</div>
<div class="col-md-4">
<input type="text" class="form-control" id="subdistrict" name="subdistrict" placeholder="{Lang::T('Sub District')}">
</div>
<div class="col-md-4">
<input type="text" class="form-control" id="ward" name="ward" placeholder="{Lang::T('Ward')}">
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6 col-md-6">
<div class="card card-primary card-hovered card-stacked mb30">
<div class="card-header">{Lang::T('Credentials')}</div>
<div class="card-body">
<div class="form-group">
<label class="control-label">{Lang::T('User Type')}</label>
<div class="">
<select name="user_type" id="user_type" class="form-control" onchange="checkUserType(this)">
{if $_admin['user_type'] eq 'Agent'}
<option value="Sales">{Lang::T('Sales')}</option>
{/if}
{if $_admin['user_type'] eq 'Admin' || $_admin['user_type'] eq 'SuperAdmin'}
<option value="Report">{Lang::T('Report Viewer')}</option>
<option value="Agent">{Lang::T('Agent')}</option>
<option value="Sales">{Lang::T('Sales')}</option>
{/if}
{if $_admin['user_type'] eq 'SuperAdmin'}
<option value="Admin">{Lang::T('Administrator')}</option>
<option value="SuperAdmin">{Lang::T('Super Administrator')}</option>
{/if}
</select>
</div>
</div>
<div class="form-group hidden" id="agentChooser">
<label class="control-label">{Lang::T('Agent')}</label>
<div class="">
<select name="root" id="root" class="form-control">
{foreach $agents as $agent}
<option value="{$agent['id']}">{$agent['username']} | {$agent['fullname']} | {$agent['phone']}</option>
{/foreach}
</select>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">{Lang::T('Username')}</label>
<div class="">
<input type="text" class="form-control" id="username" name="username">
</div>
</div>
<div class="form-group col-md-6">
<label class="control-label">{Lang::T('Password')}</label>
<div class="">
<input type="password" class="form-control" id="password" value="{rand(000000,999999)}" name="password"
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
</div>
</div>
</div>
<div class="form-group">
<label class=" control-label">{Lang::T('Send Notification')}</label>
<div class=>
<select name="send_notif" id="send_notif" class="form-control">
<option value="-">Don't Send</option>
<option value="sms">By SMS</option>
<option value="wa">By WhatsApp</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group text-center">
<button class="btn btn-primary" type="submit">{Lang::T('Save Changes')}</button>
Or <a href="{$_url}settings/users">{Lang::T('Cancel')}</a>
</div>
</form>
</div>
{literal}
<script>
function checkUserType($field){
if($field.value=='Sales'){
$('#agentChooser').removeClass('hidden');
}else{
$('#agentChooser').addClass('hidden');
}
}
</script>
{/literal}
{include file="sections/footer.tpl"}

81
ui/ui/users.tpl Normal file
View File

@ -0,0 +1,81 @@
{include file="sections/header.tpl"}
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="card card-hovered mb20 card-primary">
<div class="card-header">
<h3 class="card-title">{Lang::T('Manage Administrator')}</h3>
</div>
<div class="card-body">
<div class="md-whiteframe-z1 mb20 text-center row" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}settings/users/">
<div class="input-group">
<div class="input-group-text">
<span class="fa fa-search"></span>
</div>
<input type="text" name="search" value="{$search}" class="form-control"
placeholder="Search by Username...">
<button class="btn btn-success input-group-btn" type="submit">{Lang::T('Search')}</button>
<!-- <div class="input-group-btn">
</div> -->
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}settings/users-add" class="btn btn-primary btn-block"><i
class="fa fa-add"> </i> {Lang::T('Add New Administrator')}</a>
</div>&nbsp;
</div>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Username')}</th>
<th>{Lang::T('Full Name')}</th>
<th>{Lang::T('Phone')}</th>
<th>{Lang::T('Email')}</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Location')}</th>
<th>{Lang::T('Agent')}</th>
<th>{Lang::T('Last Login')}</th>
<th>{Lang::T('Manage')}</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['status'] != 'Active'}class="danger"{/if}>
<td>{$ds['username']}</td>
<td>{$ds['fullname']}</td>
<td>{$ds['phone']}</td>
<td>{$ds['email']}</td>
<td>{$ds['user_type']}</td>
<td>{$ds['city']}, {$ds['subdistrict']}, {$ds['ward']}</td>
<td>{if $ds['root']}
<a href="{$_url}settings/users-view/{$ds['root']}">
{$admins[$ds['root']]}</a>{/if}</td>
<td>{if $ds['last_login']}{Lang::timeElapsed($ds['last_login'])}{/if}</td>
<td>
<a href="{$_url}settings/users-view/{$ds['id']}"
class="btn btn-success btn-xs mb-1">{Lang::T('View')}</a>
<a href="{$_url}settings/users-edit/{$ds['id']}"
class="btn btn-info btn-xs mb-1">{Lang::T('Edit')}</a>
{if ($_admin['id']) neq ($ds['id'])}
<a href="{$_url}settings/users-delete/{$ds['id']}" id="{$ds['id']}"
class="btn btn-danger btn-xs" onclick="return confirm('{Lang::T('Delete')}?')"><i class="fa fa-trash"></i></a>
{/if}
</td>
<td>{$ds['id']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{include file="pagination.tpl"}
</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}