diff --git a/add_calendar_event_modal.php b/add_calendar_event_modal.php index 42a7c520..4e8e6815 100644 --- a/add_calendar_event_modal.php +++ b/add_calendar_event_modal.php @@ -64,7 +64,7 @@ diff --git a/calendar_events.php b/calendar_events.php index 566ff7e2..901c2200 100644 --- a/calendar_events.php +++ b/calendar_events.php @@ -6,95 +6,9 @@ if(isset($_GET['calendar_id'])){ $calendar_selected_id = intval($_GET['calendar_id']); } -//Get Calendar list for the select box -$sql_calendars = mysqli_query($mysqli,"SELECT * FROM calendars ORDER BY calendar_name DESC"); - -$sql = mysqli_query($mysqli,"SELECT * FROM calendars, calendar_events WHERE calendars.calendar_id = calendar_events.calendar_id AND calendar_events.calendar_id LIKE '%$calendar_selected_id%' ORDER BY calendar_event_id DESC"); - ?> -
- -
-
-
-
-
-
-
Events
- -
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
DateTimesTitleCalendarActions
- - -
-
-
-
-
-
+
@@ -108,25 +22,36 @@ $sql = mysqli_query($mysqli,"SELECT * FROM calendars, calendar_events WHERE cale var calendar = new FullCalendar.Calendar(calendarEl, { plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'list' ], defaultView: 'dayGridMonth', + customButtons: { + myCustomButton: { + text: 'New', + click: function() { + $("#addCalendarEventModal").modal("show"); + } + } + }, header: { left: 'prev,next today', center: 'title', - right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth' + right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth myCustomButton' }, events: [ - ] + ], + eventClick: function(calEvent, jsEvent, view, resourceObj) { + $("#addCalendarEventModal").modal("show"); + } }); calendar.render(); diff --git a/calendar_events_w_side.php b/calendar_events_w_side.php new file mode 100644 index 00000000..72881f0b --- /dev/null +++ b/calendar_events_w_side.php @@ -0,0 +1,86 @@ + + + + +
+
+ +
+
+ +
+ +
+
+
+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/dashboard.php b/dashboard.php index 7d7b5cd2..e7953cc0 100644 --- a/dashboard.php +++ b/dashboard.php @@ -2,7 +2,6 @@
Cash Flow
- +
diff --git a/edit_calendar_event_modal.php b/edit_calendar_event_modal.php index ac5e5e34..4d6b0e23 100644 --- a/edit_calendar_event_modal.php +++ b/edit_calendar_event_modal.php @@ -1,14 +1,14 @@ - diff --git a/footer.php b/footer.php index 457871f2..e8043321 100644 --- a/footer.php +++ b/footer.php @@ -31,6 +31,7 @@ + diff --git a/guest_footer.php b/guest_footer.php new file mode 100644 index 00000000..782c8b0d --- /dev/null +++ b/guest_footer.php @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guest_header.php b/guest_header.php new file mode 100644 index 00000000..3f8f631d --- /dev/null +++ b/guest_header.php @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + <?php echo $config_company_name; ?> + + + + + + + + + + + + + + +
+ +
+ +
\ No newline at end of file diff --git a/guest_view_invoice.php b/guest_view_invoice.php new file mode 100644 index 00000000..9c5c411a --- /dev/null +++ b/guest_view_invoice.php @@ -0,0 +1,257 @@ + + +2){ + $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); + } + $client_website = $row['client_website']; + $client_net_terms = $row['client_net_terms']; + if($client_net_terms == 0){ + $client_net_terms = $config_default_net_terms; + } + + if(mysqli_num_rows($sql) == 1){ + + $sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, accounts WHERE payments.account_id = accounts.account_id AND payments.invoice_id = $invoice_id ORDER BY payments.payment_id DESC"); + + //Add up all the payments for the invoice and get the total amount paid to the invoice + $sql_amount_paid = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS amount_paid FROM payments WHERE invoice_id = $invoice_id"); + $row = mysqli_fetch_array($sql_amount_paid); + $amount_paid = $row['amount_paid']; + + $balance = $invoice_amount - $amount_paid; + + //check to see if overdue + + $unixtime_invoice_due = strtotime($invoice_due); + if($unixtime_invoice_due < time()){ + $invoice_status = "Overdue"; + $invoice_color = "text-danger"; + } + + //Set Badge color based off of invoice status + if($invoice_status == "Sent"){ + $invoice_badge_color = "warning text-white"; + }elseif($invoice_status == "Partial"){ + $invoice_badge_color = "primary"; + }elseif($invoice_status == "Paid"){ + $invoice_badge_color = "success"; + }elseif($invoice_status == "Cancelled"){ + $invoice_badge_color = "danger"; + }else{ + $invoice_badge_color = "secondary"; + } + + + + ?> +
+
+

Invoice

+
+
+
+ Print + PDF + + Pay + +
+
+
+ +
+ +
+
+
+
+ From +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+
+
+
+
+ Bill To +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+
+
+
+
+ Details +
+
+
    +
  • Invoice Number:
    INV-
  • +
  • Invoice Date:
  • +
  • Payment Due:
  • +
+
+
+
+
+ + + +
+
+
+
+ Items +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProductDescriptionQtyPriceTaxTotal
$$$
+
+
+
+ +
+
+
+
+ Notes +
+
+
+
+
+
+
+ + + + + + + 0){ ?> + + + + + + 0){ ?> + + + + + + 0){ ?> + + + + + + + + + + +
Subtotal$
Discount$
Tax$
Paid to Date
$
Balance Due$
+
+
+ + + + + \ No newline at end of file diff --git a/post.php b/post.php index f4cac3cb..db5dee61 100644 --- a/post.php +++ b/post.php @@ -284,14 +284,14 @@ if(isset($_GET['delete_client'])){ } -if(isset($_POST['add_calendar_event'])){ +if(isset($_POST['add_event'])){ $calendar_id = intval($_POST['calendar']); $title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title'])); $start = strip_tags(mysqli_real_escape_string($mysqli,$_POST['start'])); $end = strip_tags(mysqli_real_escape_string($mysqli,$_POST['end'])); - mysqli_query($mysqli,"INSERT INTO calendar_events SET calendar_event_title = '$title', calendar_event_start = '$start', calendar_event_end = '$end', calendar_id = $calendar_id"); + mysqli_query($mysqli,"INSERT INTO events SET event_title = '$title', event_start = '$start', event_end = '$end', calendar_id = $calendar_id"); $_SESSION['alert_message'] = "Event added to the calendar"; @@ -299,15 +299,15 @@ if(isset($_POST['add_calendar_event'])){ } -if(isset($_POST['edit_calendar_event'])){ +if(isset($_POST['edit_event'])){ - $calendar_event_id = intval($_POST['calendar_event_id']); + $event_id = intval($_POST['event_id']); $calendar_id = intval($_POST['calendar']); $title = strip_tags(mysqli_real_escape_string($mysqli,$_POST['title'])); $start = strip_tags(mysqli_real_escape_string($mysqli,$_POST['start'])); $end = strip_tags(mysqli_real_escape_string($mysqli,$_POST['end'])); - mysqli_query($mysqli,"UPDATE calendar_events SET calendar_event_title = '$title', calendar_event_start = '$start', calendar_event_end = '$end', calendar_id = $calendar_id WHERE calendar_event_id = $calendar_event_id"); + mysqli_query($mysqli,"UPDATE events SET event_title = '$title', event_start = '$start', event_end = '$end', calendar_id = $calendar_id WHERE event_id = $event_id"); $_SESSION['alert_message'] = "Event modified on the calendar"; @@ -315,10 +315,10 @@ if(isset($_POST['edit_calendar_event'])){ } -if(isset($_GET['delete_calendar_event'])){ - $calendar_event_id = intval($_GET['delete_calendar_event']); +if(isset($_GET['delete_event'])){ + $event_id = intval($_GET['delete_calendar_event']); - mysqli_query($mysqli,"DELETE FROM calendar_events WHERE calendar_event_id = $calendar_event_id"); + mysqli_query($mysqli,"DELETE FROM events WHERE event_id = $event_id"); $_SESSION['alert_message'] = "Event deleted on the calendar";