gitea init

This commit is contained in:
skryper
2025-10-08 21:28:30 +04:00
commit d4651a423d
2518 changed files with 522832 additions and 0 deletions
@@ -0,0 +1,110 @@
<?php
require_once __DIR__ . '/../../../../vendor/autoload.php';
use App\Config;
require_once Config::includePath('head.php');
require_once Config::includePath('navbar.php');
require_once Config::includePath('pageheader.php');
require_once Config::includePath('pagebodystart.php');
?>
<!-- CONTENT START -->
<div class="d-flex justify-content-between align-items-center mb-3">
<h2>კლიენტის პროფილი: <?= htmlspecialchars($client['first_name'] . ' ' . $client['last_name']) ?></h2>
<a href="dashboard.php?module=clients&action=list" class="btn btn-secondary">← უკან სიისკენ</a>
</div>
<div class="row row-cards">
<div class="col-md-6">
<div class="card">
<div class="card-header"><strong>Clients Information</strong></div>
<div class="card-body">
<p><strong>First Name:</strong> <?= htmlspecialchars($client['first_name']) ?></p>
<p><strong>Last Name:</strong> <?= htmlspecialchars($client['last_name']) ?></p>
<p><strong>Company:</strong> <?= htmlspecialchars($client['company_name']) ?></p>
<p><strong>Email:</strong> <?= htmlspecialchars($client['email']) ?></p>
<p><strong>Phone:</strong> <?= htmlspecialchars($client['phone']) ?></p>
<p><strong>Address 1:</strong> <?= htmlspecialchars($client['address1']) ?></p>
<p><strong>Address 2:</strong> <?= htmlspecialchars($client['address2']) ?></p>
<p><strong>City:</strong> <?= htmlspecialchars($client['city']) ?></p>
<p><strong>State/Region:</strong> <?= htmlspecialchars($client['state']) ?></p>
<p><strong>Postcode:</strong> <?= htmlspecialchars($client['postcode']) ?></p>
<p><strong>Country:</strong> <?= htmlspecialchars($client['country']) ?></p>
</div>
</div>
</div>
<?php
?>
<div class="col-md-6">
<div class="card">
<div class="card-header"><strong>Invoices / Billing</strong></div>
<div class="card-body">
<p><strong>Paid:</strong> ₾<?= number_format($paid, 2) ?></p>
<p><strong>Draft:</strong> ₾<?= number_format($draft, 2) ?></p>
<p><strong>Unpaid / Due:</strong> ₾<?= number_format($unpaid_due, 2) ?></p>
<p><strong>Cancelled:</strong> ₾<?= number_format($cancelled, 2) ?></p>
<p><strong>Refunded:</strong> ₾<?= number_format($refunded, 2) ?></p>
<hr>
<p><strong>Gross Revenue:</strong> ₾<?= number_format($gross_revenue, 2) ?></p>
<p><strong>Net Income:</strong> ₾<?= number_format($net_income, 2) ?></p>
<p><strong>Credit Balance:</strong> ₾<?= number_format($credit_balance, 2) ?></p>
<div class="mt-3">
<a href="#" class="btn btn-outline-primary btn-sm"> Create Invoice</a>
<a href="#" class="btn btn-outline-success btn-sm"> Add Funds Invoice</a>
<a href="#" class="btn btn-outline-info btn-sm">🔁 Generate Due Invoices</a>
<a href="#" class="btn btn-outline-warning btn-sm">💳 Manage Credits</a>
<a href="/admin/billing/transactions/history.php?client_id=<?= $client['id'] ?>" class="btn btn-outline-warning btn-sm">ტრანზაქციების ისტორია</a>
</div>
</div>
</div>
</div>
</div>
<div class="row row-cards mt-4">
<div class="col-md-6">
<div class="card">
<div class="card-header"><strong>Admin Notes</strong></div>
<div class="card-body">
<p><?= nl2br(htmlspecialchars($client['admin_notes'])) ?></p>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header"><strong>Products / Services</strong></div>
<div class="card-body">
<?php if (count($services) > 0): ?>
<ul class="list-group list-group-flush">
<?php foreach ($services as $service): ?>
<li class="list-group-item">
<strong><?= htmlspecialchars($service['product_name']) ?></strong>
- <?= number_format($service['amount'], 2) ?> ₾
<br>
<small class="text-muted"> <?= htmlspecialchars($service['description']) ?> </small>
<br>
<small class="text-muted"> თარიღი: <?= htmlspecialchars($service['issue_date']) ?> </small>
</li>
<?php endforeach ?>
</ul>
<?php else: ?>
<p class="text-muted">სერვისები არ მოიძებნა.</p>
<?php endif ?>
</div>
</div>
</div>
</div>
<?php require_once Config::includePath('footer.php'); ?>
+173
View File
@@ -0,0 +1,173 @@
<?php
require_once __DIR__ . '/../../../../vendor/autoload.php';
use App\Config;
require_once Config::includePath('head.php');
require_once Config::includePath('navbar.php');
require_once Config::includePath('pageheader.php');
require_once Config::includePath('pagebodystart.php');
?>
<!-- CONTENT START -->
<h2 class="mb-4">ახალი კლიენტის დამატება</h2>
<form action="dashboard.php?module=clients&action=add" method="post">
<div class="row">
<!-- მარცხენა სვეტი -->
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">სახელი</label>
<input type="text" class="form-control" name="first_name" required>
</div>
<div class="mb-3">
<label class="form-label">გვარი</label>
<input type="text" class="form-control" name="last_name" required>
</div>
<div class="mb-3">
<label class="form-label">კომპანიის სახელი <span class="text-muted">(სურვილისამებრ)</span></label>
<input type="text" class="form-control" name="company">
</div>
<div class="mb-3">
<label class="form-label">საიდ. ნომ <span class="text-muted">(სურვილისამებრ)</span></label>
<input type="text" class="form-control" name="vat_number">
</div>
<div class="mb-3">
<label class="form-label">ელ-ფოსტა</label>
<input type="email" class="form-control" name="email" required>
</div>
<div class="mb-3">
<label class="form-label">პაროლი</label>
<div class="input-group">
<input type="text" class="form-control" id="password" name="password" required>
<button class="btn btn-outline-secondary" type="button" onclick="generatePassword()">გენერირება</button>
</div>
</div>
<div class="mb-3">
<label class="form-label">ენა</label>
<select class="form-select" name="language">
<option value="default">ნაგულისხმევი</option>
<option value="en">English</option>
<option value="ka">Georgian</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">სტატუსი</label>
<select class="form-select" name="status">
<option value="active">აქტიური</option>
<option value="inactive">გაუქმებული</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">ჯგუფი</label>
<select class="form-select" name="client_group">
<option value="none">ცარიელი</option>
<option value="vip">VIP</option>
<option value="reseller">Reseller</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Email შეტყობინებები</label>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="emails[]" value="general" checked>
<label class="form-check-label">General Emails</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="emails[]" value="invoice" checked>
<label class="form-check-label">Invoice Emails</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="emails[]" value="support">
<label class="form-check-label">Support Emails</label>
</div>
<!-- სხვა Checkbox-ები შეგიძლია დაამატო ასე -->
</div>
</div>
<!-- მარჯვენა სვეტი -->
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">მისამართი 1</label>
<input type="text" class="form-control" name="address1">
</div>
<div class="mb-3">
<label class="form-label">მისამართი 2</label>
<input type="text" class="form-control" name="address2">
</div>
<div class="mb-3">
<label class="form-label">ქალაქი</label>
<input type="text" class="form-control" name="city">
</div>
<div class="mb-3">
<label class="form-label">შტატი/რეგიონი</label>
<input type="text" class="form-control" name="state">
</div>
<div class="mb-3">
<label class="form-label">საფოსტო ინდექსი</label>
<input type="text" class="form-control" name="postcode">
</div>
<div class="mb-3">
<label class="form-label">ქვეყანა</label>
<select class="form-select" name="country">
<option value="US">United States</option>
<option value="GE">საქართველო</option>
<!-- სხვა ქვეყნები -->
</select>
</div>
<div class="mb-3">
<label class="form-label">ტელეფონი</label>
<input type="text" class="form-control" name="phone">
</div>
<div class="mb-3">
<label class="form-label">გადახდის მეთოდი</label>
<select class="form-select" name="payment_method">
<option value="default">Default</option>
<option value="paypal">PayPal</option>
<option value="bank">საბანკო გადმორიცხვა</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Billing Contact</label>
<select class="form-select" name="billing_contact">
<option value="default">Default</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">ვალუტა</label>
<select class="form-select" name="currency">
<option value="USD">USD</option>
<option value="GEL">GEL</option>
</select>
</div>
</div>
</div>
<div class="mb-3">
<label class="form-label">Admin ჩანაწერი</label>
<textarea class="form-control" name="admin_notes" rows="3"></textarea>
</div>
<div class="form-footer">
<button type="submit" class="btn btn-primary">დამატება</button>
</div>
</form>
</div>
</div>
<?php require_once Config::includePath('footer.php'); ?>
<script>
function generatePassword(length = 10) {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()";
let password = "";
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * charset.length);
password += charset[randomIndex];
}
document.getElementById('password').value = password;
}
</script>
@@ -0,0 +1,63 @@
<?php
require_once __DIR__ . '/../../../../vendor/autoload.php';
use App\Config;
require_once Config::includePath('head.php');
require_once Config::includePath('navbar.php');
require_once Config::includePath('pageheader.php');
require_once Config::includePath('pagebodystart.php');
?>
<h2 class="mb-4">კლიენტის რედაქტირება</h2>
<form action="dashboard.php?module=clients&action=edit" method="POST">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">First Name</label>
<input type="text" class="form-control" name="first_name" value="<?= htmlspecialchars($client['first_name']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Last Name</label>
<input type="text" class="form-control" name="last_name" value="<?= htmlspecialchars($client['last_name']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Company</label>
<input type="text" class="form-control" name="company" value="<?= htmlspecialchars($client['company_name']) ?>">
</div>
<div class="mb-3">
<label class="form-label">Email</label>
<input type="email" class="form-control" name="email" value="<?= htmlspecialchars($client['email']) ?>" required>
</div>
<div class="mb-3">
<label class="form-label">Phone</label>
<input type="text" class="form-control" name="phone" value="<?= htmlspecialchars($client['phone']) ?>">
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Status</label>
<select class="form-select" name="status">
<option value="active" <?= $client['status'] === 'active' ? 'selected' : '' ?>>Active</option>
<option value="inactive" <?= $client['status'] === 'inactive' ? 'selected' : '' ?>>Inactive</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Client Group</label>
<input type="text" class="form-control" name="client_group" value="<?= htmlspecialchars($client['client_group']) ?>">
</div>
<div class="mb-3">
<label class="form-label">Admin Notes</label>
<textarea class="form-control" name="admin_notes" rows="5"><?= htmlspecialchars($client['admin_notes']) ?></textarea>
</div>
</div>
</div>
<div class="form-footer">
<button type="submit" class="btn btn-primary">შენახვა</button>
<a href="dashboard.php?module=clients&action=profile&id=<?= $client['id'] ?>" class="btn btn-secondary">გაუქმება</a>
</div>
</form>
<?php require_once Config::includePath('footer.php'); ?>
@@ -0,0 +1,58 @@
<?php
require_once __DIR__ . '/../../../../vendor/autoload.php';
use App\Config;
require_once Config::includePath('head.php');
require_once Config::includePath('navbar.php');
require_once Config::includePath('pageheader.php');
require_once Config::includePath('pagebodystart.php');
?>
<!-- CONTENT START -->
<h2 class="mb-4">კლიენტების სია</h2>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>კომპანია</th>
<th>ელ.ფოსტა</th>
<th>ტელეფონი</th>
<th>შექმნის თარიღი</th>
<th>სტატუს</th>
</tr>
</thead>
<tbody>
<?php foreach ($clients as $client): ?>
<tr>
<td><?= htmlspecialchars($client['id']) ?></td>
<td><?= htmlspecialchars($client['first_name']) ?></td>
<td><?= htmlspecialchars($client['last_name']) ?></td>
<td><?= htmlspecialchars($client['company_name']) ?></td>
<td><?= htmlspecialchars($client['email']) ?></td>
<td><?= htmlspecialchars($client['phone']) ?></td>
<td><?= date('d/m/Y', strtotime($client['created_at'])) ?></td>
<td>
<span class="badge bg-light">
<?= strtoupper($client['status']) ?>
</span>
</td>
<td>
<a href="dashboard.php?module=clients&action=profile&id=<?= $client['id'] ?>" class="btn btn-sm btn-info">პროფილი</a>
<a href="dashboard.php?module=clients&action=edit&id=<?= $client['id'] ?>" class="btn btn-sm btn-warning">რედ.</a>
<a href="dashboard.php?module=clients&action=delete&id=<?= $client['id'] ?>" class="btn btn-sm btn-danger" onclick="return confirm('ნამდვილად გსურს წაშლა?');">წაშლა</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php require_once Config::includePath('footer.php'); ?>