Skip to content

Commit

Permalink
Format output for the proper code syntax, this should fix many variou…
Browse files Browse the repository at this point in the history
…s issues with output formatting and page breakage
  • Loading branch information
johnnyq committed Dec 3, 2022
1 parent 3067e6b commit b6e5408
Show file tree
Hide file tree
Showing 128 changed files with 1,222 additions and 1,227 deletions.
6 changes: 3 additions & 3 deletions accounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@

while($row = mysqli_fetch_array($sql)){
$account_id = $row['account_id'];
$account_name = $row['account_name'];
$account_name = htmlentities($row['account_name']);
$opening_balance = $row['opening_balance'];
$account_currency_code = $row['account_currency_code'];
$account_notes = $row['account_notes'];
$account_currency_code = htmlentities($row['account_currency_code']);
$account_notes = htmlentities($row['account_notes']);

$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id");
$row = mysqli_fetch_array($sql_payments);
Expand Down
8 changes: 4 additions & 4 deletions calendar_event_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
$sql = mysqli_query($mysqli,"SELECT * FROM calendars WHERE company_id = $session_company_id ORDER BY calendar_name ASC");
while($row = mysqli_fetch_array($sql)){
$calendar_id = $row['calendar_id'];
$calendar_name = $row['calendar_name'];
$calendar_color = $row['calendar_color'];
$calendar_name = htmlentities($row['calendar_name']);
$calendar_color = htmlentities($row['calendar_color']);
?>
<option <?php if($config_default_calendar == $calendar_id){ echo "selected"; } ?> data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color; ?>;'></i> <?php echo $calendar_name; ?>" value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>

Expand Down Expand Up @@ -108,8 +108,8 @@
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN contacts ON primary_contact = contact_id WHERE clients.company_id = $session_company_id ORDER BY client_name ASC");
while($row = mysqli_fetch_array($sql)){
$client_id = $row['client_id'];
$client_name = $row['client_name'];
$contact_email = $row['contact_email'];
$client_name = htmlentities($row['client_name']);
$contact_email = htmlentities($row['contact_email']);
?>
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>

Expand Down
8 changes: 4 additions & 4 deletions calendar_event_edit_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
$sql_calendars_select = mysqli_query($mysqli,"SELECT * FROM calendars WHERE company_id = $session_company_id ORDER BY calendar_name ASC");
while($row = mysqli_fetch_array($sql_calendars_select)){
$calendar_id_select = $row['calendar_id'];
$calendar_name_select = $row['calendar_name'];
$calendar_color_select = $row['calendar_color'];
$calendar_name_select = htmlentities($row['calendar_name']);
$calendar_color_select = htmlentities($row['calendar_color']);
?>
<option data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color_select; ?>;'></i> <?php echo $calendar_name_select; ?>"<?php if($calendar_id == $calendar_id_select){ echo "selected"; } ?> value="<?php echo $calendar_id_select; ?>"><?php echo $calendar_name_select; ?></option>

Expand Down Expand Up @@ -107,8 +107,8 @@
$sql_clients = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN contacts ON primary_contact = contact_id WHERE clients.company_id = $session_company_id ORDER BY client_name ASC");
while($row = mysqli_fetch_array($sql_clients)){
$client_id_select = $row['client_id'];
$client_name_select = $row['client_name'];
$contact_email_select = $row['contact_email'];
$client_name_select = htmlentities($row['client_name']);
$contact_email_select = htmlentities($row['contact_email']);
?>
<option <?php if($client_id == $client_id_select){ echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name_select; ?></option>

Expand Down
72 changes: 36 additions & 36 deletions calendar_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
$sql = mysqli_query($mysqli,"SELECT * FROM events LEFT JOIN calendars ON event_calendar_id = calendar_id WHERE calendars.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['event_id'];
$event_title = $row['event_title'];
$event_description = $row['event_description'];
$event_start = $row['event_start'];
$event_end = $row['event_end'];
$event_repeat = $row['event_repeat'];
$event_title = htmlentities($row['event_title']);
$event_description = htmlentities($row['event_description']);
$event_start = htmlentities($row['event_start']);
$event_end = htmlentities($row['event_end']);
$event_repeat = htmlentities($row['event_repeat']);
$calendar_id = $row['calendar_id'];
$calendar_name = $row['calendar_name'];
$calendar_color = $row['calendar_color'];
$calendar_name = htmlentities($row['calendar_name']);
$calendar_color = htmlentities($row['calendar_color']);
$client_id = $row['event_client_id'];

include("calendar_event_edit_modal.php");
Expand Down Expand Up @@ -76,51 +76,51 @@
<?php
$sql = mysqli_query($mysqli,"SELECT * FROM events LEFT JOIN calendars ON event_calendar_id = calendar_id WHERE calendars.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['event_id'];
$event_title = $row['event_title'];
$event_start = $row['event_start'];
$event_end = $row['event_end'];
$calendar_id = $row['calendar_id'];
$calendar_name = $row['calendar_name'];
$calendar_color = $row['calendar_color'];
$event_id = json_encode($row['event_id']);
$event_title = json_encode($row['event_title']);
$event_start = json_encode($row['event_start']);
$event_end = json_encode($row['event_end']);
$calendar_id = json_encode($row['calendar_id']);
$calendar_name = json_encode($row['calendar_name']);
$calendar_color = json_encode($row['calendar_color']);

echo "{ id: '$event_id', title: '$event_title', start: '$event_start', end: '$event_end', color: '$calendar_color'},";
echo "{ id: $event_id, title: $event_title, start: $event_start, end: $event_end, color: $calendar_color },";
}
?>

<?php
//Invoices Created
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN invoices ON client_id = invoice_client_id WHERE clients.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['invoice_id'];
$event_title = $row['invoice_prefix'] . $row['invoice_number'] . " " . $row['invoice_scope'];
$event_start = $row['invoice_date'];
$event_id = json_encode($row['invoice_id']);
$event_title = json_encode($row['invoice_prefix'] . $row['invoice_number'] . " " . $row['invoice_scope']);
$event_start = json_encode($row['invoice_date']);

echo "{ id: '$event_id', title: ". json_encode($event_title) .", start: '$event_start', color: 'blue', url: 'invoice.php?invoice_id=$event_id'},";
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'blue', url: 'invoice.php?invoice_id=$event_id' },";
}
?>

<?php
//Quotes Created
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN quotes ON client_id = quote_client_id WHERE clients.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['quote_id'];
$event_title = $row['quote_prefix'] . $row['quote_number'] . " " . $row['quote_scope'];
$event_start = $row['quote_date'];
$event_id = json_encode($row['quote_id']);
$event_title = json_encode($row['quote_prefix'] . $row['quote_number'] . " " . $row['quote_scope']);
$event_start = json_encode($row['quote_date']);

echo "{ id: '$event_id', title: ". json_encode($event_title) .", start: '$event_start', color: 'purple', url: 'quote.php?quote_id=$event_id'},";
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'purple', url: 'quote.php?quote_id=$event_id' },";
}
?>

<?php
//Tickets Created
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN tickets ON client_id = ticket_client_id WHERE clients.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['ticket_id'];
$event_title = $row['ticket_prefix'] . $row['ticket_number'] . " " . $row['ticket_subject'];
$event_start = $row['ticket_created_at'];
$event_id = json_encode($row['ticket_id']);
$event_title = json_encode($row['ticket_prefix'] . $row['ticket_number'] . " " . $row['ticket_subject']);
$event_start = json_encode($row['ticket_created_at']);

echo "{ id: '$event_id', title: ". json_encode($event_title) .", start: '$event_start', color: 'orange', url: 'ticket.php?ticket_id=$event_id'},";
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'orange', url: 'ticket.php?ticket_id=$event_id' },";

}

Expand All @@ -130,23 +130,23 @@
//Vendors Added Created
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN vendors ON client_id = vendor_client_id WHERE clients.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['vendor_id'];
$event_title = $row['vendor_name'];
$event_start = $row['vendor_created_at'];
$event_id = json_encode($row['vendor_id']);
$event_title = json_encode($row['vendor_name']);
$event_start = json_encode($row['vendor_created_at']);

echo "{ id: '$event_id', title: ". json_encode($event_title) .", start: '$event_start', color: 'brown', url: 'client_vendors.php?client_id=$event_id'},";
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'brown', url: 'client_vendors.php?client_id=$event_id' },";
}
?>

