mirror of https://github.com/itflow-org/itflow
Add CRUD for Client Domain Names
This commit is contained in:
parent
48ad18f90a
commit
2b63681023
|
|
@ -0,0 +1,60 @@
|
|||
<div class="modal fade" id="addClientDomainModal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-globe"></i> New Domain</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Domain Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-globe"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Domain name exmaple.com" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Domain Registrar</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="registrar" placeholder="ex GoDaddy" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Expire Date</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="expire" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Server</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="server" placeholder="ex ns1.pittpc.com" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="add_client_domain" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -34,6 +34,8 @@ if(isset($_GET['client_id'])){
|
|||
$num_logins = $row['num'];
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_network_id') AS num FROM client_networks WHERE client_id = $client_id"));
|
||||
$num_networks = $row['num'];
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_domain_id') AS num FROM client_domains WHERE client_id = $client_id"));
|
||||
$num_domains = $row['num'];
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('invoice_id') AS num FROM invoices WHERE client_id = $client_id"));
|
||||
$num_invoices = $row['num'];
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('client_note_id') AS num FROM client_notes WHERE client_id = $client_id"));
|
||||
|
|
@ -56,13 +58,14 @@ if(isset($_GET['client_id'])){
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientVendorModal">New Vendor</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientLoginModal">New Login</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNetworkModal">New Network</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientDomainModal">New Domain</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addInvoiceModal">New Invoice</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addQuoteModal">New Quote</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientAttachmentModal">New Attachment</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addClientNoteModal">New Note</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $invoice_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client=<?php echo $client_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -88,6 +91,7 @@ if(isset($_GET['client_id'])){
|
|||
<?php include("add_client_vendor_modal.php"); ?>
|
||||
<?php include("add_client_login_modal.php"); ?>
|
||||
<?php include("add_client_network_modal.php"); ?>
|
||||
<?php include("add_client_domain_modal.php"); ?>
|
||||
<?php include("add_invoice_modal.php"); ?>
|
||||
<?php include("add_invoice_payment_modal.php"); ?>
|
||||
<?php include("add_quote_modal.php"); ?>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
<?php $sql = mysqli_query($mysqli,"SELECT * FROM client_domains WHERE client_id = $client_id ORDER BY client_domain_id DESC"); ?>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-borderless table-hover" id="dataTable" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Domain</th>
|
||||
<th>Registrar</th>
|
||||
<th>Expire</th>
|
||||
<th>Server</th>
|
||||
<th class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$client_domain_id = $row['client_domain_id'];
|
||||
$client_domain_name = $row['client_domain_name'];
|
||||
$client_domain_registrar = $row['client_domain_registrar'];
|
||||
$client_domain_expire = $row['client_domain_expire'];
|
||||
$client_domain_server = $row['client_domain_server'];
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $client_domain_name; ?></td>
|
||||
<td><?php echo $client_domain_registrar; ?></td>
|
||||
<td><?php echo $client_domain_expire; ?></td>
|
||||
<td><?php echo $client_domain_server; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientDomainModal<?php echo $client_domain_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client_domain=<?php echo $client_domain_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_client_domain_modal.php");
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -38,6 +38,12 @@
|
|||
<span class="badge badge-pill badge-dark"><?php echo $num_networks; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=domains">
|
||||
Domains
|
||||
<span class="badge badge-pill badge-dark"><?php echo $num_domains; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?client_id=<?php echo $client_id; ?>&tab=invoices">
|
||||
Invoices
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ if(isset($_GET['tab'])){
|
|||
elseif($_GET['tab'] == "networks"){
|
||||
include("client_networks.php");
|
||||
}
|
||||
elseif($_GET['tab'] == "domains"){
|
||||
include("client_domains.php");
|
||||
}
|
||||
elseif($_GET['tab'] == "invoices"){
|
||||
include("client_invoices.php");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
<div class="modal fade" id="editClientDomainModal<?php echo $client_domain_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-globe"></i> New Domain</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_domain_id" value="<?php echo $client_domain_id; ?>">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Domain Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-globe"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Domain name exmaple.com" value="<?php echo $client_domain_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Domain Registrar</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="registrar" placeholder="ex GoDaddy" value="<?php echo $client_domain_registrar; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Expire Date</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="expire" value="<?php echo $client_domain_expire; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Server</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="server" placeholder="ex ns1.pittpc.com" value="<?php echo $client_domain_server; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="edit_client_domain" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<div class="modal fade" id="editClientDomainModal<?php echo $client_domain_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-globe"></i> New Domain</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_domain_id" value="<?php echo $client_domain_id; ?>">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Domain Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-globe"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Domain name exmaple.com" value="<?php echo $client_domain_name; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Domain Registrar</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="registrar" placeholder="ex GoDaddy" value="<?php echo $client_domain_registrar; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Expire Date</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control" name="expire" value="<?php echo $client_domain_expire; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Server</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-server"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="server" placeholder="ex ns1.pittpc.com" value="<?php echo $client_domain_server; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="edit_client_domain" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
43
post.php
43
post.php
|
|
@ -792,6 +792,49 @@ if(isset($_GET['delete_client_network'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_domain'])){
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$registrar = strip_tags(mysqli_real_escape_string($mysqli,$_POST['registrar']));
|
||||
$expire = strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire']));
|
||||
$server = strip_tags(mysqli_real_escape_string($mysqli,$_POST['server']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO client_domains SET client_domain_name = '$name', client_domain_registrar = '$registrar', client_domain_expire = '$expire', client_domain_server = '$server', client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Domain added";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['edit_client_domain'])){
|
||||
|
||||
$client_domain_id = intval($_POST['client_domain_id']);
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$registrar = strip_tags(mysqli_real_escape_string($mysqli,$_POST['registrar']));
|
||||
$expire = strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire']));
|
||||
$server = strip_tags(mysqli_real_escape_string($mysqli,$_POST['server']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE client_domains SET client_domain_name = '$name', client_domain_registrar = '$registrar', client_domain_expire = '$expire', client_domain_server = '$server' WHERE client_domain_id = $client_domain_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Domain updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client_domain'])){
|
||||
$client_domain_id = intval($_GET['delete_client_domain']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM client_domains WHERE client_domain_id = $client_domain_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Domain deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['change_password'])){
|
||||
$current_url = $_POST['current_url'];
|
||||
$new_password = mysqli_real_escape_string($mysqli,$_POST['new_password']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue