mirror of https://github.com/itflow-org/itflow
Added more created_at and updated_at to post finalizing setup
This commit is contained in:
parent
05f54a20db
commit
cc9f97067a
12
README.md
12
README.md
|
|
@ -36,6 +36,12 @@ CRM, Accounting and Invoicing System for small managed IT companies
|
|||
* Past Due Invoices
|
||||
* Software License Expiring
|
||||
* Many more...
|
||||
* Calendar Integration
|
||||
* Schedule Jobs
|
||||
* Overview of Invoices Domains
|
||||
* Schedule Events
|
||||
* Dashboard
|
||||
* Gives a clear overview of your business
|
||||
|
||||
### Installation Instructions
|
||||
|
||||
|
|
@ -44,7 +50,6 @@ CRM, Accounting and Invoicing System for small managed IT companies
|
|||
* Point your browser and away you go
|
||||
|
||||
#### Requirements
|
||||
* Linux
|
||||
* Webserver (Apache, NGINX)
|
||||
* PHP7+
|
||||
* Mysql or MariaDB
|
||||
|
|
@ -55,9 +60,14 @@ CRM, Accounting and Invoicing System for small managed IT companies
|
|||
* fontawesome
|
||||
* datatables
|
||||
* chart.js
|
||||
* moments.js
|
||||
* Jquery
|
||||
* PHPmailer
|
||||
* mPDF
|
||||
* FullCalendar.io
|
||||
* bootstrap-select
|
||||
* Date Range Picker
|
||||
* Bootstrap Typeahead
|
||||
* EasyMDE forked from SimpleMDE
|
||||
* parsedown
|
||||
|
||||
|
|
|
|||
|
|
@ -49,12 +49,12 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAccountModal<?php echo $account_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_account=<?php echo $account_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_account_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_account_modal.php");
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label>Avatar</label>
|
||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="avatar">
|
||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
|
|
|
|||
70
api.php
70
api.php
|
|
@ -17,6 +17,12 @@ if($_GET['api_key'] == $config_api_key){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['incoming_call'])){
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'call', log_description = 'incoming', log_created_at = NOW()");
|
||||
|
||||
}
|
||||
|
||||
if(isset($_GET['client_numbers'])){
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients;");
|
||||
|
|
@ -30,6 +36,70 @@ if($_GET['api_key'] == $config_api_key){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['phonebookalpha'])){
|
||||
|
||||
header('Content-type: text/xml');
|
||||
header('Pragma: public');
|
||||
header('Cache-control: private');
|
||||
header('Expires: -1');
|
||||
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||
echo '<AddressBook>';
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients;");
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$client_name = $row['client_name'];
|
||||
$client_phone = $row['client_phone'];
|
||||
|
||||
?>
|
||||
<Contact>
|
||||
<LastName><?php echo $client_name; ?></LastName>
|
||||
<Phone>
|
||||
<phonenumber><?php echo $client_phone; ?></phonenumber>
|
||||
</Phone>
|
||||
</Contact>
|
||||
<?php
|
||||
}
|
||||
echo '</AddressBook>';
|
||||
|
||||
}
|
||||
|
||||
if(isset($_GET['phonebookbeta'])){
|
||||
|
||||
$myfile = fopen("phonebook.xml", "w");
|
||||
|
||||
$txt = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
$txt = "<AddressBook>\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients;");
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$client_name = $row['client_name'];
|
||||
$client_phone = $row['client_phone'];
|
||||
|
||||
$txt = "<Contact>\n
|
||||
<LastName>$client_name</LastName>\n
|
||||
<Phone>\n
|
||||
<phonenumber>$client_phone</phonenumber>\n
|
||||
</Phone>\n
|
||||
</Contact>\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
}
|
||||
|
||||
$txt = "</AddressBook>";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
|
||||
header("Location: phonebook.xml");
|
||||
|
||||
}
|
||||
|
||||
if(isset($_GET['client_emails'])){
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM clients;");
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editCategoryModal<?php echo $category_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_category=<?php echo $category_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_category_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_category_modal.php");
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -127,12 +127,12 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAssetModal<?php echo $asset_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_asset=<?php echo $asset_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_asset_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_asset_modal.php");
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -63,13 +63,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editContactModal<?php echo $contact_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_contact=<?php echo $contact_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_contact_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_contact_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -51,13 +51,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editDomainModal<?php echo $domain_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_domain=<?php echo $domain_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_domain_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_domain_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -82,14 +82,15 @@
|
|||
<a class="dropdown-item" href="post.php?pdf_invoice=<?php echo $invoice_id; ?>">PDF</a>
|
||||
<a class="dropdown-item" href="post.php?delete_invoice=<?php echo $invoice_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include("add_invoice_copy_modal.php");
|
||||
include("edit_invoice_modal.php");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("add_invoice_copy_modal.php");
|
||||
include("edit_invoice_modal.php");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,13 +52,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLocationModal<?php echo $location_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_location=<?php echo $location_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_location_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_location_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -45,13 +45,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editLoginModal<?php echo $login_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_login=<?php echo $login_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_login_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_login_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -43,13 +43,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editNetworkModal<?php echo $network_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_network=<?php echo $network_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_network_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_network_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -71,15 +71,18 @@
|
|||
<a class="dropdown-item" href="post.php?pdf_quote=<?php echo $quote_id; ?>">PDF</a>
|
||||
<a class="dropdown-item" href="post.php?delete_quote=<?php echo $quote_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("edit_quote_modal.php");
|
||||
include("add_quote_copy_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("edit_quote_modal.php");
|
||||
include("add_quote_copy_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -73,13 +73,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editSoftwareModal<?php echo $software_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_software=<?php echo $software_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_software_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_software_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -60,14 +60,18 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketModal<?php echo $ticket_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_invoice=<?php echo $invoice_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("edit_ticket_modal.php");
|
||||
include("view_ticket_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("edit_ticket_modal.php");
|
||||
include("view_ticket_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -98,13 +98,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_vendor_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_vendor_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -78,13 +78,15 @@
|
|||
<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>
|
||||
<?php include("edit_client_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_client_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
158
config.php
158
config.php
|
|
@ -8,161 +8,5 @@
|
|||
|
||||
$mysqli = mysqli_connect($dbhost, $dbusername, $dbpassword, $database);
|
||||
|
||||
//General Settings
|
||||
|
||||
$config_date_format = "Y-m-d";
|
||||
$config_time_format = "h:ia";
|
||||
$config_no_records = "There is nothing here!";
|
||||
$config_default_expense_account = "";
|
||||
$config_default_payment_account = "";
|
||||
$config_default_net_terms = 7;
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM settings WHERE company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$config_start_page = $row['config_start_page'];
|
||||
$config_company_name = $row['config_company_name'];
|
||||
$config_company_address = $row['config_company_address'];
|
||||
$config_company_city = $row['config_company_city'];
|
||||
$config_company_state = $row['config_company_state'];
|
||||
$config_company_zip = $row['config_company_zip'];
|
||||
$config_company_phone = $row['config_company_phone'];
|
||||
if(strlen($config_company_phone)>2){
|
||||
$config_company_phone = substr($row['config_company_phone'],0,3)."-".substr($row['config_company_phone'],3,3)."-".substr($row['config_company_phone'],6,4);
|
||||
}
|
||||
$config_company_site = $row['config_company_site'];
|
||||
$config_next_invoice_number = $row['config_next_invoice_number'];
|
||||
$config_invoice_logo = $row['config_invoice_logo'];
|
||||
$config_invoice_footer = $row['config_invoice_footer'];
|
||||
$config_quote_footer = $row['config_quote_footer'];
|
||||
$config_smtp_host = $row['config_smtp_host'];
|
||||
$config_smtp_username = $row['config_smtp_username'];
|
||||
$config_smtp_password = $row['config_smtp_password'];
|
||||
$config_smtp_port = $row['config_smtp_port'];
|
||||
$config_mail_from_email = $row['config_mail_from_email'];
|
||||
$config_mail_from_name = $row['config_mail_from_name'];
|
||||
$config_account_balance_threshold = $row['config_account_balance_threshold'];
|
||||
|
||||
$config_quote_email_subject = $row['config_quote_email_subject'];
|
||||
|
||||
$config_recurring_email_auto_send = $row['config_recurring_email_auto_send'];
|
||||
|
||||
$config_api_key = $row['config_api_key'];
|
||||
|
||||
$config_base_url = "192.168.10.205/pittpc";
|
||||
|
||||
$_SESSION['alert_message'] = '';
|
||||
$_SESSION['alert_type'] = "warning";
|
||||
|
||||
$client_types_array = array(
|
||||
'Residential',
|
||||
'Law',
|
||||
'Tax and Accounting',
|
||||
'General Contractor',
|
||||
'Medical',
|
||||
'Non Profit',
|
||||
'Industrial',
|
||||
'Automotive',
|
||||
'Retail',
|
||||
'Staffing Agency',
|
||||
'Other'
|
||||
);
|
||||
|
||||
$net_terms_array = array(
|
||||
'0'=>'On Reciept',
|
||||
'7'=>'7 Days',
|
||||
'14'=>'14 Days',
|
||||
'30'=>'30 Days'
|
||||
);
|
||||
|
||||
$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'
|
||||
);
|
||||
|
||||
$timezones_array = array(
|
||||
'US/Eastern',
|
||||
'US/Central',
|
||||
'US/Mountain',
|
||||
'US/Pacific'
|
||||
);
|
||||
|
||||
$category_types_array = array(
|
||||
'Expense',
|
||||
'Income',
|
||||
'Payment Method'
|
||||
);
|
||||
|
||||
$asset_types_array = array(
|
||||
'Laptop',
|
||||
'Desktop',
|
||||
'Server',
|
||||
'Mobile Phone',
|
||||
'Tablet',
|
||||
'Firewall/Router',
|
||||
'Switch',
|
||||
'Access Point',
|
||||
'Printer',
|
||||
'Camera',
|
||||
'TV',
|
||||
'Virtual Machine',
|
||||
'Other'
|
||||
);
|
||||
|
||||
$software_types_array = array(
|
||||
'Operating System',
|
||||
'Web App',
|
||||
'Desktop App',
|
||||
'Other'
|
||||
);
|
||||
|
||||
include("get_settings.php");
|
||||
?>
|
||||
18
cron.php
18
cron.php
|
|
@ -34,7 +34,7 @@ foreach ($domainAlertArray as $day) {
|
|||
$client_id = $row['client_id'];
|
||||
$client_name = $row['client_name'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire in $day Days on $domain_expire', alert_date = CURDATE()");
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Domain', alert_message = 'Domain $domain_name will expire in $day Days on $domain_expire', alert_date = NOW()");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ foreach ($invoiceAlertArray as $day) {
|
|||
$client_id = $row['client_id'];
|
||||
$client_name = $row['client_name'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Invoice', alert_message = 'Invoice INV-$invoice_number for $client_name in the amount of $invoice_amount is overdue by $day days', alert_date = CURDATE()");
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Invoice', alert_message = 'Invoice INV-$invoice_number for $client_name in the amount of $invoice_amount is overdue by $day days', alert_date = NOW()");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ while($row = mysqli_fetch_array($sql)){
|
|||
|
||||
if($balance < $config_account_balance_threshold){
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Account Low Balance', alert_message = 'Threshold of $config_account_balance_threshold triggered low balance of $balance on account $account_name', alert_date = CURDATE()");
|
||||
mysqli_query($mysqli,"INSERT INTO alerts SET alert_type = 'Account Low Balance', alert_message = 'Threshold of $config_account_balance_threshold triggered low balance of $balance on account $account_name', alert_date = NOW()");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ while($row = mysqli_fetch_array($sql_recurring)){
|
|||
//Generate a unique URL key for clients to access
|
||||
$url_key = keygen();
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoices SET invoice_number = $new_invoice_number, invoice_date = CURDATE(), invoice_due = DATE_ADD(CURDATE(), INTERVAL $client_net_terms day), invoice_amount = '$recurring_amount', invoice_note = '$recurring_note', category_id = $category_id, invoice_status = 'Sent', invoice_url_key = '$url_key', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoices SET invoice_number = $new_invoice_number, invoice_date = CURDATE(), invoice_due = DATE_ADD(CURDATE(), INTERVAL $client_net_terms day), invoice_amount = '$recurring_amount', invoice_note = '$recurring_note', category_id = $category_id, invoice_status = 'Sent', invoice_url_key = '$url_key', invoice_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$new_invoice_id = mysqli_insert_id($mysqli);
|
||||
|
||||
|
|
@ -137,13 +137,13 @@ while($row = mysqli_fetch_array($sql_recurring)){
|
|||
$item_tax = $row['item_tax'];
|
||||
$item_total = $row['item_total'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', invoice_id = $new_invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', item_created_at = NOW(), invoice_id = $new_invoice_id");
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Invoice Generated from Recurring!', invoice_id = $new_invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Invoice Generated from Recurring!', history_created_at = NOW(), invoice_id = $new_invoice_id");
|
||||
|
||||
//update the recurring invoice with the new dates
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_last_sent = CURDATE(), recurring_next_date = DATE_ADD(CURDATE(), INTERVAL 1 $recurring_frequency) WHERE recurring_id = $recurring_id");
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_last_sent = CURDATE(), recurring_next_date = DATE_ADD(CURDATE(), INTERVAL 1 $recurring_frequency), recurring_updated_at = NOW WHERE recurring_id = $recurring_id");
|
||||
|
||||
if($config_recurring_email_auto_send == 1){
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM invoices, clients
|
||||
|
|
@ -197,14 +197,14 @@ while($row = mysqli_fetch_array($sql_recurring)){
|
|||
|
||||
$mail->send();
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Auto Emailed Invoice!', invoice_id = $new_invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Auto Emailed Invoice!', history_created_at = NOW(), invoice_id = $new_invoice_id");
|
||||
|
||||
//Update Invoice Status to Sent
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Sent', client_id = $client_id WHERE invoice_id = $new_invoice_id");
|
||||
|
||||
}catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Failed to send Invoice!', invoice_id = $new_invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Failed to send Invoice!', history_created_at = NOW(), invoice_id = $new_invoice_id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
$dbhost = "tiny";
|
||||
$dbusername = "tryme";
|
||||
$dbpassword = "overme";
|
||||
$database="what";
|
||||
|
||||
$mysqli = mysqli_connect($dbhost, $dbusername, $dbpassword, $database);
|
||||
|
||||
include("get_settings.php");
|
||||
|
||||
?>
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tags"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="type" required>
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="type" required>
|
||||
<?php foreach($asset_types_array as $asset_type_select) { ?>
|
||||
<option <?php if($asset_type_select == $asset_type) { echo "selected"; } ?>><?php echo $asset_type_select; ?></option>
|
||||
<?php } ?>
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-map-marker-alt"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="location">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="location">
|
||||
<option value="">- Location -</option>
|
||||
<?php
|
||||
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="contact">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="contact">
|
||||
<option value="">- Contact -</option>
|
||||
<?php
|
||||
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="vendor">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="vendor">
|
||||
<option value="">- Vendor -</option>
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
</div>
|
||||
<select class="form-control selectpicker" name="calendar" required>
|
||||
<select class="form-control selectpicker show-tick" name="calendar" required>
|
||||
<?php
|
||||
|
||||
$sql_calendars_select = mysqli_query($mysqli,"SELECT * FROM calendars");
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label>Type</label>
|
||||
<select class="form-control selectpicker" name="type" required>
|
||||
<select class="form-control selectpicker show-tick" name="type" required>
|
||||
<?php foreach($category_types_array as $category_type_select) { ?>
|
||||
<option <?php if($category_type == $category_type_select) { echo "selected"; } ?>><?php echo $category_type_select; ?></option>
|
||||
<?php } ?>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="type">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="type">
|
||||
|
||||
<?php foreach($client_types_array as $client_type_select) { ?>
|
||||
<option
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
|
||||
</div>
|
||||
<select class="form-control" data-live-search="true" name="state">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="state">
|
||||
<option value="">- State -</option>
|
||||
<?php foreach($states_array as $state_abbr => $state_name) { ?>
|
||||
<option <?php if($client_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="net_terms">
|
||||
<select class="form-control selectpicker show-tick" name="net_terms">
|
||||
<option value="">- Net Terms -</option>
|
||||
<?php foreach($net_terms_array as $net_term_value => $net_term_name) { ?>
|
||||
<option <?php if($net_term_value == $client_net_term) { echo "selected"; } ?> value="<?php echo $net_term_value; ?>"><?php echo $net_term_name; ?></option>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="registrar">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="registrar">
|
||||
<option value="">- Vendor -</option>
|
||||
<?php
|
||||
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-server"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="webhost">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="webhost">
|
||||
<option value="">- Vendor -</option>
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="account" required>
|
||||
<select class="form-control selectpicker show-tick" name="account" required>
|
||||
<?php
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts");
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-building"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="vendor" required>
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="vendor" required>
|
||||
<?php
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM vendors WHERE client_id = 0 ORDER BY vendor_name ASC");
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="category" required>
|
||||
<select class="form-control selectpicker show-tick" name="category" required>
|
||||
<?php
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM categories WHERE category_type = 'Expense'");
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="category" required>
|
||||
<select class="form-control selectpicker show-tick" name="category" required>
|
||||
<option value="">- Category -</option>
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="state" required>
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="state" required>
|
||||
<?php foreach($states_array as $state_abbr => $state_name) { ?>
|
||||
<option <?php if($location_state == $state_abbr) { echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
|
||||
<?php } ?>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-list"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="category" required>
|
||||
<select class="form-control selectpicker show-tick" name="category" required>
|
||||
<option value="">- Category -</option>
|
||||
<?php
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-tag"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="type" required>
|
||||
<select class="form-control selectpicker show-tick" name="type" required>
|
||||
<?php foreach($software_types_array as $software_type_select) { ?>
|
||||
<option <?php if($software_type == $software_type_select) { echo "selected"; } ?>><?php echo $software_type_select; ?></option>
|
||||
<?php } ?>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="account_from" required>
|
||||
<select class="form-control selectpicker show-tick" name="account_from" required>
|
||||
<?php
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts");
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-arrow-right"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="account_to" required>
|
||||
<select class="form-control selectpicker show-tick" name="account_to" required>
|
||||
<?php
|
||||
|
||||
$sql2 = mysqli_query($mysqli,"SELECT * FROM accounts");
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-flag"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="state">
|
||||
<select class="form-control selectpicker show-tick" data-live-search="true" name="state">
|
||||
<option value="">- State -</option>
|
||||
<?php foreach($states_array as $state_abbr => $state_name) { ?>
|
||||
<option <?php if($vendor_state == $state_abbr){ echo "selected"; } ?> value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
|
||||
|
|
|
|||
14
expenses.php
14
expenses.php
|
|
@ -76,15 +76,19 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addExpenseRefundModal<?php echo $expense_id; ?>">Refund</a>
|
||||
<a class="dropdown-item" href="post.php?delete_expense=<?php echo $expense_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("edit_expense_modal.php");
|
||||
include("add_expense_copy_modal.php");
|
||||
include("add_expense_refund_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("edit_expense_modal.php");
|
||||
include("add_expense_copy_modal.php");
|
||||
include("add_expense_refund_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@
|
|||
<script src='vendor/fullcalendar/timegrid/main.min.js'></script>
|
||||
<script src='vendor/fullcalendar/list/main.min.js'></script>
|
||||
<script src='vendor/bootstrap-select/js/bootstrap-select.min.js'></script>
|
||||
<script src='vendor/bootstrap-showpassword/bootstrap-show-password.min.js'></script>
|
||||
<script src='vendor/daterangepicker/daterangepicker.js'></script>
|
||||
<script src='vendor/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js'></script>
|
||||
|
||||
<!-- Custom scripts for all pages-->
|
||||
<script src="js/sb-admin.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,153 @@
|
|||
<?php
|
||||
|
||||
//General Settings
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM settings WHERE company_id = 1");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
|
||||
$config_start_page = $row['config_start_page'];
|
||||
$config_company_name = $row['config_company_name'];
|
||||
$config_company_address = $row['config_company_address'];
|
||||
$config_company_city = $row['config_company_city'];
|
||||
$config_company_state = $row['config_company_state'];
|
||||
$config_company_zip = $row['config_company_zip'];
|
||||
$config_company_phone = $row['config_company_phone'];
|
||||
if(strlen($config_company_phone)>2){
|
||||
$config_company_phone = substr($row['config_company_phone'],0,3)."-".substr($row['config_company_phone'],3,3)."-".substr($row['config_company_phone'],6,4);
|
||||
}
|
||||
$config_company_site = $row['config_company_site'];
|
||||
$config_next_invoice_number = $row['config_next_invoice_number'];
|
||||
$config_invoice_logo = $row['config_invoice_logo'];
|
||||
$config_invoice_footer = $row['config_invoice_footer'];
|
||||
$config_quote_footer = $row['config_quote_footer'];
|
||||
$config_smtp_host = $row['config_smtp_host'];
|
||||
$config_smtp_username = $row['config_smtp_username'];
|
||||
$config_smtp_password = $row['config_smtp_password'];
|
||||
$config_smtp_port = $row['config_smtp_port'];
|
||||
$config_mail_from_email = $row['config_mail_from_email'];
|
||||
$config_mail_from_name = $row['config_mail_from_name'];
|
||||
$config_account_balance_threshold = $row['config_account_balance_threshold'];
|
||||
|
||||
$config_quote_email_subject = $row['config_quote_email_subject'];
|
||||
|
||||
$config_recurring_email_auto_send = $row['config_recurring_email_auto_send'];
|
||||
$config_default_net_terms = $row['default_net_terms'];
|
||||
|
||||
$config_api_key = $row['config_api_key'];
|
||||
|
||||
$config_base_url = $row['config_base_url'];
|
||||
|
||||
$_SESSION['alert_message'] = '';
|
||||
$_SESSION['alert_type'] = "warning";
|
||||
|
||||
$client_types_array = array(
|
||||
'Residential',
|
||||
'Law',
|
||||
'Tax and Accounting',
|
||||
'General Contractor',
|
||||
'Medical',
|
||||
'Non Profit',
|
||||
'Industrial',
|
||||
'Automotive',
|
||||
'Retail',
|
||||
'Staffing Agency',
|
||||
'Other'
|
||||
);
|
||||
|
||||
$net_terms_array = array(
|
||||
'0'=>'On Reciept',
|
||||
'7'=>'7 Days',
|
||||
'14'=>'14 Days',
|
||||
'30'=>'30 Days'
|
||||
);
|
||||
|
||||
$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'
|
||||
);
|
||||
|
||||
$timezones_array = array(
|
||||
'US/Eastern',
|
||||
'US/Central',
|
||||
'US/Mountain',
|
||||
'US/Pacific'
|
||||
);
|
||||
|
||||
$category_types_array = array(
|
||||
'Expense',
|
||||
'Income',
|
||||
'Payment Method'
|
||||
);
|
||||
|
||||
$asset_types_array = array(
|
||||
'Laptop',
|
||||
'Desktop',
|
||||
'Server',
|
||||
'Mobile Phone',
|
||||
'Tablet',
|
||||
'Firewall/Router',
|
||||
'Switch',
|
||||
'Access Point',
|
||||
'Printer',
|
||||
'Camera',
|
||||
'TV',
|
||||
'Virtual Machine',
|
||||
'Other'
|
||||
);
|
||||
|
||||
$software_types_array = array(
|
||||
'Operating System',
|
||||
'Web App',
|
||||
'Desktop App',
|
||||
'Other'
|
||||
);
|
||||
?>
|
||||
|
|
@ -41,6 +41,8 @@
|
|||
<link href='vendor/fullcalendar/timegrid/main.min.css' rel='stylesheet' />
|
||||
<link href='vendor/fullcalendar/list/main.min.css' rel='stylesheet' />
|
||||
<link href='vendor/fullcalendar/bootstrap/main.min.css' rel='stylesheet' />
|
||||
<link href='vendor/daterangepicker/daterangepicker.css' rel='stylesheet' />
|
||||
<link href='vendor/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css' rel='stylesheet' />
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
|||
48
invoice.php
48
invoice.php
|
|
@ -86,7 +86,7 @@ if(isset($_GET['invoice_id'])){
|
|||
|
||||
|
||||
|
||||
<form action="post.php" method="post">
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||
<div class="row mb-4 d-print-none">
|
||||
<div class="col-md-4">
|
||||
|
|
@ -222,8 +222,8 @@ if(isset($_GET['invoice_id'])){
|
|||
<td></td>
|
||||
<td><input type="text" class="form-control typeahead" name="name" id="item"></td>
|
||||
<td><textarea class="form-control" rows="1" name="description"></textarea></td>
|
||||
<td><input type="text" class="form-control" style="text-align: right;" name="price"></td>
|
||||
<td><input type="text" class="form-control" style="text-align: center;" name="qty"></td>
|
||||
<td><input type="text" class="form-control" style="text-align: right;" id="price" name="price"></td>
|
||||
<td>
|
||||
<select dir="rtl" class="form-control" name="tax">
|
||||
<option value="0.00">None</option>
|
||||
|
|
@ -389,9 +389,49 @@ var products = [
|
|||
|
||||
];
|
||||
|
||||
$('#item').typeahead({
|
||||
source: products
|
||||
var productCosts2 = [
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli,"SELECT product_id, product_name, product_cost FROM products");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$product_id = $row['product_id'];
|
||||
$product_name = $row['product_name'];
|
||||
$product_cost = $row['product_cost'];
|
||||
echo "\"$product_cost\",";
|
||||
}
|
||||
?>
|
||||
|
||||
];
|
||||
|
||||
|
||||
var productCosts = [
|
||||
<?php
|
||||
$sql = mysqli_query($mysqli,"SELECT product_id, product_name, product_cost FROM products");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$product_id = $row['product_id'];
|
||||
$product_name = $row['product_name'];
|
||||
$product_cost = $row['product_cost'];
|
||||
echo "{ id: '$product_id', name: '$product_name', cost: '$product_cost' },";
|
||||
}
|
||||
?>
|
||||
|
||||
];
|
||||
|
||||
$('#item1').typeahead({
|
||||
source: products,
|
||||
afterSelect: function(){
|
||||
$('#price').val( '<?php echo $product_cost; ?>' );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#item').typeahead({
|
||||
minLength: 3,
|
||||
source: function (query, process) {
|
||||
data: productCosts
|
||||
|
||||
afterSelect: function(args){
|
||||
$('#price').val(args.cost );
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
12
invoices.php
12
invoices.php
|
|
@ -182,14 +182,18 @@
|
|||
<a class="dropdown-item" href="post.php?pdf_invoice=<?php echo $invoice_id; ?>"><i class="fa fa-fw fa-file-pdf"></i> PDF</a>
|
||||
<a class="dropdown-item" href="post.php?delete_invoice=<?php echo $invoice_id; ?>"><i class="fa fa-fw fa-trash"></i> Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("add_invoice_copy_modal.php");
|
||||
include("edit_invoice_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("add_invoice_copy_modal.php");
|
||||
include("edit_invoice_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><AddressBook>
|
||||
<Contact>
|
||||
|
||||
<LastName>PittPC</LastName>
|
||||
|
||||
<Phone>
|
||||
|
||||
<phonenumber>4125009434</phonenumber>
|
||||
|
||||
</Phone>
|
||||
|
||||
</Contact>
|
||||
<Contact>
|
||||
|
||||
<LastName>Matts Accounting Firm</LastName>
|
||||
|
||||
<Phone>
|
||||
|
||||
<phonenumber>4127716047</phonenumber>
|
||||
|
||||
</Phone>
|
||||
|
||||
</Contact>
|
||||
<Contact>
|
||||
|
||||
<LastName>poop</LastName>
|
||||
|
||||
<Phone>
|
||||
|
||||
<phonenumber>4443332222</phonenumber>
|
||||
|
||||
</Phone>
|
||||
|
||||
</Contact>
|
||||
</AddressBook>
|
||||
156
post.php
156
post.php
|
|
@ -172,19 +172,14 @@ if(isset($_POST['add_user'])){
|
|||
$password = md5(mysqli_real_escape_string($mysqli,$_POST['password']));
|
||||
$client_id = intval($_POST['client']);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$user_id = mysqli_insert_id($mysqli);
|
||||
|
||||
$check = getimagesize($_FILES["avatar"]["tmp_name"]);
|
||||
if($check !== false) {
|
||||
$avatar_path = "uploads/users/";
|
||||
//$avatar_path = $avatar_path . $user_id . '_' . time() . '_' . basename( $_FILES['avatar']['name']);
|
||||
$avatar_path = $avatar_path . basename( $_FILES['file']['name']);
|
||||
move_uploaded_file($_FILES['avatar']['tmp_name'], $avatar_path);
|
||||
if($_FILES['file']['tmp_name']!='') {
|
||||
$path = "uploads/users/";
|
||||
$path = $path . time() . basename( $_FILES['file']['name']);
|
||||
$file_name = basename($path);
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"UPDATE users SET avatar = '$avatar_path' WHERE user_id = $user_id");
|
||||
mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', avatar = '$path', created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "User added";
|
||||
|
||||
|
|
@ -267,7 +262,7 @@ if(isset($_POST['edit_client'])){
|
|||
|
||||
mysqli_query($mysqli,"UPDATE clients SET client_name = '$name', client_type = '$type', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_phone = '$phone', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_updated_at = NOW() WHERE client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Client updated type: $type - name: $name";
|
||||
$_SESSION['alert_message'] = "Client $name updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
|
|
@ -297,7 +292,6 @@ if(isset($_POST['add_calendar'])){
|
|||
|
||||
}
|
||||
|
||||
|
||||
if(isset($_POST['add_event'])){
|
||||
|
||||
$calendar_id = intval($_POST['calendar']);
|
||||
|
|
@ -305,7 +299,7 @@ if(isset($_POST['add_event'])){
|
|||
$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 events SET event_title = '$title', event_start = '$start', event_end = '$end', calendar_id = $calendar_id");
|
||||
mysqli_query($mysqli,"INSERT INTO events SET event_title = '$title', event_start = '$start', event_end = '$end', event_created_at = NOW(), calendar_id = $calendar_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Event added to the calendar";
|
||||
|
||||
|
|
@ -321,7 +315,7 @@ if(isset($_POST['edit_event'])){
|
|||
$start = strip_tags(mysqli_real_escape_string($mysqli,$_POST['start']));
|
||||
$end = strip_tags(mysqli_real_escape_string($mysqli,$_POST['end']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE events SET event_title = '$title', event_start = '$start', event_end = '$end', calendar_id = $calendar_id WHERE event_id = $event_id");
|
||||
mysqli_query($mysqli,"UPDATE events SET event_title = '$title', event_start = '$start', event_end = '$end', event_updated_at = NOW(), calendar_id = $calendar_id WHERE event_id = $event_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Event modified on the calendar";
|
||||
|
||||
|
|
@ -788,10 +782,10 @@ if(isset($_POST['add_invoice'])){
|
|||
//Generate a unique URL key for clients to access
|
||||
$url_key = keygen();
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoices SET invoice_number = $invoice_number, invoice_date = '$date', invoice_due = DATE_ADD(CURDATE(), INTERVAL $client_net_terms day), category_id = $category, invoice_status = 'Draft', invoice_url_key = '$url_key', client_id = $client");
|
||||
mysqli_query($mysqli,"INSERT INTO invoices SET invoice_number = $invoice_number, invoice_date = '$date', invoice_due = DATE_ADD(CURDATE(), INTERVAL $client_net_terms day), category_id = $category, invoice_status = 'Draft', invoice_url_key = '$url_key', invoice_created_at = NOW(), client_id = $client");
|
||||
$invoice_id = mysqli_insert_id($mysqli);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'INVOICE added!', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'INVOICE added!', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
$_SESSION['alert_message'] = "Invoice added";
|
||||
|
||||
header("Location: invoice.php?invoice_id=$invoice_id");
|
||||
|
|
@ -804,7 +798,7 @@ if(isset($_POST['edit_invoice'])){
|
|||
$due = strip_tags(mysqli_real_escape_string($mysqli,$_POST['due']));
|
||||
$category = intval($_POST['category']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_date = '$date', invoice_due = '$due', category_id = $category WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_date = '$date', invoice_due = '$due', invoice_updated_at = NOW(), category_id = $category WHERE invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Invoice modified";
|
||||
|
||||
|
|
@ -830,7 +824,7 @@ if(isset($_POST['add_invoice_copy'])){
|
|||
$client_id = $row['client_id'];
|
||||
$category_id = $row['category_id'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoices SET invoice_number = $invoice_number, invoice_date = '$date', invoice_due = DATE_ADD(CURDATE(), INTERVAL $client_net_terms day), category_id = $category_id, invoice_status = 'Draft', invoice_amount = '$invoice_amount', invoice_note = '$invoice_note', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoices SET invoice_number = $invoice_number, invoice_date = '$date', invoice_due = DATE_ADD(CURDATE(), INTERVAL $client_net_terms day), category_id = $category_id, invoice_status = 'Draft', invoice_amount = '$invoice_amount', invoice_note = '$invoice_note', invoice_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$new_invoice_id = mysqli_insert_id($mysqli);
|
||||
|
||||
|
|
@ -847,7 +841,7 @@ if(isset($_POST['add_invoice_copy'])){
|
|||
$item_tax = $row['item_tax'];
|
||||
$item_total = $row['item_total'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', invoice_id = $new_invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', item_created_at = NOW(), invoice_id = $new_invoice_id");
|
||||
}
|
||||
|
||||
$_SESSION['alert_message'] = "Invoice copied";
|
||||
|
|
@ -884,7 +878,7 @@ if(isset($_POST['add_invoice_recurring'])){
|
|||
$item_tax = $row['item_tax'];
|
||||
$item_total = $row['item_total'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', recurring_id = $recurring_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', item_created_at = NOW(), recurring_id = $recurring_id");
|
||||
}
|
||||
|
||||
$_SESSION['alert_message'] = "Created recurring Invoice from this Invoice";
|
||||
|
|
@ -912,7 +906,7 @@ if(isset($_POST['add_quote'])){
|
|||
|
||||
$quote_id = mysqli_insert_id($mysqli);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Quote created!', quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Quote created!', history_created_at = NOW(), quote_id = $quote_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Quote added";
|
||||
|
||||
|
|
@ -935,7 +929,7 @@ if(isset($_POST['save_quote'])){
|
|||
$tax = $subtotal * $tax;
|
||||
$total = $subtotal + $tax;
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', item_created_at = NOW(), quote_id = $quote_id");
|
||||
|
||||
//Update Invoice Balances
|
||||
|
||||
|
|
@ -944,7 +938,7 @@ if(isset($_POST['save_quote'])){
|
|||
|
||||
$new_quote_amount = $row['quote_amount'] + $total;
|
||||
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = '$new_quote_amount' WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = '$new_quote_amount', quote_updated_at = NOW() WHERE quote_id = $quote_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Item added";
|
||||
|
||||
|
|
@ -954,7 +948,7 @@ if(isset($_POST['save_quote'])){
|
|||
if(isset($_POST['quote_note'])){
|
||||
$quote_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['quote_note']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_note = '$quote_note' WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_note = '$quote_note', quote_updated_at = NOW() WHERE quote_id = $quote_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Notes added";
|
||||
}
|
||||
|
|
@ -1023,7 +1017,7 @@ if(isset($_POST['add_quote_copy'])){
|
|||
|
||||
$new_quote_id = mysqli_insert_id($mysqli);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Quote copied!', quote_id = $new_quote_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Quote copied!', history_created_at = NOW(), quote_id = $new_quote_id");
|
||||
|
||||
$sql_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id");
|
||||
while($row = mysqli_fetch_array($sql_items)){
|
||||
|
|
@ -1036,7 +1030,7 @@ if(isset($_POST['add_quote_copy'])){
|
|||
$item_tax = $row['item_tax'];
|
||||
$item_total = $row['item_total'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', quote_id = $new_quote_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', item_created_at = NOW(), quote_id = $new_quote_id");
|
||||
}
|
||||
|
||||
$_SESSION['alert_message'] = "Quote copied";
|
||||
|
|
@ -1067,7 +1061,7 @@ if(isset($_POST['add_quote_to_invoice'])){
|
|||
|
||||
$new_invoice_id = mysqli_insert_id($mysqli);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Quote copied to Invoice!', invoice_id = $new_invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Draft', history_description = 'Quote copied to Invoice!', history_created_at = NOW(), invoice_id = $new_invoice_id");
|
||||
|
||||
$sql_items = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id");
|
||||
while($row = mysqli_fetch_array($sql_items)){
|
||||
|
|
@ -1080,7 +1074,7 @@ if(isset($_POST['add_quote_to_invoice'])){
|
|||
$item_tax = $row['item_tax'];
|
||||
$item_total = $row['item_total'];
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', invoice_id = $new_invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$item_name', item_description = '$item_description', item_quantity = $item_quantity, item_price = '$item_price', item_subtotal = '$item_subtotal', item_tax = '$item_tax', item_total = '$item_total', item_created_at = NOW(), invoice_id = $new_invoice_id");
|
||||
}
|
||||
|
||||
$_SESSION['alert_message'] = "Quoted copied to Invoice";
|
||||
|
|
@ -1104,7 +1098,7 @@ if(isset($_GET['delete_quote_item'])){
|
|||
|
||||
$new_quote_amount = $row['quote_amount'] - $item_total;
|
||||
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = '$new_quote_amount' WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_amount = '$new_quote_amount', quote_updated_at = NOW() WHERE quote_id = $quote_id");
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM invoice_items WHERE item_id = $item_id");
|
||||
|
||||
|
|
@ -1118,9 +1112,9 @@ if(isset($_GET['approve_quote'])){
|
|||
|
||||
$quote_id = intval($_GET['approve_quote']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Approved' WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Approved', quote_updated_at = NOW() WHERE quote_id = $quote_id");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Approved', history_description = 'Quote approved!', quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Approved', history_description = 'Quote approved!', history_created_at = NOW(), quote_id = $quote_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Quote approved";
|
||||
|
||||
|
|
@ -1132,9 +1126,9 @@ if(isset($_GET['reject_quote'])){
|
|||
|
||||
$quote_id = intval($_GET['reject_quote']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Rejected' WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Rejected', quote_updated_at = NOW() WHERE quote_id = $quote_id");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Cancelled', history_description = 'Quote rejected!', quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Cancelled', history_description = 'Quote rejected!', history_created_at = NOW(), quote_id = $quote_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Quote rejected";
|
||||
|
||||
|
|
@ -1379,12 +1373,12 @@ if(isset($_GET['email_quote'])){
|
|||
$mail->send();
|
||||
echo 'Message has been sent';
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Quote!', quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Quote!', history_created_at = NOW(), quote_id = $quote_id");
|
||||
|
||||
//Don't change the status to sent if the status is anything but draft
|
||||
if($quote_status == 'Draft'){
|
||||
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Sent', client_id = $client_id WHERE quote_id = $quote_id");
|
||||
mysqli_query($mysqli,"UPDATE quotes SET quote_status = 'Sent', quote_updated_at = NOW() WHERE quote_id = $quote_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1405,11 +1399,11 @@ if(isset($_POST['add_recurring'])){
|
|||
$start_date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['start_date']));
|
||||
$category = intval($_POST['category']);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO recurring SET recurring_frequency = '$frequency', recurring_next_date = '$start_date', category_id = $category, recurring_status = 1, client_id = $client");
|
||||
mysqli_query($mysqli,"INSERT INTO recurring SET recurring_frequency = '$frequency', recurring_next_date = '$start_date', category_id = $category, recurring_status = 1, recurring_created_at = NOW(), client_id = $client");
|
||||
|
||||
$recurring_id = mysqli_insert_id($mysqli);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_description = 'Reccuring Invoice created!', recurring_id = $recurring_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_description = 'Recurring Invoice created!', history_created_at = NOW(), recurring_id = $recurring_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Recurring Invoice added";
|
||||
|
||||
|
|
@ -1481,7 +1475,7 @@ if(isset($_POST['save_recurring'])){
|
|||
$tax = $subtotal * $tax;
|
||||
$total = $subtotal + $tax;
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', recurring_id = $recurring_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', item_created_at = NOW(), recurring_id = $recurring_id");
|
||||
|
||||
//Update Invoice Balances
|
||||
|
||||
|
|
@ -1490,7 +1484,7 @@ if(isset($_POST['save_recurring'])){
|
|||
|
||||
$new_recurring_amount = $row['recurring_amount'] + $total;
|
||||
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_amount = '$new_recurring_amount' WHERE recurring_id = $recurring_id");
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_amount = '$new_recurring_amount', recurring_updated_at = NOW()WHERE recurring_id = $recurring_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1498,7 +1492,7 @@ if(isset($_POST['save_recurring'])){
|
|||
|
||||
$recurring_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['recurring_note']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_note = '$recurring_note' WHERE recurring_id = $recurring_id");
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_note = '$recurring_note', recurring_updated_at = NOW() WHERE recurring_id = $recurring_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1523,7 +1517,7 @@ if(isset($_GET['delete_recurring_item'])){
|
|||
|
||||
$new_recurring_amount = $row['recurring_amount'] - $item_total;
|
||||
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_amount = '$new_recurring_amount' WHERE recurring_id = $recurring_id");
|
||||
mysqli_query($mysqli,"UPDATE recurring SET recurring_amount = '$new_recurring_amount', recurring_updated_at = NOW() WHERE recurring_id = $recurring_id");
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM invoice_items WHERE item_id = $item_id");
|
||||
|
||||
|
|
@ -1538,9 +1532,9 @@ if(isset($_GET['mark_invoice_sent'])){
|
|||
|
||||
$invoice_id = intval($_GET['mark_invoice_sent']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Sent' WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Sent', invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'INVOICE marked sent', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'INVOICE marked sent', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Invoice marked sent";
|
||||
|
||||
|
|
@ -1552,9 +1546,9 @@ if(isset($_GET['cancel_invoice'])){
|
|||
|
||||
$invoice_id = intval($_GET['cancel_invoice']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Cancelled' WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Cancelled', invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Cancelled', history_description = 'INVOICE cancelled!', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Cancelled', history_description = 'INVOICE cancelled!', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Invoice cancelled";
|
||||
|
||||
|
|
@ -1609,7 +1603,7 @@ if(isset($_POST['save_invoice'])){
|
|||
$tax = $subtotal * $tax;
|
||||
$total = $subtotal + $tax;
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', item_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
//Update Invoice Balances
|
||||
|
||||
|
|
@ -1618,7 +1612,7 @@ if(isset($_POST['save_invoice'])){
|
|||
|
||||
$new_invoice_amount = $row['invoice_amount'] + $total;
|
||||
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = '$new_invoice_amount' WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = '$new_invoice_amount', invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Item added";
|
||||
|
||||
|
|
@ -1629,7 +1623,7 @@ if(isset($_POST['save_invoice'])){
|
|||
|
||||
$invoice_note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['invoice_note']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_note = '$invoice_note' WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_note = '$invoice_note', invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Notes added";
|
||||
|
||||
|
|
@ -1654,7 +1648,7 @@ if(isset($_GET['delete_invoice_item'])){
|
|||
|
||||
$new_invoice_amount = $row['invoice_amount'] - $item_total;
|
||||
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = '$new_invoice_amount' WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_amount = '$new_invoice_amount', invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM invoice_items WHERE item_id = $item_id");
|
||||
|
||||
|
|
@ -1680,7 +1674,7 @@ if(isset($_POST['add_payment'])){
|
|||
$_SESSION['alert_message'] = "Payment is more than the balance";
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
}else{
|
||||
mysqli_query($mysqli,"INSERT INTO payments SET payment_date = '$date', payment_amount = '$amount', account_id = $account, payment_method = '$payment_method', payment_reference = '$reference', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO payments SET payment_date = '$date', payment_amount = '$amount', account_id = $account, payment_method = '$payment_method', payment_reference = '$reference', payment_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
//Add up all the payments for the invoice and get the total amount paid to the invoice
|
||||
$sql_total_payments_amount = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS payments_amount FROM payments WHERE invoice_id = $invoice_id");
|
||||
|
|
@ -1733,7 +1727,7 @@ if(isset($_POST['add_payment'])){
|
|||
$mail->send();
|
||||
echo 'Message has been sent';
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Receipt!', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Receipt!', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
|
|
@ -1769,7 +1763,7 @@ if(isset($_POST['add_payment'])){
|
|||
$mail->send();
|
||||
echo 'Message has been sent';
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Receipt!', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Receipt!', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
|
||||
|
|
@ -1779,10 +1773,10 @@ if(isset($_POST['add_payment'])){
|
|||
}
|
||||
|
||||
//Update Invoice Status
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = '$invoice_status' WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = '$invoice_status' invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
//Add Payment to History
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'INVOICE payment added', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'INVOICE payment added', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Payment added";
|
||||
|
||||
|
|
@ -1819,10 +1813,10 @@ if(isset($_GET['delete_payment'])){
|
|||
}
|
||||
|
||||
//Update Invoice Status
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = '$invoice_status' WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = '$invoice_status', invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
//Add Payment to History
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'INVOICE payment deleted', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$invoice_status', history_description = 'INVOICE payment deleted', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM payments WHERE payment_id = $payment_id");
|
||||
|
||||
|
|
@ -1908,12 +1902,12 @@ if(isset($_GET['email_invoice'])){
|
|||
$mail->send();
|
||||
echo 'Message has been sent';
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Invoice!', invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = 'Sent', history_description = 'Emailed Invoice!', history_created_at = NOW(), invoice_id = $invoice_id");
|
||||
|
||||
//Don't chnage the status to sent if the status is anything but draf
|
||||
if($invoice_status == 'Draft'){
|
||||
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Sent', client_id = $client_id WHERE invoice_id = $invoice_id");
|
||||
mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Sent', invoice_updated_at = NOW() WHERE invoice_id = $invoice_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2138,7 +2132,7 @@ if(isset($_POST['add_contact'])){
|
|||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_email = '$email', contact_photo = '$path', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_email = '$email', contact_photo = '$path', contact_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Contact added";
|
||||
|
||||
|
|
@ -2155,7 +2149,7 @@ if(isset($_POST['edit_contact'])){
|
|||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_email = '$email' WHERE contact_id = $contact_id");
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_name = '$name', contact_title = '$title', contact_phone = '$phone', contact_email = '$email', contact_updated_at = NOW() WHERE contact_id = $contact_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Contact updated";
|
||||
|
||||
|
|
@ -2186,7 +2180,7 @@ if(isset($_POST['add_location'])){
|
|||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Location added";
|
||||
|
||||
|
|
@ -2206,7 +2200,7 @@ if(isset($_POST['edit_location'])){
|
|||
$phone = preg_replace("/[^0-9]/", '',$phone);
|
||||
$hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours' WHERE location_id = $location_id");
|
||||
mysqli_query($mysqli,"UPDATE locations SET location_name = '$name', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_hours = '$hours', location_updated_at = NOW() WHERE location_id = $location_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Location updated";
|
||||
|
||||
|
|
@ -2240,14 +2234,14 @@ if(isset($_POST['add_asset'])){
|
|||
$warranty_expire = strip_tags(mysqli_real_escape_string($mysqli,$_POST['warranty_expire']));
|
||||
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_note = '$note', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_note = '$note', asset_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
if(!empty($_POST['username'])) {
|
||||
$asset_id = mysqli_insert_id($mysqli);
|
||||
$username = strip_tags(mysqli_real_escape_string($mysqli,$_POST['username']));
|
||||
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
|
||||
$description = "$type - $name";
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_description = '$description', login_username = '$username', login_password = '$password', asset_id = $asset_id, client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_description = '$description', login_username = '$username', login_password = '$password', login_created_at = NOW(), asset_id = $asset_id, client_id = $client_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2277,16 +2271,16 @@ if(isset($_POST['edit_asset'])){
|
|||
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
|
||||
$description = "$type - $name";
|
||||
|
||||
mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_note = '$note' WHERE asset_id = $asset_id");
|
||||
mysqli_query($mysqli,"UPDATE assets SET asset_name = '$name', asset_type = '$type', asset_make = '$make', asset_model = '$model', asset_serial = '$serial', location_id = $location, vendor_id = $vendor, contact_id = $contact, asset_purchase_date = '$purchase_date', asset_warranty_expire = '$warranty_expire', asset_note = '$note', asset_updated_at = NOW() WHERE asset_id = $asset_id");
|
||||
|
||||
//If login exists then update the login
|
||||
if($login_id > 0){
|
||||
mysqli_query($mysqli,"UPDATE logins SET login_description = '$description', login_username = '$username', login_password = '$password' WHERE login_id = $login_id");
|
||||
mysqli_query($mysqli,"UPDATE logins SET login_description = '$description', login_username = '$username', login_password = '$password', login_updated_at = NOW() WHERE login_id = $login_id");
|
||||
}else{
|
||||
//If Username is filled in then add a login
|
||||
if(!empty($_POST['username'])) {
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_description = '$description', login_username = '$username', login_password = '$password', asset_id = $asset_id, client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_description = '$description', login_username = '$username', login_password = '$password', login_created_at = NOW(), asset_id = $asset_id, client_id = $client_id");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -2320,7 +2314,7 @@ if(isset($_POST['add_login'])){
|
|||
$asset_id = intval($_POST['asset']);
|
||||
$application_id = intval($_POST['application']);
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_description = '$description', login_web_link = '$web_link', login_username = '$username', login_password = '$password', login_note = '$note', vendor_id = $vendor_id, asset_id = $asset_id, application_id = $application_id, client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_description = '$description', login_web_link = '$web_link', login_username = '$username', login_password = '$password', login_note = '$note', login_created_at = NOW(), vendor_id = $vendor_id, asset_id = $asset_id, application_id = $application_id, client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Login added";
|
||||
|
||||
|
|
@ -2337,7 +2331,7 @@ if(isset($_POST['edit_login'])){
|
|||
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
|
||||
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE logins SET login_description = '$description', login_web_link = '$web_link', login_username = '$username', login_password = '$password', login_note = '$note' WHERE login_id = $login_id");
|
||||
mysqli_query($mysqli,"UPDATE logins SET login_description = '$description', login_web_link = '$web_link', login_username = '$username', login_password = '$password', login_note = '$note', login_updated_at = NOW() WHERE login_id = $login_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Login updated";
|
||||
|
||||
|
|
@ -2370,7 +2364,7 @@ if(isset($_POST['add_file'])){
|
|||
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO files SET file_name = '$path', file_ext = '$ext', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO files SET file_name = '$path', file_ext = '$ext', file_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "File uploaded";
|
||||
|
||||
|
|
@ -2401,7 +2395,7 @@ if(isset($_POST['add_note'])){
|
|||
$subject = strip_tags(mysqli_real_escape_string($mysqli,$_POST['subject']));
|
||||
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO notes SET note_subject = '$subject', note_body = '$note', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO notes SET note_subject = '$subject', note_body = '$note', note_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Note added";
|
||||
|
||||
|
|
@ -2415,7 +2409,7 @@ if(isset($_POST['edit_note'])){
|
|||
$subject = strip_tags(mysqli_real_escape_string($mysqli,$_POST['subject']));
|
||||
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE notes SET note_subject = '$subject', note_body = '$note' WHERE note_id = $note_id");
|
||||
mysqli_query($mysqli,"UPDATE notes SET note_subject = '$subject', note_body = '$note', note_updated_at = NOW() WHERE note_id = $note_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Note updated";
|
||||
|
||||
|
|
@ -2442,7 +2436,7 @@ if(isset($_POST['add_network'])){
|
|||
$gateway = strip_tags(mysqli_real_escape_string($mysqli,$_POST['gateway']));
|
||||
$dhcp_range = strip_tags(mysqli_real_escape_string($mysqli,$_POST['dhcp_range']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range', network_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Network added";
|
||||
|
||||
|
|
@ -2458,7 +2452,7 @@ if(isset($_POST['edit_network'])){
|
|||
$gateway = strip_tags(mysqli_real_escape_string($mysqli,$_POST['gateway']));
|
||||
$dhcp_range = strip_tags(mysqli_real_escape_string($mysqli,$_POST['dhcp_range']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range' WHERE network_id = $network_id");
|
||||
mysqli_query($mysqli,"UPDATE networks SET network_name = '$name', network = '$network', network_gateway = '$gateway', network_dhcp_range = '$dhcp_range', network_updated_at = NOW() WHERE network_id = $network_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Network updated";
|
||||
|
||||
|
|
@ -2485,7 +2479,7 @@ if(isset($_POST['add_domain'])){
|
|||
$webhost = intval($_POST['webhost']);
|
||||
$expire = strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire', domain_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Domain added";
|
||||
|
||||
|
|
@ -2501,7 +2495,7 @@ if(isset($_POST['edit_domain'])){
|
|||
$webhost = intval($_POST['webhost']);
|
||||
$expire = strip_tags(mysqli_real_escape_string($mysqli,$_POST['expire']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire' WHERE domain_id = $domain_id");
|
||||
mysqli_query($mysqli,"UPDATE domains SET domain_name = '$name', domain_registrar = $registrar, domain_webhost = $webhost, domain_expire = '$expire', domain_updated_at = NOW() WHERE domain_id = $domain_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Domain updated";
|
||||
|
||||
|
|
@ -2527,14 +2521,14 @@ if(isset($_POST['add_software'])){
|
|||
$type = strip_tags(mysqli_real_escape_string($mysqli,$_POST['type']));
|
||||
$license = strip_tags(mysqli_real_escape_string($mysqli,$_POST['license']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO software SET software_name = '$name', software_type = '$type', software_license = '$license', client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO software SET software_name = '$name', software_type = '$type', software_license = '$license', software_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
if(!empty($_POST['username'])) {
|
||||
$software_id = mysqli_insert_id($mysqli);
|
||||
$username = strip_tags(mysqli_real_escape_string($mysqli,$_POST['username']));
|
||||
$password = strip_tags(mysqli_real_escape_string($mysqli,$_POST['password']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_username = '$username', login_password = '$password', software_id = $software_id, client_id = $client_id");
|
||||
mysqli_query($mysqli,"INSERT INTO logins SET login_username = '$username', login_password = '$password', software_id = $software_id, login_created_at = NOW(), client_id = $client_id");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -2551,7 +2545,7 @@ if(isset($_POST['edit_software'])){
|
|||
$type = strip_tags(mysqli_real_escape_string($mysqli,$_POST['type']));
|
||||
$license = strip_tags(mysqli_real_escape_string($mysqli,$_POST['license']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE software SET software_name = '$name', software_type = '$type', software_license = '$license' WHERE software_id = $software_id");
|
||||
mysqli_query($mysqli,"UPDATE software SET software_name = '$name', software_type = '$type', software_license = '$license', software_updated_at = NOW() WHERE software_id = $software_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Software updated";
|
||||
|
||||
|
|
@ -2570,4 +2564,4 @@ if(isset($_GET['delete_software'])){
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
@ -42,13 +42,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editProductModal<?php echo $product_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_product=<?php echo $product_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_product_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_product_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
10
quotes.php
10
quotes.php
|
|
@ -83,14 +83,18 @@
|
|||
<a class="dropdown-item" href="post.php?pdf_quote=<?php echo $quote_id; ?>">PDF</a>
|
||||
<a class="dropdown-item" href="post.php?delete_quote=<?php echo $quote_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("edit_quote_modal.php");
|
||||
include("add_quote_copy_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("edit_quote_modal.php");
|
||||
include("add_quote_copy_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-plane-arrival"></i></span>
|
||||
</div>
|
||||
<select class="form-control" name="config_start_page" required>
|
||||
<select class="form-control selectpicker show-tick" name="config_start_page" required>
|
||||
<option value="dashboard.php">Dashboard</option>
|
||||
<option value="clients.php">Clients</option>
|
||||
<option value="invoices.php">Invoices</option>
|
||||
|
|
|
|||
622
setup.php
622
setup.php
|
|
@ -1,8 +1,110 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
//include("config.php");
|
||||
//include("check_login.php");
|
||||
//include("functions.php");
|
||||
if(isset($_POST['add_database'])){
|
||||
|
||||
$host = $_POST['host'];
|
||||
$database = $_POST['database'];
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
$myfile = fopen("dbconnect.php", "w");
|
||||
|
||||
$txt = "<?php\n\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
$txt = "\$dbhost = \"$host\";\n\$dbusername = \"$username\";\n\$dbpassword = \"$password\";\n\$database=\"$database\";\n\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
$txt = "\$mysqli = mysqli_connect(\$dbhost, \$dbusername, \$dbpassword, \$database);\n\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
$txt = "include(\"get_settings.php\");\n\n";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
$txt = "?>";
|
||||
|
||||
fwrite($myfile, $txt);
|
||||
|
||||
fclose($myfile);
|
||||
|
||||
$_SESSION['alert_message'] = "Database successful";
|
||||
|
||||
header("setup_post.php?import_database");
|
||||
|
||||
}
|
||||
|
||||
include("config.php");
|
||||
|
||||
if(isset($_POST['import_database'])){
|
||||
|
||||
// Name of the file
|
||||
$filename = 'db.sql';
|
||||
// Temporary variable, used to store current query
|
||||
$templine = '';
|
||||
// Read in entire file
|
||||
$lines = file($filename);
|
||||
// Loop through each line
|
||||
foreach ($lines as $line){
|
||||
// Skip it if it's a comment
|
||||
if(substr($line, 0, 2) == '--' || $line == '')
|
||||
continue;
|
||||
|
||||
// Add this line to the current segment
|
||||
$templine .= $line;
|
||||
// If it has a semicolon at the end, it's the end of the query
|
||||
if(substr(trim($line), -1, 1) == ';'){
|
||||
// Perform the query
|
||||
mysqli_query($mysqli,$templine) or print('Error performing query \'<strong>' . $templine . '\': ' . mysqli_error() . '<br /><br />');
|
||||
// Reset temp variable to empty
|
||||
$templine = '';
|
||||
}
|
||||
}
|
||||
echo "Tables imported successfully";
|
||||
|
||||
header("setup.php");
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_user'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$password = md5(mysqli_real_escape_string($mysqli,$_POST['password']));
|
||||
|
||||
if($_FILES['file']['tmp_name']!='') {
|
||||
$path = "uploads/users/";
|
||||
$path = $path . time() . basename( $_FILES['file']['name']);
|
||||
$file_name = basename($path);
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $path);
|
||||
}
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', avatar = '$path', created_at = NOW()");
|
||||
|
||||
$_SESSION['alert_message'] = "User added";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_company_settings'])){
|
||||
|
||||
$config_company_name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_name']));
|
||||
$config_company_address = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_address']));
|
||||
$config_company_city = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_city']));
|
||||
$config_company_state = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_state']));
|
||||
$config_company_zip = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_zip']));
|
||||
$config_company_phone = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_phone']));
|
||||
$config_company_site = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_site']));
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO settings SET 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'");
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -32,332 +134,234 @@
|
|||
|
||||
<body id="page-top">
|
||||
|
||||
<?php include("setup_top_nav.php"); ?>
|
||||
<!-- Top Nav -->
|
||||
<nav class="navbar navbar-expand navbar-dark bg-primary static-top">
|
||||
|
||||
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
|
||||
<!-- Navbar -->
|
||||
<ul class="navbar-nav ml-auto ml-md-0">
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
include("setup_side_nav.php");
|
||||
?>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<ul class="sidebar navbar-nav d-print-none">
|
||||
<li class="nav-item">
|
||||
<h2 class="text-white text-center my-3">Setup</h2>
|
||||
</li>
|
||||
<li class="nav-item <?php if(isset($_GET['database'])) { echo "active"; } ?>">
|
||||
<a class="nav-link" href="?database">
|
||||
<i class="fas fa-fw fa-database mx-2"></i>
|
||||
<span>Database</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item <?php if(isset($_GET['user'])) { echo "active"; } ?>">
|
||||
<a class="nav-link" href="?user">
|
||||
<i class="fas fa-fw fa-user mx-2"></i>
|
||||
<span>User</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item <?php if(isset($_GET['company'])) { echo "active"; } ?>">
|
||||
<a class="nav-link" href="?company">
|
||||
<i class="fas fa-fw fa-building mx-2"></i>
|
||||
<span>Company</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="content-wrapper">
|
||||
|
||||
<div class="container">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-database"></i> Setup Database</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
|
||||
<div class="form-group">
|
||||
<label>MySQL Host</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="host" placeholder="Usually localhost" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>MySQL Username</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="username" placeholder="Username to access the database" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>MySQL Password</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="password" placeholder="Enter the password" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-5">
|
||||
<label>MySQL Database Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-database"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="database" placeholder="Name of the database" required>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" name="add_database" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-user"></i> Create your first user</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<form class="p-3" action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Full Name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Password</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="password" placeholder="Enter a Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-5">
|
||||
<label>Avatar</label>
|
||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="avatar">
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" name="add_user" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-building"></i> Company Settings</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>Company Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-building"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_company_name" placeholder="Company Name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Address</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-map-marker"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_company_address" placeholder="Street Address">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>City</label>
|
||||
<input type="text" class="form-control" name="config_company_city" placeholder="City">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>State</label>
|
||||
<select class="form-control" name="config_company_state">
|
||||
<option value="">Select a state...</option>
|
||||
<?php foreach($states_array as $state_abbr => $state_name) { ?>
|
||||
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Zip</label>
|
||||
<input type="text" class="form-control" name="config_company_zip" placeholder="Zip Code">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Phone</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_company_phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-5">
|
||||
<label>Website</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="config_company_site" placeholder="Website address https://">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="edit_company_settings" class="btn btn-primary">Save</button>
|
||||
<?php if(isset($_GET['database'])){ ?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-database"></i> Setup Database</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="p-3" action="setup_post.php" method="post" autocomplete="off">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-university"></i> Create an Account</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>Account Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-university"></i></span>
|
||||
<div class="form-group">
|
||||
<label>MySQL Host</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="host" placeholder="Usually localhost" required>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Account name" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Opening Balance</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="number" class="form-control" step="0.01" min="0" name="opening_balance" placeholder="Opening Balance" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox mb-5">
|
||||
<input type="checkbox" class="custom-control-input" id="customControlAutosizing" name="auto_create_accounts" value="1" >
|
||||
<label class="custom-control-label" for="customControlAutosizing">Auto Create</label>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" name="add_account" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-tag"></i> Create some categories</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<label>Expense Category</label>
|
||||
<div class="form-group row">
|
||||
<div class="form-group">
|
||||
<label>MySQL Username</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="username" placeholder="Username to access the database" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>MySQL Password</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="password" placeholder="Enter the password" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group col-10">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-shopping-cart"></i></span>
|
||||
<div class="form-group mb-5">
|
||||
<label>MySQL Database Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-database"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="database" placeholder="Name of the database" required>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="expense_category" placeholder="Expense category name" required>
|
||||
</div>
|
||||
<div class="input-group col-2">
|
||||
<input type="color" class="form-control" name="expense_category_color" placeholder="Pick a color" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Invoice Category</label>
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="input-group col-10">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-file"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="income_category" placeholder="Invoice category name" required>
|
||||
</div>
|
||||
<div class="input-group col-2">
|
||||
<input type="color" class="form-control" name="income_category_color" placeholder="Pick a color" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>Payment Type</label>
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="input-group col-10">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-credit-card"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="payment_category" placeholder="Payment type eg. check, cash, credit card etc" required>
|
||||
</div>
|
||||
<div class="input-group col-2">
|
||||
<input type="color" class="form-control" name="payment_category_color" placeholder="Pick a color" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="custom-control custom-checkbox mb-5">
|
||||
<input type="checkbox" class="custom-control-input" id="customControlAutosizing" name="auto_create_categories" value="1" >
|
||||
<label class="custom-control-label" for="customControlAutosizing">Auto Create</label>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" name="add_categories" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
<hr>
|
||||
<button type="submit" name="add_database" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="float-left mt-1"><i class="fa fa-envelope"></i> Mail Settings</h6>
|
||||
|
||||
<?php }?>
|
||||
|
||||
|
||||
<?php if(isset($_GET['user'])){ ?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-user"></i> Create your first user</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<form class="p-3" action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="name" placeholder="Full Name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Email</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-envelope"></i></span>
|
||||
</div>
|
||||
<input type="email" class="form-control" name="email" placeholder="Email Address" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Password</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="password" placeholder="Enter a Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-5">
|
||||
<label>Avatar</label>
|
||||
<input type="file" class="form-control-file" accept="image/*;capture=camera" name="file">
|
||||
</div>
|
||||
<hr>
|
||||
<button type="submit" name="add_user" class="btn btn-primary">Save</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>SMTP Host</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="config_smtp_host" placeholder="Mail Server Address" required>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Port</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-plug"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_smtp_port" placeholder="Mail Server Port Number" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>SMTP Username</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-user"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_smtp_username" placeholder="Username" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-5">
|
||||
<label>SMTP Password</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-lock"></i></span>
|
||||
</div>
|
||||
<input type="password" class="form-control" name="config_smtp_password" placeholder="Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(isset($_GET['company'])){ ?>
|
||||
|
||||
<hr>
|
||||
<button type="submit" name="edit_mail_settings" class="btn btn-primary">Save</button>
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h6 class="mt-1"><i class="fa fa-building"></i> Company Settings</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form class="p-3" action="post.php" method="post" autocomplete="off">
|
||||
<div class="form-group">
|
||||
<label>Company Name</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-building"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_company_name" placeholder="Company Name" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="form-group">
|
||||
<label>Address</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-map-marker"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_company_address" placeholder="Street Address">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>City</label>
|
||||
<input type="text" class="form-control" name="config_company_city" placeholder="City">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>State</label>
|
||||
<select class="form-control" name="config_company_state">
|
||||
<option value="">Select a state...</option>
|
||||
<?php foreach($states_array as $state_abbr => $state_name) { ?>
|
||||
<option value="<?php echo $state_abbr; ?>"><?php echo $state_name; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Zip</label>
|
||||
<input type="text" class="form-control" name="config_company_zip" placeholder="Zip Code">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Phone</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-phone"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="config_company_phone" placeholder="Phone Number" data-inputmask="'mask': '999-999-9999'">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-5">
|
||||
<label>Website</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="config_company_site" placeholder="Website address https://">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<button type="submit" name="add_company_settings" class="btn btn-primary">Save</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<!-- /.container-fluid -->
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
<!-- Sidebar -->
|
||||
<ul class="sidebar navbar-nav d-print-none">
|
||||
<li class="nav-item">
|
||||
<h2 class="text-white text-center my-3">Setup</h2>
|
||||
</li>
|
||||
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "setup.php") { echo "active"; } ?>">
|
||||
<a class="nav-link" href="setup.php">
|
||||
<i class="fas fa-fw fa-database mx-2"></i>
|
||||
<span>Database</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "clients.php") { echo "active"; } ?>">
|
||||
<a class="nav-link" href="setup.php">
|
||||
<i class="fas fa-fw fa-user mx-2"></i>
|
||||
<span>User</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "calendar_events.php") { echo "active"; } ?>">
|
||||
<a class="nav-link" href="calendar_events.php">
|
||||
<i class="fas fa-fw fa-building mx-2"></i>
|
||||
<span>Company</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "products.php") { echo "active"; } ?>">
|
||||
<a class="nav-link" href="products.php">
|
||||
<i class="fas fa-fw fa-university mx-2"></i>
|
||||
<span>Account</span></a>
|
||||
</li>
|
||||
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "vendors.php") { echo "active"; } ?>">
|
||||
<a class="nav-link" href="vendors.php">
|
||||
<i class="fas fa-fw fa-th mx-2"></i>
|
||||
<span>Categories</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item <?php if(basename($_SERVER["REQUEST_URI"]) == "invoices.php") { echo "active"; } ?>">
|
||||
<a class="nav-link" href="invoices.php">
|
||||
<i class="fas fa-fw fa-envelope mx-2"></i>
|
||||
<span>Mail</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<nav class="navbar navbar-expand navbar-dark bg-primary static-top">
|
||||
|
||||
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
|
||||
<!-- Navbar -->
|
||||
<ul class="navbar-nav ml-auto ml-md-0">
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
10
tickets.php
10
tickets.php
|
|
@ -71,14 +71,18 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketModal<?php echo $ticket_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_ticket=<?php echo $ticket_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include("edit_ticket_modal.php");
|
||||
include("view_ticket_modal.php");
|
||||
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
include("edit_ticket_modal.php");
|
||||
include("view_ticket_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -59,13 +59,15 @@ $sql = mysqli_query($mysqli,"SELECT * FROM transfers ORDER BY transfer_date DESC
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTransferModal<?php echo $transfer_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_transfer=<?php echo $transfer_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_transfer_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_transfer_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -48,13 +48,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTripModal<?php echo $mileage_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_trip=<?php echo $trip_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_trip_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_trip_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -59,13 +59,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editUserModal<?php echo $user_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_user=<?php echo $user_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_user_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_user_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2017 Javi Aguilar
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<a class="readme-logo" href="https://farbelous.io/bootstrap-colorpicker">
|
||||
<img alt="Logo by @reallinfo" src="logo.png" width="128px" />
|
||||
</a>
|
||||
|
||||
# Bootstrap Colorpicker
|
||||
|
||||
<!--version-->
|
||||
|
||||
[Bootstrap Colorpicker](https://github.com/farbelous/bootstrap-colorpicker/) is a modular color picker plugin for Bootstrap 4.
|
||||
|
||||
[](https://travis-ci.org/farbelous/bootstrap-colorpicker)
|
||||
[](https://www.npmjs.com/package/bootstrap-colorpicker)
|
||||
|
||||
## Install
|
||||
You can get the latest version in many different ways:
|
||||
|
||||
- Downloading [a ZIP file from the releases](https://github.com/farbelous/bootstrap-colorpicker/releases)
|
||||
- Cloning using Git: `git clone https://github.com/farbelous/bootstrap-colorpicker.git`
|
||||
- Installing via NPM: `npm install bootstrap-colorpicker`
|
||||
- Installing via Yarn: `yarn add bootstrap-colorpicker`
|
||||
- Installing via Composer: `composer require itsjavi/bootstrap-colorpicker`
|
||||
|
||||
Note that the `dist` files are only distributed via the NPM and Yarn installations.
|
||||
|
||||
For the rest methods, you will need to generate the files initializing the project with `yarn install`
|
||||
and then building the code using `npm run build`.
|
||||
|
||||
## Versions
|
||||
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Colorpicker version</th>
|
||||
<th>Compatible Bootstrap version</th>
|
||||
<th>Dependencies</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://github.com/farbelous/bootstrap-colorpicker/tree/v2.x">v2.x</a> <br>
|
||||
<a href="https://farbelous.github.io/bootstrap-colorpicker/v2">Documentation</a>
|
||||
</td>
|
||||
<td>(any)</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>jQuery >= 1.10</li>
|
||||
<li>Bootstrap CSS (input addon)</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://github.com/farbelous/bootstrap-colorpicker">v3.x</a> <br>
|
||||
<a href="https://farbelous.github.io/bootstrap-colorpicker">Documentation</a>
|
||||
</td>
|
||||
<td>Bootstrap 4</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>jQuery >= 2.1.0</li>
|
||||
<li>Bootstrap CSS (input addon, popover)</li>
|
||||
<li>Bootstrap JS Bundle (popover)</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
Note that the plugin may work without Bootstrap if your code is not using any of the mentioned Bootstrap
|
||||
dependencies.
|
||||
|
||||
|
||||
## Basic example
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link href="//cdn.rawgit.com/twbs/bootstrap/v4.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="dist/css/bootstrap-colorpicker.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div class="jumbotron">
|
||||
<h1>Bootstrap Colorpicker Demo</h1>
|
||||
<input id="demo" type="text" class="form-control" value="rgb(255, 128, 0)" />
|
||||
</div>
|
||||
<script src="//code.jquery.com/jquery-3.3.1.js"></script>
|
||||
<script src="//cdn.rawgit.com/twbs/bootstrap/v4.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="dist/js/bootstrap-colorpicker.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
// Basic instantiation:
|
||||
$('#demo').colorpicker();
|
||||
|
||||
// Example using an event, to change the color of the .jumbotron background:
|
||||
$('#demo').on('colorpickerChange', function(event) {
|
||||
$('.jumbotron').css('background-color', event.color.toString());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
```
|
||||
|
||||
## Contributions
|
||||
* [Issues](https://github.com/farbelous/bootstrap-colorpicker/issues)
|
||||
* [Pull Requests](https://github.com/farbelous/bootstrap-colorpicker/pulls)
|
||||
* [Milestones](https://github.com/farbelous/bootstrap-colorpicker/milestones)
|
||||
* [Planned Features](https://github.com/farbelous/bootstrap-colorpicker/projects)
|
||||
|
||||
This project exists thanks to all the [people who contribute](https://github.com/farbelous/bootstrap-colorpicker/graphs/contributors).
|
||||
|
||||
Please read [CONTRIBUTING](https://github.com/farbelous/bootstrap-colorpicker/blob/master/.github/CONTRIBUTING.md)
|
||||
before sending a pull request or issue.
|
||||
|
||||
## License
|
||||
The MIT License (MIT).
|
||||
Please see the [License File](https://github.com/farbelous/bootstrap-colorpicker/blob/master/LICENSE) for more information.
|
||||
|
||||
## Credits
|
||||
|
||||
Written and maintained by [Javi Aguilar](https://itsjavi.com) and all other contributors.
|
||||
|
||||
*Based on Stefan Petre's color picker (2013).*
|
||||
|
||||
*Thanks to JetBrains for supporting this project.*
|
||||
|
|
@ -0,0 +1,399 @@
|
|||
/*!
|
||||
* Bootstrap Colorpicker - Bootstrap Colorpicker is a modular color picker plugin for Bootstrap 4.
|
||||
* @package bootstrap-colorpicker
|
||||
* @version v3.1.2
|
||||
* @license MIT
|
||||
* @link https://farbelous.github.io/bootstrap-colorpicker/
|
||||
* @link https://github.com/farbelous/bootstrap-colorpicker.git
|
||||
*/
|
||||
.colorpicker {
|
||||
position: relative;
|
||||
display: none;
|
||||
font-size: inherit;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
background-color: #ffffff;
|
||||
background-clip: padding-box;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
padding: .75rem .75rem;
|
||||
width: 148px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box; }
|
||||
|
||||
.colorpicker.colorpicker-disabled,
|
||||
.colorpicker.colorpicker-disabled * {
|
||||
cursor: default !important; }
|
||||
|
||||
.colorpicker div {
|
||||
position: relative; }
|
||||
|
||||
.colorpicker-popup {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
float: left;
|
||||
margin-top: 1px;
|
||||
z-index: 1060; }
|
||||
|
||||
.colorpicker-popup.colorpicker-bs-popover-content {
|
||||
position: relative;
|
||||
top: auto;
|
||||
left: auto;
|
||||
float: none;
|
||||
margin: 0;
|
||||
z-index: initial;
|
||||
border: none;
|
||||
padding: 0.25rem 0;
|
||||
border-radius: 0;
|
||||
background: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none; }
|
||||
|
||||
.colorpicker:before,
|
||||
.colorpicker:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
line-height: 0; }
|
||||
|
||||
.colorpicker-clear {
|
||||
clear: both;
|
||||
display: block; }
|
||||
|
||||
.colorpicker:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #ccc;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
left: auto;
|
||||
right: 6px; }
|
||||
|
||||
.colorpicker:after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #ffffff;
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: auto;
|
||||
right: 7px; }
|
||||
|
||||
.colorpicker.colorpicker-with-alpha {
|
||||
width: 170px; }
|
||||
|
||||
.colorpicker.colorpicker-with-alpha .colorpicker-alpha {
|
||||
display: block; }
|
||||
|
||||
.colorpicker-saturation {
|
||||
position: relative;
|
||||
width: 126px;
|
||||
height: 126px;
|
||||
/* FF3.6+ */
|
||||
/* Chrome,Safari4+ */
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
/* Opera 11.10+ */
|
||||
/* IE10+ */
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(transparent), to(black)), -webkit-gradient(linear, left top, right top, from(white), to(rgba(255, 255, 255, 0)));
|
||||
background: linear-gradient(to bottom, transparent 0%, black 100%), linear-gradient(to right, white 0%, rgba(255, 255, 255, 0) 100%);
|
||||
/* W3C */
|
||||
cursor: crosshair;
|
||||
float: left;
|
||||
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
margin-bottom: 6px; }
|
||||
.colorpicker-saturation .colorpicker-guide {
|
||||
display: block;
|
||||
height: 6px;
|
||||
width: 6px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #000;
|
||||
-webkit-box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: -3px 0 0 -3px; }
|
||||
|
||||
.colorpicker-hue,
|
||||
.colorpicker-alpha {
|
||||
position: relative;
|
||||
width: 16px;
|
||||
height: 126px;
|
||||
float: left;
|
||||
cursor: row-resize;
|
||||
margin-left: 6px;
|
||||
margin-bottom: 6px; }
|
||||
|
||||
.colorpicker-alpha-color {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%; }
|
||||
|
||||
.colorpicker-hue,
|
||||
.colorpicker-alpha-color {
|
||||
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
|
||||
|
||||
.colorpicker-hue .colorpicker-guide,
|
||||
.colorpicker-alpha .colorpicker-guide {
|
||||
display: block;
|
||||
height: 4px;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin-left: -2px;
|
||||
margin-top: -2px;
|
||||
right: -2px;
|
||||
z-index: 1; }
|
||||
|
||||
.colorpicker-hue {
|
||||
/* FF3.6+ */
|
||||
/* Chrome,Safari4+ */
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
/* Opera 11.10+ */
|
||||
/* IE10+ */
|
||||
background: -webkit-gradient(linear, left bottom, left top, from(red), color-stop(8%, #ff8000), color-stop(17%, yellow), color-stop(25%, #80ff00), color-stop(33%, lime), color-stop(42%, #00ff80), color-stop(50%, cyan), color-stop(58%, #0080ff), color-stop(67%, blue), color-stop(75%, #8000ff), color-stop(83%, magenta), color-stop(92%, #ff0080), to(red));
|
||||
background: linear-gradient(to top, red 0%, #ff8000 8%, yellow 17%, #80ff00 25%, lime 33%, #00ff80 42%, cyan 50%, #0080ff 58%, blue 67%, #8000ff 75%, magenta 83%, #ff0080 92%, red 100%);
|
||||
/* W3C */ }
|
||||
|
||||
.colorpicker-alpha {
|
||||
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
|
||||
background-size: 10px 10px;
|
||||
background-position: 0 0, 5px 5px;
|
||||
display: none; }
|
||||
|
||||
.colorpicker-bar {
|
||||
min-height: 16px;
|
||||
margin: 6px 0 0 0;
|
||||
clear: both;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
line-height: normal;
|
||||
max-width: 100%;
|
||||
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
|
||||
.colorpicker-bar:before {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
|
||||
.colorpicker-bar.colorpicker-bar-horizontal {
|
||||
height: 126px;
|
||||
width: 16px;
|
||||
margin: 0 0 6px 0;
|
||||
float: left; }
|
||||
|
||||
.colorpicker-input-addon {
|
||||
position: relative; }
|
||||
|
||||
.colorpicker-input-addon i {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
vertical-align: text-top;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
position: relative; }
|
||||
|
||||
.colorpicker-input-addon:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: inline-block;
|
||||
vertical-align: text-top;
|
||||
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
|
||||
background-size: 10px 10px;
|
||||
background-position: 0 0, 5px 5px; }
|
||||
|
||||
.colorpicker.colorpicker-inline {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
float: none;
|
||||
z-index: auto;
|
||||
vertical-align: text-bottom; }
|
||||
|
||||
.colorpicker.colorpicker-horizontal {
|
||||
width: 126px;
|
||||
height: auto; }
|
||||
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-bar {
|
||||
width: 126px; }
|
||||
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-saturation {
|
||||
float: none;
|
||||
margin-bottom: 0; }
|
||||
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-hue,
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-alpha {
|
||||
float: none;
|
||||
width: 126px;
|
||||
height: 16px;
|
||||
cursor: col-resize;
|
||||
margin-left: 0;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 0; }
|
||||
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-hue .colorpicker-guide,
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-alpha .colorpicker-guide {
|
||||
position: absolute;
|
||||
display: block;
|
||||
bottom: -2px;
|
||||
left: 0;
|
||||
right: auto;
|
||||
height: auto;
|
||||
width: 4px; }
|
||||
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-hue {
|
||||
/* FF3.6+ */
|
||||
/* Chrome,Safari4+ */
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
/* Opera 11.10+ */
|
||||
/* IE10+ */
|
||||
background: -webkit-gradient(linear, right top, left top, from(red), color-stop(8%, #ff8000), color-stop(17%, yellow), color-stop(25%, #80ff00), color-stop(33%, lime), color-stop(42%, #00ff80), color-stop(50%, cyan), color-stop(58%, #0080ff), color-stop(67%, blue), color-stop(75%, #8000ff), color-stop(83%, magenta), color-stop(92%, #ff0080), to(red));
|
||||
background: linear-gradient(to left, red 0%, #ff8000 8%, yellow 17%, #80ff00 25%, lime 33%, #00ff80 42%, cyan 50%, #0080ff 58%, blue 67%, #8000ff 75%, magenta 83%, #ff0080 92%, red 100%);
|
||||
/* W3C */ }
|
||||
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-alpha {
|
||||
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
|
||||
background-size: 10px 10px;
|
||||
background-position: 0 0, 5px 5px; }
|
||||
|
||||
.colorpicker-inline:before,
|
||||
.colorpicker-no-arrow:before,
|
||||
.colorpicker-popup.colorpicker-bs-popover-content:before {
|
||||
content: none;
|
||||
display: none; }
|
||||
|
||||
.colorpicker-inline:after,
|
||||
.colorpicker-no-arrow:after,
|
||||
.colorpicker-popup.colorpicker-bs-popover-content:after {
|
||||
content: none;
|
||||
display: none; }
|
||||
|
||||
.colorpicker-alpha,
|
||||
.colorpicker-saturation,
|
||||
.colorpicker-hue {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
|
||||
.colorpicker.colorpicker-visible,
|
||||
.colorpicker-alpha.colorpicker-visible,
|
||||
.colorpicker-saturation.colorpicker-visible,
|
||||
.colorpicker-hue.colorpicker-visible,
|
||||
.colorpicker-bar.colorpicker-visible {
|
||||
display: block; }
|
||||
|
||||
.colorpicker.colorpicker-hidden,
|
||||
.colorpicker-alpha.colorpicker-hidden,
|
||||
.colorpicker-saturation.colorpicker-hidden,
|
||||
.colorpicker-hue.colorpicker-hidden,
|
||||
.colorpicker-bar.colorpicker-hidden {
|
||||
display: none; }
|
||||
|
||||
.colorpicker-inline.colorpicker-visible {
|
||||
display: inline-block; }
|
||||
|
||||
.colorpicker.colorpicker-disabled:after {
|
||||
border: none;
|
||||
content: '';
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(233, 236, 239, 0.33);
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: auto;
|
||||
z-index: 2;
|
||||
position: absolute; }
|
||||
|
||||
.colorpicker.colorpicker-disabled .colorpicker-guide {
|
||||
display: none; }
|
||||
|
||||
/** EXTENSIONS **/
|
||||
.colorpicker-preview {
|
||||
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
|
||||
background-size: 10px 10px;
|
||||
background-position: 0 0, 5px 5px; }
|
||||
|
||||
.colorpicker-preview > div {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%; }
|
||||
|
||||
.colorpicker-bar.colorpicker-swatches {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
height: auto; }
|
||||
|
||||
.colorpicker-swatches--inner {
|
||||
clear: both;
|
||||
margin-top: -6px; }
|
||||
|
||||
.colorpicker-swatch {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
margin-right: 6px;
|
||||
margin-top: 6px;
|
||||
margin-left: 0;
|
||||
display: block;
|
||||
-webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
background: linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), linear-gradient(45deg, rgba(0, 0, 0, 0.1) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.1) 75%, rgba(0, 0, 0, 0.1) 0), white;
|
||||
background-size: 10px 10px;
|
||||
background-position: 0 0, 5px 5px; }
|
||||
|
||||
.colorpicker-swatch--inner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%; }
|
||||
|
||||
.colorpicker-swatch:nth-of-type(7n+0) {
|
||||
margin-right: 0; }
|
||||
|
||||
.colorpicker-with-alpha .colorpicker-swatch:nth-of-type(7n+0) {
|
||||
margin-right: 6px; }
|
||||
|
||||
.colorpicker-with-alpha .colorpicker-swatch:nth-of-type(8n+0) {
|
||||
margin-right: 0; }
|
||||
|
||||
.colorpicker-horizontal .colorpicker-swatch:nth-of-type(6n+0) {
|
||||
margin-right: 0; }
|
||||
|
||||
.colorpicker-horizontal .colorpicker-swatch:nth-of-type(7n+0) {
|
||||
margin-right: 6px; }
|
||||
|
||||
.colorpicker-horizontal .colorpicker-swatch:nth-of-type(8n+0) {
|
||||
margin-right: 6px; }
|
||||
|
||||
.colorpicker-swatch:last-of-type:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both; }
|
||||
|
||||
*[dir='rtl'] .colorpicker-element input,
|
||||
.colorpicker-element[dir='rtl'] input,
|
||||
.colorpicker-element input[dir='rtl'] {
|
||||
direction: ltr;
|
||||
text-align: right; }
|
||||
|
||||
/*# sourceMappingURL=bootstrap-colorpicker.css.map */
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,6 @@
|
|||
bower_components
|
||||
node_modules
|
||||
npm-debug.log
|
||||
*.sublime-workspace
|
||||
*.sublime-project
|
||||
*.sw[onp]
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
# Date Range Picker
|
||||
|
||||

|
||||
|
||||
This date range picker component creates a dropdown menu from which a user can
|
||||
select a range of dates. I created it while building the UI for [Improvely](http://www.improvely.com),
|
||||
which needed a way to select date ranges for reports.
|
||||
|
||||
Features include limiting the selectable date range, localizable strings and date formats,
|
||||
a single date picker mode, a time picker, and predefined date ranges.
|
||||
|
||||
## [Documentation and Live Usage Examples](http://www.daterangepicker.com)
|
||||
|
||||
## [See It In a Live Application](https://awio.iljmp.com/5/drpdemogh)
|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2012-2019 Dan Grossman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "daterangepicker",
|
||||
"main": [
|
||||
"daterangepicker.js",
|
||||
"daterangepicker.css"
|
||||
],
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests",
|
||||
"moment.js",
|
||||
"moment.min.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": "1.9.1 - 3",
|
||||
"moment": ">=2.9.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,410 @@
|
|||
.daterangepicker {
|
||||
position: absolute;
|
||||
color: inherit;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ddd;
|
||||
width: 278px;
|
||||
max-width: none;
|
||||
padding: 0;
|
||||
margin-top: 7px;
|
||||
top: 100px;
|
||||
left: 20px;
|
||||
z-index: 3001;
|
||||
display: none;
|
||||
font-family: arial;
|
||||
font-size: 15px;
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
.daterangepicker:before, .daterangepicker:after {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||
content: '';
|
||||
}
|
||||
|
||||
.daterangepicker:before {
|
||||
top: -7px;
|
||||
border-right: 7px solid transparent;
|
||||
border-left: 7px solid transparent;
|
||||
border-bottom: 7px solid #ccc;
|
||||
}
|
||||
|
||||
.daterangepicker:after {
|
||||
top: -6px;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #fff;
|
||||
border-left: 6px solid transparent;
|
||||
}
|
||||
|
||||
.daterangepicker.opensleft:before {
|
||||
right: 9px;
|
||||
}
|
||||
|
||||
.daterangepicker.opensleft:after {
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.daterangepicker.openscenter:before {
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.daterangepicker.openscenter:after {
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.daterangepicker.opensright:before {
|
||||
left: 9px;
|
||||
}
|
||||
|
||||
.daterangepicker.opensright:after {
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
.daterangepicker.drop-up {
|
||||
margin-top: -7px;
|
||||
}
|
||||
|
||||
.daterangepicker.drop-up:before {
|
||||
top: initial;
|
||||
bottom: -7px;
|
||||
border-bottom: initial;
|
||||
border-top: 7px solid #ccc;
|
||||
}
|
||||
|
||||
.daterangepicker.drop-up:after {
|
||||
top: initial;
|
||||
bottom: -6px;
|
||||
border-bottom: initial;
|
||||
border-top: 6px solid #fff;
|
||||
}
|
||||
|
||||
.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar {
|
||||
float: none;
|
||||
}
|
||||
|
||||
.daterangepicker.single .drp-selected {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.daterangepicker.show-calendar .drp-calendar {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.daterangepicker.show-calendar .drp-buttons {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.daterangepicker.auto-apply .drp-buttons {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar {
|
||||
display: none;
|
||||
max-width: 270px;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.left {
|
||||
padding: 8px 0 8px 8px;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.right {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.single .calendar-table {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span {
|
||||
color: #fff;
|
||||
border: solid black;
|
||||
border-width: 0 2px 2px 0;
|
||||
border-radius: 0;
|
||||
display: inline-block;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-table .next span {
|
||||
transform: rotate(-45deg);
|
||||
-webkit-transform: rotate(-45deg);
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-table .prev span {
|
||||
transform: rotate(135deg);
|
||||
-webkit-transform: rotate(135deg);
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-table th, .daterangepicker .calendar-table td {
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
min-width: 32px;
|
||||
width: 32px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid transparent;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-table {
|
||||
border: 1px solid #fff;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-table table {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
|
||||
background-color: #eee;
|
||||
border-color: transparent;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.daterangepicker td.week, .daterangepicker th.week {
|
||||
font-size: 80%;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
|
||||
background-color: #fff;
|
||||
border-color: transparent;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.daterangepicker td.in-range {
|
||||
background-color: #ebf4f8;
|
||||
border-color: transparent;
|
||||
color: #000;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.daterangepicker td.start-date {
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
|
||||
.daterangepicker td.end-date {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
.daterangepicker td.start-date.end-date {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.daterangepicker td.active, .daterangepicker td.active:hover {
|
||||
background-color: #357ebd;
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.daterangepicker th.month {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.daterangepicker td.disabled, .daterangepicker option.disabled {
|
||||
color: #999;
|
||||
cursor: not-allowed;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
|
||||
font-size: 12px;
|
||||
padding: 1px;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.daterangepicker select.monthselect {
|
||||
margin-right: 2%;
|
||||
width: 56%;
|
||||
}
|
||||
|
||||
.daterangepicker select.yearselect {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
|
||||
width: 50px;
|
||||
margin: 0 auto;
|
||||
background: #eee;
|
||||
border: 1px solid #eee;
|
||||
padding: 2px;
|
||||
outline: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-time {
|
||||
text-align: center;
|
||||
margin: 4px auto 0 auto;
|
||||
line-height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.daterangepicker .calendar-time select.disabled {
|
||||
color: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-buttons {
|
||||
clear: both;
|
||||
text-align: right;
|
||||
padding: 8px;
|
||||
border-top: 1px solid #ddd;
|
||||
display: none;
|
||||
line-height: 12px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-selected {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-buttons .btn {
|
||||
margin-left: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.daterangepicker.show-ranges.single.rtl .drp-calendar.left {
|
||||
border-right: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.daterangepicker.show-ranges.single.ltr .drp-calendar.left {
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.daterangepicker.show-ranges.rtl .drp-calendar.right {
|
||||
border-right: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.daterangepicker.show-ranges.ltr .drp-calendar.left {
|
||||
border-left: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges {
|
||||
float: none;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.daterangepicker.show-calendar .ranges {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges ul {
|
||||
list-style: none;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges li {
|
||||
font-size: 12px;
|
||||
padding: 8px 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges li:hover {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges li.active {
|
||||
background-color: #08c;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Larger Screen Styling */
|
||||
@media (min-width: 564px) {
|
||||
.daterangepicker {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges ul {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.daterangepicker.single .ranges ul {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.daterangepicker.single .drp-calendar.left {
|
||||
clear: none;
|
||||
}
|
||||
|
||||
.daterangepicker.single .ranges, .daterangepicker.single .drp-calendar {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.daterangepicker {
|
||||
direction: ltr;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.left {
|
||||
clear: left;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.left .calendar-table {
|
||||
border-right: none;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.right {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.right .calendar-table {
|
||||
border-left: none;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.left .calendar-table {
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges, .daterangepicker .drp-calendar {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 730px) {
|
||||
.daterangepicker .ranges {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.daterangepicker .ranges {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.daterangepicker.rtl .ranges {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.daterangepicker .drp-calendar.left {
|
||||
clear: none !important;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,374 @@
|
|||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>A date range picker for Bootstrap</title>
|
||||
|
||||
<!--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" />-->
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="all" href="daterangepicker.css" />
|
||||
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="daterangepicker.js"></script>
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body style="margin: 60px 0">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1 style="margin: 0 0 20px 0">Configuration Builder</h1>
|
||||
|
||||
<div class="well configurator">
|
||||
|
||||
<form>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parentEl">parentEl</label>
|
||||
<input type="text" class="form-control" id="parentEl" value="" placeholder="body">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="startDate">startDate</label>
|
||||
<input type="text" class="form-control" id="startDate" value="07/01/2015">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="endDate">endDate</label>
|
||||
<input type="text" class="form-control" id="endDate" value="07/15/2015">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="minDate">minDate</label>
|
||||
<input type="text" class="form-control" id="minDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="maxDate">maxDate</label>
|
||||
<input type="text" class="form-control" id="maxDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoApply"> autoApply
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="singleDatePicker"> singleDatePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showDropdowns"> showDropdowns
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showWeekNumbers"> showWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showISOWeekNumbers"> showISOWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker" checked="checked"> timePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker24Hour"> timePicker24Hour
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="timePickerIncrement">timePickerIncrement (in minutes)</label>
|
||||
<input type="text" class="form-control" id="timePickerIncrement" value="1">
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePickerSeconds"> timePickerSeconds
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="dateLimit"> dateLimit (with example date range span)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="ranges" checked="checked"> ranges (with example predefined ranges)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="locale"> locale (with example settings)
|
||||
</label>
|
||||
<label id="rtl-wrap">
|
||||
<input type="checkbox" id="rtl"> RTL (right-to-left)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="alwaysShowCalendars"> alwaysShowCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="linkedCalendars" checked="checked"> linkedCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoUpdateInput" checked="checked"> autoUpdateInput
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showCustomRangeLabel" checked="checked"> showCustomRangeLabel
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="opens">opens</label>
|
||||
<select id="opens" class="form-control">
|
||||
<option value="right" selected>right</option>
|
||||
<option value="left">left</option>
|
||||
<option value="center">center</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="drops">drops</label>
|
||||
<select id="drops" class="form-control">
|
||||
<option value="down" selected>down</option>
|
||||
<option value="up">up</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="buttonClasses">buttonClasses</label>
|
||||
<input type="text" class="form-control" id="buttonClasses" value="btn btn-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="applyClass">applyClass</label>
|
||||
<input type="text" class="form-control" id="applyClass" value="btn-success">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cancelClass">cancelClass</label>
|
||||
<input type="text" class="form-control" id="cancelClass" value="btn-default">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 col-md-offset-2 demo">
|
||||
<h4>Your Date Range Picker</h4>
|
||||
<center>
|
||||
<input type="text" id="config-demo" class="form-control">
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<h4>Configuration</h4>
|
||||
|
||||
<div class="well">
|
||||
<textarea id="config-text" style="height: 300px; width: 100%; padding: 10px"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
.demo { position: relative; }
|
||||
.demo i {
|
||||
position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#config-text').keyup(function() {
|
||||
eval($(this).val());
|
||||
});
|
||||
|
||||
$('.configurator input, .configurator select').change(function() {
|
||||
updateConfig();
|
||||
});
|
||||
|
||||
$('.demo i').click(function() {
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
$('#startDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment().subtract(6, 'days')
|
||||
});
|
||||
|
||||
$('#endDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment()
|
||||
});
|
||||
|
||||
updateConfig();
|
||||
|
||||
function updateConfig() {
|
||||
var options = {};
|
||||
|
||||
if ($('#singleDatePicker').is(':checked'))
|
||||
options.singleDatePicker = true;
|
||||
|
||||
if ($('#showDropdowns').is(':checked'))
|
||||
options.showDropdowns = true;
|
||||
|
||||
if ($('#showWeekNumbers').is(':checked'))
|
||||
options.showWeekNumbers = true;
|
||||
|
||||
if ($('#showISOWeekNumbers').is(':checked'))
|
||||
options.showISOWeekNumbers = true;
|
||||
|
||||
if ($('#timePicker').is(':checked'))
|
||||
options.timePicker = true;
|
||||
|
||||
if ($('#timePicker24Hour').is(':checked'))
|
||||
options.timePicker24Hour = true;
|
||||
|
||||
if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1)
|
||||
options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10);
|
||||
|
||||
if ($('#timePickerSeconds').is(':checked'))
|
||||
options.timePickerSeconds = true;
|
||||
|
||||
if ($('#autoApply').is(':checked'))
|
||||
options.autoApply = true;
|
||||
|
||||
if ($('#dateLimit').is(':checked'))
|
||||
options.dateLimit = { days: 7 };
|
||||
|
||||
if ($('#ranges').is(':checked')) {
|
||||
options.ranges = {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
};
|
||||
}
|
||||
|
||||
if ($('#locale').is(':checked')) {
|
||||
$('#rtl-wrap').show();
|
||||
options.locale = {
|
||||
direction: $('#rtl').is(':checked') ? 'rtl' : 'ltr',
|
||||
format: 'MM/DD/YYYY HH:mm',
|
||||
separator: ' - ',
|
||||
applyLabel: 'Apply',
|
||||
cancelLabel: 'Cancel',
|
||||
fromLabel: 'From',
|
||||
toLabel: 'To',
|
||||
customRangeLabel: 'Custom',
|
||||
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
|
||||
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
firstDay: 1
|
||||
};
|
||||
} else {
|
||||
$('#rtl-wrap').hide();
|
||||
}
|
||||
|
||||
if (!$('#linkedCalendars').is(':checked'))
|
||||
options.linkedCalendars = false;
|
||||
|
||||
if (!$('#autoUpdateInput').is(':checked'))
|
||||
options.autoUpdateInput = false;
|
||||
|
||||
if (!$('#showCustomRangeLabel').is(':checked'))
|
||||
options.showCustomRangeLabel = false;
|
||||
|
||||
if ($('#alwaysShowCalendars').is(':checked'))
|
||||
options.alwaysShowCalendars = true;
|
||||
|
||||
if ($('#parentEl').val().length)
|
||||
options.parentEl = $('#parentEl').val();
|
||||
|
||||
if ($('#startDate').val().length)
|
||||
options.startDate = $('#startDate').val();
|
||||
|
||||
if ($('#endDate').val().length)
|
||||
options.endDate = $('#endDate').val();
|
||||
|
||||
if ($('#minDate').val().length)
|
||||
options.minDate = $('#minDate').val();
|
||||
|
||||
if ($('#maxDate').val().length)
|
||||
options.maxDate = $('#maxDate').val();
|
||||
|
||||
if ($('#opens').val().length && $('#opens').val() != 'right')
|
||||
options.opens = $('#opens').val();
|
||||
|
||||
if ($('#drops').val().length && $('#drops').val() != 'down')
|
||||
options.drops = $('#drops').val();
|
||||
|
||||
if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm')
|
||||
options.buttonClasses = $('#buttonClasses').val();
|
||||
|
||||
if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success')
|
||||
options.applyClass = $('#applyClass').val();
|
||||
|
||||
if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default')
|
||||
options.cancelClass = $('#cancelClass').val();
|
||||
|
||||
$('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});");
|
||||
|
||||
$('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); }).click();;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
|
|
@ -0,0 +1,210 @@
|
|||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>A date range picker for Bootstrap</title>
|
||||
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" type="text/css" media="all" href="../../daterangepicker.css" />
|
||||
<style type="text/css">
|
||||
.demo { position: relative; }
|
||||
.demo i {
|
||||
position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin: 60px 0">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1 style="margin: 0 0 20px 0">Configuration Builder</h1>
|
||||
|
||||
<div class="well configurator">
|
||||
|
||||
<form>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parentEl">parentEl</label>
|
||||
<input type="text" class="form-control" id="parentEl" value="" placeholder="body">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="startDate">startDate</label>
|
||||
<input type="text" class="form-control" id="startDate" value="07/01/2015">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="endDate">endDate</label>
|
||||
<input type="text" class="form-control" id="endDate" value="07/15/2015">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="minDate">minDate</label>
|
||||
<input type="text" class="form-control" id="minDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="maxDate">maxDate</label>
|
||||
<input type="text" class="form-control" id="maxDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoApply"> autoApply
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="singleDatePicker"> singleDatePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showDropdowns"> showDropdowns
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showWeekNumbers"> showWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showISOWeekNumbers"> showISOWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker"> timePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker24Hour"> timePicker24Hour
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="timePickerIncrement">timePickerIncrement (in minutes)</label>
|
||||
<input type="text" class="form-control" id="timePickerIncrement" value="1">
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePickerSeconds"> timePickerSeconds
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="dateLimit"> dateLimit (with example date range span)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="ranges"> ranges (with example predefined ranges)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="locale"> locale (with example settings)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="linkedCalendars" checked="checked"> linkedCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoUpdateInput" checked="checked"> autoUpdateInput
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="alwaysShowCalendars"> alwaysShowCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="opens">opens</label>
|
||||
<select id="opens" class="form-control">
|
||||
<option value="right" selected>right</option>
|
||||
<option value="left">left</option>
|
||||
<option value="center">center</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="drops">drops</label>
|
||||
<select id="drops" class="form-control">
|
||||
<option value="down" selected>down</option>
|
||||
<option value="up">up</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="buttonClasses">buttonClasses</label>
|
||||
<input type="text" class="form-control" id="buttonClasses" value="btn btn-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="applyClass">applyClass</label>
|
||||
<input type="text" class="form-control" id="applyClass" value="btn-success">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cancelClass">cancelClass</label>
|
||||
<input type="text" class="form-control" id="cancelClass" value="btn-default">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 col-md-offset-2 demo">
|
||||
<h4>Your Date Range Picker</h4>
|
||||
<input type="text" id="config-demo" class="form-control">
|
||||
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<h4>Configuration</h4>
|
||||
|
||||
<div class="well">
|
||||
<textarea id="config-text" style="height: 300px; width: 100%; padding: 10px"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript" src="require.js" data-main="main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
requirejs.config({
|
||||
"paths": {
|
||||
"jquery": "https://code.jquery.com/jquery-1.11.3.min",
|
||||
"moment": "../../moment",
|
||||
"daterangepicker": "../../daterangepicker"
|
||||
}
|
||||
});
|
||||
|
||||
requirejs(['jquery', 'moment', 'daterangepicker'] , function ($, moment) {
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#config-text').keyup(function() {
|
||||
eval($(this).val());
|
||||
});
|
||||
|
||||
$('.configurator input, .configurator select').change(function() {
|
||||
updateConfig();
|
||||
});
|
||||
|
||||
$('.demo i').click(function() {
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
$('#startDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment().subtract(6, 'days')
|
||||
});
|
||||
|
||||
$('#endDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment()
|
||||
});
|
||||
|
||||
updateConfig();
|
||||
|
||||
function updateConfig() {
|
||||
var options = {};
|
||||
|
||||
if ($('#singleDatePicker').is(':checked'))
|
||||
options.singleDatePicker = true;
|
||||
|
||||
if ($('#showDropdowns').is(':checked'))
|
||||
options.showDropdowns = true;
|
||||
|
||||
if ($('#showWeekNumbers').is(':checked'))
|
||||
options.showWeekNumbers = true;
|
||||
|
||||
if ($('#showISOWeekNumbers').is(':checked'))
|
||||
options.showISOWeekNumbers = true;
|
||||
|
||||
if ($('#timePicker').is(':checked'))
|
||||
options.timePicker = true;
|
||||
|
||||
if ($('#timePicker24Hour').is(':checked'))
|
||||
options.timePicker24Hour = true;
|
||||
|
||||
if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1)
|
||||
options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10);
|
||||
|
||||
if ($('#timePickerSeconds').is(':checked'))
|
||||
options.timePickerSeconds = true;
|
||||
|
||||
if ($('#autoApply').is(':checked'))
|
||||
options.autoApply = true;
|
||||
|
||||
if ($('#dateLimit').is(':checked'))
|
||||
options.dateLimit = { days: 7 };
|
||||
|
||||
if ($('#ranges').is(':checked')) {
|
||||
options.ranges = {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
};
|
||||
}
|
||||
|
||||
if ($('#locale').is(':checked')) {
|
||||
options.locale = {
|
||||
format: 'MM/DD/YYYY HH:mm',
|
||||
separator: ' - ',
|
||||
applyLabel: 'Apply',
|
||||
cancelLabel: 'Cancel',
|
||||
fromLabel: 'From',
|
||||
toLabel: 'To',
|
||||
customRangeLabel: 'Custom',
|
||||
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
|
||||
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
firstDay: 1
|
||||
};
|
||||
}
|
||||
|
||||
if (!$('#linkedCalendars').is(':checked'))
|
||||
options.linkedCalendars = false;
|
||||
|
||||
if (!$('#autoUpdateInput').is(':checked'))
|
||||
options.autoUpdateInput = false;
|
||||
|
||||
if ($('#alwaysShowCalendars').is(':checked'))
|
||||
options.alwaysShowCalendars = true;
|
||||
|
||||
if ($('#parentEl').val().length)
|
||||
options.parentEl = $('#parentEl').val();
|
||||
|
||||
if ($('#startDate').val().length)
|
||||
options.startDate = $('#startDate').val();
|
||||
|
||||
if ($('#endDate').val().length)
|
||||
options.endDate = $('#endDate').val();
|
||||
|
||||
if ($('#minDate').val().length)
|
||||
options.minDate = $('#minDate').val();
|
||||
|
||||
if ($('#maxDate').val().length)
|
||||
options.maxDate = $('#maxDate').val();
|
||||
|
||||
if ($('#opens').val().length && $('#opens').val() != 'right')
|
||||
options.opens = $('#opens').val();
|
||||
|
||||
if ($('#drops').val().length && $('#drops').val() != 'down')
|
||||
options.drops = $('#drops').val();
|
||||
|
||||
if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm')
|
||||
options.buttonClasses = $('#buttonClasses').val();
|
||||
|
||||
if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success')
|
||||
options.applyClass = $('#applyClass').val();
|
||||
|
||||
if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default')
|
||||
options.cancelClass = $('#cancelClass').val();
|
||||
|
||||
$('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});");
|
||||
|
||||
$('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); });
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
|
||||
Released under MIT license, http://github.com/requirejs/requirejs/LICENSE
|
||||
*/
|
||||
var requirejs,require,define;
|
||||
(function(ga){function ka(b,c,d,g){return g||""}function K(b){return"[object Function]"===Q.call(b)}function L(b){return"[object Array]"===Q.call(b)}function y(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function X(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));--d);}}function x(b,c){return la.call(b,c)}function e(b,c){return x(b,c)&&b[c]}function D(b,c){for(var d in b)if(x(b,d)&&c(b[d],d))break}function Y(b,c,d,g){c&&D(c,function(c,e){if(d||!x(b,e))!g||"object"!==
|
||||
typeof c||!c||L(c)||K(c)||c instanceof RegExp?b[e]=c:(b[e]||(b[e]={}),Y(b[e],c,d,g))});return b}function z(b,c){return function(){return c.apply(b,arguments)}}function ha(b){throw b;}function ia(b){if(!b)return b;var c=ga;y(b.split("."),function(b){c=c[b]});return c}function F(b,c,d,g){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=g;d&&(c.originalError=d);return c}function ma(b){function c(a,n,b){var h,k,f,c,d,l,g,r;n=n&&n.split("/");var q=p.map,m=q&&q["*"];
|
||||
if(a){a=a.split("/");k=a.length-1;p.nodeIdCompat&&U.test(a[k])&&(a[k]=a[k].replace(U,""));"."===a[0].charAt(0)&&n&&(k=n.slice(0,n.length-1),a=k.concat(a));k=a;for(f=0;f<k.length;f++)c=k[f],"."===c?(k.splice(f,1),--f):".."===c&&0!==f&&(1!==f||".."!==k[2])&&".."!==k[f-1]&&0<f&&(k.splice(f-1,2),f-=2);a=a.join("/")}if(b&&q&&(n||m)){k=a.split("/");f=k.length;a:for(;0<f;--f){d=k.slice(0,f).join("/");if(n)for(c=n.length;0<c;--c)if(b=e(q,n.slice(0,c).join("/")))if(b=e(b,d)){h=b;l=f;break a}!g&&m&&e(m,d)&&
|
||||
(g=e(m,d),r=f)}!h&&g&&(h=g,l=r);h&&(k.splice(0,l,h),a=k.join("/"))}return(h=e(p.pkgs,a))?h:a}function d(a){E&&y(document.getElementsByTagName("script"),function(n){if(n.getAttribute("data-requiremodule")===a&&n.getAttribute("data-requirecontext")===l.contextName)return n.parentNode.removeChild(n),!0})}function m(a){var n=e(p.paths,a);if(n&&L(n)&&1<n.length)return n.shift(),l.require.undef(a),l.makeRequire(null,{skipMap:!0})([a]),!0}function r(a){var n,b=a?a.indexOf("!"):-1;-1<b&&(n=a.substring(0,
|
||||
b),a=a.substring(b+1,a.length));return[n,a]}function q(a,n,b,h){var k,f,d=null,g=n?n.name:null,p=a,q=!0,m="";a||(q=!1,a="_@r"+(Q+=1));a=r(a);d=a[0];a=a[1];d&&(d=c(d,g,h),f=e(v,d));a&&(d?m=f&&f.normalize?f.normalize(a,function(a){return c(a,g,h)}):-1===a.indexOf("!")?c(a,g,h):a:(m=c(a,g,h),a=r(m),d=a[0],m=a[1],b=!0,k=l.nameToUrl(m)));b=!d||f||b?"":"_unnormalized"+(T+=1);return{prefix:d,name:m,parentMap:n,unnormalized:!!b,url:k,originalName:p,isDefine:q,id:(d?d+"!"+m:m)+b}}function u(a){var b=a.id,
|
||||
c=e(t,b);c||(c=t[b]=new l.Module(a));return c}function w(a,b,c){var h=a.id,k=e(t,h);if(!x(v,h)||k&&!k.defineEmitComplete)if(k=u(a),k.error&&"error"===b)c(k.error);else k.on(b,c);else"defined"===b&&c(v[h])}function A(a,b){var c=a.requireModules,h=!1;if(b)b(a);else if(y(c,function(b){if(b=e(t,b))b.error=a,b.events.error&&(h=!0,b.emit("error",a))}),!h)g.onError(a)}function B(){V.length&&(y(V,function(a){var b=a[0];"string"===typeof b&&(l.defQueueMap[b]=!0);G.push(a)}),V=[])}function C(a){delete t[a];
|
||||
delete Z[a]}function J(a,b,c){var h=a.map.id;a.error?a.emit("error",a.error):(b[h]=!0,y(a.depMaps,function(h,f){var d=h.id,g=e(t,d);!g||a.depMatched[f]||c[d]||(e(b,d)?(a.defineDep(f,v[d]),a.check()):J(g,b,c))}),c[h]=!0)}function H(){var a,b,c=(a=1E3*p.waitSeconds)&&l.startTime+a<(new Date).getTime(),h=[],k=[],f=!1,g=!0;if(!aa){aa=!0;D(Z,function(a){var l=a.map,e=l.id;if(a.enabled&&(l.isDefine||k.push(a),!a.error))if(!a.inited&&c)m(e)?f=b=!0:(h.push(e),d(e));else if(!a.inited&&a.fetched&&l.isDefine&&
|
||||
(f=!0,!l.prefix))return g=!1});if(c&&h.length)return a=F("timeout","Load timeout for modules: "+h,null,h),a.contextName=l.contextName,A(a);g&&y(k,function(a){J(a,{},{})});c&&!b||!f||!E&&!ja||ba||(ba=setTimeout(function(){ba=0;H()},50));aa=!1}}function I(a){x(v,a[0])||u(q(a[0],null,!0)).init(a[1],a[2])}function O(a){a=a.currentTarget||a.srcElement;var b=l.onScriptLoad;a.detachEvent&&!ca?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=l.onScriptError;a.detachEvent&&!ca||a.removeEventListener("error",
|
||||
b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function P(){var a;for(B();G.length;){a=G.shift();if(null===a[0])return A(F("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));I(a)}l.defQueueMap={}}var aa,da,l,R,ba,p={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},t={},Z={},ea={},G=[],v={},W={},fa={},Q=1,T=1;R={require:function(a){return a.require?a.require:a.require=l.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?
|
||||
v[a.map.id]=a.exports:a.exports=v[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return e(p.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};da=function(a){this.events=e(ea,a.id)||{};this.map=a;this.shim=e(p.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};da.prototype={init:function(a,b,c,h){h=h||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&
|
||||
(c=z(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=h.ignore;h.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,--this.depCount,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;l.startTime=(new Date).getTime();var a=this.map;if(this.shim)l.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],z(this,function(){return a.prefix?this.callPlugin():
|
||||
this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;W[a]||(W[a]=!0,l.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var h=this.exports,k=this.factory;if(!this.inited)x(l.defQueueMap,c)||this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(K(k)){if(this.events.error&&this.map.isDefine||g.onError!==
|
||||
ha)try{h=l.execCb(c,k,b,h)}catch(d){a=d}else h=l.execCb(c,k,b,h);this.map.isDefine&&void 0===h&&((b=this.module)?h=b.exports:this.usingExports&&(h=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",A(this.error=a)}else h=k;this.exports=h;if(this.map.isDefine&&!this.ignore&&(v[c]=h,g.onResourceLoad)){var f=[];y(this.depMaps,function(a){f.push(a.normalizedMap||a)});g.onResourceLoad(l,this.map,f)}C(c);
|
||||
this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);w(d,"defined",z(this,function(h){var k,f,d=e(fa,this.map.id),M=this.map.name,r=this.map.parentMap?this.map.parentMap.name:null,m=l.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(h.normalize&&(M=h.normalize(M,function(a){return c(a,r,!0)})||
|
||||
""),f=q(a.prefix+"!"+M,this.map.parentMap),w(f,"defined",z(this,function(a){this.map.normalizedMap=f;this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),h=e(t,f.id)){this.depMaps.push(f);if(this.events.error)h.on("error",z(this,function(a){this.emit("error",a)}));h.enable()}}else d?(this.map.url=l.nameToUrl(d),this.load()):(k=z(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),k.error=z(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];D(t,function(a){0===
|
||||
a.map.id.indexOf(b+"_unnormalized")&&C(a.map.id)});A(a)}),k.fromText=z(this,function(h,c){var d=a.name,f=q(d),M=S;c&&(h=c);M&&(S=!1);u(f);x(p.config,b)&&(p.config[d]=p.config[b]);try{g.exec(h)}catch(e){return A(F("fromtexteval","fromText eval for "+b+" failed: "+e,e,[b]))}M&&(S=!0);this.depMaps.push(f);l.completeLoad(d);m([d],k)}),h.load(a.name,m,k,p))}));l.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){Z[this.map.id]=this;this.enabling=this.enabled=!0;y(this.depMaps,z(this,function(a,
|
||||
b){var c,h;if("string"===typeof a){a=q(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=e(R,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;w(a,"defined",z(this,function(a){this.undefed||(this.defineDep(b,a),this.check())}));this.errback?w(a,"error",z(this,this.errback)):this.events.error&&w(a,"error",z(this,function(a){this.emit("error",a)}))}c=a.id;h=t[c];x(R,c)||!h||h.enabled||l.enable(a,this)}));D(this.pluginMaps,z(this,function(a){var b=e(t,a.id);
|
||||
b&&!b.enabled&&l.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){y(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};l={config:p,contextName:b,registry:t,defined:v,urlFetched:W,defQueue:G,defQueueMap:{},Module:da,makeModuleMap:q,nextTick:g.nextTick,onError:A,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");if("string"===typeof a.urlArgs){var b=
|
||||
a.urlArgs;a.urlArgs=function(a,c){return(-1===c.indexOf("?")?"?":"&")+b}}var c=p.shim,h={paths:!0,bundles:!0,config:!0,map:!0};D(a,function(a,b){h[b]?(p[b]||(p[b]={}),Y(p[b],a,!0,!0)):p[b]=a});a.bundles&&D(a.bundles,function(a,b){y(a,function(a){a!==b&&(fa[a]=b)})});a.shim&&(D(a.shim,function(a,b){L(a)&&(a={deps:a});!a.exports&&!a.init||a.exportsFn||(a.exportsFn=l.makeShimExports(a));c[b]=a}),p.shim=c);a.packages&&y(a.packages,function(a){var b;a="string"===typeof a?{name:a}:a;b=a.name;a.location&&
|
||||
(p.paths[b]=a.location);p.pkgs[b]=a.name+"/"+(a.main||"main").replace(na,"").replace(U,"")});D(t,function(a,b){a.inited||a.map.unnormalized||(a.map=q(b,null,!0))});(a.deps||a.callback)&&l.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ga,arguments));return b||a.exports&&ia(a.exports)}},makeRequire:function(a,n){function m(c,d,f){var e,r;n.enableBuildCallback&&d&&K(d)&&(d.__requireJsBuild=!0);if("string"===typeof c){if(K(d))return A(F("requireargs",
|
||||
"Invalid require call"),f);if(a&&x(R,c))return R[c](t[a.id]);if(g.get)return g.get(l,c,a,m);e=q(c,a,!1,!0);e=e.id;return x(v,e)?v[e]:A(F("notloaded",'Module name "'+e+'" has not been loaded yet for context: '+b+(a?"":". Use require([])")))}P();l.nextTick(function(){P();r=u(q(null,a));r.skipMap=n.skipMap;r.init(c,d,f,{enabled:!0});H()});return m}n=n||{};Y(m,{isBrowser:E,toUrl:function(b){var d,f=b.lastIndexOf("."),g=b.split("/")[0];-1!==f&&("."!==g&&".."!==g||1<f)&&(d=b.substring(f,b.length),b=b.substring(0,
|
||||
f));return l.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return x(v,q(b,a,!1,!0).id)},specified:function(b){b=q(b,a,!1,!0).id;return x(v,b)||x(t,b)}});a||(m.undef=function(b){B();var c=q(b,a,!0),f=e(t,b);f.undefed=!0;d(b);delete v[b];delete W[c.url];delete ea[b];X(G,function(a,c){a[0]===b&&G.splice(c,1)});delete l.defQueueMap[b];f&&(f.events.defined&&(ea[b]=f.events),C(b))});return m},enable:function(a){e(t,a.id)&&u(a).enable()},completeLoad:function(a){var b,c,d=e(p.shim,a)||{},g=d.exports;
|
||||
for(B();G.length;){c=G.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);I(c)}l.defQueueMap={};c=e(t,a);if(!b&&!x(v,a)&&c&&!c.inited)if(!p.enforceDefine||g&&ia(g))I([a,d.deps||[],d.exportsFn]);else return m(a)?void 0:A(F("nodefine","No define call for "+a,null,[a]));H()},nameToUrl:function(a,b,c){var d,k,f,m;(d=e(p.pkgs,a))&&(a=d);if(d=e(fa,a))return l.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=p.paths;k=a.split("/");for(f=k.length;0<f;--f)if(m=k.slice(0,f).join("/"),
|
||||
m=e(d,m)){L(m)&&(m=m[0]);k.splice(0,f,m);break}d=k.join("/");d+=b||(/^data\:|^blob\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":p.baseUrl)+d}return p.urlArgs&&!/^blob\:/.test(d)?d+p.urlArgs(a,d):d},load:function(a,b){g.load(l,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||oa.test((a.currentTarget||a.srcElement).readyState))N=null,a=O(a),l.completeLoad(a.id)},onScriptError:function(a){var b=O(a);if(!m(b.id)){var c=[];
|
||||
D(t,function(a,d){0!==d.indexOf("_@r")&&y(a.depMaps,function(a){if(a.id===b.id)return c.push(d),!0})});return A(F("scripterror",'Script error for "'+b.id+(c.length?'", needed by: '+c.join(", "):'"'),a,[b.id]))}}};l.require=l.makeRequire();return l}function pa(){if(N&&"interactive"===N.readyState)return N;X(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b});return N}var g,B,C,H,O,I,N,P,u,T,qa=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ra=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
||||
U=/\.js$/,na=/^\.\//;B=Object.prototype;var Q=B.toString,la=B.hasOwnProperty,E=!("undefined"===typeof window||"undefined"===typeof navigator||!window.document),ja=!E&&"undefined"!==typeof importScripts,oa=E&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,ca="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),J={},w={},V=[],S=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(K(requirejs))return;w=requirejs;requirejs=void 0}"undefined"===typeof require||
|
||||
K(require)||(w=require,require=void 0);g=requirejs=function(b,c,d,m){var r,q="_";L(b)||"string"===typeof b||(r=b,L(c)?(b=c,c=d,d=m):b=[]);r&&r.context&&(q=r.context);(m=e(J,q))||(m=J[q]=g.s.newContext(q));r&&m.configure(r);return m.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.2.0";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=E;B=g.s={contexts:J,newContext:ma};g({});y(["toUrl",
|
||||
"undef","defined","specified"],function(b){g[b]=function(){var c=J._;return c.require[b].apply(c,arguments)}});E&&(C=B.head=document.getElementsByTagName("head")[0],H=document.getElementsByTagName("base")[0])&&(C=B.head=H.parentNode);g.onError=ha;g.createNode=function(b,c,d){c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var m=b&&b.config||
|
||||
{},e;if(E){e=g.createNode(m,c,d);e.setAttribute("data-requirecontext",b.contextName);e.setAttribute("data-requiremodule",c);!e.attachEvent||e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code")||ca?(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)):(S=!0,e.attachEvent("onreadystatechange",b.onScriptLoad));e.src=d;if(m.onNodeCreated)m.onNodeCreated(e,m,c,d);P=e;H?C.insertBefore(e,H):C.appendChild(e);P=null;return e}if(ja)try{setTimeout(function(){},
|
||||
0),importScripts(d),b.completeLoad(c)}catch(q){b.onError(F("importscripts","importScripts failed for "+c+" at "+d,q,[c]))}};E&&!w.skipDataMain&&X(document.getElementsByTagName("script"),function(b){C||(C=b.parentNode);if(O=b.getAttribute("data-main"))return u=O,w.baseUrl||-1!==u.indexOf("!")||(I=u.split("/"),u=I.pop(),T=I.length?I.join("/")+"/":"./",w.baseUrl=T),u=u.replace(U,""),g.jsExtRegExp.test(u)&&(u=O),w.deps=w.deps?w.deps.concat(u):[u],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&
|
||||
(d=c,c=b,b=null);L(c)||(d=c,c=null);!c&&K(d)&&(c=[],d.length&&(d.toString().replace(qa,ka).replace(ra,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));S&&(e=P||pa())&&(b||(b=e.getAttribute("data-requiremodule")),g=J[e.getAttribute("data-requirecontext")]);g?(g.defQueue.push([b,c,d]),g.defQueueMap[b]=!0):V.push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(w)}})(this);
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Browserify example
|
||||
|
||||
Two steps need to be done for this to work
|
||||
|
||||
In the project root
|
||||
|
||||
npm install
|
||||
|
||||
In this folder
|
||||
|
||||
../../node_modules/.bin/browserify main.js -o bundle.js
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>A date range picker for Bootstrap</title>
|
||||
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" type="text/css" media="all" href="../../daterangepicker.css" />
|
||||
<style type="text/css">
|
||||
.demo { position: relative; }
|
||||
.demo i {
|
||||
position: absolute; bottom: 10px; right: 24px; top: auto; cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin: 60px 0">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<h1 style="margin: 0 0 20px 0">Configuration Builder</h1>
|
||||
|
||||
<div class="well configurator">
|
||||
|
||||
<form>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parentEl">parentEl</label>
|
||||
<input type="text" class="form-control" id="parentEl" value="" placeholder="body">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="startDate">startDate</label>
|
||||
<input type="text" class="form-control" id="startDate" value="07/01/2015">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="endDate">endDate</label>
|
||||
<input type="text" class="form-control" id="endDate" value="07/15/2015">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="minDate">minDate</label>
|
||||
<input type="text" class="form-control" id="minDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="maxDate">maxDate</label>
|
||||
<input type="text" class="form-control" id="maxDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoApply"> autoApply
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="singleDatePicker"> singleDatePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showDropdowns"> showDropdowns
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showWeekNumbers"> showWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showISOWeekNumbers"> showISOWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker"> timePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker24Hour"> timePicker24Hour
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="timePickerIncrement">timePickerIncrement (in minutes)</label>
|
||||
<input type="text" class="form-control" id="timePickerIncrement" value="1">
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePickerSeconds"> timePickerSeconds
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="dateLimit"> dateLimit (with example date range span)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="ranges"> ranges (with example predefined ranges)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="locale"> locale (with example settings)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="linkedCalendars" checked="checked"> linkedCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoUpdateInput" checked="checked"> autoUpdateInput
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="alwaysShowCalendars"> alwaysShowCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="opens">opens</label>
|
||||
<select id="opens" class="form-control">
|
||||
<option value="right" selected>right</option>
|
||||
<option value="left">left</option>
|
||||
<option value="center">center</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="drops">drops</label>
|
||||
<select id="drops" class="form-control">
|
||||
<option value="down" selected>down</option>
|
||||
<option value="up">up</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="buttonClasses">buttonClasses</label>
|
||||
<input type="text" class="form-control" id="buttonClasses" value="btn btn-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="applyClass">applyClass</label>
|
||||
<input type="text" class="form-control" id="applyClass" value="btn-success">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cancelClass">cancelClass</label>
|
||||
<input type="text" class="form-control" id="cancelClass" value="btn-default">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 col-md-offset-2 demo">
|
||||
<h4>Your Date Range Picker</h4>
|
||||
<input type="text" id="config-demo" class="form-control">
|
||||
<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<h4>Configuration</h4>
|
||||
|
||||
<div class="well">
|
||||
<textarea id="config-text" style="height: 300px; width: 100%; padding: 10px"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
require('../../daterangepicker.js');
|
||||
var $ = require('jquery'),
|
||||
moment = require('moment');
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#config-text').keyup(function() {
|
||||
eval($(this).val());
|
||||
});
|
||||
|
||||
$('.configurator input, .configurator select').change(function() {
|
||||
updateConfig();
|
||||
});
|
||||
|
||||
$('.demo i').click(function() {
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
$('#startDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment().subtract(6, 'days')
|
||||
});
|
||||
|
||||
$('#endDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment()
|
||||
});
|
||||
|
||||
updateConfig();
|
||||
|
||||
function updateConfig() {
|
||||
var options = {};
|
||||
|
||||
if ($('#singleDatePicker').is(':checked'))
|
||||
options.singleDatePicker = true;
|
||||
|
||||
if ($('#showDropdowns').is(':checked'))
|
||||
options.showDropdowns = true;
|
||||
|
||||
if ($('#showWeekNumbers').is(':checked'))
|
||||
options.showWeekNumbers = true;
|
||||
|
||||
if ($('#showISOWeekNumbers').is(':checked'))
|
||||
options.showISOWeekNumbers = true;
|
||||
|
||||
if ($('#timePicker').is(':checked'))
|
||||
options.timePicker = true;
|
||||
|
||||
if ($('#timePicker24Hour').is(':checked'))
|
||||
options.timePicker24Hour = true;
|
||||
|
||||
if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1)
|
||||
options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10);
|
||||
|
||||
if ($('#timePickerSeconds').is(':checked'))
|
||||
options.timePickerSeconds = true;
|
||||
|
||||
if ($('#autoApply').is(':checked'))
|
||||
options.autoApply = true;
|
||||
|
||||
if ($('#dateLimit').is(':checked'))
|
||||
options.dateLimit = { days: 7 };
|
||||
|
||||
if ($('#ranges').is(':checked')) {
|
||||
options.ranges = {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
};
|
||||
}
|
||||
|
||||
if ($('#locale').is(':checked')) {
|
||||
options.locale = {
|
||||
format: 'MM/DD/YYYY HH:mm',
|
||||
separator: ' - ',
|
||||
applyLabel: 'Apply',
|
||||
cancelLabel: 'Cancel',
|
||||
fromLabel: 'From',
|
||||
toLabel: 'To',
|
||||
customRangeLabel: 'Custom',
|
||||
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
|
||||
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
firstDay: 1
|
||||
};
|
||||
}
|
||||
|
||||
if (!$('#linkedCalendars').is(':checked'))
|
||||
options.linkedCalendars = false;
|
||||
|
||||
if (!$('#autoUpdateInput').is(':checked'))
|
||||
options.autoUpdateInput = false;
|
||||
|
||||
if ($('#alwaysShowCalendars').is(':checked'))
|
||||
options.alwaysShowCalendars = true;
|
||||
|
||||
if ($('#parentEl').val().length)
|
||||
options.parentEl = $('#parentEl').val();
|
||||
|
||||
if ($('#startDate').val().length)
|
||||
options.startDate = $('#startDate').val();
|
||||
|
||||
if ($('#endDate').val().length)
|
||||
options.endDate = $('#endDate').val();
|
||||
|
||||
if ($('#minDate').val().length)
|
||||
options.minDate = $('#minDate').val();
|
||||
|
||||
if ($('#maxDate').val().length)
|
||||
options.maxDate = $('#maxDate').val();
|
||||
|
||||
if ($('#opens').val().length && $('#opens').val() != 'right')
|
||||
options.opens = $('#opens').val();
|
||||
|
||||
if ($('#drops').val().length && $('#drops').val() != 'down')
|
||||
options.drops = $('#drops').val();
|
||||
|
||||
if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm')
|
||||
options.buttonClasses = $('#buttonClasses').val();
|
||||
|
||||
if ($('#applyClass').val().length && $('#applyClass').val() != 'btn-success')
|
||||
options.applyClass = $('#applyClass').val();
|
||||
|
||||
if ($('#cancelClass').val().length && $('#cancelClass').val() != 'btn-default')
|
||||
options.cancelClass = $('#cancelClass').val();
|
||||
|
||||
$('#config-text').val("$('#demo').daterangepicker(" + JSON.stringify(options, null, ' ') + ", function(start, end, label) {\n console.log(\"New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')\");\n});");
|
||||
|
||||
$('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); });
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,17 @@
|
|||
Package.describe({
|
||||
name: 'dangrossman:bootstrap-daterangepicker',
|
||||
version: '3.0.5',
|
||||
summary: 'Date range picker component',
|
||||
git: 'https://github.com/dangrossman/daterangepicker',
|
||||
documentation: 'README.md'
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.versionsFrom('METEOR@0.9.0.1');
|
||||
|
||||
api.use('momentjs:moment@2.22.1', ["client"]);
|
||||
api.use('jquery@3.3.1', ["client"]);
|
||||
|
||||
api.addFiles('daterangepicker.js', ["client"]);
|
||||
api.addFiles('daterangepicker.css', ["client"]);
|
||||
});
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "daterangepicker",
|
||||
"version": "3.0.5",
|
||||
"description": "Date range picker component for Bootstrap",
|
||||
"main": "daterangepicker.js",
|
||||
"style": "daterangepicker.css",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dangrossman/daterangepicker.git"
|
||||
},
|
||||
"author": {
|
||||
"name": "Dan Grossman",
|
||||
"email": "dan@dangrossman.info",
|
||||
"url": "http://www.dangrossman.info"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/dangrossman/daterangepicker/issues"
|
||||
},
|
||||
"homepage": "https://github.com/dangrossman/daterangepicker",
|
||||
"dependencies": {
|
||||
"jquery": ">=1.10",
|
||||
"moment": "^2.9.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,744 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Date Range Picker — JavaScript Date & Time Picker Library</title>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
||||
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/trianglify/0.2.1/trianglify.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="daterangepicker.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="daterangepicker.css" />
|
||||
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
|
||||
|
||||
<script src="website.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="website.css" />
|
||||
|
||||
<meta name="google-site-verification" content="1fP-Eo9i1ozV4MUlqZv2vsLv1r7tvYutUb6i38v0_vg" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-sm navbar-dark bg-dark" style="padding: 0; justify-content: space-between">
|
||||
<div class="container">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item" style="padding-left: 0"><a class="nav-link" href="/" style="color: #eeeeee"><i class="fa fa-calendar"></i> Date Range Picker</a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item"><a class="nav-link" href="https://www.improvely.com" style="color: #33beff"><i class="fa fa-chart-bar"></i> Improvely</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="https://www.w3counter.com" style="color: #ff9999"><i class="fa fa-chart-pie"></i> W3Counter</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="https://www.websitegoodies.com" style="color: #f49a16"><i class="fa fa-wrench"></i> Website Goodies</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div id="jumbo">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
|
||||
<h1 style="margin: 0 0 10px 0">Date Range Picker</h1>
|
||||
<p style="font-size: 18px; margin-bottom: 0">
|
||||
A JavaScript component for choosing date ranges,
|
||||
dates and times.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12" style="text-align: right; padding-right: 0">
|
||||
|
||||
<div style="margin-bottom: 10px; margin-right: 15px">
|
||||
<a href="https://github.com/dangrossman/daterangepicker" class="btn btn-light"><i class="fab fa-github-alt"></i> View on GitHub</a>
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/dangrossman/daterangepicker/archive/master.zip" class="btn btn-success"><i class="fas fa-download"></i> Download ZIP</a>
|
||||
</div>
|
||||
|
||||
<div style="margin-right: 0px">
|
||||
<iframe src="https://ghbtns.com/github-btn.html?user=dangrossman&repo=daterangepicker&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
|
||||
|
||||
<iframe src="https://ghbtns.com/github-btn.html?user=dangrossman&repo=daterangepicker&type=watch&count=true&size=large&v=2" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
|
||||
|
||||
<iframe src="https://ghbtns.com/github-btn.html?user=dangrossman&repo=daterangepicker&type=fork&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" style="padding: 0 30px" id="main">
|
||||
<div class="row">
|
||||
<div class="leftcol d-none d-lg-block d-xl-block">
|
||||
<div id="menu" class="list-group" style="margin-bottom: 10px">
|
||||
<a class="list-group-item" href="#usage">Getting Started</a>
|
||||
<a class="list-group-item" href="#examples">Examples</a>
|
||||
<a class="list-group-item" href="#options">Options, Methods & Events</a>
|
||||
<a class="list-group-item" href="#config">Configuration Generator</a>
|
||||
<a class="list-group-item" href="#license">License & Comments</a>
|
||||
</div>
|
||||
|
||||
<div style="width: 300px; min-width: 300px">
|
||||
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
||||
<!-- DRP Responsive -->
|
||||
<ins class="adsbygoogle"
|
||||
style="display:block"
|
||||
data-ad-client="ca-pub-9095657276960731"
|
||||
data-ad-slot="8963174596"
|
||||
data-ad-format="auto"></ins>
|
||||
<script>
|
||||
(adsbygoogle = window.adsbygoogle || []).push({});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="rightcol">
|
||||
|
||||
<p>Originally created for reports at <a href="https://www.improvely.com">Improvely</a>, the Date Range Picker can be attached to any webpage element to pop up two calendars for selecting dates, times, or predefined ranges like "Last 30 Days".</p>
|
||||
|
||||
<a style="display: block; height: 300px; background: url('drp.png') top right no-repeat; background-size: cover; border: 1px solid #ccc; margin-bottom: 30px" href="https://awio.iljmp.com/5/drpdemo" title="Click for a Live Demo"></a>
|
||||
|
||||
<h1><a id="usage" href="#usage">Getting Started</a></h1>
|
||||
|
||||
<p>
|
||||
To get started, include jQuery, Moment.js and Date Range Picker's files in your webpage:
|
||||
</p>
|
||||
|
||||
<script src="https://gist.github.com/dangrossman/4879503153c6a7a0b3b6ebd64e0383b7.js"></script>
|
||||
|
||||
<p style="margin-bottom: 10px">
|
||||
Then attach a date range picker to whatever you want to trigger it:
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<label>Code:</label>
|
||||
<script src="https://gist.github.com/dangrossman/f460cf1243d8ffb08c749730e89c2f3d.js"></script>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label>Produces:</label>
|
||||
<input type="text" name="dates" class="form-control pull-right" />
|
||||
<script>
|
||||
$(function() {
|
||||
$('input[name="dates"]').daterangepicker({ startDate: moment(), endDate: moment().add(2, 'day')});
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
You can customize Date Range Picker with options, and get notified when the user chooses new dates by providing a callback function.
|
||||
</p>
|
||||
|
||||
<h1><a id="examples" href="#examples">Examples</a></h1>
|
||||
|
||||
<!-- Example 1 -->
|
||||
<h2><a data-toggle="nothing" href="#example1">Simple Date Range Picker With a Callback</a></h2>
|
||||
<div class="collapsable" id="example1">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<label>Code:</label>
|
||||
<script src="https://gist.github.com/dangrossman/e118af4dbadc5177d7494dba9d3295d1.js"></script>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label>Produces:</label>
|
||||
<input type="text" name="daterange" class="form-control" value="1/01/2018 - 01/15/2018" />
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('input[name="daterange"]').daterangepicker({
|
||||
opens: 'left'
|
||||
}, function(start, end, label) {
|
||||
console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Example 2 -->
|
||||
<h2><a data-toggle="nothing" href="#example2">Date Range Picker With Times</a></h2>
|
||||
<div class="collapsable" id="example2">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<label>Code:</label>
|
||||
<script src="https://gist.github.com/dangrossman/14db17599e24652db7401ed2448eb91a.js"></script>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label>Produces:</label>
|
||||
<input type="text" name="datetimes" class="form-control pull-right" />
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('input[name="datetimes"]').daterangepicker({
|
||||
timePicker: true,
|
||||
startDate: moment().startOf('hour'),
|
||||
endDate: moment().startOf('hour').add(32, 'hour'),
|
||||
locale: {
|
||||
format: 'M/DD hh:mm A'
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Example 3 -->
|
||||
<h2><a data-toggle="nothing" href="#example3">Single Date Picker</a></h2>
|
||||
<div class="collapsable" id="example3">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<label>Code:</label>
|
||||
<script src="https://gist.github.com/dangrossman/98d8f1c304328c191b1ad33ac21354fd.js"></script>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label>Produces:</label>
|
||||
<input type="text" name="birthday" class="form-control pull-right" value="10/24/1984" />
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('input[name="birthday"]').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
maxYear: parseInt(moment().format('YYYY'),10)
|
||||
}, function(start, end, label) {
|
||||
var years = moment().diff(start, 'years');
|
||||
alert("You are " + years + " years old!");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Example 4 -->
|
||||
<h2><a data-toggle="nothing" href="#example4">Predefined Date Ranges</a></h2>
|
||||
<div class="collapsable" id="example4">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<label>Code:</label>
|
||||
<script src="https://gist.github.com/dangrossman/8c6747b82572bc860364f17258004dbb.js"></script>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label>Produces:</label>
|
||||
|
||||
<div id="reportrange" class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||
<i class="fa fa-calendar"></i>
|
||||
<span></span> <i class="fa fa-caret-down"></i>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
var start = moment().subtract(29, 'days');
|
||||
var end = moment();
|
||||
|
||||
function cb(start, end) {
|
||||
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
||||
}
|
||||
|
||||
$('#reportrange').daterangepicker({
|
||||
startDate: start,
|
||||
endDate: end,
|
||||
ranges: {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
}
|
||||
}, cb);
|
||||
|
||||
cb(start, end);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Example 5 -->
|
||||
<h2><a data-toggle="nothing" href="#example5">Input Initially Empty</a></h2>
|
||||
<div class="collapsable" id="example5">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<label>Code:</label>
|
||||
<script src="https://gist.github.com/dangrossman/d50376f3467f69e7fb5570afd07dc921.js"></script>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label>Produces:</label>
|
||||
<input type="text" name="datefilter" class="form-control pull-right" value="" />
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('input[name="datefilter"]').daterangepicker({
|
||||
autoUpdateInput: false,
|
||||
locale: {
|
||||
cancelLabel: 'Clear'
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name="datefilter"]').on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));
|
||||
});
|
||||
|
||||
$('input[name="datefilter"]').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 style="margin-top: 30px"><a id="options" href="#options">Options</a></h1>
|
||||
|
||||
<ul class="nobullets">
|
||||
<li>
|
||||
<code>startDate</code> (Date or string) The beginning date of the initially selected date range. If you provide a string, it must match the date format string set in your <code>locale</code> setting.
|
||||
</li>
|
||||
<li>
|
||||
<code>endDate</code>: (Date or string) The end date of the initially selected date range.
|
||||
</li>
|
||||
<li>
|
||||
<code>minDate</code>: (Date or string) The earliest date a user may select.
|
||||
</li>
|
||||
<li>
|
||||
<code>maxDate</code>: (Date or string) The latest date a user may select.
|
||||
</li>
|
||||
<li>
|
||||
<code>maxSpan</code>: (object) The maximum span between the selected start and end dates. Check off <code>maxSpan</code> in the configuration generator for an example of how to use this. You can provide any object the <code>moment</code> library would let you add to a date.
|
||||
</li>
|
||||
<li>
|
||||
<code>showDropdowns</code>: (true/false) Show year and month select boxes above calendars to jump to a specific month and year.
|
||||
</li>
|
||||
<li>
|
||||
<code>minYear</code>: (number) The minimum year shown in the dropdowns when <code>showDropdowns</code> is set to true.
|
||||
</li>
|
||||
<li>
|
||||
<code>maxYear</code>: (number) The maximum year shown in the dropdowns when <code>showDropdowns</code> is set to true.
|
||||
</li>
|
||||
<li>
|
||||
<code>showWeekNumbers</code>: (true/false) Show localized week numbers at the start of each week on the calendars.
|
||||
</li>
|
||||
<li>
|
||||
<code>showISOWeekNumbers</code>: (true/false) Show ISO week numbers at the start of each week on the calendars.
|
||||
</li>
|
||||
<li>
|
||||
<code>timePicker</code>: (true/false) Adds select boxes to choose times in addition to dates.
|
||||
</li>
|
||||
<li>
|
||||
<code>timePickerIncrement</code>: (number) Increment of the minutes selection list for times (i.e. 30 to allow only selection of times ending in 0 or 30).
|
||||
</li>
|
||||
<li>
|
||||
<code>timePicker24Hour</code>: (true/false) Use 24-hour instead of 12-hour times, removing the AM/PM selection.
|
||||
</li>
|
||||
<li>
|
||||
<code>timePickerSeconds</code>: (true/false) Show seconds in the timePicker.
|
||||
</li>
|
||||
<li>
|
||||
<code>ranges</code>: (object) Set predefined date ranges the user can select from. Each key is the label for the range, and its value an array with two dates representing the bounds of the range. Click <code>ranges</code> in the configuration generator for examples.
|
||||
</li>
|
||||
<li>
|
||||
<code>showCustomRangeLabel</code>: (true/false) Displays "Custom Range" at
|
||||
the end of the list of predefined ranges, when the <code>ranges</code> option is used.
|
||||
This option will be highlighted whenever the current date range selection does not match one of the predefined ranges. Clicking it will display the calendars to select a new range.
|
||||
</li>
|
||||
<li>
|
||||
<code>alwaysShowCalendars</code>: (true/false) Normally, if you use the <code>ranges</code> option to specify pre-defined date ranges, calendars for choosing a custom date range are not shown until the user clicks "Custom Range". When this option is set to true, the calendars for choosing a custom date range are always shown instead.
|
||||
</li>
|
||||
<li>
|
||||
<code>opens</code>: ('left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to.
|
||||
</li>
|
||||
<li>
|
||||
<code>drops</code>: ('down'/'up') Whether the picker appears below (default) or above the HTML element it's attached to.
|
||||
</li>
|
||||
<li>
|
||||
<code>buttonClasses</code>: (string) CSS class names that will be added to both the apply and cancel buttons.
|
||||
</li>
|
||||
<li>
|
||||
<code>applyButtonClasses</code>: (string) CSS class names that will be added only to the apply button.
|
||||
</li>
|
||||
<li>
|
||||
<code>cancelButtonClasses</code>: (string) CSS class names that will be added only to the cancel button.
|
||||
</li>
|
||||
<li>
|
||||
<code>locale</code>: (object) Allows you to provide localized strings for buttons and labels, customize the date format, and change the first day of week for the calendars.
|
||||
Check off <code>locale</code> in the configuration generator to see how
|
||||
to customize these options.
|
||||
</li>
|
||||
<li>
|
||||
<code>singleDatePicker</code>: (true/false) Show only a single calendar to choose one date, instead of a range picker with two calendars. The start and end dates provided to your callback will be the same single date chosen.
|
||||
</li>
|
||||
<li>
|
||||
<code>autoApply</code>: (true/false) Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates are clicked.
|
||||
</li>
|
||||
<li>
|
||||
<code>linkedCalendars</code>: (true/false) When enabled, the two calendars displayed will always be for two sequential months (i.e. January and February), and both will be advanced when clicking the left or right arrows above the calendars. When disabled, the two calendars can be individually advanced and display any month/year.
|
||||
</li>
|
||||
<li>
|
||||
<code>isInvalidDate</code>: (function) A function that is passed each date in the two
|
||||
calendars before they are displayed, and may return true or false to indicate whether
|
||||
that date should be available for selection or not.
|
||||
</li>
|
||||
<li>
|
||||
<code>isCustomDate</code>: (function) A function that is passed each date in the two
|
||||
calendars before they are displayed, and may return a string or array of CSS class names
|
||||
to apply to that date's calendar cell.
|
||||
</li>
|
||||
<li>
|
||||
<code>autoUpdateInput</code>: (true/false) Indicates whether the date range picker should
|
||||
automatically update the value of the <code><input></code> element it's attached to at initialization and when the selected dates change.
|
||||
</li>
|
||||
<li>
|
||||
<code>parentEl</code>: (string) jQuery selector of the parent element that the date range picker will be added to, if not provided this will be 'body'
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h1 style="margin-top: 30px"><a id="methods" href="#methods">Methods</a></h1>
|
||||
|
||||
<p>
|
||||
You can programmatically update the <code>startDate</code> and <code>endDate</code>
|
||||
in the picker using the <code>setStartDate</code> and <code>setEndDate</code> methods.
|
||||
You can access the Date Range Picker object and its functions and properties through
|
||||
data properties of the element you attached it to.
|
||||
</p>
|
||||
|
||||
<script src="https://gist.github.com/dangrossman/8ff9b1220c9b5682e8bd.js"></script>
|
||||
|
||||
<br/>
|
||||
|
||||
<ul class="nobullets">
|
||||
<li>
|
||||
<code>setStartDate(Date or string)</code>: Sets the date range picker's currently selected start date to the provided date
|
||||
</li>
|
||||
<li>
|
||||
<code>setEndDate(Date or string)</code>: Sets the date range picker's currently selected end date to the provided date
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p style="margin: 0"><b>Example usage:</b></p>
|
||||
|
||||
<script src="https://gist.github.com/dangrossman/e1a8effbaeacb50a1e31.js"></script>
|
||||
|
||||
<h1 style="margin-top: 30px"><a id="events" href="#events">Events</a></h1>
|
||||
|
||||
<p>
|
||||
Several events are triggered on the element you attach the picker to, which you can listen for.
|
||||
</p>
|
||||
|
||||
<ul class="nobullets">
|
||||
<li>
|
||||
<code>show.daterangepicker</code>: Triggered when the picker is shown
|
||||
</li>
|
||||
<li>
|
||||
<code>hide.daterangepicker</code>: Triggered when the picker is hidden
|
||||
</li>
|
||||
<li>
|
||||
<code>showCalendar.daterangepicker</code>: Triggered when the calendar(s) are shown
|
||||
</li>
|
||||
<li>
|
||||
<code>hideCalendar.daterangepicker</code>: Triggered when the calendar(s) are hidden
|
||||
</li>
|
||||
<li>
|
||||
<code>apply.daterangepicker</code>: Triggered when the apply button is clicked,
|
||||
or when a predefined range is clicked
|
||||
</li>
|
||||
<li>
|
||||
<code>cancel.daterangepicker</code>: Triggered when the cancel button is clicked
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Some applications need a "clear" instead of a "cancel" functionality, which can be achieved by changing the button label and watching for the cancel event:
|
||||
</p>
|
||||
|
||||
<script src="https://gist.github.com/dangrossman/1bea78da703f2896564d.js"></script>
|
||||
|
||||
<br/>
|
||||
|
||||
<p>
|
||||
While passing in a callback to the constructor is the easiest way to listen for changes in the selected date range, you can also do something every time the apply button is clicked even if the selection hasn't changed:
|
||||
</p>
|
||||
|
||||
<script src="https://gist.github.com/dangrossman/0c6c911fea1459b5fd13.js"></script>
|
||||
|
||||
<h1 style="margin-top: 30px"><a id="config" href="#config">Configuration Generator</a></h1>
|
||||
|
||||
<div class="well configurator">
|
||||
|
||||
<form>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parentEl">parentEl</label>
|
||||
<input type="text" class="form-control" id="parentEl" value="" placeholder="body">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="startDate">startDate</label>
|
||||
<input type="text" class="form-control" id="startDate" value="07/01/2017">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="endDate">endDate</label>
|
||||
<input type="text" class="form-control" id="endDate" value="07/15/2017">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="minDate">minDate</label>
|
||||
<input type="text" class="form-control" id="minDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="maxDate">maxDate</label>
|
||||
<input type="text" class="form-control" id="maxDate" value="" placeholder="MM/DD/YYYY">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="opens">opens</label>
|
||||
<select id="opens" class="form-control">
|
||||
<option value="right" selected>right</option>
|
||||
<option value="left">left</option>
|
||||
<option value="center">center</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="drops">drops</label>
|
||||
<select id="drops" class="form-control">
|
||||
<option value="down" selected>down</option>
|
||||
<option value="up">up</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showDropdowns"> showDropdowns
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="minYear">minYear</label>
|
||||
<input type="text" class="form-control" id="minYear" value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="maxYear">maxYear</label>
|
||||
<input type="text" class="form-control" id="maxYear" value="">
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showWeekNumbers"> showWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showISOWeekNumbers"> showISOWeekNumbers
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="singleDatePicker"> singleDatePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker"> timePicker
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePicker24Hour"> timePicker24Hour
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="timePickerIncrement">timePickerIncrement (in minutes)</label>
|
||||
<input type="text" class="form-control" id="timePickerIncrement" value="1">
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="timePickerSeconds"> timePickerSeconds
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="maxSpan"> maxSpan (example value)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="locale"> locale (example settings)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoApply"> autoApply
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="buttonClasses">buttonClasses</label>
|
||||
<input type="text" class="form-control" id="buttonClasses" value="btn btn-sm">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="applyButtonClasses">applyButtonClasses</label>
|
||||
<input type="text" class="form-control" id="applyButtonClasses" value="btn-primary">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cancelButtonClasses">cancelButtonClasses</label>
|
||||
<input type="text" class="form-control" id="cancelButtonClasses" value="btn-default">
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="ranges"> ranges (with example predefined ranges)
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="alwaysShowCalendars"> alwaysShowCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="showCustomRangeLabel" checked="checked"> showCustomRangeLabel
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="linkedCalendars" checked="checked"> linkedCalendars
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="autoUpdateInput" checked="checked"> autoUpdateInput
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-4 demo">
|
||||
<div style="position: relative">
|
||||
<h2 style="margin-bottom: 15px">Your Date Range Picker</h2>
|
||||
<input type="text" id="config-demo" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<h2 style="margin-bottom: 15px">Your Configuration to Copy</h2>
|
||||
|
||||
<div class="well">
|
||||
<textarea id="config-text" style="height: 300px; width: 100%; padding: 10px"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- License -->
|
||||
|
||||
<h1 style="margin-top: 30px"><a id="license" href="#license">License</a></h1>
|
||||
|
||||
<p>The MIT License (MIT)</p>
|
||||
|
||||
<p>Copyright (c) 2012-2019 <a href="http://www.dangrossman.info">Dan Grossman</a></p>
|
||||
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
</p>
|
||||
|
||||
<h1 style="margin-top: 30px"><a id="config" href="#comments">Comments</a></h1>
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_url = 'http://www.dangrossman.info/2012/08/20/a-date-range-picker-for-twitter-bootstrap/';
|
||||
var disqus_identifier = '1045 http://www.dangrossman.info/?p=1045';
|
||||
var disqus_container_id = 'disqus_thread';
|
||||
var disqus_shortname = 'dangrossman';
|
||||
var disqus_title = "A Date Range Picker for Bootstrap";
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Begin W3Counter Tracking Code -->
|
||||
<script type="text/javascript" src="https://www.w3counter.com/tracker.js?id=90840"></script>
|
||||
<!-- End W3Counter Tracking Code -->
|
||||
|
||||
<script type="text/javascript">
|
||||
var im_domain = 'awio';
|
||||
var im_project_id = 48;
|
||||
(function(e,t){window._improvely=[];var n=e.getElementsByTagName("script")[0];var r=e.createElement("script");r.type="text/javascript";r.src="https://"+im_domain+".iljmp.com/improvely.js";r.async=true;n.parentNode.insertBefore(r,n);if(typeof t.init=="undefined"){t.init=function(e,t){window._improvely.push(["init",e,t])};t.goal=function(e){window._improvely.push(["goal",e])};t.conversion=function(e){window._improvely.push(["conversion",e])};t.label=function(e){window._improvely.push(["label",e])}}window.improvely=t;t.init(im_domain,im_project_id)})(document,window.improvely||[])
|
||||
</script>
|
||||
|
||||
<div id="footer">
|
||||
Copyright © 2012-2018 <a href="http://www.dangrossman.info/">Dan Grossman</a>.
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
body {
|
||||
font-size: 15px;
|
||||
line-height: 1.6em;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.navbar .nav-item {
|
||||
padding: 8px 0 8px 20px;
|
||||
}
|
||||
|
||||
.navbar .nav-link {
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.navbar-expand-sm .navbar-nav .nav-link {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.well {
|
||||
background: #f5f5f5;
|
||||
border-radius: 4px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
margin-bottom: 1em;
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 1px dotted #08c;
|
||||
}
|
||||
|
||||
h1:before {
|
||||
content: '#';
|
||||
color: #666;
|
||||
position: relative;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
padding: 0;
|
||||
margin: 20px 0 0 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
h2 a {
|
||||
color: #444;
|
||||
display: block;
|
||||
background: #eee;
|
||||
padding: 8px 12px;
|
||||
margin-bottom: 0;
|
||||
cursor: default;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
input.form-control {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.collapsable {
|
||||
border: 1px solid #eee;
|
||||
padding: 12px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.gist {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.gist .blob-wrapper.data {
|
||||
max-height: 350px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.list-group-item {
|
||||
padding: 4px 0;
|
||||
border: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.leftcol {
|
||||
position: absolute;
|
||||
top: 180px;
|
||||
}
|
||||
|
||||
.rightcol {
|
||||
max-width: 950px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1300px;
|
||||
}
|
||||
|
||||
@media (min-width: 980px) {
|
||||
.rightcol {
|
||||
margin-left: 320px;
|
||||
}
|
||||
}
|
||||
|
||||
p, pre {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
ul.nobullets {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
ul.nobullets li {
|
||||
padding-bottom: 1em;
|
||||
margin-bottom: 1em;
|
||||
border-bottom: 1px dotted #ddd;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
padding: 6px;
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
background: #222;
|
||||
margin-top: 80px;
|
||||
padding: 10px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
#footer a:link, #footer a:visited {
|
||||
color: #fff;
|
||||
border-bottom: 1px dotted #fff;
|
||||
}
|
||||
#jumbo {
|
||||
background: #c1deef;
|
||||
color: #000;
|
||||
padding: 20px 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#jumbo h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
#jumbo .btn {
|
||||
border-radius: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
|
@ -0,0 +1,179 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
$('#config-text').keyup(function() {
|
||||
eval($(this).val());
|
||||
});
|
||||
|
||||
$('.configurator input, .configurator select').change(function() {
|
||||
updateConfig();
|
||||
});
|
||||
|
||||
$('.demo i').click(function() {
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
$('#startDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment().subtract(6, 'days')
|
||||
});
|
||||
|
||||
$('#endDate').daterangepicker({
|
||||
singleDatePicker: true,
|
||||
startDate: moment()
|
||||
});
|
||||
|
||||
//updateConfig();
|
||||
|
||||
function updateConfig() {
|
||||
var options = {};
|
||||
|
||||
if ($('#singleDatePicker').is(':checked'))
|
||||
options.singleDatePicker = true;
|
||||
|
||||
if ($('#showDropdowns').is(':checked'))
|
||||
options.showDropdowns = true;
|
||||
|
||||
if ($('#minYear').val().length && $('#minYear').val() != 1)
|
||||
options.minYear = parseInt($('#minYear').val(), 10);
|
||||
|
||||
if ($('#maxYear').val().length && $('#maxYear').val() != 1)
|
||||
options.maxYear = parseInt($('#maxYear').val(), 10);
|
||||
|
||||
if ($('#showWeekNumbers').is(':checked'))
|
||||
options.showWeekNumbers = true;
|
||||
|
||||
if ($('#showISOWeekNumbers').is(':checked'))
|
||||
options.showISOWeekNumbers = true;
|
||||
|
||||
if ($('#timePicker').is(':checked'))
|
||||
options.timePicker = true;
|
||||
|
||||
if ($('#timePicker24Hour').is(':checked'))
|
||||
options.timePicker24Hour = true;
|
||||
|
||||
if ($('#timePickerIncrement').val().length && $('#timePickerIncrement').val() != 1)
|
||||
options.timePickerIncrement = parseInt($('#timePickerIncrement').val(), 10);
|
||||
|
||||
if ($('#timePickerSeconds').is(':checked'))
|
||||
options.timePickerSeconds = true;
|
||||
|
||||
if ($('#autoApply').is(':checked'))
|
||||
options.autoApply = true;
|
||||
|
||||
if ($('#maxSpan').is(':checked'))
|
||||
options.maxSpan = { days: 7 };
|
||||
|
||||
if ($('#ranges').is(':checked')) {
|
||||
options.ranges = {
|
||||
'Today': [moment(), moment()],
|
||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
};
|
||||
}
|
||||
|
||||
if ($('#locale').is(':checked')) {
|
||||
options.locale = {
|
||||
format: 'MM/DD/YYYY',
|
||||
separator: ' - ',
|
||||
applyLabel: 'Apply',
|
||||
cancelLabel: 'Cancel',
|
||||
fromLabel: 'From',
|
||||
toLabel: 'To',
|
||||
customRangeLabel: 'Custom',
|
||||
weekLabel: 'W',
|
||||
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
|
||||
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
||||
firstDay: 1
|
||||
};
|
||||
}
|
||||
|
||||
if (!$('#linkedCalendars').is(':checked'))
|
||||
options.linkedCalendars = false;
|
||||
|
||||
if (!$('#autoUpdateInput').is(':checked'))
|
||||
options.autoUpdateInput = false;
|
||||
|
||||
if (!$('#showCustomRangeLabel').is(':checked'))
|
||||
options.showCustomRangeLabel = false;
|
||||
|
||||
if ($('#alwaysShowCalendars').is(':checked'))
|
||||
options.alwaysShowCalendars = true;
|
||||
|
||||
if ($('#parentEl').val().length)
|
||||
options.parentEl = $('#parentEl').val();
|
||||
|
||||
if ($('#startDate').val().length)
|
||||
options.startDate = $('#startDate').val();
|
||||
|
||||
if ($('#endDate').val().length)
|
||||
options.endDate = $('#endDate').val();
|
||||
|
||||
if ($('#minDate').val().length)
|
||||
options.minDate = $('#minDate').val();
|
||||
|
||||
if ($('#maxDate').val().length)
|
||||
options.maxDate = $('#maxDate').val();
|
||||
|
||||
if ($('#opens').val().length && $('#opens').val() != 'right')
|
||||
options.opens = $('#opens').val();
|
||||
|
||||
if ($('#drops').val().length && $('#drops').val() != 'down')
|
||||
options.drops = $('#drops').val();
|
||||
|
||||
if ($('#buttonClasses').val().length && $('#buttonClasses').val() != 'btn btn-sm')
|
||||
options.buttonClasses = $('#buttonClasses').val();
|
||||
|
||||
if ($('#applyButtonClasses').val().length && $('#applyButtonClasses').val() != 'btn-primary')
|
||||
options.applyButtonClasses = $('#applyButtonClasses').val();
|
||||
|
||||
if ($('#cancelButtonClasses').val().length && $('#cancelButtonClasses').val() != 'btn-default')
|
||||
options.cancelClass = $('#cancelButtonClasses').val();
|
||||
|
||||
$('#config-demo').daterangepicker(options, function(start, end, label) { console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')'); });
|
||||
|
||||
if (typeof options.ranges !== 'undefined') {
|
||||
options.ranges = {};
|
||||
}
|
||||
|
||||
var option_text = JSON.stringify(options, null, ' ');
|
||||
|
||||
var replacement = "ranges: {\n"
|
||||
+ " 'Today': [moment(), moment()],\n"
|
||||
+ " 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n"
|
||||
+ " 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n"
|
||||
+ " 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n"
|
||||
+ " 'This Month': [moment().startOf('month'), moment().endOf('month')],\n"
|
||||
+ " 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n"
|
||||
+ " }";
|
||||
option_text = option_text.replace(new RegExp('"ranges"\: \{\}', 'g'), replacement);
|
||||
|
||||
$('#config-text').val("$('#demo').daterangepicker(" + option_text + ", function(start, end, label) {\n console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');\n});");
|
||||
|
||||
}
|
||||
|
||||
$(window).scroll(function (event) {
|
||||
var scroll = $(window).scrollTop();
|
||||
if (scroll > 180) {
|
||||
$('.leftcol').css('position', 'fixed');
|
||||
$('.leftcol').css('top', '10px');
|
||||
} else {
|
||||
$('.leftcol').css('position', 'absolute');
|
||||
$('.leftcol').css('top', '180px');
|
||||
}
|
||||
});
|
||||
|
||||
var bg = new Trianglify({
|
||||
x_colors: ["#e1f3fd", "#eeeeee", "#407dbf"],
|
||||
y_colors: 'match_x',
|
||||
width: document.body.clientWidth,
|
||||
height: 150,
|
||||
stroke_width: 0,
|
||||
cell_size: 20
|
||||
});
|
||||
|
||||
$('#jumbo').css('background-image', 'url(' + bg.png() + ')');
|
||||
|
||||
});
|
||||
|
|
@ -53,13 +53,15 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editVendorModal<?php echo $vendor_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_vendor=<?php echo $vendor_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include("edit_vendor_modal.php"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
include("edit_vendor_modal.php");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
|
|
|||
Loading…
Reference in New Issue