mirror of
https://github.com/itflow-org/itflow
synced 2026-03-04 21:04:50 +00:00
Created a tmp directory, added states array to setup add localhost default database host value to setup, added inputmask to setup
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,3 +9,5 @@ uploads/settings/*
|
|||||||
!uploads/settings/index.php
|
!uploads/settings/index.php
|
||||||
uploads/users/*
|
uploads/users/*
|
||||||
!uploads/users/index.php
|
!uploads/users/index.php
|
||||||
|
uploads/tmp/*
|
||||||
|
!uploads/tmp/index.php
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ $total_pages = ceil($total_found_rows / 10);
|
|||||||
|
|
||||||
while($row = mysqli_fetch_array($sql)){
|
while($row = mysqli_fetch_array($sql)){
|
||||||
$ticket_id = $row['ticket_id'];
|
$ticket_id = $row['ticket_id'];
|
||||||
|
$ticket_number = $row['ticket_number'];
|
||||||
$ticket_subject = $row['ticket_subject'];
|
$ticket_subject = $row['ticket_subject'];
|
||||||
$ticket_details = $row['ticket_details'];
|
$ticket_details = $row['ticket_details'];
|
||||||
$ticket_status = $row['ticket_status'];
|
$ticket_status = $row['ticket_status'];
|
||||||
@@ -103,7 +104,7 @@ $total_pages = ceil($total_found_rows / 10);
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="#" data-toggle="modal" data-target="#viewTicketModal<?php echo $ticket_id; ?>"><span class="badge badge-pill badge-secondary p-3"><?php echo $ticket_id; ?></span></a></td>
|
<td><a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><span class="badge badge-pill badge-secondary p-3"><?php echo $ticket_number; ?></span></a></td>
|
||||||
<td><?php echo $ticket_subject; ?></td>
|
<td><?php echo $ticket_subject; ?></td>
|
||||||
<td><?php echo $ticket_created_at; ?></td>
|
<td><?php echo $ticket_created_at; ?></td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
13
post.php
13
post.php
@@ -81,6 +81,7 @@ if(isset($_POST['add_company'])){
|
|||||||
mkdir("uploads/clients/$company_id");
|
mkdir("uploads/clients/$company_id");
|
||||||
mkdir("uploads/expenses/$company_id");
|
mkdir("uploads/expenses/$company_id");
|
||||||
mkdir("uploads/settings/$company_id");
|
mkdir("uploads/settings/$company_id");
|
||||||
|
mkdir("uploads/tmp/$company_id");
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$name', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0");
|
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$name', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0");
|
||||||
|
|
||||||
@@ -522,6 +523,18 @@ if(isset($_POST['add_ticket_update'])){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($_POST['close_ticket'])){
|
||||||
|
|
||||||
|
$ticket_id = intval($_POST['ticket_id']);
|
||||||
|
|
||||||
|
mysqli_query($mysqli,"UPDATE tickets SET ticket_status = 'Closed', ticket_updated_at = NOW(), ticket_closed_at = NOW(), ticket_closed_by = $session_user_id WHERE ticket_id = $ticket_id") or die(mysqli_error($mysqli));
|
||||||
|
|
||||||
|
$_SESSION['alert_message'] = "Ticket Closed, this cannot not be reopened but you may start another one";
|
||||||
|
|
||||||
|
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_POST['add_vendor'])){
|
if(isset($_POST['add_vendor'])){
|
||||||
|
|
||||||
$client_id = intval($_POST['client_id']); //Used if this vendor is under a contact otherwise its 0 for under company
|
$client_id = intval($_POST['client_id']); //Used if this vendor is under a contact otherwise its 0 for under company
|
||||||
|
|||||||
66
setup.php
66
setup.php
@@ -2,6 +2,60 @@
|
|||||||
|
|
||||||
include("functions.php");
|
include("functions.php");
|
||||||
|
|
||||||
|
$states_array = array(
|
||||||
|
'AL'=>'Alabama',
|
||||||
|
'AK'=>'Alaska',
|
||||||
|
'AZ'=>'Arizona',
|
||||||
|
'AR'=>'Arkansas',
|
||||||
|
'CA'=>'California',
|
||||||
|
'CO'=>'Colorado',
|
||||||
|
'CT'=>'Connecticut',
|
||||||
|
'DE'=>'Delaware',
|
||||||
|
'DC'=>'District of Columbia',
|
||||||
|
'FL'=>'Florida',
|
||||||
|
'GA'=>'Georgia',
|
||||||
|
'HI'=>'Hawaii',
|
||||||
|
'ID'=>'Idaho',
|
||||||
|
'IL'=>'Illinois',
|
||||||
|
'IN'=>'Indiana',
|
||||||
|
'IA'=>'Iowa',
|
||||||
|
'KS'=>'Kansas',
|
||||||
|
'KY'=>'Kentucky',
|
||||||
|
'LA'=>'Louisiana',
|
||||||
|
'ME'=>'Maine',
|
||||||
|
'MD'=>'Maryland',
|
||||||
|
'MA'=>'Massachusetts',
|
||||||
|
'MI'=>'Michigan',
|
||||||
|
'MN'=>'Minnesota',
|
||||||
|
'MS'=>'Mississippi',
|
||||||
|
'MO'=>'Missouri',
|
||||||
|
'MT'=>'Montana',
|
||||||
|
'NE'=>'Nebraska',
|
||||||
|
'NV'=>'Nevada',
|
||||||
|
'NH'=>'New Hampshire',
|
||||||
|
'NJ'=>'New Jersey',
|
||||||
|
'NM'=>'New Mexico',
|
||||||
|
'NY'=>'New York',
|
||||||
|
'NC'=>'North Carolina',
|
||||||
|
'ND'=>'North Dakota',
|
||||||
|
'OH'=>'Ohio',
|
||||||
|
'OK'=>'Oklahoma',
|
||||||
|
'OR'=>'Oregon',
|
||||||
|
'PA'=>'Pennsylvania',
|
||||||
|
'RI'=>'Rhode Island',
|
||||||
|
'SC'=>'South Carolina',
|
||||||
|
'SD'=>'South Dakota',
|
||||||
|
'TN'=>'Tennessee',
|
||||||
|
'TX'=>'Texas',
|
||||||
|
'UT'=>'Utah',
|
||||||
|
'VT'=>'Vermont',
|
||||||
|
'VA'=>'Virginia',
|
||||||
|
'WA'=>'Washington',
|
||||||
|
'WV'=>'West Virginia',
|
||||||
|
'WI'=>'Wisconsin',
|
||||||
|
'WY'=>'Wyoming'
|
||||||
|
);
|
||||||
|
|
||||||
$_SESSION['alert_message'] = '';
|
$_SESSION['alert_message'] = '';
|
||||||
$_SESSION['alert_type'] = "warning";
|
$_SESSION['alert_type'] = "warning";
|
||||||
|
|
||||||
@@ -113,6 +167,11 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
|
|
||||||
$company_id = mysqli_insert_id($mysqli);
|
$company_id = mysqli_insert_id($mysqli);
|
||||||
|
|
||||||
|
mkdir("uploads/clients/$company_id");
|
||||||
|
mkdir("uploads/expenses/$company_id");
|
||||||
|
mkdir("uploads/settings/$company_id");
|
||||||
|
mkdir("uploads/tmp/$company_id");
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO user_companies SET user_id = $user_id, company_id = $company_id");
|
mysqli_query($mysqli,"INSERT INTO user_companies SET user_id = $user_id, company_id = $company_id");
|
||||||
|
|
||||||
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = $config_company_phone, config_company_site = '$config_company_site', config_start_page = 'dashboard.php', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1");
|
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = $config_company_phone, config_company_site = '$config_company_site', config_start_page = 'dashboard.php', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1");
|
||||||
@@ -234,7 +293,7 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
<form class="p-3" method="post" autocomplete="off">
|
<form class="p-3" method="post" autocomplete="off">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Database Name</label>
|
<label>Database</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-database"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-database"></i></span>
|
||||||
@@ -269,7 +328,7 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control" name="host" placeholder="Usually localhost" required>
|
<input type="text" class="form-control" name="host" value="localhost" placeholder="Hostname of the server" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -279,7 +338,6 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php }elseif(isset($_GET['user'])){ ?>
|
<?php }elseif(isset($_GET['user'])){ ?>
|
||||||
|
|
||||||
<div class="card mb-3">
|
<div class="card mb-3">
|
||||||
@@ -473,6 +531,8 @@ if(isset($_POST['add_company_settings'])){
|
|||||||
<!-- Custom scripts for all pages-->
|
<!-- Custom scripts for all pages-->
|
||||||
<script src="js/sb-admin.min.js"></script>
|
<script src="js/sb-admin.min.js"></script>
|
||||||
<script src='vendor/bootstrap-select/js/bootstrap-select.min.js'></script>
|
<script src='vendor/bootstrap-select/js/bootstrap-select.min.js'></script>
|
||||||
|
<script src='vendor/Inputmask/dist/inputmask.min.js'></script>
|
||||||
|
<script src='vendor/Inputmask/dist/bindings/inputmask.binding.js'></script>
|
||||||
|
|
||||||
<!-- Custom js-->
|
<!-- Custom js-->
|
||||||
<script src="js/app.js"></script>
|
<script src="js/app.js"></script>
|
||||||
|
|||||||
@@ -120,13 +120,13 @@ if(isset($_GET['ticket_id'])){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form class="mb-3" action="post.php" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
|
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea rows="5" class="form-control" name="ticket_update"></textarea>
|
<textarea rows="5" class="form-control" name="ticket_update"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" name="add_ticket_update" class="btn btn-primary">Save</button>
|
<button type="submit" name="add_ticket_update" class="btn btn-primary">Save</button>
|
||||||
|
<button type="submit" name="close_ticket" class="btn btn-secondary">Close Ticket</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
0
uploads/tmp/index.php
Normal file
0
uploads/tmp/index.php
Normal file
Reference in New Issue
Block a user