<?php
//Clients Added
$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE clients.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
$event_id = $row['client_id'];
$event_title = $row['client_name'];
$event_start = $row['client_created_at'];
$event_id = json_encode($row['client_id']);
$event_title = json_encode($row['client_name']);
$event_start = json_encode($row['client_created_at']);

echo "{ id: '$event_id', title: ". json_encode($event_title) .", start: '$event_start', color: 'green', url: 'client.php?client_id=$event_id'},";
echo "{ id: $event_id, title: $event_title, start: $event_start, color: 'green', url: 'client.php?client_id=$event_id' },";
}
?>

Expand All @@ -160,4 +160,4 @@
calendar.render();
});

</script>
</script>
4 changes: 2 additions & 2 deletions categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@

while($row = mysqli_fetch_array($sql)){
$category_id = $row['category_id'];
$category_name = $row['category_name'];
$category_color = $row['category_color'];
$category_name = htmlentities($row['category_name']);
$category_color = htmlentities($row['category_color']);
//$colors_used_array[] = $row['category_color'];

?>
Expand Down
8 changes: 4 additions & 4 deletions client_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

$referral_sql = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL AND company_id = $session_company_id ORDER BY category_name ASC");
while($row = mysqli_fetch_array($referral_sql)){
$referral = $row['category_name'];
$referral = htmlentities($row['category_name']);
?>
<option><?php echo $referral; ?></option>

Expand Down Expand Up @@ -279,9 +279,9 @@

while($row = mysqli_fetch_array($sql_tags_select)){
$tag_id_select = $row['tag_id'];
$tag_name_select = $row['tag_name'];
$tag_color_select = $row['tag_color'];
$tag_icon_select = $row['tag_icon'];
$tag_name_select = htmlentities($row['tag_name']);
$tag_color_select = htmlentities($row['tag_color']);
$tag_icon_select = htmlentities($row['tag_icon']);

?>
<li class="list-group-item">
Expand Down
10 changes: 5 additions & 5 deletions client_asset_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
$sql = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
while($row = mysqli_fetch_array($sql)){
$location_id = $row['location_id'];
$location_name = $row['location_name'];
$location_name = htmlentities($row['location_name']);
?>
<option value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>

Expand All @@ -150,7 +150,7 @@
$sql = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
while($row = mysqli_fetch_array($sql)){
$contact_id = $row['contact_id'];
$contact_name = $row['contact_name'];
$contact_name = htmlentities($row['contact_name']);
?>
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>

Expand Down Expand Up @@ -190,8 +190,8 @@
$sql = mysqli_query($mysqli,"SELECT * FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
while($row = mysqli_fetch_array($sql)){
$network_id = $row['network_id'];
$network_name = $row['network_name'];
$network = $row['network'];
$network_name = htmlentities($row['network_name']);
$network = htmlentities($row['network']);

?>
<option value="<?php echo $network_id; ?>"><?php echo $network_name; ?> - <?php echo $network; ?></option>
Expand Down Expand Up @@ -240,7 +240,7 @@
$sql = mysqli_query($mysqli,"SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
while($row = mysqli_fetch_array($sql)){
$vendor_id = $row['vendor_id'];
$vendor_name = $row['vendor_name'];
$vendor_name = htmlentities($row['vendor_name']);
?>
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>

Expand Down
10 changes: 5 additions & 5 deletions client_asset_copy_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
$sql_locations = mysqli_query($mysqli,"SELECT * FROM locations WHERE location_client_id = $client_id ORDER BY location_name ASC");
while($row = mysqli_fetch_array($sql_locations)){
$location_id_select = $row['location_id'];
$location_name_select = $row['location_name'];
$location_name_select = htmlentities($row['location_name']);
?>
<option <?php if($asset_location_id == $location_id_select){ echo "selected"; } ?> value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>

Expand All @@ -148,7 +148,7 @@
$sql_contacts = mysqli_query($mysqli,"SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
while($row = mysqli_fetch_array($sql_contacts)){
$contact_id = $row['contact_id'];
$contact_name = $row['contact_name'];
$contact_name = htmlentities($row['contact_name']);
?>
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>

Expand Down Expand Up @@ -187,8 +187,8 @@
$sql_networks = mysqli_query($mysqli,"SELECT * FROM networks WHERE (network_archived_at > '$asset_created_at' OR network_archived_at IS NULL) AND network_client_id = $client_id ORDER BY network_name ASC");
while($row = mysqli_fetch_array($sql_networks)){
$network_id_select = $row['network_id'];
$network_name_select = $row['network_name'];
$network_select = $row['network'];
$network_name_select = htmlentities($row['network_name']);
$network_select = htmlentities($row['network']);

?>
<option <?php if($asset_network_id == $network_id_select){ echo "selected"; } ?> value="<?php echo $network_id_select; ?>"><?php echo $network_name_select; ?> - <?php echo $network_select; ?></option>
Expand Down Expand Up @@ -237,7 +237,7 @@
$sql_vendors = mysqli_query($mysqli,"SELECT * FROM vendors WHERE (vendor_archived_at > '$asset_created_at' OR vendor_archived_at IS NULL) AND vendor_client_id = $client_id ORDER BY vendor_name ASC");
while($row = mysqli_fetch_array($sql_vendors)){
$vendor_id_select = $row['vendor_id'];
$vendor_name_select = $row['vendor_name'];
$vendor_name_select = htmlentities($row['vendor_name']);
?>
<option <?php if($asset_vendor_id == $vendor_id_select){ echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>

Expand Down
2 changes: 1 addition & 1 deletion client_asset_documents_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<?php
while($row = mysqli_fetch_array($sql_related_documents)){
$related_document_id = $row['document_id'];
$related_document_name = $row['document_name'];
$related_document_name = htmlentities($row['document_name']);
?>
<p>
<i class="fas fa-fw fa-document text-secondary"></i>
Expand Down
Loading

0 comments on commit b6e5408

Please sign in to comment.