Skip to content

Commit

Permalink
Tidy codestyle - spaces between parenthesis and curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
wrongecho committed Jan 21, 2023
1 parent 7f3ec8c commit 2c3ebb3
Show file tree
Hide file tree
Showing 164 changed files with 2,156 additions and 2,156 deletions.
2 changes: 1 addition & 1 deletion account_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<select class="form-control select2" name="currency_code" required>
<option value="">- Currency -</option>
<?php foreach($currencies_array as $currency_code => $currency_name) { ?>
<option <?php if($session_company_currency == $currency_code){ echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
<option <?php if ($session_company_currency == $currency_code) { echo "selected"; } ?> value="<?php echo $currency_code; ?>"><?php echo "$currency_code - $currency_name"; ?></option>
<?php } ?>
</select>
</div>
Expand Down
10 changes: 5 additions & 5 deletions accounts.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php include("inc_all_settings.php");

if(!empty($_GET['sb'])){
if (!empty($_GET['sb'])) {
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
}else{
$sb = "account_name";
Expand All @@ -27,7 +27,7 @@
<div class="card-body">
<form autocomplete="off">
<div class="input-group">
<input type="search" class="form-control col-md-4" name="q" value="<?php if(isset($q)){ echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Accounts">
<input type="search" class="form-control col-md-4" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Accounts">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
Expand All @@ -36,7 +36,7 @@
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
<tr>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=account_name&o=<?php echo $disp; ?>">Name</a></th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=account_currency_code&o=<?php echo $disp; ?>">Currency</a></th>
Expand All @@ -47,7 +47,7 @@
<tbody>
<?php

while($row = mysqli_fetch_array($sql)){
while ($row = mysqli_fetch_array($sql)) {
$account_id = $row['account_id'];
$account_name = htmlentities($row['account_name']);
$opening_balance = $row['opening_balance'];
Expand Down Expand Up @@ -80,7 +80,7 @@
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAccountModal<?php echo $account_id; ?>">Edit</a>
<?php if($balance == 0){ //Cannot Archive an Account until it reaches 0 Balance ?>
<?php if ($balance == 0) { //Cannot Archive an Account until it reaches 0 Balance ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="post.php?archive_account=<?php echo $account_id; ?>">Archive</a>
<?php } ?>
Expand Down
2 changes: 1 addition & 1 deletion api_key_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<?php

$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE company_id = $session_company_id ORDER BY client_name ASC");
while($row = mysqli_fetch_array($sql)){
while ($row = mysqli_fetch_array($sql)) {
$client_id = $row['client_id'];
$client_name = htmlentities($row['client_name']);
?>
Expand Down
10 changes: 5 additions & 5 deletions calendar_event_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
<?php

$sql = mysqli_query($mysqli,"SELECT * FROM calendars WHERE company_id = $session_company_id ORDER BY calendar_name ASC");
while($row = mysqli_fetch_array($sql)){
while ($row = mysqli_fetch_array($sql)) {
$calendar_id = $row['calendar_id'];
$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>
<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>

<?php
}
Expand Down Expand Up @@ -105,7 +105,7 @@

<div class="tab-pane fade" id="pills-attendees">

<?php if(isset($client_id)){ ?>
<?php if (isset($client_id)) { ?>

<input type="hidden" name="client" value="<?php echo $client_id; ?>">

Expand All @@ -122,7 +122,7 @@
<?php

$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)){
while ($row = mysqli_fetch_array($sql)) {
$client_id = $row['client_id'];
$client_name = htmlentities($row['client_name']);
$contact_email = htmlentities($row['contact_email']);
Expand All @@ -138,7 +138,7 @@

<?php } ?>

<?php if(!empty($config_smtp_host)){ ?>
<?php if (!empty($config_smtp_host)) { ?>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customControlAutosizing" name="email_event" value="1" >
<label class="custom-control-label" for="customControlAutosizing">Email Event</label>
Expand Down
22 changes: 11 additions & 11 deletions calendar_event_edit_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
<?php

$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)){
while ($row = mysqli_fetch_array($sql_calendars_select)) {
$calendar_id_select = $row['calendar_id'];
$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>
<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>

<?php
}
Expand Down Expand Up @@ -91,11 +91,11 @@
<span class="input-group-text"><i class="fa fa-fw fa-recycle"></i></span>
</div>
<select class="form-control select2" name="repeat">
<option <?php if(empty($event_repeat)){ echo "selected"; } ?> value="">Never</option>
<option <?php if($event_repeat == "Day"){ echo "selected"; } ?>>Day</option>
<option <?php if($event_repeat == "Week"){ echo "selected"; } ?>>Week</option>
<option <?php if($event_repeat == "Month"){ echo "selected"; } ?>>Month</option>
<option <?php if($event_repeat == "Year"){ echo "selected"; } ?>>Year</option>
<option <?php if (empty($event_repeat)) { echo "selected"; } ?> value="">Never</option>
<option <?php if ($event_repeat == "Day") { echo "selected"; } ?>>Day</option>
<option <?php if ($event_repeat == "Week") { echo "selected"; } ?>>Week</option>
<option <?php if ($event_repeat == "Month") { echo "selected"; } ?>>Month</option>
<option <?php if ($event_repeat == "Year") { echo "selected"; } ?>>Year</option>
</select>
</div>
</div>
Expand All @@ -104,7 +104,7 @@

<div class="tab-pane fade" id="pills-attendees<?php echo $event_id; ?>">

<?php if(isset($_GET['client_id'])){ ?>
<?php if (isset($_GET['client_id'])) { ?>

<input type="hidden" name="client" value="<?php echo $client_id; ?>">

Expand All @@ -121,12 +121,12 @@
<?php

$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)){
while ($row = mysqli_fetch_array($sql_clients)) {
$client_id_select = $row['client_id'];
$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>
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name_select; ?></option>

<?php
}
Expand All @@ -137,7 +137,7 @@

<?php } ?>

<?php if(!empty($config_smtp_host)){ ?>
<?php if (!empty($config_smtp_host)) { ?>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customControlAutosizing<?php echo $event_id; ?>" name="email_event" value="1" >
<label class="custom-control-label" for="customControlAutosizing<?php echo $event_id; ?>">Email Event</label>
Expand Down
16 changes: 8 additions & 8 deletions calendar_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<?php

if(isset($_GET['calendar_id'])){
if (isset($_GET['calendar_id'])) {
$calendar_selected_id = intval($_GET['calendar_id']);
}

Expand All @@ -23,7 +23,7 @@
<?php
//loop through IDs and create a modal for each
$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)){
while ($row = mysqli_fetch_array($sql)) {
$event_id = $row['event_id'];
$event_title = htmlentities($row['event_title']);
$event_description = htmlentities($row['event_description']);
Expand Down Expand Up @@ -75,7 +75,7 @@
events: [
<?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)){
while ($row = mysqli_fetch_array($sql)) {
$event_id = json_encode($row['event_id']);
$event_title = json_encode($row['event_title']);
$event_start = json_encode($row['event_start']);
Expand All @@ -91,7 +91,7 @@
<?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)){
while ($row = mysqli_fetch_array($sql)) {
$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']);
Expand All @@ -103,7 +103,7 @@
<?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)){
while ($row = mysqli_fetch_array($sql)) {
$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']);
Expand All @@ -115,7 +115,7 @@
<?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)){
while ($row = mysqli_fetch_array($sql)) {
$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']);
Expand All @@ -129,7 +129,7 @@
<?php
//Vendors Added Created
$sql = mysqli_query($mysqli,"SELECT * FROM clients LEFT JOIN vendors ON client_id = vendor_client_id WHERE vendor_template = 0 AND clients.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
while ($row = mysqli_fetch_array($sql)) {
$event_id = json_encode($row['vendor_id']);
$event_title = json_encode($row['vendor_name']);
$event_start = json_encode($row['vendor_created_at']);
Expand All @@ -141,7 +141,7 @@
<?php
//Clients Added
$sql = mysqli_query($mysqli,"SELECT * FROM clients WHERE clients.company_id = $session_company_id");
while($row = mysqli_fetch_array($sql)){
while ($row = mysqli_fetch_array($sql)) {
$event_id = json_encode($row['client_id']);
$event_title = json_encode($row['client_name']);
$event_start = json_encode($row['client_created_at']);
Expand Down
20 changes: 10 additions & 10 deletions categories.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php include("inc_all_settings.php");

if(isset($_GET['category'])){
if (isset($_GET['category'])) {
$category = strip_tags(mysqli_real_escape_string($mysqli,$_GET['category']));
}else{
$category = "Expense";
}

if(!empty($_GET['sb'])){
if (!empty($_GET['sb'])) {
$sb = strip_tags(mysqli_real_escape_string($mysqli,$_GET['sb']));
}else{
$sb = "category_name";
Expand All @@ -32,7 +32,7 @@
AND company_id = $session_company_id"
);

while($color_used_row = mysqli_fetch_array($sql_colors_used)){
while ($color_used_row = mysqli_fetch_array($sql_colors_used)) {
$colors_used_array[] = $color_used_row['category_color'];
}
$colors_diff = array_diff($colors_array,$colors_used_array);
Expand All @@ -53,26 +53,26 @@
<div class="row">
<div class="col-sm-4 mb-2">
<div class="input-group">
<input type="search" class="form-control" name="q" value="<?php if(isset($q)){ echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Categories">
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo strip_tags(htmlentities($q)); } ?>" placeholder="Search Categories">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="btn-group float-right">
<a href="?category=Expense" class="btn <?php if($category == 'Expense'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Expense</a>
<a href="?category=Income" class="btn <?php if($category == 'Income'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Income</a>
<a href="?category=Referral" class="btn <?php if($category == 'Referral'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Referral</a>
<a href="?category=Payment Method" class="btn <?php if($category == 'Payment Method'){ echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Payment Method</a>
<a href="?category=Expense" class="btn <?php if ($category == 'Expense') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Expense</a>
<a href="?category=Income" class="btn <?php if ($category == 'Income') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Income</a>
<a href="?category=Referral" class="btn <?php if ($category == 'Referral') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Referral</a>
<a href="?category=Payment Method" class="btn <?php if ($category == 'Payment Method') { echo 'btn-primary'; }else{ echo 'btn-default'; } ?>">Payment Method</a>
</div>
</div>
</div>
</form>
<hr>
<div class="table-responsive">
<table class="table table-striped table-borderless table-hover">
<thead class="text-dark <?php if($num_rows[0] == 0){ echo "d-none"; } ?>">
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
<tr>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Name</a></th>
<th>Color</th>
Expand All @@ -82,7 +82,7 @@
<tbody>
<?php

while($row = mysqli_fetch_array($sql)){
while ($row = mysqli_fetch_array($sql)) {
$category_id = $row['category_id'];
$category_name = htmlentities($row['category_name']);
$category_color = htmlentities($row['category_color']);
Expand Down
18 changes: 9 additions & 9 deletions check_login.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?php

if(!isset($_SESSION)){
if (!isset($_SESSION)) {
// HTTP Only cookies
ini_set("session.cookie_httponly", True);
if($config_https_only){
if ($config_https_only) {
// Tell client to only send cookie(s) over HTTPS
ini_set("session.cookie_secure", True);
}
session_start();
}

//Check to see if setup is enabled
if(!isset($config_enable_setup) || $config_enable_setup == 1){
if (!isset($config_enable_setup) || $config_enable_setup == 1) {
header("Location: setup.php");
exit;
}

if(!$_SESSION['logged']){
if (!$_SESSION['logged']) {
header("Location: login.php");
die;
}
Expand All @@ -38,9 +38,9 @@
$session_token = $row['user_token'];
$session_company_id = $row['user_default_company'];
$session_user_role = $row['user_role'];
if($session_user_role == 3){
if ($session_user_role == 3) {
$session_user_role_display = "Administrator";
}elseif($session_user_role == 2){
}elseif ($session_user_role == 2) {
$session_user_role_display = "Technician";
}else{
$session_user_role_display = "Accountant";
Expand All @@ -49,13 +49,13 @@
//LOAD USER COMPANY ACCESS PERMISSIONS
$session_user_company_access_sql = mysqli_query($mysqli,"SELECT company_id FROM user_companies WHERE user_id = $session_user_id");
$session_user_company_access_array = array();
while($row = mysqli_fetch_array($session_user_company_access_sql)){
while ($row = mysqli_fetch_array($session_user_company_access_sql)) {
$session_user_company_access_array[] = $row['company_id'];
}
$session_user_company_access = implode(',',$session_user_company_access_array);

//Check to see if user has rights to company Prevents User from access a company he is not allowed to have access to.
if(!in_array($session_company_id,$session_user_company_access_array)){
if (!in_array($session_company_id,$session_user_company_access_array)) {
session_start();
session_destroy();
header('Location: login.php');
Expand All @@ -76,7 +76,7 @@
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");

if($iPod || $iPhone || $iPad){
if ($iPod || $iPhone || $iPad) {
$session_map_source = "apple";
}else{
$session_map_source = "google";
Expand Down
Loading

0 comments on commit 2c3ebb3

Please sign in to comment.