From becab02bcede401f78e8af5d751920525e35a18e Mon Sep 17 00:00:00 2001 From: sonnysk76 Date: Tue, 17 May 2016 12:19:13 -0500 Subject: [PATCH 1/4] lang1 esp --- translations/common_lang.csv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translations/common_lang.csv b/translations/common_lang.csv index 4e8ce61a0..1912c1452 100644 --- a/translations/common_lang.csv +++ b/translations/common_lang.csv @@ -23,7 +23,7 @@ common_gender_male,Ffi,M,M,M,M,M,M,M,ชาย,M,M,M,M common_inv,lelt.,Lag,stock,inv,inv,inv,庫存,инв,ยอด,Stok,Persediaan,inv,lelt. common_last_name,Keresztnév,Nachname,Achternaam,Apellidos,Last Name,Nom,姓,Фамилия,นามสกุล,Soy İsim,Nama Belakang,Sobrenome,Prezime common_last_name_required,A keresztnév kötelező mező,Nachname ist erforderlich,De achternaam moet ingevuld worden.,Apellidos es un campo requerido,The last name is a required field,Le nom est requis,姓氏為必填,Фамилия обязательный пробел,นามสกุลต้องกรอก,Soy isim zorunlu alandır.,Nama belakang wajib diisi.,O sobrenome é requerido,Prezime je obavezno -common_last_page,Utolsó,Letzte,Laatste,�ltima,Last,Last,Last,Last,Last,Last,Last,Última,Zadnja +common_last_page,Utolsó,Letzte,Laatste,Ultima,Last,Last,Last,Last,Last,Last,Last,Última,Zadnja common_learn_about_project,a legfrissebb információkért a projekttel kapcsolatban.,für neueste Nachrichten zum Projekt,om de laatste informatie te verkrijgen over het project,para leer la información más reciente acerca del proyecto,to learn the latest information about the project,pour les dernières informations sur le projet,了解系統開展進度,", чтобы узнать самую последнюю информацию о проекте",เพื่อศึกษาข้อมูลล่าสุดของโครงการ, ,Untuk belajar informasi terbaru tentang proyek ini,para saber mais do projeto,za pregled zadnjih informacija o projektu common_list_of,Lista: ,Liste von,Lijst van,Lista de,List of,Liste de,列表,Список,รายการ,Liste,Daftar,Lista de,Lista common_logout,Kilépés,Logout,Logout,Salir,Logout,Déconnion,登出,Выход,ออกจากระบบ,Çıkış,Keluar,Sair,Odjava @@ -52,10 +52,10 @@ common_import,Import,Import,Import,Importar,Import,Import,Import,Import,นำ common_download_import_template,Excel sablon (CSV) letöltése,Download Import Excel Voralge (CSV),Download Import Excel Template (CSV),Descargar Plantilla de Importación de Excel (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Download Import Excel Template (CSV),Baixar Modelo de importação Excel(CSV),Preuzmite predložak za uvoz(CSV) common_import_excel,Excel Import,Excel Import,Excel Import,Importar Excel,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import,Excel Import,Importar do Excel,Excel uvoz common_import_full_path,A teljes elérési út kötelező,Voller Dateipfad zum Excel File notwendig,Full path to excel file required,Requerida la ruta completa del archivo,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Full path to excel file required,Caminho completo para o arquivo do Excel é necessário,Potrebna je potpuna putanja do excel datoteke -common_import_select_file,Fájl kiválasztása,Select file,Select file,Select file,Select file,Select file,Select file,Select file,Select file,Select file,Select file,Selecionar o arquivo,Odaberite datoteku -common_import_change_file,Változtat,Change,Change,Change,Change,Change,Change,Change,Change,Change,Change,Requerido,Promjena -common_import_remove_file,Eltávolít,Remove,Remove,Remove,Remove,Remove,Remove,Remove,Remove,Remove,Remove,Remover,Ukloni -common_export_excel,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Exportar para Excel,Excel izvoz -common_export_excel_yes,Igen,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Sim,Da +common_import_select_file,Fájl kiválasztása,Select file,Select file,Seleccionar archivo,Select file,Select file,Select file,Select file,Select file,Select file,Select file,Selecionar o arquivo,Odaberite datoteku +common_import_change_file,Változtat,Change,Change,Cambiar,Change,Change,Change,Change,Change,Change,Change,Requerido,Promjena +common_import_remove_file,Eltávolít,Remove,Remove,Eliminar,Remove,Remove,Remove,Remove,Remove,Remove,Remove,Remover,Ukloni +common_export_excel,Excel Export,Excel Export,Excel Export,Reporte en Excel,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Excel Export,Exportar para Excel,Excel izvoz +common_export_excel_yes,Igen,Yes,Yes,Si,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Sim,Da common_export_excel_no,Nem,No,No,No,No,No,No,No,No,No,No,Não,Ne common_required,Kötelező,Erforderlich,Required,Requerido,Required,Required,Required,Required,ต้องกรอก,Required,Required,Requerido,Potreban From bde97b3ec8f58acb0af8c4383c5ead29e6a7dbbd Mon Sep 17 00:00:00 2001 From: sonnysk76 Date: Tue, 17 May 2016 13:48:01 -0500 Subject: [PATCH 2/4] Update languaje ES on csv --- translations/config_lang.csv | 48 ++++++++++++++++---------------- translations/customers_lang.csv | 2 +- translations/datepicker_lang.csv | 16 +++++------ translations/employees_lang.csv | 2 +- translations/items_lang.csv | 12 ++++---- translations/messages_lang.csv | 24 ++++++++-------- translations/module_lang.csv | 4 +-- translations/reports_lang.csv | 8 +++--- translations/sales_lang.csv | 12 ++++---- translations/suppliers_lang.csv | 2 +- 10 files changed, 65 insertions(+), 65 deletions(-) diff --git a/translations/config_lang.csv b/translations/config_lang.csv index fb4673bb9..96de32ec0 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -27,14 +27,14 @@ config_barcode_width,Szélesség (px),Breite (px),Breedte (px),Ancho (px),Width config_barcode_generate_if_empty,Generáljon ha üres,Generiere Barcode wenn leer,Genereer indien leeg,Generate if empty,Generate if empty,Generate if empty,Generate if empty,Generate if empty,Generate if empty,Generate if empty,Generate if empty,Gerar se vazio,Generiraj ako je prazno config_company,Cégnév,Firmenname,Bedrijfsnaam,Nombre del Comercio,Company Name,Nome de l'Entreprise,公司名稱,Название Компании,ชื่อร้านค้า,Şirket Adı,Nama Perusahaan,Nome da empresa é um campo obrigatório,Naziv tvrtke config_company_logo,Cég logó,Logo,Logo,Logotipo del Comercio,Company Logo,Company Logo,Company Logo,Company Logo,ภาพโลโก้,Company Logo,Company Logo,Logo,Logo tvrtke -config_company_select_image,Kép kiválasztása,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Selecionar imagem,Odaberi logo -config_company_change_image,Kép cseréje,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Trocar imagem,Promijeni logo -config_company_remove_image,Kép eltávolítása,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remover imagem,Ukloni logo +config_company_select_image,Kép kiválasztása,Select Image,Select Image,Selecciona Imagen,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Selecionar imagem,Odaberi logo +config_company_change_image,Kép cseréje,Change Image,Change Image,Cambiar Imagen,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Trocar imagem,Promijeni logo +config_company_remove_image,Kép eltávolítása,Remove Image,Remove Image,Quitar Imagen,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remover imagem,Ukloni logo config_company_required,Cégnév kötelező mező,Firmenname ist erforderlich,De bedrijfsnaam moet ingevuld worden,Nombre del Comercio es requerido,Company name is a required field,Le nom d'entreprise est requis,公司名稱為必填,Имя Компании обязательный пробел,ชื่อร้านค้าต้องกรอก,Şirket Adı zorunlu alandır,Nama Perusahaan wajib diisi,Nome da empresa é requerido,Polje naziv tvrtke je potreban config_company_website_url,A cég webcime nem érvényes URL (http://...),Webseite ist nicht in korrektem Format,De website van het bedrijf is geen geldige URL (http://...),Sitio Web no es una URL estándar (http://...),Company website is not a valid URL (http://...),Le site web de l'entreprise n'est pas une URL valide (http://...),公司網址格式錯誤 (http://...),Веб-сайт Компании не является допустимым URL (http://...),เว็บไซต์ร้านค้าไม่ถูกต้อง,website adresi yanlış (http://...),Situs Perusahaan bukan URL yang benar(http://...),Site da empresa não é uma URL válida (http: // ...),Adresa web stranice nije valjana (http://...) config_currency_side,Jobb oldal,Pos. rechts,Rechterkant,Lado derecho,Right side,Symbole à droite,Right side,Правая сторона,ด้านขวา,Sağda,Sisi Kanan,Lado Direito,Desna strana config_currency_symbol,Pénznem,Währungssymbol,Valuta,Símbolo de moneda,Currency Symbol,Symbole Monétaire,貨幣符號,Символ валюты,สัญลักษณ์ค่าเงิน,Para Birimi,Simbol Mata Uang,Simbolo moeda,Valutna oznaka -config_currency_decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Decimais moeda,Velutne decimale +config_currency_decimals,Currency Decimals,Currency Decimals,Currency Decimals,Decimales de Moneda,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Currency Decimals,Decimais moeda,Velutne decimale config_custom1,Egyedi mező 1,Zusatzfeld 1,Custom Veld 1,Campo Libre 1,Custom Field 1,Champ Personnalisé 1,Custom Field 1,Изготовленный пробел 1,พื้นที่เพิ่มเติม 1,Özel Alan 1,Custom Field 1,Campo customizado 1,Korisničko polje1 config_custom10,Egyedi mező 10,Zusatzfeld 10,Custom Veld 10,Campo Libre 10,Custom Field 10,Champ Personnalisé 10,Custom Field 10,Изготовленный пробел 10,พื้นที่เพิ่มเติม 10,Özel Alan 10,Custom Field 10,Campo customizado 10,Korisničko polje10 config_custom2,Egyedi mező 2,Zusatzfeld 2,Custom Veld 2,Campo Libre 2,Custom Field 2,Champ Personnalisé 2,Custom Field 2,Изготовленный пробел 2,พื้นที่เพิ่มเติม 2,Özel Alan 2,Custom Field 2,Campo customizado 2,Korisničko polje2 @@ -77,7 +77,7 @@ config_info_configuration,Bolt információk,Instellungen,Instellingen,Informaci config_invoice,Számla,Rechnungs,Factuur,Factura,Invoice,Invoice,Invoice,Invoice,Invoice,Invoice,Invoice,Fatura,Račun config_invoice_configuration,Nyomtatási beállitások,Druckereinstellungen,Print Instellingen,Parámetros de Impresión,Invoice Print Settings,Invoice Print Settings,Invoice Print Settings,Invoice Print Settings,Invoice Print Settings,Invoice Print Settings,Invoice Print Settings,Configuração de Impressão,Postavke štamapnja config_invoice_default_comments,Alapértelmezett számla kommentek,Rechnungskommentar,Factuur Mededeling,Comentarios predeterminados en la factura,Default Invoice Comments,Default Invoice Comments,Default Invoice Comments,Default Invoice Comments,Default Invoice Comments,Default Invoice Comments,Default Invoice Comments,Comentário,Komentar na računu -config_invoice_enable,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Habilitar faturamento,Enable Invoicing +config_invoice_enable,Enable Invoicing,Enable Invoicing,Enable Invoicing,Activar Facturacion,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Enable Invoicing,Habilitar faturamento,Enable Invoicing config_invoice_email_message,Email számla sablon,Rechnungsvorlage (Email),Invoice Email Template,Plantilla de Factura por Email,Invoice Email Template,Invoice Email Template,Invoice Email Template,Invoice Email Template,Invoice Email Template,Invoice Email Template,Invoice Email Template,Modelo de e-mail Fatura,e-mail za račun config_invoice_printer,Számla nyomtató,Rechnungsdrucker,Factuur Printer,Impresora de Factura,Invoice Printer,Invoice Printer,Invoice Printer,Invoice Printer,Invoice Printer,Invoice Printer,Invoice Printer,Imprimir fatura,Printer za račun config_jsprintsetup_required,"Figyelem! Ez a letiltott funkció csak akkor működik megfelelően, ha a FireFox jsPrintSetup kiegészítő telepítve van. Menti mindezek tudatában?",Warnung! Diese Funktion ist nur funktionsfähig,Opgelet! De uitgeschakelde functionaliteit werkt enkel met de jsPrintSetup addon in Firefox.,Advertencia!Esta funcionalidad desactivada solo funciona con el addon jsPrintSetup de FireFox instalado. Guardar de todas formas?,Warning! This disabled functionality will only work if you have the FireFox jsPrintSetup addon installed. Save anyway?,Warning! This disabled functionality will only work if you have the FireFox jsPrintSetup addon installed. Save anyway?,Warning! This disabled functionality will only work if you have the FireFox jsPrintSetup addon installed. Save anyway?,Warning! This disabled functionality will only work if you have the FireFox jsPrintSetup addon installed. Save anyway?,Warning! This disabled functionality will only work if you have the FireFox jsPrintSetup addon installed. Save anyway?,Warning! This disabled functionality will only work if you have the FireFox jsPrintSetup addon installed. Save anyway?,Warning! This disabled functionality will only work if you have the FireFox jsPrintSetup addon installed. Save anyway?,Aviso! Esta funcionalidade só irá funcionar se você tem o addon FireFox jsPrintSetup instalado. Salvar de qualquer maneira?,Upozorenje! Onemogućene opcije će raditi samo ako imate instaliran FireFox jsPrintSetup dodatak. Svakako snimiti? @@ -85,23 +85,23 @@ config_language,Nyelv,Sprache,Taal,Idioma,Language,Langue,語言,Язик,ภา config_lines_per_page,Sorok száma oldalanként,Zeilen pro Seite,Lijnen Per Pagina,Líneas por página,Lines Per Page,Lines Per Page,Lines Per Page,Lines Per Page,Lines Per Page,Lines Per Page,Lines Per Page,Linhas por página,Linija po stranici config_lines_per_page_number,A sorok száma oldalanként kötelező mező,Zeilen pro Seite muss eine Zahl sein,The lines per page must be a number,Líneas por página debe ser un número,,The lines per page must be a number,The lines per page must be a number,The lines per page must be a number,The lines per page must be a number,The lines per page must be a number,The lines per page must be a number,Linhas por página deve ser um número,Linija po stranici mora biti broj config_lines_per_page_required,A sor per oldal kötelező mező,Zeilen pro Seite ist erforderlich,The lines per page is a required field,Líneas por página es requerido,The lines per page is a required field,The lines per page is a required field,The lines per page is a required field,The lines per page is a required field,The lines per page is a required field,The lines per page is a required field,The lines per page is a required field,As linhas por página é um campo obrigatório,Broj linija po stranici je potreban podatak -config_locale,Lokalizációs,Länder,Localisation,Localisation,Localisation,Localisation,Localisation,Localisation,ตั้งค่าภาษา,Localisation,Localisation,Localização,Lokacija -config_locale_configuration,Lokalizációs beállitások,Länderkonfiguration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,ตั้งค่าภาษา,Localisation Configuration,Localisation Configuration,Configuração de Localização,Konfiguracija -config_locale_info,Lokalizációs beállitási információk,Info Länderkonfiguration,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Informações da Configuração de Localização,Informacije o lokalnoj konfiguraciji +config_locale,Lokalizációs,Länder,Localisation,Ubicacion,Localisation,Localisation,Localisation,Localisation,ตั้งค่าภาษา,Localisation,Localisation,Localização,Lokacija +config_locale_configuration,Lokalizációs beállitások,Länderkonfiguration,Localisation Configuration,Configuracion de la Ubicacion,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,ตั้งค่าภาษา,Localisation Configuration,Localisation Configuration,Configuração de Localização,Konfiguracija +config_locale_info,Lokalizációs beállitási információk,Info Länderkonfiguration,Localisation Configuration Information,Informacion de la Configuracion de la Ubicacion,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Informações da Configuração de Localização,Informacije o lokalnoj konfiguraciji config_location,Készlet,Lagerort,Stock,Inventario,Stock,Stock,Stock,Stock,Stock,Stock,Stock,Estoque,Skladišta config_location_configuration,Készlet helye,Lagerort,Stock Locaties,Ubicación de Inventario,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Stock Locations,Localização do Estoque,Mjesto skladišta config_location_info,Helyszin konfigurációs információk,Lagerort-Information,Instellingen Locatie,Información de Configuración de Ubicación,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Location Configuration Information,Informações da localização,Info o lokaciji skladišta config_logout,"Nem szeretne mentést csinálni kilépés előtt? Kattintson az [OK]-ra a mentéshez, [Mégsem] a kilépéshez",Wollen Sie eine Sicherung machen vor dem Beenden? Klicke [OK] für Sicherung,Wilt u een backup maken alvorens uit te loggen?,Desea hacer un respaldo antes de salir?,"Don't you want to make a backup before logging out? Click [OK] to backup, [Cancel] to logout",Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Don't you want to make a backup before logging out?,Você não quer fazer uma cópia de segurança antes de sair? Clique [OK] para fazer a cópia de segurança,"Želite napraviti arhivu prije nego izađete? Pritisnite [OK] za arhivu, [Cancel] to otkazivanje." -config_message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message -config_message_configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration -config_msg_msg,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message -config_msg_msg_placeholder,"If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank.","If you wish to use a SMS template save your message here. Otherwise leave the box blank." -config_msg_uid,"SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username","SMS-API Username" -config_msg_uid_required,"SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field","SMS-API Username is a required field" -config_msg_pwd,"SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password","SMS-API Password" -config_msg_pwd_required,"SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field","SMS-API Password is a required field" -config_msg_src,"SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID","SMS-API Sender ID" -config_msg_src_required,"SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field","SMS-API Sender ID is a required field" +config_message,Message,Message,Message,Mensaje,Message,Message,Message,Message,Message,Message,Message,Message,Message +config_message_configuration,Message Configuration,Message Configuration,Message Configuration,Configuracion del Mensaje,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration,Message Configuration +config_msg_msg,Saved Text Message,Saved Text Message,Saved Text Message,Guardar Mensaje de Texto,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message,Saved Text Message +config_msg_msg_placeholder,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,Si desea usa el formato de SMS guarde su mensaje aqui. De lo contrario deje la casilla en blanco.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank.,If you wish to use a SMS template save your message here. Otherwise leave the box blank. +config_msg_uid,SMS-API Username,SMS-API Username,SMS-API Username,SMS-API Usuario,SMS-API Username,SMS-API Username,SMS-API Username,SMS-API Username,SMS-API Username,SMS-API Username,SMS-API Username,SMS-API Username,SMS-API Username +config_msg_uid_required,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Usuario es un campo requerido,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field,SMS-API Username is a required field +config_msg_pwd,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password,SMS-API Password +config_msg_pwd_required,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password es un campo requerido,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field,SMS-API Password is a required field +config_msg_src,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API ID Remitente,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID +config_msg_src_required,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API ID Remitente es un campo requerido,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field config_number_format,Szám formátum,Zahlenformat,Number Format,Formato de número,Number Format,Number Format,Number Format,Number Format,รูปแบบตัวเลข,Number Format,Format Nomor,Formato do número,Format broja config_phone,Cég telefonszáma,Telefon,Telefoon,Teléfono del Comercio,Company Phone,Téléphone,電話,Телефон Компании,เบอร์โทรศัพท์,Şirket Telefonu,Telepon Perusahaan,Telefone,Telefon tvrtke config_phone_required,Cég telefonszáma kötelező mező,Telefon ist erforderlich,De telefoonnummer van het bedrijf moet ingevuld worden,Teléfono del Comercio es requerido,Company phone is a required field,Le numéro de téléphone est requis,公司電話為必填,Телефон Компании обязательный пробел,เบอร์โทรต้องกรอก,Şirket Telefonu zorunlu alandır,Telepon Perusahaan wajib diisi,Telefone da Empresa é requerido,Telefon tvrtke je potreban @@ -120,15 +120,15 @@ config_print_silently,Show Print Dialog,Zeige Druckdialog,Toon Printvenster,Most config_print_top_margin,Felső margó,Rand oben,Marge Boven,Margen Superior,Margin Top,Margin Top,Margin Top,Margin Top,Margin Top,Margin Top,Margin Top,Margem superior,Gornja margina config_print_top_margin_number,The default top margin must be a number,Rand oben muss eine Zahl sein,The default top margin must be a number,Margen Superior debe ser un número,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,A margem superior padrão deve ser um número,Gornja margina mora biti broj config_print_top_margin_required,The default top margin is a required field,Rand oben ist erforderlich,The default top margin is a required field,Margen Superior es requerido,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,A margem superior padrão é um campo obrigatório,Gornja margina je obavezna -config_quantity_decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Número de decimais,Decimalne količine +config_quantity_decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Cantidad de Decimales,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Número de decimais,Decimalne količine config_receipt,Nyugta,Eingang,Ontvangst,Recibo,Receipt,Receipt,Receipt,Receipt,Receipt,Receipt,Receipt,Recibo,Priznanica config_receipt_configuration,Nyomtatási beállitások,Druckereinstellungen,Print Instellingen,Parámetros de Impresión,Receipt Print Settings,Receipt Print Settings,Receipt Print Settings,Receipt Print Settings,Receipt Print Settings,Receipt Print Settings,Receipt Print Settings,Configuração de Impressão,Postavke štamapnja config_receipt_info,Nyugta beállítási információk,Quittungsinformation,Ticket Instellingen,Información de Configuración de Recibo,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Informações de configuração de Recibos,Informacije o POS računu config_receipt_printer,Jegy nyomtató,Quittungsdrucker,Ticket Printer,Impresora de Ticket,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer,Imprimir recibo,POS printer config_receipt_show_taxes,Adók mutatása,Zeige MWSt,Toon VAT,Mostrar impuestos,Show Taxes,Show Taxes,Show Taxes,Show Taxes,Show Taxes,Show Taxes,Show Taxes,Mostrar Impostos,Prikaži porez config_receipt_show_total_discount,Összes kedvezmény mutatása,Zeige Gesamtrabatt,Toon Totale Korting,Mostrar Descuento Total,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Show Total Discount,Mostrar total desconto,Pokaži ukupni popust -config_receipt_show_description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Exibir descrição,Show Description -config_receipt_show_serialnumber,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Exibir número serial,Show Serial Number +config_receipt_show_description,Show Description,Show Description,Show Description,Mostrar Descripcion,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Show Description,Exibir descrição,Show Description +config_receipt_show_serialnumber,Show Serial Number,Show Serial Number,Show Serial Number,Mostrar Numero de Serie,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Show Serial Number,Exibir número serial,Show Serial Number config_receiving_calculate_average_price,Átl. Ár számitása (visszáru),Berechne Durchschnittseinkaufspreis,Calc avg. Price (Receiving),Calc precio promedio (Recepción),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc avg. Price (Receiving),Calc Médio de Preço (Recebimento),Računaj prosječnu cijenu (primke) config_recv_invoice_format,Visszatérítési számla formátum,Format Eingangsrechnung,Formattering Order #,Formato de Factura de Recepción,Receivings Invoice Format,Receivings Invoice Format,Receivings Invoice Format,Receivings Invoice Format,ใบส่งของ,Receivings Invoice Format,Format Nota,Formato da fatura de recebimento,Oblik ulaznog računa(primke) config_return_policy_required,Return policy is a required field,Rücknahmepolitik erforderlich,De retourvoorwaarden moeten ingevuld worden,Política de Devolución es requerida,Return policy is a required field,Le Message est un champ requis,退換貨政策為必填,Возвратний полис обязательный пробел,ต้องกรอกเงื่อนไขการคืนสินค้า,İade Politikası zorunlu alandır,Kebijakan retur wajib diisi,A política de devolução é um campo obrigatório,Polje za povratne obavijesti je potrebno @@ -139,11 +139,11 @@ config_stock_location,Bolt helye,Lagerort,Stock locatie,Ubicación de Inventario config_stock_location_duplicate,Kérem egyedi helyszin nevet használjon,Bitte verwenden Sie einen eindeutigen Lagerort,Vul een unieke naam in,Por favor use un nombre de inventario único,Please use an unique location name,Please use an unique location name,Please use an unique location name,Please use an unique location name,,Please use an unique location name,Please use an unique location name,"Por favor, use um nome de localização única",Molim koristite jedinstveni naziv skladišta config_stock_location_invalid_chars,A bolt helyének neve nem tartalmazhat '_' karaktert,Der Lagerort kann keine Unterstriche enthalten,De bedrijfsnaam moet ingevuld worden,Nombre de la Ubicación de Inventario no debe contener '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',The stock location name can not contain '_',O nome do local de ações não pode conter '_',Naziv skaldišta ne može sadržavati '_' config_stock_location_required,Bolt helyszín szám kötelező mező,Lagerort Nummer ist erforderlich,Naam van de stock locatie is een verplicht veld,Número de Ubicación de Inventario es requerido,Stock location is a required field,Stock location number is a required field,Stock location number is a required field,Stock location number is a required field,จำเป็นต้องระบุสถานที่เก็บ,Mağaza Yeri numarası zorunlu alandır,Stock location number is a required field,Número da localização do estoque é um campo obrigatório,Naziv skladišta je potreban -config_takings_printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Imprimir Vendas,Printer za 'Prodano' -config_tax_decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Decimais da taxa,Porezne decimale +config_takings_printer,Takings Printer,Takings Printer,Takings Printer,Impresion de Retenciones,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Takings Printer,Imprimir Vendas,Printer za 'Prodano' +config_tax_decimals,Tax Decimals,Tax Decimals,Tax Decimals,Decimales de Impuestos,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Tax Decimals,Decimais da taxa,Porezne decimale config_tax_included,Adókat tartalmaz,MWSt inbegriffen,VAT Inbegrepen,Impuestos incluidos,Tax Included,Tax Included,Tax Included,Tax Included,รวมภาษีแล้ว,Tax Included,Dikenakan Pajak,Imposto Incluído,Uključuje porez config_thousands_separator,Ezres elválasztó,Tausendertrennzeichen,Thousands Separator,Separador de miles,Thousands Separator,Thousands Separator,Thousands Separator,Thousands Separator,ตัวคั่นหลักพัน,Thousands Separator,Pemisah Ribuan,Separador de milhar,Razdjelnik za tisućice config_timezone,Időzóna,Zeitzone,Tijdzone,Zona Horaria,Timezone,Fuseau Horaire,時區,Часовой пояс,โซนเวลา,Saat Dilimi,Zona Waktu,Fuso horário,Vremenska zona config_use_invoice_template,Számla sablon használata,Verwende Rechnungsvorlage,Gebruik template voor facturen,Use plantilla de factura,Use Invoice Template,Use Invoice Template,Use Invoice Template,Use Invoice Template,Use Invoice Template,Use Invoice Template,Use Invoice Template,Usar modelo de fatura,Koristi predložak za fakture config_website,Weboldal,Website,Website,Sitio Web,Website,Site-web,網站,Веб-сайт,เว็บไซต์,Website,Situs Perusahaan,Site da internet,web strana -config_datetimeformat,Dátum és idő formátum,Datum und Zeit,Date and Time format,Date and Time format,Date and Time format,Date and Time format,Date and Time format,Date and Time format,รูปแบบวันเวลา,Date and Time format,Date and Time format,Formato da data e hora,Oblik datuma i vremena +config_datetimeformat,Dátum és idő formátum,Datum und Zeit,Date and Time format,Formato de Fecha y Hora,Date and Time format,Date and Time format,Date and Time format,Date and Time format,รูปแบบวันเวลา,Date and Time format,Date and Time format,Formato da data e hora,Oblik datuma i vremena diff --git a/translations/customers_lang.csv b/translations/customers_lang.csv index 3df22bd3c..b35e5c800 100644 --- a/translations/customers_lang.csv +++ b/translations/customers_lang.csv @@ -5,7 +5,7 @@ customers_cannot_be_deleted,"Nem lehet törölni a kiválasztott vevőket, mert customers_company_name,Cég neve.,Firmenname,Bedrijfsnaam,Nombre del Comercio,Company,Company,Company,Company,Company,Company,Company,Empresa,Naziv tvrtke customers_confirm_delete,Biztos törölni kívánja a kiválasztott vevőket?,Wollen Sie die gewählten Kunden wirklich löschen?,Bent u zeker dat u de geselecteerde klanten wil verwijderen?,¿Seguro(a) de que quieres borrar a los clientes seleccionados?,Are you sure you want to delete the selected customers?,Etes vous sûr(e) de vouloir supprimer ces clients?,你確定要刪除選定的客戶?,"Вы уверены, что хотите удалить выбранных клиентов?",ยืนยันลบข้อมูลลูกค้า?,Seçili müşteriyi silmek istediğinize emin misiniz?,Apakah Anda yakin ingin menghapus pelanggan yang dipilih?,Tem certeza de que deseja excluir os clientes selecionados?,Želite li obrisati odabranog kupca? customers_customer,Vevő,Kunde,Klant,Cliente,Customer,Client,客戶,Клиент,ลูกค้า,Müşteri,Pelanggan,Cliente,Kupac -customers_discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount +customers_discount,Discount,Discount,Discount,Descuento,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount customers_error_adding_updating,Hiba a vásárló modosításánál/hozzáadásánál,Fehler beim Hinzufügen/Ändern,Fout bij het toevoegen/bewerken van een klant,Error agregando/actualizando cliente,Error adding/updating customer,Érreur lors de l'ajout/suppression de client,添加/更新客戶錯誤,Ошибка при добавлении/обновлении клиента,แก้ไขข้อมูลลูกค้าผิดพลาด,Müşteri ekleme/güncelleme hatası,Menambah / Memperbarui Pelanggan Salah,Erro adicionar/atualizar cliente,Greška kod dodavanja/ažuriranja kupca customers_new,Új vevő,Neuer Kunde,Nieuwe Klant,Nuevo Cliente,New Customer,Nouveau Client,新客戶,Новый Клиент,ลูกค้าใหม่,Yeni Müşteri,Pelanggan Baru,Novo Cliente,Novi kupac customers_none_selected,Nem választott ki egyetlen vásárlót sem a törléshez,Sie haben keinen Kunde zum Löschen gewählt,U hebt geen klanten geselecteerd,No has seleccionado clientes para ser borrados,You have not selected any customers to delete,Vous n'avez pas sélectionné de client à supprimer,您還沒有選擇任何客戶進行刪除,"Вы не выбрали ни клиентов, чтобы удалить.",คุณยังไม่ได้ทำการเลือกลูกค้า,Silmek için müşteri seçmediniz,Anda belum memilih pelanggan untuk dihapus,Você não selecionou nenhum clientes para apagar,Niste odabrali nijednog kupca za brisanje diff --git a/translations/datepicker_lang.csv b/translations/datepicker_lang.csv index 0e6075f82..5148b414e 100644 --- a/translations/datepicker_lang.csv +++ b/translations/datepicker_lang.csv @@ -7,14 +7,14 @@ datepicker_last_30,Utolsó 30 nap,Letzte 30 Tage,Vorige 30 Dagen,Últimos 30 Dí datepicker_last_month,Múlt hónap,Letzter Monat,Vorige Maand,Último Mes,Last Month,Le mois dernier,上個月,Последний месяц,เดือนที่แล้ว,Geçen Ay,Bulan lalu,Último Mês,Zadnji mjesec datepicker_last_year,Múlt év,Letztes Jahr,Vorig Jaar,Último Año,Last Year,L'année passée,去年,в прошлом году,ปีที่แล้ว,Geçen Yıl,Tahun lalu,Último ano,Zadnja godina datepicker_this_month,Ez a hónap,Dieser Monat,Deze Maand,Este Mes,This Month,Ce mois,這個月,В этом месяце,เดือนนี้,Bu Ay,Bulan ini,Este Mês,Ovaj mjesec -datepicker_this_month_last_year,"Ez a hónap, múlt évben",Dieser Monat letzten Jahres,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,Este mês último ano,Ovaj mjesec prošle godine -datepicker_this_month_to_today,"Ez a hónap, mai napig",Dieser Monat bis heute,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,Deste mês para hoje,Ovaj mjesec do danas -datepicker_this_month_to_today_last_year,"Ez a hónap, mai nap, múlt évben",Dieser Monat bis Heute letzten Jahres,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,Este mês Para Hoje Último Ano,Ovaj mjesec do danas prošle godine +datepicker_this_month_last_year,"Ez a hónap, múlt évben",Dieser Monat letzten Jahres,This Month Last Year,Este Mes año anterior,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,This Month Last Year,Este mês último ano,Ovaj mjesec prošle godine +datepicker_this_month_to_today,"Ez a hónap, mai napig",Dieser Monat bis heute,This Month To Today,Este Mes a la Fecha,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,This Month To Today,Deste mês para hoje,Ovaj mjesec do danas +datepicker_this_month_to_today_last_year,"Ez a hónap, mai nap, múlt évben",Dieser Monat bis Heute letzten Jahres,This Month To Today Last Year,Este Mes a Hoy hace un año,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,This Month To Today Last Year,Este mês Para Hoje Último Ano,Ovaj mjesec do danas prošle godine datepicker_this_year,Ezév,Dieses Jahr,Dit Jaar,Este Año,This Year,Cette Année,今年,В этом году,ปีนี้,Bu Yıl,Tahun ini,Este Ano,Ova godina -datepicker_today_last_year,"Mai nap, elmúlt évben",Heute letzten Jahres,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Hoje Último Ano,Ovaj dan prošle godine +datepicker_today_last_year,"Mai nap, elmúlt évben",Heute letzten Jahres,Today Last Year,Hoy Hace un Año,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Today Last Year,Hoje Último Ano,Ovaj dan prošle godine datepicker_yesterday,Tegnap,Gestern,Gisteren,Ayer,Yesterday,Hier,昨天,вчера,เมื่อวานนี้,Dün,Kemarin,Ontem,Jučer -datepicker_apply,Elfogad,Apply,Apply,Apply,Apply,Apply,Apply,Apply,Apply,Apply,Apply,Aplicar,Primjeni -datepicker_cancel,Mégsem,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancelar,Otkaži -datepicker_from,Tól,From,From,From,From,From,From,From,From,From,From,De,Od -datepicker_to,Ig,To,To,To,To,To,To,To,To,To,To,Para,Do +datepicker_apply,Elfogad,Apply,Apply,Aplicar,Apply,Apply,Apply,Apply,Apply,Apply,Apply,Aplicar,Primjeni +datepicker_cancel,Mégsem,Cancel,Cancel,Cancelar,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancelar,Otkaži +datepicker_from,Tól,From,From,De,From,From,From,From,From,From,From,De,Od +datepicker_to,Ig,To,To,Para,To,To,To,To,To,To,To,Para,Do datepicker_custom,Egyedi,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Cliente,Slobodan izbor diff --git a/translations/employees_lang.csv b/translations/employees_lang.csv index 8cb07de88..a9fe47cbc 100644 --- a/translations/employees_lang.csv +++ b/translations/employees_lang.csv @@ -24,4 +24,4 @@ employees_update,Munkavállaló módosítása,Mitarbeiter ändern,Update Werknem employees_username,Felhasználó név,Benutzername,Gebruikersnaam,Usuario,Username,Nom d'utilisateur,帳號,Имя пользователя,Username,Kullandı Adı,Nama Pengguna,Usuário,Korisničko ime employees_username_minlength,A felhasználó névnek legalább 5 karakternek kell lennie,Benutzername muss mindestens 5 Zeichen lang sein,Gebruikersnaam moet minstens 5 characters lang zijn,"El Usuario debe tener, por lo menos, 5 caracteres",The username must be at least 5 characters,Le Nom d'utilisateur doit etre long d'au moins 5 caractères,帳號必需為五個字元以上,Имя пользователя должна быть не менее 5 символов,ชื่อผู้ใช้งานต้องยาวเกิน 5 อักษร,Kullanıcı Adı en az 5 karakter olmalıdır,Nama Pengguna minimal 5 huruf,O nome de usuário deve ter pelo menos 5 caracteres,Korisničko ime mora imati najmanje 5 znakova employees_username_required,Felhasználó név kötelező,Benutzername ist erforderlich,Gebruikersnaam moet ingevuld worden,Usuario es requerido,Username is a required field,Le Nom d'utilisateur est requis,帳號為必填,Имя пользователи обязательный пробел,จำเป็นต้องกรอกชื่อผู้ใช้งาน,Kullanıcı Adı zorunlu alandır,Nama Pengguna wajib diisi,Nome de Usuário é um campo obrigatório,Korisničko ime je potrebno -employees_subpermission_required,Engedélyezzen legalább egyet minden modulhoz,Fügen Sie mindestens ein Zugangsrecht pro Modul hinzu,Selecteer minstens één permissie voor elke module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Adicione pelo menos um privilégio para cada módulo,Odaberite barem jednu dozvolu po modulu +employees_subpermission_required,Engedélyezzen legalább egyet minden modulhoz,Fügen Sie mindestens ein Zugangsrecht pro Modul hinzu,Selecteer minstens één permissie voor elke module,Agregue al menos un permiso para cada modulo,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Add at least one grant for each module,Adicione pelo menos um privilégio para cada módulo,Odaberite barem jednu dozvolu po modulu diff --git a/translations/items_lang.csv b/translations/items_lang.csv index 9ba249757..acd43b316 100644 --- a/translations/items_lang.csv +++ b/translations/items_lang.csv @@ -1,6 +1,6 @@ label,hu-HU,de-CH,nl-BE,es,en,fr,zh,ru,th,tr,id,pt-BR,hr-HR items_add_minus,Mennyiség hozzáadása/elvétele,Bestandsänderung,Corrigatie hoeveelheid,Inventario a agregar/substraer,Inventory to add/subtract,Ajoujer/Soustraire à l'Inventaire,增/減庫存,Инвентарь для сложения/вычитания,เพิ่ม/ลบ จำนวนสินค้าคงคลัง,Eklenen/Çıkarılan Adet,Penyesuaian Inventori TAMBAH / KURANG (-),Inventário para adicionar/subtrair,Dodavanje/skidanje s inventure -items_allow_alt_desciption,Alternativ leirás eng.,Erlaube Alt. Bez.,,,,,,,Allow Alt Description,,,Descrição longa,Dozvoli Alt opis +items_allow_alt_desciption,Alternativ leirás eng.,Erlaube Alt. Bez.,,Permitir Descripción Alternativa,,,,,Allow Alt Description,,,Descrição longa,Dozvoli Alt opis items_allow_alt_description,Alternativ leirás eng.,Erlaube Alt. Bez.,Aanpasbare omschrijving,Permitir Descripción Alternativa,Allow Alt Description,Autoriser Description Alt,允許ALT描述,Разрешить альтернативные описания,แสดงข้อมูลเพิ่มเติม,Dip Nota izin ver,Deskripsi Alternatif dimungkinkan,Permitir atualizar descrição,Dozvoli Alt opis items_amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon,Amazon items_bulk_edit,Tömeges módosítás,Sammeländerung,Bewerk Selectie,Edición Múltiple,Bulk Edit,Édition en groupe,批次編輯,Массовое изменение,แก้ไขความจุ,Toplu Düzenleme,Ubah Massal,Editar Múltiplos Itens,Zajedno uređenje @@ -12,9 +12,9 @@ items_category_required,Kategória kötelező mező,Kategorie ist erforderlich,C items_change_all_to_allow_alt_desc,Alternativ leirás eng. mindenhol,Ändere alle zu Erlaube Alt. Bez.,Aanpasb. omschrijvingen,Permitir Descripción Alternativa Para Todos, Allow Alt Desc For All, Autoriser Desc Alt Pour Tous, 充許全部ALT倒序,Разрешить альтернативные Описание для всех, Allow Alt Desc For All, Tümünde dip nota izin ver, Diijinkan Deskripsi alternatif untuk semua,Permitir alterar desconto para todos,Dozvali Alt opis za sve items_change_all_to_not_allow_allow_desc,Alternativ leirás tiltása,Ändere alle zu NICHT Erlaube Alt. Bez.,Vaste omschrijvingen,Denegar Descripción Alternativa Para Todos,Not Allow Alt Desc For All,Interdire Desc Alt Pour Tous,不允許全部ALT倒序,Не разрешить альтернативные Описание для всех,Not Allow Alt Desc For All,Tümünde dip nota izin verme,Tidak Diijinkan Deskripsi alternatif untuk semua,Não Permitir alterar desconto para todos,Nije dozvoljen Alt opis za sve items_change_all_to_serialized,Change All To Serialized,Ändere alle zu serialisiert,Genummerd,Cambiar Todo A Serializado,Change All To Serialized,Tout Sérialiser,全部更改序號至序列化,Изменить все в сериализованную,เปลี่ยนแปลงรหัสสินค้าทั้งหมด,Tümünü seri numaralı yap,Ubah semua menggunakan nomor serial,Alterar todos para serializados,Promijeni sve u serijske brojeve -items_change_all_to_unserialized,Change All To Unserialized,Ändere alle zu nicht serialisiert,Niet genummerd,Cambiar Todo A Deserializado,Change All To Unserialized,Tout désérialiser,全部更改序號至非序列化,Изменить все в несериализованную,ลบรหัสสินค้าทั้งหมด,Tümünü seri numarasız yap,Ubah semua tanpa nomor serial,Alterar todos para desserializados,ukloni sve serijske brojeve +items_change_all_to_unserialized,Change All To Unserialized,Ändere alle zu nicht serialisiert,Niet genummerd,Cambiar Todo A No Serializado,Change All To Unserialized,Tout désérialiser,全部更改序號至非序列化,Изменить все в несериализованную,ลบรหัสสินค้าทั้งหมด,Tümünü seri numarasız yap,Ubah semua tanpa nomor serial,Alterar todos para desserializados,ukloni sve serijske brojeve items_confirm_bulk_edit,Biztosan módosítani kívánja a kiválasztott termékeket?,Wollen Sie alle gewählten Artikel ändern?,Bent u zeker dat u de geselecteerde producten wil aanpassen?,¿Estás seguro(a) de querer editar los artículos seleccionados?,Are you sure you want to edit all the items selected?,Etes vous sûre de vouloir éditer toute la sélection?,您確定您要編輯的所有選定的產品嗎?,"Вы уверены, что хотите редактировать все товари выбраны?",แน่ใจหรือไม่ที่จะแก้ใขสินค้าทั้งหมดที่คุณเลือก?,Seçili tüm ürünleri düzenlemek istediğinize emin misiniz?,Apakah Anda yakin ingin merubah semua item yang dipilih?,Tem certeza de que deseja editar todos os itens selecionados?,Jeste li sigurni da želite urediti odabrane stavke? -items_confirm_bulk_edit_wipe_taxes,Minden termék adó információja cserélve lesz!,All item tax information will be replaced!,Alle taxgegevens zullen overschreven worden!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,Tem certeza de que deseja editar todos osimpostos selecionados?,Sve stavke poreznih informacija bit će zamijenjene +items_confirm_bulk_edit_wipe_taxes,Minden termék adó információja cserélve lesz!,All item tax information will be replaced!,Alle taxgegevens zullen overschreven worden!,Toda la información del impuesto del articulo sera cambiada!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,All item tax information will be replaced!,Tem certeza de que deseja editar todos osimpostos selecionados?,Sve stavke poreznih informacija bit će zamijenjene items_confirm_delete,Biztosan törölni kívánja a kijelölt termékeket?,Wollen Sie alle gewählten Artikel löschen?,Bent u zeker dat u de geselecteerde producten wil verwijderen?,¿Estás seguro(a) de querer borrar los artículos seleccionados?,Are you sure you want to delete the selected items?,Etes vous sûre de vouloir supprimer la sélection?,你確定你要刪除選定的產品嗎?,"Вы уверены, что хотите удалить выбранные товари?",โปรดยืนยันการลบสินค้าที่ถูกเลือก?,Seçili ürünleri silmek istediğinize emin misiniz?,Apakah Anda yakin ingin menghapus item yang dipilih?,Tem certeza de que deseja excluir os itens selecionados?,Jeste li sigrni da želite obrisati odabrane stavke? items_cost_price,Beker. Ár,Einstandspreis,Aankoopprijs,Precio de Compra,Cost Price,Prix de Gros,成本價,Оптовая Цена,ราคาทุน,Maliyet Fiyatı,Harga Pokok,Preço de Custo,Nabavna cijena items_cost_price_number,Bekerülési árnak számnak kell lennie,Einstandspresi muss eine Zahl sein,Kostprijs moet een cijfer zijn,Precio de Compra debe ser número,Cost price must be a number,Le Prix d'achat doit etre un nombre,成本價必需是數值,Оптовая цена должно быть число,ราคาทุนต้องเป็นตัวเลข,Fiyat sayı olmalıdır (9.90),Biaya Item harus angka,Preço de custo deve ser um número,Nabavna cijena mora biti broj @@ -84,6 +84,6 @@ items_upc_database,UPC adatbázis,UPC Datenbank,UPC Database,Base de datos UPC,U items_update,Termék módosítás,Ändere Artikel,Bewerk Product,Actualizar Artículo,Update Item,Éditer Item,更新產品,Обновить Товар,ปรับแต่งสินค้า,Ürün Güncelle,Ubah,Atualizar Item,Ažuriraj artikl items_use_inventory_menu,Készl. menü haszn.,Verwende Bestandesmenu,Use Inv. Menu,Usar Menú de Inventario,Use Inv. Menu,Utiliser Menu Inv.,使用庫存清單,Используйте меню инвентаря,ใช้เมนูสินค้าคงเหลือ,Stok Menüsünü Kullan,Gunakan Inv. Menu,Usar Menu Inventário,Koristi inv. meni items_import_items_excel,Termékek importálása Excelből,Importiere Artikel mit Excel Datei,Import items from Excel sheet,Importar Artículos desde Excel,Import items from Excel sheet,Import items from Excel sheet,Import items from Excel sheet,Import items from Excel sheet,Import items from Excel sheet,Import items from Excel sheet,Import items from Excel sheet,Importar planilha de produtos do Excel,Uvezi stavke iz Excel-a -items_select_image,Kép kiválasztása,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Selecionar imagem,Odaberi sliku -items_change_image,Kép cseréje,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Substituir imagem,Promjeni sliku -items_remove_image,Kép eltávolítása,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remover imagem,Ukloni sliku +items_select_image,Kép kiválasztása,Select Image,Select Image,Seleccionar Imagen,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Select Image,Selecionar imagem,Odaberi sliku +items_change_image,Kép cseréje,Change Image,Change Image,Cambiar Imagen,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Change Image,Substituir imagem,Promjeni sliku +items_remove_image,Kép eltávolítása,Remove Image,Remove Image,Quitar Imagen,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remove Image,Remover imagem,Ukloni sliku diff --git a/translations/messages_lang.csv b/translations/messages_lang.csv index 1d7c0cc6c..be32389ab 100644 --- a/translations/messages_lang.csv +++ b/translations/messages_lang.csv @@ -1,13 +1,13 @@ label,hu-HU,de-CH,nl-BE,es,en,fr,zh,ru,th,tr,id,pt-BR,hr-HR -messages_sms_send,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS -messages_first_name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name,First name -messages_last_name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name -messages_phone,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number -messages_phone_placeholder,"Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here...","Mobile Number(s) here..." -messages_phone_number_required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required -messages_message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message,Message -messages_message_placeholder,"Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here...","Your Message here..." -messages_message_required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required -messages_multiple_phones,"(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)" -messages_successfully_sent,"Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: ","Message successfully sent to: " -messages_unsuccessfully_sent,"Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: ","Message unsuccessfully sent to: " +messages_sms_send,Send SMS,Send SMS,Send SMS,Enviar SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS,Send SMS +messages_first_name,First name,First name,First name,Nombre,First name,First name,First name,First name,First name,First name,First name,First name,First name +messages_last_name,Last name,Last name,Last name,Apellido,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name,Last name +messages_phone,Phone number,Phone number,Phone number,Numero de Teléfono,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number,Phone number +messages_phone_placeholder,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here...,Números de Celulares Aquí…,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here...,Mobile Number(s) here... +messages_phone_number_required,Phone number required,Phone number required,Phone number required,Numero de Teléfono Requerido,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required,Phone number required +messages_message,Message,Message,Message,Mensaje,Message,Message,Message,Message,Message,Message,Message,Message,Message +messages_message_placeholder,Your Message here...,Your Message here...,Your Message here...,Tu Mensaje Aqui…,Your Message here...,Your Message here...,Your Message here...,Your Message here...,Your Message here...,Your Message here...,Your Message here...,Your Message here...,Your Message here... +messages_message_required,Message required,Message required,Message required,Mensaje Requerido,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required,Message required +messages_multiple_phones,"(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(En caso de varios destinatarios, escriba los numeros de celular separados por comas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)","(In case of multiple recipients, enter mobile numbers separated by commas)" +messages_successfully_sent,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: ,Mensaje enviado exitosamente a:,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: ,Message successfully sent to: +messages_unsuccessfully_sent,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Mensaje no enviado a:,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: ,Message unsuccessfully sent to: diff --git a/translations/module_lang.csv b/translations/module_lang.csv index 6dbc94d4d..423778486 100644 --- a/translations/module_lang.csv +++ b/translations/module_lang.csv @@ -20,5 +20,5 @@ module_sales,Értékesítés,Verkauf,Kassa,Ventas,Sales,Ventes,出貨,Прода module_sales_desc,Termékek értékesítése és visszavétele,"Hinzufügen, Ändern, Löschen und Suchen",Verwerk aankopen en retours,Procesar ventas y devoluciones,Process sales and returns,Ventes et chiffre d'affaire,出貨與退貨,Процесс продажи и возвращается,งานขาย และ รับคืน,Satış ve iade,Proses Penjualan dan Retur,Processar vendas e devoluções,Procesi prodaje i povrata module_suppliers,Beszállítók,Lieferanten,Leveranciers,Proveedores,Suppliers,Fournisseurs,供應商,Поставщики,ผู้ผลิต,Sağlayıcılar,Pemasok,Fornecedores,Dobavljači module_suppliers_desc,"Beszállítók hozzáadása, módosítása, törlése és keresése","Hinzufügen, Ändern, Löschen und Suchen","Zoek, bewerk, verwijder en voeg leveranciers toe","Agregar, Actualizar, Borrar y Buscar proveedores","Add, Update, Delete, and Search suppliers","Ajouter, Éditer, Supprimer, et Chercher des fournisseurs",添加,更新,刪除,搜索供應商,"Добавление, обновление, удаление и поиск suppliers","เพิ่ม, อัพเดท, ลบ, และค้นหา ผู้ผลิต","Ekleme, değiştirme, silme ve arama","Tambah, Rubah, Hapus, dan Cari Pemasok","Adicionar, atualizar, excluir e Pesquisar fornecedores","Dodaj, ažuriraj, obriši ili traži dobavljače" -module_messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages -module_messages_desc,"Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al." +module_messages,Messages,Messages,Messages,Mensajes,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages,Messages +module_messages_desc,"Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Enviar Mensajes a Clientes, Proveedores, Empleados, etc.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al.","Send Messages to Customers, Suppliers, Employees et al." diff --git a/translations/reports_lang.csv b/translations/reports_lang.csv index 21799f342..1cfcc319e 100644 --- a/translations/reports_lang.csv +++ b/translations/reports_lang.csv @@ -86,10 +86,10 @@ reports_taxes,Adók,Steuern,Belastingen,Impuestos,Taxes,Taxes,稅額,Налог reports_taxes_summary_report,Adók összegző riport,Bericht: Steuern (summarisch),Rapport Overzicht Belastingen,Reporte de Resumen de Impuestos,Taxes Summary Report,Rapport: Résumé Taxes,稅金摘要報告,Сводный отчет налоги,รายงานสรุปภาษี,Vergi Özet Raporu,Laporan Ringkasan Pajak,Relatório Resumido de Impostos,Zbrojni izvještaj po porezima reports_total,Összesen,Total,Totaal,Total,Total,Total,總計,сумма,ยอดรวม,Toplam,Total,Total,Ukupno reports_type,Típus,Typ,Type,Tipo,Type,Type,類型,тип,ชนิด,Tür,Tipe,Tipo,Tip -reports_item_count,Filter Item Count,Filter nach Artikelzahl,Filter Item Count,Filter Item Count,Filter Item Count,Filter Item Count,Filter Item Count,Filter Item Count,Filter Item Count,Filter Stok Habis/Belum Habis/Minus,,Filtro por quantidade,Filter broja artikala +reports_item_count,Filter Item Count,Filter nach Artikelzahl,Filter Item Count,Filtrar cantidad de Articulo,Filter Item Count,Filter Item Count,Filter Item Count,Filter Item Count,Filter Item Count,Filter Stok Habis/Belum Habis/Minus,,Filtro por quantidade,Filter broja artikala reports_cost_price,Beker. ár,Einstandspreis,Aankoopprijs,Precio de Compra,Cost Price,Prix de Gros,成本價,Оптовая Цена,ราคาทุน,Maliyet Fiyatı,Harga Pokok,Preço de Custo,Nabavna cijena reports_unit_price,Kisker. ár,Verkaufspreis,Verkoopprijs,Precio de Venta,Retail Price,Prix au Détail,單價,Розничная Цена,ราคาขาย,Satış Fiyatı,Harga Jual,Preço Varejo,Jedinična cijena reports_sub_total_value,Sub Total,Zwischentotal,Subtotaal,Subtotal,Sub Total,Sous-Total,小計,промежуточный итог,ยอดรวมหักภาษี ,Ara Toplam,Sub Total,Sub Total,Iznos međuzbroja -reports_total_inventory_value,Total Inventory Value,Total Inventarwert,Totale waarde stock,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Nilai Persediaan,Valor Total Inventário,Ukupan iznos inventure -reports_zero_and_less,Nulla és kevesebb,Null und weniger,Nul en minder,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Stok habis dan minus,Zero e menor,Nula i manje -reports_more_than_zero,Több mint nulla,Mehr als Null,Meer dan nul,More than zero,More than zero,More than zero,More than zero,More than zero,More than zero,More than zero,Stok belum habis,Maior do que zero,Više od nule +reports_total_inventory_value,Total Inventory Value,Total Inventarwert,Totale waarde stock,Valor Total del Inventario,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Inventory Value,Total Nilai Persediaan,Valor Total Inventário,Ukupan iznos inventure +reports_zero_and_less,Nulla és kevesebb,Null und weniger,Nul en minder,Cero y Menores,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Zero and less,Stok habis dan minus,Zero e menor,Nula i manje +reports_more_than_zero,Több mint nulla,Mehr als Null,Meer dan nul,Mayores a Cero,More than zero,More than zero,More than zero,More than zero,More than zero,More than zero,Stok belum habis,Maior do que zero,Više od nule diff --git a/translations/sales_lang.csv b/translations/sales_lang.csv index e04b2a42f..47eae48e5 100644 --- a/translations/sales_lang.csv +++ b/translations/sales_lang.csv @@ -13,11 +13,11 @@ sales_complete_sale,Eladás befej.,Abschliessen,Bevestig,Completar Venta,Complet sales_confirm_cancel_sale,Biztos kiüriti ezt az eladást? MINDEGYIK termék törölve lesz.,Wollen Sie diesen Verkauf abschliessen? Alle Artikeleinträge werden entfernt,Bent u zeker dat u deze aankoop wil verwijderen?,¿Seguro(a) de querer limpiar esta venta? Todos los artículos serán limpiados.,Are you sure you want to clear this sale? All items will cleared.,Etes vous sûr(e) de vouloir annuler cette vente?,你確定要清除此筆銷售單?本單內的所有產品將被清除。,"Вы уверены, что хотите удалить эту продажу? Все детали будут очищены.",แน่ใจหรือไม่ที่จะล้างรายการขาย? สินค้าทุกอย่างจะถูกลบจากบอร์ด.,Bu satışı iptal etmek istiyor musunuz? Tüm ürünler çıkarılacak.,Anda yakin ingin membatalkan transaksi penjualan ini? Semua item akan dihapus.,Tem certeza de que deseja apagar esta venda? Todos os itens serão apagados.,Želite li otkazati ovu prodaju? Svi artikli se brišu. sales_confirm_delete,"Biztos, hogy törli a kijelölt értékesitéseket?",Wollen Sie die gewählten Aufträge löschen?,Bent u zeker dat u de geselecteerde aankopen wil verwijderen?,¿Seguro(a) de querer borrar las ventas seleccionadas?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Tem certeza de que deseja excluir as vendas selecionados?,Želite li obrisati odabranu prodaju? sales_credit,Hitelkártya,Kreditkarte,Kredietkaart,Tarjeta de Crédito,Credit Card,Carte de Crédit,信用卡,кредитная карта,เครดิตการ์ด,Kredi Kartı,Kartu Credit,Cartão Crédito,Kreditna kartica -sales_customer,Vevő,Kunde,Klant,cliente,Name,Client,客戶,клиент,ลูกค้า,Müşteri,Pelanggan,Cliente,Kupac -sales_customer_email,Vevő e-mail,Customer Email,Customer Email,Customer Email,Email,Customer Email,Customer Email,Customer Email,Customer Email,Customer Email,Customer Email,e-mail,e-mail kupca -sales_customer_address,Vevő cím,Customer Address,Customer Address,Customer Address,Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Endereço,Adresa kupca -sales_customer_location,Vevő hely,Customer Location,Customer Location,Customer Location,Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Localização,Mjesto kupca -sales_customer_discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount +sales_customer,Vevő,Kunde,Klant,Nombre,Name,Client,客戶,клиент,ลูกค้า,Müşteri,Pelanggan,Cliente,Kupac +sales_customer_email,Vevő e-mail,Customer Email,Customer Email,Correo,Email,Customer Email,Customer Email,Customer Email,Customer Email,Customer Email,Customer Email,e-mail,e-mail kupca +sales_customer_address,Vevő cím,Customer Address,Customer Address,Direccion,Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Endereço,Adresa kupca +sales_customer_location,Vevő hely,Customer Location,Customer Location,Ubicacion,Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Localização,Mjesto kupca +sales_customer_discount,Discount,Discount,Discount,Descuento,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount sales_customer_total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total sales_date,Eladás dátuma,Datum,Datum,Fecha,Sale Date,Date de Vente,日期,Число,วันที่ขาย,Satış Tarihi,Tanggal,Data Venda,Datum prodaje sales_date_required,Korrekt dátumot kell megadnia.,Ein korrektas Datum ist erforderlich,Gelieve een correcte datum in te vullen,Una fecha correcta de ser ingresada,A correct date needs to be filled in,A correct date needs to be filled in,A correct date needs to be filled in,A correct date needs to be filled in,A correct date needs to be filled in,A correct date needs to be filled in,Permintaan Data,A data correta precisa ser preenchida,Morate unijeti ispravan datum @@ -81,7 +81,7 @@ sales_quantity,Menny.,Menge,Aantal,Cant.,Qty.,Qté.,數量.,Кол-во.,จำ sales_quantity_less_than_zero,"Figyelem, a megadott mennyiség elégtelen! Tovább folytathatja az értékesitést, de ellenőrizze a készletet.","Warnung: Gewünschte Menge ist nicht verfügbar. Sie können den Verkauf fortsetzen, dennoch prüfen Sie bitte den Lagerbestand.","Waarschuwing, de gewenste hoeveelheid is onvoldoende. U kunt deze aankoop verwerken, maar kijk toch even de voorraad na.",Advertencia. La cantidad deseada es insuficiente. Puedes procesar la venta pero verifica el inventario.,"Warning, Desired Quantity is Insufficient. You can still process the sale, but check your inventory","Avertissement, Quantité Demandée Insuffisante. Vous pouvez accomplir la ventre, mais veuillez vérifier votre inventaire",警告!產品的庫存數量是不足的。您仍然可以處理銷售,但檢查您的庫存,"Внимание Желаемое количество является недостаточным. Вы все еще можете обрабатывать продажи, но проверить ваш инвентарь",คำเตือน ถ้าจำนวนของไม่เพียงพอกับความต้องการหรือไม่ตรงกับยอดในบันชี ก็สามารถทำการขายได้ แต่ต้องเชคปริมานสินค้าคงคลัง,"Dikkat, İstenen stok yetersiz. Satışa devam edebilirsiniz ama stoğunuzu kontrol ediniz","Peringatan!... Stok Inventori Kosong. Proses penjualan masih dapat dilanjutkan, Periksa Inventori.","Aviso, Quantidade desejado é insuficiente. Você ainda pode processar a venda mas verifique seu inventário","Upozorenje! Željena količina je nedovoljna. Možete nastaviti prodaju, ali provjerite svoju zalihu." sales_quantity_less_than_reorder_level,"Figyelem, a megadott mennyiség elégtelen!",Warnung: Gewünschte Menge ist nicht verfügbar.,"Waarschuwing, de gewenste hoeveelheid stock is overgeschreden.",Advertencia. La cantidad deseada es insuficiente,"Warning, Desired Quantity is below reorder level","Avertissement, Quantité Demandée Insuffisante",警告!產品的庫存數量是不足的。您仍然可以處理銷售,但檢查您的庫存,Внимание Желаемое количество является недостаточным.,คำเตือน ถ้าจำนวนของไม่เพียงพอกับความต้องการหรือไม่ตรงกับยอดในบันชี ก็สามารถทำการขายได้ แต่ต้องเชคปริมานสินค้าคงคลัง,"Dikkat, İstenen stok yetersiz.",Peringatan!... Stok Inventori Kosong.,"Aviso, quantidade desejada está abaixo do nível de reabastecimento",Upozorenje! Željena količina je ispod minimalne. sales_receipt,Eladási nyugta,Quittung,Ticket #,Recibo de Venta,Sales Receipt,Recu de Ventes,銷貨單,товарный чек,บิลขาย,Satış Faturası,Faktur Penjualan,Vendas,Račun -sales_receipt_number,Értékesítési #,Quittung Nr.,Ticket #,POS #,Sale #,# Caisse,POS #,POS #,จุดขาย#,,POS #,Venda nº,Račun br. +sales_receipt_number,Értékesítési #,Quittung Nr.,Ticket #,Venta #,Sale #,# Caisse,POS #,POS #,จุดขาย#,,POS #,Venda nº,Račun br. sales_register,Értékesitési nyilvántartás,Kasse,Kassa,Registro de Ventas,Sales Register,Registre des Ventes,銷售登記,Продажи журнала,ลงทะเบียนขาย,Satış Kaydı,Transaksi Penjualan,Registar Venda,Registracija prodaje sales_remove_customer,Vásárló eltávolítása,Entferne Kunde,Verwijder Klant,Borrar Cliente,Remove Customer,Enlever Client,移除客戶,Удалите клиентов,ลบลูกค้า,Müşteriyi Kaldır,Hapus Pelanggan,Remover Cliente,Ukloni kupca sales_return,Visszavétel,Retoure,Retour,Devolución,Return,Reprise,退貨,возвращать,คืน,İade,Retur,Devolução,Povrat diff --git a/translations/suppliers_lang.csv b/translations/suppliers_lang.csv index 46e4a1c03..0f0c33b40 100644 --- a/translations/suppliers_lang.csv +++ b/translations/suppliers_lang.csv @@ -3,7 +3,7 @@ suppliers_account_number,Számla #,Konto-Nr.,Btw nummer,Cuenta #,Account #,# Com suppliers_cannot_be_deleted,"Nem lehet törölni a beszállítót, mert már van eladásuk.","Kann gewählte Lieferanten nicht löschen, einer oder mehrere weisen Verkäufe aus.",De geselecteeerde leveranciers konden niet worden verwijderd. Eén of meerdere leveranciers hebben ordergegevens in de database zitten.,No se pudo borrar los proveedores seleccionados. Uno o más de los seleccionados tiene ventas.,"Could not deleted selected suppliers, one or more of the selected suppliers has sales.",Impossible de supprimer le(s) fournisseur(s) sélectionné(s). Un ou plusieurs ont des ventes.,無法刪除所選擇的供應商,選定的供應商中至少有一家已有銷售紀錄。,"Не удалось удалить выбранные поставщиков, один или более из выбранных поставщиков имеет продаж.","ลบผู้ผลิตที่ถูกเลือกไม่ได้, one or more of the selected suppliers has sales.","Sağlayıcı silinemedi, bazı sağlayıcıların satışı var.","Tidak bisa dihapus pemasok yang dipilih, satu atau lebih dari pemasok yang dipilih memiliki penjualan.","Não foi possível excluir fornecedores selecionados, um ou mais dos fornecedores selecionados tem vendas.",Ne mogu obrisati odabranog dobavljača. Jedan ili više odabranih dobavljača ima prodaju. suppliers_company_name,Cégnév,Firmenname,Leverancier,Nombre de la Compañía,Company Name,Nom d'Entreprise,公司名稱,Название компании,ชื่อบริษัท,Şirket Adı,Nama Perusahaan,Empresa,Naziv tvrtke suppliers_company_name_required,Cégnév kötelező mező,Firmenname ist erforderlich,Bedrijfsnaam moet ingevuld worden,Nombre de la Compañía es requerido,Company Name is a required field,Le Nom d'Entreprise est un champ requis,公司名稱是必填欄位,Название компании является обязательным полем,ชื่อบริษัทต้องกรอก,Şirket Adı zorunlu alandır,Nama Perusahaan wajib diisi,Nome da Empresa é um campo obrigatório,Naziv tvrtke je potreban -suppliers_agency_name,Ügynökség neve,Name der Agentur,Agencynaam,Nombre de la Agency,Agency Name,Nom d'Agence, , , , ,Nama,Nome da Agência,Naziv djelatnosti +suppliers_agency_name,Ügynökség neve,Name der Agentur,Agencynaam,Nombre de la Agencia,Agency Name,Nom d'Agence, , , , ,Nama,Nome da Agência,Naziv djelatnosti suppliers_confirm_delete,"Biztos, hogy törölni kívánja a kiválasztott beszállítókat?",Wollen Sie die gewählten Lieferanten löschen?,Bent u zeker dat u de geselecteerde leveranciers wil verwijderen?,¿Seguro(a) de querer borrar los proveedores seleccionados?,Are you sure you want to delete the selected suppliers?,Etes vous sûr(e) de vouloir supprimer ce(s) fournisseur(s)?,你確定要刪除選定的供應商嗎?,"Вы уверены, что хотите удалить выбранных поставщиков?",แน่ใจหรือไม่ที่จะลบผู้ผลิตที่ถููกเลือก?,Seçili sağlayıcıları düzenlemek istiyor musunuz?,Apakah Anda yakin ingin menghapus pemasok yang dipilih?,Tem certeza de que deseja excluir os fornecedores selecionados?,Jeste li ste sigurni da želite obrisati odabranog dobavljača? suppliers_error_adding_updating,Hiba beszállító hozzáadásánál/módosításánál,Fehler beim Hinzufügen/Ändern,Fout bij het toevoegen/aanpassen van een leverancier,Error agregando/actualizando proveedor,Error adding/updating supplier,Error lors de l'ajout/suppression de fournisseur,新增/更新供應商錯誤,Ошибка при добавлении/обновлении поставщиком,เพิ่ม/แก้ไข ผู้ผลิต ล้มเหลว,Sağlayıcı ekleme/düzenleme hatası,Kesalahan Menambah / memperbarui data pemasok,Erro ao adicionar/atualizar fornecedor,Greška kod dodavanja/ažuriranja dobavljača suppliers_new,Új beszállító,Neuer Lieferant,N. Leverancier,Nuevo Proveedor,New Supplier,Nouveau Fournisseur,新增供應商,Новый поставщик,ผู้ผลิตรายใหม่,Yeni Sağlayıcı,Pemasok Baru,Novo Fornecedor,Novi dobavljač From fa01e18e412db47cee77940c3f5ddc28f6e883ab Mon Sep 17 00:00:00 2001 From: sonnysk76 Date: Fri, 3 Jun 2016 13:43:46 -0500 Subject: [PATCH 3/4] Spanish lang review --- translations/common_lang.csv | 6 +++--- translations/config_lang.csv | 2 +- translations/datepicker_lang.csv | 2 +- translations/items_lang.csv | 2 +- translations/reports_lang.csv | 2 +- translations/sales_lang.csv | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/translations/common_lang.csv b/translations/common_lang.csv index 1912c1452..fccd71a14 100644 --- a/translations/common_lang.csv +++ b/translations/common_lang.csv @@ -6,9 +6,9 @@ common_comments,Megjegyzések,Kommentare,Commentaar,Comentarios,Comments,Comment common_common,közös,Allgemein,algemeen,común,common,commun,一般,общественно,ธรรมดา,genel,Biasa,comum,Zajedničko common_confirm_search,"Ön egy vagy több mezőt választott ki, a keresés után ezek már nem lesznek kiválasztva. Biztos, hogy elküldi ezt a keresést?",Sie haben einen oder mehrere Zeilen gewählt. Nach der Verarbeitung werden diese nicht mehr selektiert sein. Wollen Sie die Suche dennoch verarbeiten?,"U hebt een of meerdere rijen geselecteerd, deze zullen niet langer geselecteerd zijn na de zoekopdracht. Bent u zeker dat u wil verdergaan?",Has seleccionado una o más filas. Éstas no estarán seleccionadas después de tu búsqueda. ¿Seguro(a) que quieres hacer esta búsqueda?,"You have selected one or more rows, these will no longer be selected after your search. Are you sure you want to submit this search?",Vous avez sélectionné une ou plusieurs ligne(s). Elles ne seront plus selectionnées apres cette recherche. Voulez-vous lancer cette recherche?,您已經選擇一行或多行,在搜索後這些紀錄將不能再被選取。您確定要提交這個搜索?,"Вы выбрали одну или несколько строк, это больше не будет быть выбрано после поиска. Вы уверены, что хотите, чтобы представить этот поиск?","คุณเลือกมากกว่าหนึ่งแถว, สิ่งที่คุณเลือกจะถูกยกเลิกหลังการค้นหา. แน่ใจหรือไม่ที่จะค้นหา?","Birden fazla satır seçtiniz, arama yaptığınızda seçiminiz kaybolacak. Arama yapmak istediğinize emin misiniz?","Anda telah memilih satu atau lebih baris, ini tidak akan lagi dipilih setelah pencarian Anda. Apakah Anda yakin ingin mengirimkan pencarian ini?","Você selecionou uma ou mais linhas, estes não serão mais selecionados após a sua pesquisa. Tem certeza de que deseja enviar esta pesquisa?",Odabrali ste jedan ili više redova koji neće biti odabrani nakon pretrage. Jeste li ste sigurni da želite pretragu? common_country,Ország,Land,Land,País,Country,Pays,國家,Страна,ประเทศ,Ülke,Negara,País,Država -common_date,Dátum,Datum,Datum,Date,Date,Date,Date,Date,Date,Date,Date,Data,Datum +common_date,Dátum,Datum,Datum,Fecha,Date,Date,Date,Date,Date,Date,Date,Data,Datum common_delete,Törlés,Löschen,Verwijder,Borrar,Delete,Effacer,刪除,Удалить,ลบ,Sil,Hapus,Apagar,Obrisati -common_print,Nyomtat,Drucken,Print,Print,Print,Imprimer,Print,Print,พิมพ์,Print,Print,Imprimir,Štampati +common_print,Nyomtat,Drucken,Print,Imprimir,Print,Imprimer,Print,Print,พิมพ์,Print,Print,Imprimir,Štampati common_det,részletek,Details,details,detalles,details,détails,更多,детали,สรุป,Detaylar,Detail,detalhes,Detalji common_edit,szerkeszt,Ändern,bewerk,editar,edit,éditer,編輯,редактировать,แก้ไข,düzenle,Ubah,editar,Uredi common_email,E-Mail,Email,Email,Email,Email,Email,Email,Электронная почта,Email,E-Posta,Email,e-mail,e-mail @@ -31,7 +31,7 @@ common_new,Új,Neu,Nieuw,Nuevo,New,New,New,New,New,New,New,Novo,Novi common_no_persons_to_display,Nincsenek megjeleníthető emberek,Keine Personen zum Anzeigen,Er werden geen personen gevonden,No hay gente que mostrar,There are no people to display,Il n'y a personne à afficher,沒有使用者資料可以顯示,"Там нет людей, чтобы отобразить",ไม่พบข้อมูลตัวบุคคล,Gösterecek kişi yok,Tidak ada orang untuk ditampilkan,Não existem pessoas para mostrar,Nema nijede osoba za prikazati common_or,VAGY,Oder,Of,Ó,OR,OU,或,ИЛИ,หรือ,Yada,ATAU,ou,Ili common_phone_number,Telefonszám,Telefon,Telefoon,Teléfono,Phone Number,Téléphone,電話,Номер телефона,โทรศัพท์,Telefon,Telepon,Telefone,Broj telefona -common_phone_number_required,Telefonszám kötelező mező,Telefon ist erforderlich,,,,Le numéro de téléphone est requis.,,,ต้องกรอกเบอร์โทร,,Nomer Telepon Wajib Diisi,Número do telefone é requerido,Broj telefona je obavezan +common_phone_number_required,Telefonszám kötelező mező,Telefon ist erforderlich,,El teléfono es requerido ,,Le numéro de téléphone est requis.,,,ต้องกรอกเบอร์โทร,,Nomer Telepon Wajib Diisi,Número do telefone é requerido,Broj telefona je obavezan common_please_visit_my,Kérem látogassa meg a ,Bitte beuschen Sie ,Bezoek mijn,"Por favor, visita mi",Please visit my,SVP visitez le,請造訪,"пожалуйста, посетите",เยี่ยมชมที่,ziyaret edin,Silahkan kunjungi,Por favor visite o site da internet,Molim posjetite common_powered_by,Powered by,Powered by,Powered by,Potenciado por,Powered by,Animé par,Powered by,самоходные из,จัดทำโดย,Powered by,Diberdayakan oleh,Desenvolvido por,Pokreće common_price,Ár,Preis,Prijs,Precio,Price,Prix,價值,Цена,ราคา,Fiyat,Harga,Preço,Ár diff --git a/translations/config_lang.csv b/translations/config_lang.csv index 96de32ec0..e15741828 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -68,7 +68,7 @@ config_default_tax_rate_1,Adó 1,MWSt 1,VAT 1 %,Impuesto 1,Tax 1 Rate,Taux d'Imp config_default_tax_rate_2,Adó 2,MWSt 2,VAT 2 %,Impuesto 2,Tax 2 Rate,Taux d'Imposition 2,稅率 2,ставка налога 2,อัตราภาษี 2,Vergi Oranı 2,Tarif Pajak 2,Imposto 2 Tarifa,Porez 2 % config_default_tax_rate_number,Az alapértelmezett adónak számnak kell lennie,MWSt Rate,Het percentage VAT moet een nummer zijn,El Impuesto Predeterminado debe ser un número,The default tax rate must be a number,Le taux d'imposition doit etre un nombre,預設稅率必需為數字,Обычный ставка налога должен быть цифра,อัตราภาษีเริ่มต้นต้องเป็นตัวเลข,Varsayılan Vergi Oranı sayı olmalıdır,Tarif Pajak Biasa harus angka,A taxa de Imposto padrão deve ser um número,Zadani porez mora biti broj config_default_tax_rate_required,Az alapértelmezett adó kötelező mező,MWSt ist erforderlich,Het percentage VAT moet ingevuld worden,El Impuesto Predeterminado es requerido,The default tax rate is a required field,Le taux d'imposition par défaut est requis,預設稅率為必填,Обычный ставка налога обязательный пробел,อัตราภาษีเริ่มต้นต้องกรอก,Varsayılan Vergi Oranı zorunlu alandır,Tarif Pajak Biasa wajib diisi,A taxa de Imposto padrão é um campo obrigatório,Zadani porez je potreban -config_default_tax_name_required,Alapértelmezett adó név kötelező mező,The default tax name is a required field,De naam van de VAT moet ingevuld worden,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,Nome da taxa padrão é requerida,Naziv poreza je poteban +config_default_tax_name_required,Alapértelmezett adó név kötelező mező,The default tax name is a required field,De naam van de VAT moet ingevuld worden,El nombre del Impuesto Predeterminado es requerido,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,The default tax name is a required field,Nome da taxa padrão é requerida,Naziv poreza je poteban config_fax,Fax,Fax,Fax,Fax,Fax,Fax,傳真,Факс,แฟ็กซ์,Faks,Fax,Fax,Fax config_general,Általános,Einstellungen,Algemene,General,General,General,General,General,ตั้งค่าทั่วไป,General,General,Gerais,Opća config_general_configuration,Általános beállitás,Einstellungen,Algemene Instellingen,Configuración General,General Configuration,General Configuration,General Configuration,General Configuration,ตั้งค่าทั่วไป,General Configuration,General Configuration,Configurações Gerais,Opća konfiguracija diff --git a/translations/datepicker_lang.csv b/translations/datepicker_lang.csv index 5148b414e..6a2576c37 100644 --- a/translations/datepicker_lang.csv +++ b/translations/datepicker_lang.csv @@ -17,4 +17,4 @@ datepicker_apply,Elfogad,Apply,Apply,Aplicar,Apply,Apply,Apply,Apply,Apply,Apply datepicker_cancel,Mégsem,Cancel,Cancel,Cancelar,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancel,Cancelar,Otkaži datepicker_from,Tól,From,From,De,From,From,From,From,From,From,From,De,Od datepicker_to,Ig,To,To,Para,To,To,To,To,To,To,To,Para,Do -datepicker_custom,Egyedi,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Cliente,Slobodan izbor +datepicker_custom,Egyedi,Custom,Custom,Personalizado,Custom,Custom,Custom,Custom,Custom,Custom,Custom,Cliente,Slobodan izbor diff --git a/translations/items_lang.csv b/translations/items_lang.csv index acd43b316..ea23bcb7b 100644 --- a/translations/items_lang.csv +++ b/translations/items_lang.csv @@ -40,7 +40,7 @@ items_item,Termék információ,Artikel,Product,Artículo,Item,Item,產品,То items_item_number,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,โค๊ด,UPC/EAN/ISBN,Kode Barang,Cod. Barra,UPC/EAN/ISBN items_item_number_duplicate,A termék száma már szerepel az adatbázisban,Die Artikelnummer existiert bereits in der Datenbank,De barcode nummer is reeds aanwezig in de database,El número de artículo ya esta presente en la base de datos,The item number is already present in the database,The item number is already present in the database,The item number is already present in the database,The item number is already present in the database,The item number is already present in the database,The item number is already present in the database,The item number is already present in the database,O número do item já está presente na base de dados,Broj stavke već postoji u bazi items_location,Helyszín,Ort,Locatie,Ubicación,Location,Location,位置,место,ที่ตั้ง,Yer,Lokasi Barang,Localização,Mjesto -items_empty_upc_items,Üres UPC term.,Leere UPC Artikel,Zonder barcode,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Vazio UPC Itens,UPC artikal +items_empty_upc_items,Üres UPC term.,Leere UPC Artikel,Zonder barcode,UPC de Articulos Vacio,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Empty UPC Items,Vazio UPC Itens,UPC artikal items_low_inventory_items,Kifogyott term.,nicht am Lager,Niet in stock,Artículos de Inventario Escaso,Out Of Stock Items,Items à Stock Faible,低庫存產品,Низкий инвентаризации товары,สินค้าคงเหลือน้อย,,Daftar Stock Rendah,Itens sem estoque,Rasprodaja artikala items_manually_editing_of_quantity,Mennyiség módosítása manuálisan,Manuelle Bestandesänderung,Manuele aanpassing hoeveelheid,Edición Manual de Cantidad,Manual Edit of Quantity,Édition Manuelle de Quantité,手動編輯數量,Руководство Изменить количество,แก้ไขจำนวน,Elle adet düzeltme,Perubahan jumlah Stok secara manual,Editar manualmente a quantidade,Ručno uređivanje količine items_must_select_item_for_barcode,Legalább 1 (egy) terméket ki kell választania vonalkód generálásához,"Sie müssen mindestens einen Artikel wählen, um Barcodes zu generieren",U moet ten minste 1 product selecteren om een barcode te genereren,Debes seleccionar al menos 1 artículo para generar códigos de barras,You must select at least 1 item to generate barcodes,Vous devez sélectionner au moins un item,您必須至少選擇一個產品生才能產生條碼,Вы должны выбрать хотя бы 1 товар для создания штрих-кодов,คุต้องเลือกสินค้าอย่างน้อยหนึ่งอย่างเพื่อจะสร้างบาร์โค๊ด,Barkod üretmek için en az bir ürün seçmelisiniz,Anda harus memilih minimal 1 item untuk membuat barcode,Você deve selecionar pelo menos um item para gerar códigos de barras,Morate odabrati barem jedan artikl da generirate barkod diff --git a/translations/reports_lang.csv b/translations/reports_lang.csv index 1cfcc319e..c183203ad 100644 --- a/translations/reports_lang.csv +++ b/translations/reports_lang.csv @@ -43,7 +43,7 @@ reports_payment_type,Fizetési mód,Zahlungsart,Betaald,Tipo de Pago,Payment Typ reports_payments,Fizetések,Zahlungen,Betalingen,Pagos,Payments,Paiements,付款,Оплаты,รายจ่าย,Ödemeler,Pembayaran,Pagamentos,Plaćanja reports_payments_summary_report,Fizetések összefoglaló riport,Bericht: Zahlungen (summarisch),Overzicht Betalingen,Reporte de Resumen de Pagos,Payments Summary Report,Rapport: Résumé des Paiements,收入報告摘要,Платежей Сводный отчет,รายงานสรุปการจ่าย,Ödeme Özet Raporu,Laporan Ringkasan Pembayaran,Relatório Resumido de Pagamentos,Zbrojni izvještaj plaćanja reports_profit,Profit,Gewinn,Winst,Ganancia,Profit,Bénéfice,利潤,прибыль,กำไร,Kâr,Keuntungan/Laba,Lucro,RUC -reports_cost,Kiadás,Kosten,Cost,Cost,Cost,Cost,Cost,Cost,Cost,,,Custo,Cijena +reports_cost,Kiadás,Kosten,Cost,Costo,Cost,Cost,Cost,Cost,Cost,,,Custo,Cijena reports_quantity,Mennyiség,Menge,Stock,Cantidad,Quantity,Quantité,數量,Количество,จำนวน,Adet,Jumlah,Quantidade,Količina reports_quantity_purchased,Vásárolt mennyiség,Menge gekauft,Aangekochte Hoeveelheid,Cantidad Comprada,Quantity Purchased,Quantité Achetée,銷售金額,купенный количество,จำนวนการช์้อ,Satın Alınan Adet,Jumlah Dibeli,Quantidade Comprada,Nabavna količina reports_received_by,Átvéve,Erhalten von,Ontvangen door,Recibido por,Received By,Recu par,收款人,получило за,รับโดย,Alım Yapan,Diterima Oleh,Recebido por,Primljeno od diff --git a/translations/sales_lang.csv b/translations/sales_lang.csv index 47eae48e5..78d5a8e4f 100644 --- a/translations/sales_lang.csv +++ b/translations/sales_lang.csv @@ -15,8 +15,8 @@ sales_confirm_delete,"Biztos, hogy törli a kijelölt értékesitéseket?",Wolle sales_credit,Hitelkártya,Kreditkarte,Kredietkaart,Tarjeta de Crédito,Credit Card,Carte de Crédit,信用卡,кредитная карта,เครดิตการ์ด,Kredi Kartı,Kartu Credit,Cartão Crédito,Kreditna kartica sales_customer,Vevő,Kunde,Klant,Nombre,Name,Client,客戶,клиент,ลูกค้า,Müşteri,Pelanggan,Cliente,Kupac sales_customer_email,Vevő e-mail,Customer Email,Customer Email,Correo,Email,Customer Email,Customer Email,Customer Email,Customer Email,Customer Email,Customer Email,e-mail,e-mail kupca -sales_customer_address,Vevő cím,Customer Address,Customer Address,Direccion,Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Endereço,Adresa kupca -sales_customer_location,Vevő hely,Customer Location,Customer Location,Ubicacion,Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Localização,Mjesto kupca +sales_customer_address,Vevő cím,Customer Address,Customer Address,Dirección,Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Customer Address,Endereço,Adresa kupca +sales_customer_location,Vevő hely,Customer Location,Customer Location,Ubicación,Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Customer Location,Localização,Mjesto kupca sales_customer_discount,Discount,Discount,Discount,Descuento,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount,Discount sales_customer_total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total,Total sales_date,Eladás dátuma,Datum,Datum,Fecha,Sale Date,Date de Vente,日期,Число,วันที่ขาย,Satış Tarihi,Tanggal,Data Venda,Datum prodaje From 9f7ea6f1cbd30e020d9c0455544d826ad6b7856c Mon Sep 17 00:00:00 2001 From: sonnysk76 Date: Fri, 10 Jun 2016 16:58:26 -0500 Subject: [PATCH 4/4] merging --- .bowerrc | 3 +- .dockerignore | 21 + .travis.yml | 36 +- Dockerfile | 38 +- Dockerfile.test | 11 + Gruntfile.js | 10 +- README.md | 17 +- application/config/config.php | 4 +- application/config/routes.php | 5 +- application/controllers/Barcode.php | 16 - application/controllers/Config.php | 239 +- application/controllers/Customers.php | 267 +- application/controllers/Employees.php | 159 +- application/controllers/Giftcards.php | 115 +- application/controllers/Home.php | 15 +- application/controllers/Item_kits.php | 154 +- application/controllers/Items.php | 620 +- application/controllers/Languagecheck.php | 192 - application/controllers/Login.php | 13 +- application/controllers/Messages.php | 53 +- application/controllers/No_access.php | 16 +- application/controllers/Person_controller.php | 53 - application/controllers/Persons.php | 32 + application/controllers/Receivings.php | 22 +- application/controllers/Reports.php | 962 +- application/controllers/Sales.php | 156 +- application/controllers/Secure_Controller.php | 52 + application/controllers/Secure_area.php | 65 - application/controllers/Suppliers.php | 147 +- .../interfaces/Idata_controller.php | 16 - .../interfaces/Iperson_controller.php | 11 - application/helpers/locale_helper.php | 18 +- application/helpers/table_helper.php | 637 +- application/hooks/load_config.php | 31 +- .../language/de-CH/bootstrap_tables_lang.php | 10 + application/language/de-CH/common_lang.php | 1 + application/language/de-CH/config_lang.php | 3 + application/language/de-CH/customers_lang.php | 4 + application/language/de-CH/items_lang.php | 4 +- .../language/de-CH/receivings_lang.php | 4 +- application/language/de-CH/reports_lang.php | 1 + .../language/en/bootstrap_tables_lang.php | 10 + application/language/en/common_lang.php | 1 + application/language/en/config_lang.php | 3 + application/language/en/customers_lang.php | 4 + application/language/en/items_lang.php | 4 +- application/language/en/receivings_lang.php | 4 +- application/language/en/reports_lang.php | 1 + .../language/es/bootstrap_tables_lang.php | 10 + application/language/es/common_lang.php | 1 + application/language/es/config_lang.php | 3 + application/language/es/customers_lang.php | 4 + application/language/es/items_lang.php | 4 +- application/language/es/receivings_lang.php | 4 +- application/language/es/reports_lang.php | 1 + .../language/fr/bootstrap_tables_lang.php | 10 + application/language/fr/common_lang.php | 1 + application/language/fr/config_lang.php | 3 + application/language/fr/customers_lang.php | 4 + application/language/fr/items_lang.php | 4 +- application/language/fr/receivings_lang.php | 4 +- application/language/fr/reports_lang.php | 1 + .../language/hr-HR/bootstrap_tables_lang.php | 10 + application/language/hr-HR/common_lang.php | 1 + application/language/hr-HR/config_lang.php | 3 + application/language/hr-HR/customers_lang.php | 4 + application/language/hr-HR/items_lang.php | 4 +- .../language/hr-HR/receivings_lang.php | 4 +- application/language/hr-HR/reports_lang.php | 1 + .../language/hu-HU/bootstrap_tables_lang.php | 10 + application/language/hu-HU/common_lang.php | 1 + application/language/hu-HU/config_lang.php | 3 + application/language/hu-HU/customers_lang.php | 4 + application/language/hu-HU/items_lang.php | 4 +- .../language/hu-HU/receivings_lang.php | 4 +- application/language/hu-HU/reports_lang.php | 1 + .../language/id/bootstrap_tables_lang.php | 10 + application/language/id/common_lang.php | 1 + application/language/id/config_lang.php | 3 + application/language/id/customers_lang.php | 4 + application/language/id/items_lang.php | 4 +- application/language/id/receivings_lang.php | 4 +- application/language/id/reports_lang.php | 1 + .../language/nl-BE/bootstrap_tables_lang.php | 10 + application/language/nl-BE/common_lang.php | 1 + application/language/nl-BE/config_lang.php | 3 + application/language/nl-BE/customers_lang.php | 4 + application/language/nl-BE/items_lang.php | 4 +- .../language/nl-BE/receivings_lang.php | 4 +- application/language/nl-BE/reports_lang.php | 1 + .../language/pt-BR/bootstrap_tables_lang.php | 10 + application/language/pt-BR/common_lang.php | 1 + application/language/pt-BR/config_lang.php | 23 +- application/language/pt-BR/customers_lang.php | 6 +- application/language/pt-BR/giftcards_lang.php | 2 +- application/language/pt-BR/item_kits_lang.php | 2 +- application/language/pt-BR/items_lang.php | 8 +- application/language/pt-BR/messages_lang.php | 24 +- application/language/pt-BR/module_lang.php | 4 +- .../language/pt-BR/receivings_lang.php | 4 +- application/language/pt-BR/reports_lang.php | 3 +- application/language/pt-BR/sales_lang.php | 4 +- .../language/ru/bootstrap_tables_lang.php | 10 + application/language/ru/common_lang.php | 1 + application/language/ru/config_lang.php | 3 + application/language/ru/customers_lang.php | 4 + application/language/ru/items_lang.php | 4 +- application/language/ru/receivings_lang.php | 4 +- application/language/ru/reports_lang.php | 1 + .../language/th/bootstrap_tables_lang.php | 10 + application/language/th/common_lang.php | 1 + application/language/th/config_lang.php | 3 + application/language/th/customers_lang.php | 4 + application/language/th/items_lang.php | 4 +- application/language/th/receivings_lang.php | 4 +- application/language/th/reports_lang.php | 1 + .../language/tr/bootstrap_tables_lang.php | 10 + application/language/tr/common_lang.php | 1 + application/language/tr/config_lang.php | 3 + application/language/tr/customers_lang.php | 4 + application/language/tr/items_lang.php | 4 +- application/language/tr/receivings_lang.php | 4 +- application/language/tr/reports_lang.php | 1 + .../language/zh/bootstrap_tables_lang.php | 10 + application/language/zh/common_lang.php | 1 + application/language/zh/config_lang.php | 3 + application/language/zh/customers_lang.php | 4 + application/language/zh/items_lang.php | 4 +- application/language/zh/receivings_lang.php | 4 +- application/language/zh/reports_lang.php | 1 + application/libraries/Receiving_lib.php | 1 + application/libraries/Sale_lib.php | 177 +- application/libraries/Sms.php | 5 +- .../libraries/ofc-library/Dot_base.php | 231 - application/libraries/ofc-library/JSON.php | 806 -- .../libraries/ofc-library/Json_format.php | 86 - .../libraries/ofc-library/Ofc_area_base.php | 40 - .../libraries/ofc-library/Ofc_area_hollow.php | 10 - .../libraries/ofc-library/Ofc_area_line.php | 10 - .../libraries/ofc-library/Ofc_arrow.php | 27 - application/libraries/ofc-library/Ofc_bar.php | 34 - .../libraries/ofc-library/Ofc_bar_3d.php | 22 - .../libraries/ofc-library/Ofc_bar_base.php | 97 - .../libraries/ofc-library/Ofc_bar_filled.php | 39 - .../libraries/ofc-library/Ofc_bar_glass.php | 131 - .../libraries/ofc-library/Ofc_bar_sketch.php | 29 - .../libraries/ofc-library/Ofc_bar_stack.php | 55 - .../libraries/ofc-library/Ofc_candle.php | 41 - .../libraries/ofc-library/Ofc_hbar.php | 64 - .../libraries/ofc-library/Ofc_line.php | 157 - .../libraries/ofc-library/Ofc_line_base.php | 92 - .../libraries/ofc-library/Ofc_line_dot.php | 33 - .../libraries/ofc-library/Ofc_line_hollow.php | 9 - .../libraries/ofc-library/Ofc_line_style.php | 11 - .../libraries/ofc-library/Ofc_menu.php | 56 - application/libraries/ofc-library/Ofc_pie.php | 257 - .../libraries/ofc-library/Ofc_radar_axis.php | 47 - .../ofc-library/Ofc_radar_axis_labels.php | 15 - .../ofc-library/Ofc_radar_spoke_labels.php | 15 - .../libraries/ofc-library/Ofc_scatter.php | 47 - .../ofc-library/Ofc_scatter_line.php | 49 - .../libraries/ofc-library/Ofc_shape.php | 25 - .../libraries/ofc-library/Ofc_sugar.php | 43 - .../libraries/ofc-library/Ofc_tags.php | 133 - .../libraries/ofc-library/Ofc_title.php | 39 - .../libraries/ofc-library/Ofc_tooltip.php | 67 - .../libraries/ofc-library/Ofc_x_axis.php | 140 - .../ofc-library/Ofc_x_axis_label.php | 45 - .../ofc-library/Ofc_x_axis_labels.php | 69 - .../libraries/ofc-library/Ofc_x_legend.php | 15 - .../libraries/ofc-library/Ofc_y_axis.php | 17 - .../libraries/ofc-library/Ofc_y_axis_base.php | 116 - .../ofc-library/Ofc_y_axis_label.php | 38 - .../ofc-library/Ofc_y_axis_labels.php | 57 - .../ofc-library/Ofc_y_axis_right.php | 6 - .../libraries/ofc-library/Ofc_y_legend.php | 15 - .../ofc-library/Open-flash-chart-object.php | 109 - .../ofc-library/Open-flash-chart.php | 178 - application/libraries/ofc-library/README.txt | 16 - application/models/Appconfig.php | 69 +- application/models/Customer.php | 169 +- application/models/Employee.php | 374 +- application/models/Giftcard.php | 152 +- application/models/Inventory.php | 16 +- application/models/Item.php | 205 +- application/models/Item_kit.php | 69 +- application/models/Item_kit_items.php | 16 +- application/models/Item_quantity.php | 36 +- application/models/Item_taxes.php | 48 +- application/models/Module.php | 38 +- application/models/Person.php | 104 +- application/models/Receiving.php | 174 +- application/models/Sale.php | 214 +- application/models/Sale_suspended.php | 134 +- application/models/Stock_location.php | 89 +- application/models/Supplier.php | 225 +- .../models/reports/Detailed_receivings.php | 53 +- application/models/reports/Detailed_sales.php | 47 +- application/models/reports/Inventory_low.php | 4 +- .../models/reports/Inventory_summary.php | 18 +- application/models/reports/Report.php | 2 +- .../models/reports/Specific_customer.php | 8 +- .../models/reports/Specific_discount.php | 12 +- .../models/reports/Specific_employee.php | 8 +- .../models/reports/Summary_categories.php | 8 +- .../models/reports/Summary_customers.php | 8 +- .../models/reports/Summary_discounts.php | 9 +- .../models/reports/Summary_employees.php | 8 +- application/models/reports/Summary_items.php | 8 +- .../models/reports/Summary_payments.php | 8 +- application/models/reports/Summary_sales.php | 8 +- .../models/reports/Summary_suppliers.php | 8 +- application/models/reports/Summary_taxes.php | 38 +- application/views/configs/barcode_config.php | 32 +- application/views/configs/general_config.php | 51 +- application/views/configs/info_config.php | 29 +- application/views/configs/invoice_config.php | 32 +- application/views/configs/locale_config.php | 59 +- application/views/configs/manage.php | 26 +- application/views/configs/message_config.php | 27 +- application/views/configs/receipt_config.php | 24 +- application/views/configs/stock_config.php | 24 +- application/views/customers/form.php | 4 +- .../views/customers/form_excel_import.php | 28 +- application/views/employees/form.php | 31 +- application/views/giftcards/form.php | 10 +- application/views/giftcards/manage.php | 92 +- application/views/item_kits/form.php | 9 +- application/views/item_kits/manage.php | 111 +- application/views/items/form.php | 4 +- application/views/items/form_bulk.php | 14 +- .../views/items/form_count_details.php | 2 +- application/views/items/form_excel_import.php | 28 +- application/views/items/form_inventory.php | 2 +- application/views/items/manage.php | 223 +- application/views/login.php | 2 +- application/views/messages/form_sms.php | 4 +- application/views/messages/sms.php | 9 +- .../views/partial/bootstrap_tables_locale.php | 43 + application/views/partial/footer.php | 3 +- application/views/partial/footer_excel.php | 3 - application/views/partial/header.php | 29 +- application/views/partial/header_excel.php | 43 - application/views/partial/print_receipt.php | 8 +- application/views/people/form_basic_info.php | 3 +- application/views/people/manage.php | 130 +- application/views/receivings/form.php | 52 +- application/views/receivings/receipt.php | 2 +- application/views/receivings/receiving.php | 125 +- .../views/reports/date_input_excel_export.php | 63 - application/views/reports/excel_export.php | 45 - application/views/reports/graphical.php | 14 +- application/views/reports/graphs/bar.php | 141 +- application/views/reports/graphs/hbar.php | 155 +- application/views/reports/graphs/line.php | 222 +- application/views/reports/graphs/pie.php | 108 +- .../views/reports/inventory_summary_input.php | 15 +- application/views/reports/specific_input.php | 14 +- application/views/reports/tabular.php | 101 +- application/views/reports/tabular_details.php | 214 +- application/views/sales/form.php | 46 +- application/views/sales/invoice.php | 6 +- application/views/sales/invoice_email.php | 2 +- application/views/sales/manage.php | 247 +- application/views/sales/register.php | 180 +- application/views/suppliers/form.php | 4 +- application/views/suppliers/manage.php | 88 - bower.json | 29 +- css/ospos.css | 36 +- css/ospos_print.css | 17 +- css/receipt.css | 5 - css/register.css | 6 +- css/reports.css | 44 +- css/tables.css | 125 - database/2.0_to_2.1.sql | 13 + database/2.1_to_2.2.sql | 3 + database/2.4_to_3.0.sql | 5 +- database/database.sql | 6 +- database/migrate_phppos_dist.sql | 5 +- database/tables.sql | 5 +- dist/bootstrap.min.css | 4 +- dist/opensourcepos.js | 8832 ++++------------- dist/opensourcepos.min.css | 8 +- dist/opensourcepos.min.js | 50 +- docker-compose.test.yml | 39 + docker-compose.yml | 35 + docker/foreground.sh | 9 - docker/start_container.sh | 19 - docker/supervisor.conf | 147 - docker/supervisord.conf | 147 - js/common.js | 16 - js/jquery.tablesorter.staticrow.js | 81 - js/manage_tables.js | 723 +- js/nominatim.autocomplete.js | 13 +- open-flash-chart.swf | Bin 276186 -> 0 bytes templates/spacelab/views/login.php | 2 +- templates/spacelab/views/partial/footer.php | 3 +- templates/spacelab/views/partial/header.php | 18 +- test/giftcard_numbering.js | 10 +- test/make_sale_receiving.js | 15 +- test/ospos.js | 15 +- test/receiving_quantity.js | 7 +- translations/bootstrap_tables_lang.csv | 9 + translations/common_lang.csv | 11 +- translations/config_lang.csv | 47 +- translations/customers_lang.csv | 4 +- translations/datepicker_lang.csv | 14 +- translations/employees_lang.csv | 2 +- translations/giftcards_lang.csv | 2 +- translations/item_kits_lang.csv | 2 +- translations/items_lang.csv | 9 +- translations/messages_lang.csv | 24 +- translations/module_lang.csv | 4 +- translations/receivings_lang.csv | 4 +- translations/reports_lang.csv | 7 +- translations/sales_lang.csv | 14 +- translations/suppliers_lang.csv | 2 +- 317 files changed, 7335 insertions(+), 17124 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile.test delete mode 100644 application/controllers/Barcode.php delete mode 100644 application/controllers/Languagecheck.php delete mode 100644 application/controllers/Person_controller.php create mode 100644 application/controllers/Persons.php create mode 100644 application/controllers/Secure_Controller.php delete mode 100644 application/controllers/Secure_area.php delete mode 100644 application/controllers/interfaces/Idata_controller.php delete mode 100644 application/controllers/interfaces/Iperson_controller.php create mode 100644 application/language/de-CH/bootstrap_tables_lang.php create mode 100644 application/language/en/bootstrap_tables_lang.php create mode 100644 application/language/es/bootstrap_tables_lang.php create mode 100644 application/language/fr/bootstrap_tables_lang.php create mode 100644 application/language/hr-HR/bootstrap_tables_lang.php create mode 100644 application/language/hu-HU/bootstrap_tables_lang.php create mode 100644 application/language/id/bootstrap_tables_lang.php create mode 100644 application/language/nl-BE/bootstrap_tables_lang.php create mode 100644 application/language/pt-BR/bootstrap_tables_lang.php create mode 100644 application/language/ru/bootstrap_tables_lang.php create mode 100644 application/language/th/bootstrap_tables_lang.php create mode 100644 application/language/tr/bootstrap_tables_lang.php create mode 100644 application/language/zh/bootstrap_tables_lang.php delete mode 100644 application/libraries/ofc-library/Dot_base.php delete mode 100644 application/libraries/ofc-library/JSON.php delete mode 100644 application/libraries/ofc-library/Json_format.php delete mode 100644 application/libraries/ofc-library/Ofc_area_base.php delete mode 100644 application/libraries/ofc-library/Ofc_area_hollow.php delete mode 100644 application/libraries/ofc-library/Ofc_area_line.php delete mode 100644 application/libraries/ofc-library/Ofc_arrow.php delete mode 100644 application/libraries/ofc-library/Ofc_bar.php delete mode 100644 application/libraries/ofc-library/Ofc_bar_3d.php delete mode 100644 application/libraries/ofc-library/Ofc_bar_base.php delete mode 100644 application/libraries/ofc-library/Ofc_bar_filled.php delete mode 100644 application/libraries/ofc-library/Ofc_bar_glass.php delete mode 100644 application/libraries/ofc-library/Ofc_bar_sketch.php delete mode 100644 application/libraries/ofc-library/Ofc_bar_stack.php delete mode 100644 application/libraries/ofc-library/Ofc_candle.php delete mode 100644 application/libraries/ofc-library/Ofc_hbar.php delete mode 100644 application/libraries/ofc-library/Ofc_line.php delete mode 100644 application/libraries/ofc-library/Ofc_line_base.php delete mode 100644 application/libraries/ofc-library/Ofc_line_dot.php delete mode 100644 application/libraries/ofc-library/Ofc_line_hollow.php delete mode 100644 application/libraries/ofc-library/Ofc_line_style.php delete mode 100644 application/libraries/ofc-library/Ofc_menu.php delete mode 100644 application/libraries/ofc-library/Ofc_pie.php delete mode 100644 application/libraries/ofc-library/Ofc_radar_axis.php delete mode 100644 application/libraries/ofc-library/Ofc_radar_axis_labels.php delete mode 100644 application/libraries/ofc-library/Ofc_radar_spoke_labels.php delete mode 100644 application/libraries/ofc-library/Ofc_scatter.php delete mode 100644 application/libraries/ofc-library/Ofc_scatter_line.php delete mode 100644 application/libraries/ofc-library/Ofc_shape.php delete mode 100644 application/libraries/ofc-library/Ofc_sugar.php delete mode 100644 application/libraries/ofc-library/Ofc_tags.php delete mode 100644 application/libraries/ofc-library/Ofc_title.php delete mode 100644 application/libraries/ofc-library/Ofc_tooltip.php delete mode 100644 application/libraries/ofc-library/Ofc_x_axis.php delete mode 100644 application/libraries/ofc-library/Ofc_x_axis_label.php delete mode 100644 application/libraries/ofc-library/Ofc_x_axis_labels.php delete mode 100644 application/libraries/ofc-library/Ofc_x_legend.php delete mode 100644 application/libraries/ofc-library/Ofc_y_axis.php delete mode 100644 application/libraries/ofc-library/Ofc_y_axis_base.php delete mode 100644 application/libraries/ofc-library/Ofc_y_axis_label.php delete mode 100644 application/libraries/ofc-library/Ofc_y_axis_labels.php delete mode 100644 application/libraries/ofc-library/Ofc_y_axis_right.php delete mode 100644 application/libraries/ofc-library/Ofc_y_legend.php delete mode 100644 application/libraries/ofc-library/Open-flash-chart-object.php delete mode 100644 application/libraries/ofc-library/Open-flash-chart.php delete mode 100644 application/libraries/ofc-library/README.txt create mode 100644 application/views/partial/bootstrap_tables_locale.php delete mode 100644 application/views/partial/footer_excel.php delete mode 100644 application/views/partial/header_excel.php delete mode 100644 application/views/reports/date_input_excel_export.php delete mode 100644 application/views/reports/excel_export.php delete mode 100644 application/views/suppliers/manage.php delete mode 100644 css/tables.css create mode 100644 database/2.0_to_2.1.sql create mode 100644 database/2.1_to_2.2.sql create mode 100644 docker-compose.test.yml create mode 100644 docker-compose.yml delete mode 100644 docker/foreground.sh delete mode 100644 docker/start_container.sh delete mode 100644 docker/supervisor.conf delete mode 100644 docker/supervisord.conf delete mode 100644 js/common.js delete mode 100644 js/jquery.tablesorter.staticrow.js delete mode 100644 open-flash-chart.swf create mode 100644 translations/bootstrap_tables_lang.csv diff --git a/.bowerrc b/.bowerrc index 1e77ab58c..6f66a8895 100644 --- a/.bowerrc +++ b/.bowerrc @@ -1,5 +1,6 @@ { "scripts": { - "postinstall": "grunt" + "postinstall": "grunt", + "postuninstall": "grunt" } } diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..544c9b50c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,21 @@ +node_modules +bower_components +tmp +application/config/email.php +application/config/database.php +*.patch +patches/ +.idea/ +git-svn-diff.py +*.bash +.swp +.buildpath +.project +.settings/* +*.swp +*.rej +*.orig +*~ +*.~ +*.log +application/sessions/* diff --git a/.travis.yml b/.travis.yml index 60d249815..ba6014d2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,34 @@ -sudo: false +sudo: true # Required to install packages -language: node_js +services: - docker -node_js: - - "4.1" +env: + global: + - DOCKER_VERSION=1.7.1 # Install Docker version 1.7.1 + - DOCKER_COMPOSE_VERSION=1.7.1 + - DOCKER_VERSION=get.docker.com # Install Docker using get.docker.com (may break) -services: - - docker + - BRANCH=stable # Use 'stable' branch + - BRANCH=develop # Use 'develop' branch + - QUIET=1 # Less verbose logging + - UML_FIG=0 # Don't install fig + - UML_DOCKERCOMPOSE=1 # Install docker-compose + + install: + # Install https://github.com/moul/travis-docker toolchain + # - curl -sLo - http://j.mp/install-travis-docker | sh -xe before_install: - - docker build -t jekkos/opensourcepos . - - docker run -d jekkos/opensourcepos + - sudo rm /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + - docker-compose build + - docker-compose up -d script: - - docker exec -t -i $(docker ps | tail -n 1 | cut -d' ' -f1) /bin/sh -c "while ! curl http://localhost/index.php | grep username; do sleep 1; done; cd app && grunt mochaWebdriver:test" + - docker-wait opensourcepos_php_1 + +after_success: + - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" + - docker push jekkos/opensourcepos diff --git a/Dockerfile b/Dockerfile index 118418979..17f0a157e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,19 @@ -FROM ubuntu:utopic +FROM php:5-apache MAINTAINER jekkos RUN sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list -RUN apt-get update -RUN apt-get -y upgrade -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php5-gd php5-apcu nodejs npm curl -RUN easy_install supervisor -ADD ./docker/foreground.sh /etc/apache2/foreground.sh -ADD ./docker/supervisord.conf /etc/supervisord.conf -RUN chmod 755 /etc/apache2/foreground.sh -# Install dependencies -RUN apt-get install -y --no-install-recommends software-properties-common -RUN apt-get install -y python git +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + php5-gd \ + php5-apcu -# Get latest Ospos source from Git -RUN git clone https://github.com/jekkos/opensourcepos.git /app -RUN cd app && git checkout origin/master -RUN ln -s /usr/bin/nodejs /usr/bin/node -RUN cd app && npm install -RUN npm install -g grunt-cli -RUN ln -s /usr/local/bin/grunt /usr/bin/grunt +RUN a2enmod rewrite +RUN docker-php-ext-install mysql mysqli -RUN ln -fs /app/* /var/www/html -ADD ./docker/start_container.sh /start_container.sh -RUN chmod 755 /start_container.sh -EXPOSE 80 3306 -CMD ["/bin/bash", "/start_container.sh"] +WORKDIR /app +COPY . /app + +RUN cp application/config/database.php.tmpl application/config/database.php && \ + sed -i -e "s/\(localhost\)/web/g" test/ospos.js && \ + sed -i -e "s/\(user.*\?=.\).*\(.\)$/\1'${MYSQL_USERNAME}'\2/g" application/config/database.php && \ + sed -i -e "s/\(password.*\?=.\).*\(.\)$/\1'${MYSQL_PASSWORD}'\2/g" application/config/database.php && \ + sed -i -e "s/\(database.*\?=.\).*\(.\)$/\1'${MYSQL_DB_NAME}'\2/g" application/config/database.php && \ + sed -i -e "s/\(hostname.*\?=.\).*\(.\)$/\1'${MYSQL_HOST_NAME}'\2/g" application/config/database.php diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 000000000..cb55d5275 --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,11 @@ +FROM digitallyseamless/nodejs-bower-grunt:5 +MAINTAINER jekkos + +apt-get install curl + +COPY Gruntfile.js . +COPY package.json . +COPY test . +RUN npm install + +CMD ['while ! curl web/index.php | grep username; do sleep 1; done; && grunt mochaWebdriver:test'] diff --git a/Gruntfile.js b/Gruntfile.js index 3b38b3df3..127dfaee9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,7 +17,8 @@ module.exports = function(grunt) { bower_concat: { all: { mainFiles: { - 'bootswatch-dist': ['bootstrap/dist/js/bootstrap.js'] + 'bootswatch-dist': ['bootstrap/dist/js/bootstrap.js'], + 'bootstrap-table': [ "src/bootstrap-table.js", "src/bootstrap-table.css", "dist/extensions/export/bootstrap-table-export.js", "dist/extensions/mobile/bootstrap-table-mobile.js"] }, dest: { 'js': 'tmp/opensourcepos_bower.js', @@ -146,8 +147,7 @@ module.exports = function(grunt) { absolutePath: true }, src: ['js/jquery*', 'js/*.js'], - dest: 'application/views/partial/header.php', - dest: 'templates/spacelab/views/partial/header.php' + dest: 'application/views/partial/header.php' }, minjs: { options: { @@ -157,8 +157,7 @@ module.exports = function(grunt) { absolutePath: true }, src: ['dist/*min.js'], - dest: 'application/views/partial/header.php', - dest: 'templates/spacelab/views/partial/header.php' + dest: 'application/views/partial/header.php' } }, mochaWebdriver: { @@ -195,6 +194,7 @@ module.exports = function(grunt) { }); require('load-grunt-tasks')(grunt); + grunt.loadNpmTasks('grunt-mocha-webdriver'); grunt.registerTask('default', ['wiredep', 'bower_concat', 'bowercopy', 'concat', 'uglify', 'cssmin', 'tags', 'cachebreaker']); diff --git a/README.md b/README.md index c2329ee48..e78907c32 100644 --- a/README.md +++ b/README.md @@ -58,23 +58,14 @@ FAQ --- If a blank page (HTTP status 500) shows after search completion or receipt generation, then double check php5-gd presence in your php installation. On windows check in php.ini whether the lib is installed. On Ubuntu issue `sudo apt-get install php5-gd`. Also have a look at the Dockerfile for a complete list of recommended packages. -13/01/2016: Install using Docker +08/06/2014: Install using Docker -------------------------------- From now on ospos can be deployed using Docker on Linux, Mac or Windows. This setup dramatically reduces the number of possible issues as all setup is now done in a Dockerfile. Docker runs natively on mac and linux, but will require more overhead on windows. Please refer to the docker documentation for instructions on how to set it up on your platform. To build and run the image, issue following commands in a terminal with docker installed - docker build -t me/ospos https://github.com/jekkos/opensourcepos.git - docker run -d -p 80:80 me/ospos - -Docker will clone the latest master into the image and start a LAMP stack with the application configured. If you like to persist your changes in this install, then you can use two docker data containers to store database and filesystem changes. In this case you will need following command (first time only) - - docker run -d -v /app --name="ospos" -v /var/lib/mysql --name="ospos-sql" -p 127.0.0.1:80:80 me/ospos - -After stopping the created container for the first time, this command will be replaced with - - docker run -d -v /app --volumes-from="ospos" -v /var/lib/mysql --volumes-from="ospos-sql" -p 127.0.0.1:80:80 me/ospos - -Both the data and mysql directories will be persisted in a separate docker container and can be mounted within any other container using the last command. A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation) + docker-compose build + docker-commpose up + diff --git a/application/config/config.php b/application/config/config.php index c82190a6c..d0ff6bee0 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -89,7 +89,7 @@ $config['url_suffix'] = ''; | than english. | */ -$config['language'] = 'en'; +$config['language'] = 'es'; /* |-------------------------------------------------------------------------- @@ -327,7 +327,7 @@ $config['cache_query_string'] = FALSE; | https://codeigniter.com/user_guide/libraries/encryption.html | */ -$config['encryption_key'] = ''; +$config['encryption_key'] = 'r'; /* |-------------------------------------------------------------------------- diff --git a/application/config/routes.php b/application/config/routes.php index d96d28a66..1b3b03950 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -57,13 +57,12 @@ $route['sales/index/([^/]+)'] = 'sales/manage/$1'; $route['sales/index/([^/]+)/([^/]+)'] = 'sales/manage/$1/$2'; $route['sales/index/([^/]+)/([^/]+)/([^/]+)'] = 'sales/manage/$1/$2/$3'; $route['reports/(summary_:any)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3'; -$route['reports/summary_:any'] = 'reports/date_input_excel_export'; +$route['reports/summary_:any'] = 'reports/date_input'; $route['reports/(graphical_:any)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3'; $route['reports/graphical_:any'] = 'reports/date_input'; $route['reports/(inventory_:any)/([^/]+)'] = 'reports/$1/$2'; -$route['reports/inventory_:any'] = 'reports/excel_export'; $route['reports/inventory_summary'] = 'reports/inventory_summary_input'; -$route['reports/(inventory_summary)/([^/]+)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3/$4'; +$route['reports/(inventory_summary)/([^/]+)/([^/]+)/([^/]+)'] = 'reports/$1/$2'; $route['reports/(detailed_sales)/([^/]+)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3$/$4'; $route['reports/detailed_sales'] = 'reports/date_input_sales'; diff --git a/application/controllers/Barcode.php b/application/controllers/Barcode.php deleted file mode 100644 index 9e9655ded..000000000 --- a/application/controllers/Barcode.php +++ /dev/null @@ -1,16 +0,0 @@ -load->view('barcode'); - } - -} -?> \ No newline at end of file diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 7b79763e1..acd5e82d6 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -1,125 +1,138 @@ -load->library('barcode_lib'); } - function index() + public function index() { - $location_names = array(); $data['stock_locations'] = $this->Stock_location->get_all()->result_array(); $data['support_barcode'] = $this->barcode_lib->get_list_barcodes(); $data['logo_exists'] = $this->Appconfig->get('company_logo') != ''; + + $data = $this->xss_clean($data); $this->load->view("configs/manage", $data); } - function save_info() + public function save_info() { $upload_success = $this->_handle_logo_upload(); $upload_data = $this->upload->data(); - + $batch_save_data = array( - 'company'=>$this->input->post('company'), - 'address'=>$this->input->post('address'), - 'phone'=>$this->input->post('phone'), - 'email'=>$this->input->post('email'), - 'fax'=>$this->input->post('fax'), - 'website'=>$this->input->post('website'), - 'return_policy'=>$this->input->post('return_policy') + 'company' => $this->input->post('company'), + 'address' => $this->input->post('address'), + 'phone' => $this->input->post('phone'), + 'email' => $this->input->post('email'), + 'fax' => $this->input->post('fax'), + 'website' => $this->input->post('website'), + 'return_policy' => $this->input->post('return_policy') ); if (!empty($upload_data['orig_name'])) { - $batch_save_data['company_logo'] = $upload_data['raw_name'] . $upload_data['file_ext']; + // XSS file image sanity check + if ($this->xss_clean($upload_data['raw_name'], TRUE) === TRUE) + { + $batch_save_data['company_logo'] = $upload_data['raw_name'] . $upload_data['file_ext']; + } } $result = $this->Appconfig->batch_save($batch_save_data); - $success = $upload_success && $result ? true : false; + $success = $upload_success && $result ? TRUE : FALSE; $message = $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'); $message = $upload_success ? $message : $this->upload->display_errors(); - echo json_encode(array('success'=>$success, 'message'=>$message)); + echo json_encode(array('success' => $success, 'message' => $message)); } - function save_general() + public function save_general() { $batch_save_data = array( - 'default_tax_1_rate'=>$this->input->post('default_tax_1_rate'), - 'default_tax_1_name'=>$this->input->post('default_tax_1_name'), - 'default_tax_2_rate'=>$this->input->post('default_tax_2_rate'), - 'default_tax_2_name'=>$this->input->post('default_tax_2_name'), - 'tax_included'=>$this->input->post('tax_included') != null, - 'receiving_calculate_average_price'=>$this->input->post('receiving_calculate_average_price') != null, - 'lines_per_page'=>$this->input->post('lines_per_page'), - 'default_sales_discount'=>$this->input->post('default_sales_discount'), - 'custom1_name'=>$this->input->post('custom1_name'), - 'custom2_name'=>$this->input->post('custom2_name'), - 'custom3_name'=>$this->input->post('custom3_name'), - 'custom4_name'=>$this->input->post('custom4_name'), - 'custom5_name'=>$this->input->post('custom5_name'), - 'custom6_name'=>$this->input->post('custom6_name'), - 'custom7_name'=>$this->input->post('custom7_name'), - 'custom8_name'=>$this->input->post('custom8_name'), - 'custom9_name'=>$this->input->post('custom9_name'), - 'custom10_name'=>$this->input->post('custom10_name') + 'default_tax_1_rate' => $this->input->post('default_tax_1_rate'), + 'default_tax_1_name' => $this->input->post('default_tax_1_name'), + 'default_tax_2_rate' => $this->input->post('default_tax_2_rate'), + 'default_tax_2_name' => $this->input->post('default_tax_2_name'), + 'tax_included' => $this->input->post('tax_included') != NULL, + 'receiving_calculate_average_price' => $this->input->post('receiving_calculate_average_price') != NULL, + 'lines_per_page' => $this->input->post('lines_per_page'), + 'default_sales_discount' => $this->input->post('default_sales_discount'), + 'config_notify_horizontal_position' => $this->input->post('config_notify_horizontal_position'), + 'config_notify_vertical_position' => $this->input->post('config_notify_vertical_position'), + 'custom1_name' => $this->input->post('custom1_name'), + 'custom2_name' => $this->input->post('custom2_name'), + 'custom3_name' => $this->input->post('custom3_name'), + 'custom4_name' => $this->input->post('custom4_name'), + 'custom5_name' => $this->input->post('custom5_name'), + 'custom6_name' => $this->input->post('custom6_name'), + 'custom7_name' => $this->input->post('custom7_name'), + 'custom8_name' => $this->input->post('custom8_name'), + 'custom9_name' => $this->input->post('custom9_name'), + 'custom10_name' => $this->input->post('custom10_name') ); $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; + $success = $result ? TRUE : FALSE; - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } function save_locale() { $batch_save_data = array( - 'currency_symbol'=>$this->input->post('currency_symbol'), - 'currency_side'=>$this->input->post('currency_side') != null, - 'language'=>$this->input->post('language'), - 'timezone'=>$this->input->post('timezone'), - 'dateformat'=>$this->input->post('dateformat'), - 'timeformat'=>$this->input->post('timeformat'), - 'thousands_separator'=>$this->input->post('thousands_separator'), - 'decimal_point'=>$this->input->post('decimal_point'), - 'currency_decimals'=>$this->input->post('currency_decimals'), - 'tax_decimals'=>$this->input->post('tax_decimals'), - 'quantity_decimals'=>$this->input->post('quantity_decimals') + 'currency_symbol' => $this->input->post('currency_symbol'), + 'currency_side' => $this->input->post('currency_side') != NULL, + 'language' => $this->input->post('language'), + 'timezone' => $this->input->post('timezone'), + 'dateformat' => $this->input->post('dateformat'), + 'timeformat' => $this->input->post('timeformat'), + 'thousands_separator' => $this->input->post('thousands_separator'), + 'decimal_point' => $this->input->post('decimal_point'), + 'currency_decimals' => $this->input->post('currency_decimals'), + 'tax_decimals' => $this->input->post('tax_decimals'), + 'quantity_decimals' => $this->input->post('quantity_decimals'), + 'country_codes' => $this->input->post('country_codes') ); $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; + $success = $result ? TRUE : FALSE; - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } - function save_message() + public function save_message() { $batch_save_data = array( - 'msg_msg'=>$this->input->post('msg_msg'), - 'msg_uid'=>$this->input->post('msg_uid'), - 'msg_pwd'=>$this->input->post('msg_pwd'), - 'msg_src'=>$this->input->post('msg_src') + 'msg_msg' => $this->input->post('msg_msg'), + 'msg_uid' => $this->input->post('msg_uid'), + 'msg_pwd' => $this->input->post('msg_pwd'), + 'msg_src' => $this->input->post('msg_src') ); $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; + $success = $result ? TRUE : FALSE; - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } - function stock_locations() + public function stock_locations() { $stock_locations = $this->Stock_location->get_all()->result_array(); + + $stock_locations = $this->xss_clean($stock_locations); - $this->load->view('partial/stock_locations', array('stock_locations'=>$stock_locations)); + $this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); } - function _clear_session_state() + private function _clear_session_state() { $this->load->library('sale_lib'); $this->sale_lib->clear_sale_location(); @@ -130,7 +143,7 @@ class Config extends Secure_area $this->receiving_lib->clear_all(); } - function save_locations() + public function save_locations() { $this->db->trans_start(); @@ -142,7 +155,7 @@ class Config extends Secure_area $location_id = preg_replace("/.*?_(\d+)$/", "$1", $key); unset($deleted_locations[$location_id]); // save or update - $location_data = array('location_name'=>$value); + $location_data = array('location_name' => $value); if ($this->Stock_location->save($location_data, $location_id)) { $this->_clear_session_state(); @@ -156,80 +169,82 @@ class Config extends Secure_area $this->Stock_location->delete($location_id); } - $success = $this->db->trans_complete(); + $this->db->trans_complete(); - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + $success = $this->db->trans_status(); + + echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } - function save_barcode() + public function save_barcode() { $batch_save_data = array( - 'barcode_type'=>$this->input->post('barcode_type'), - 'barcode_quality'=>$this->input->post('barcode_quality'), - 'barcode_width'=>$this->input->post('barcode_width'), - 'barcode_height'=>$this->input->post('barcode_height'), - 'barcode_font'=>$this->input->post('barcode_font'), - 'barcode_font_size'=>$this->input->post('barcode_font_size'), - 'barcode_first_row'=>$this->input->post('barcode_first_row'), - 'barcode_second_row'=>$this->input->post('barcode_second_row'), - 'barcode_third_row'=>$this->input->post('barcode_third_row'), - 'barcode_num_in_row'=>$this->input->post('barcode_num_in_row'), - 'barcode_page_width'=>$this->input->post('barcode_page_width'), - 'barcode_page_cellspacing'=>$this->input->post('barcode_page_cellspacing'), - 'barcode_generate_if_empty'=>$this->input->post('barcode_generate_if_empty') != null, - 'barcode_content'=>$this->input->post('barcode_content') + 'barcode_type' => $this->input->post('barcode_type'), + 'barcode_quality' => $this->input->post('barcode_quality'), + 'barcode_width' => $this->input->post('barcode_width'), + 'barcode_height' => $this->input->post('barcode_height'), + 'barcode_font' => $this->input->post('barcode_font'), + 'barcode_font_size' => $this->input->post('barcode_font_size'), + 'barcode_first_row' => $this->input->post('barcode_first_row'), + 'barcode_second_row' => $this->input->post('barcode_second_row'), + 'barcode_third_row' => $this->input->post('barcode_third_row'), + 'barcode_num_in_row' => $this->input->post('barcode_num_in_row'), + 'barcode_page_width' => $this->input->post('barcode_page_width'), + 'barcode_page_cellspacing' => $this->input->post('barcode_page_cellspacing'), + 'barcode_generate_if_empty' => $this->input->post('barcode_generate_if_empty') != NULL, + 'barcode_content' => $this->input->post('barcode_content') ); $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; + $success = $result ? TRUE : FALSE; - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } - function save_receipt() + public function save_receipt() { $batch_save_data = array ( - 'receipt_show_taxes'=>$this->input->post('receipt_show_taxes') != null, - 'receipt_show_total_discount'=>$this->input->post('receipt_show_total_discount') != null, - 'receipt_show_description'=>$this->input->post('receipt_show_description') != null, - 'receipt_show_serialnumber'=>$this->input->post('receipt_show_serialnumber') != null, - 'print_silently'=>$this->input->post('print_silently') != null, - 'print_header'=>$this->input->post('print_header') != null, - 'print_footer'=>$this->input->post('print_footer') != null, - 'print_top_margin'=>$this->input->post('print_top_margin'), - 'print_left_margin'=>$this->input->post('print_left_margin'), - 'print_bottom_margin'=>$this->input->post('print_bottom_margin'), - 'print_right_margin'=>$this->input->post('print_right_margin') + 'receipt_show_taxes' => $this->input->post('receipt_show_taxes') != NULL, + 'receipt_show_total_discount' => $this->input->post('receipt_show_total_discount') != NULL, + 'receipt_show_description' => $this->input->post('receipt_show_description') != NULL, + 'receipt_show_serialnumber' => $this->input->post('receipt_show_serialnumber') != NULL, + 'print_silently' => $this->input->post('print_silently') != NULL, + 'print_header' => $this->input->post('print_header') != NULL, + 'print_footer' => $this->input->post('print_footer') != NULL, + 'print_top_margin' => $this->input->post('print_top_margin'), + 'print_left_margin' => $this->input->post('print_left_margin'), + 'print_bottom_margin' => $this->input->post('print_bottom_margin'), + 'print_right_margin' => $this->input->post('print_right_margin') ); $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; + $success = $result ? TRUE : FALSE; - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } - function save_invoice() + public function save_invoice() { $batch_save_data = array ( - 'invoice_enable'=>$this->input->post('invoice_enable') != null, - 'sales_invoice_format'=>$this->input->post('sales_invoice_format'), - 'recv_invoice_format'=>$this->input->post('recv_invoice_format'), - 'use_invoice_template'=>$this->input->post('use_invoice_template') != null, - 'invoice_default_comments'=>$this->input->post('invoice_default_comments'), - 'invoice_email_message'=>$this->input->post('invoice_email_message') + 'invoice_enable' => $this->input->post('invoice_enable') != NULL, + 'sales_invoice_format' => $this->input->post('sales_invoice_format'), + 'recv_invoice_format' => $this->input->post('recv_invoice_format'), + 'use_invoice_template' => $this->input->post('use_invoice_template') != NULL, + 'invoice_default_comments' => $this->input->post('invoice_default_comments'), + 'invoice_email_message' => $this->input->post('invoice_email_message') ); $result = $this->Appconfig->batch_save($batch_save_data); - $success = $result ? true : false; + $success = $result ? TRUE : FALSE; - echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); + echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } public function remove_logo() { $result = $this->Appconfig->batch_save(array('company_logo' => '')); - echo json_encode(array('success'=>$result)); + echo json_encode(array('success' => $result)); } private function _handle_logo_upload() @@ -249,12 +264,13 @@ class Config extends Secure_area return strlen($this->upload->display_errors()) == 0 || !strcmp($this->upload->display_errors(), '

'.$this->lang->line('upload_no_file_selected').'

'); } - function backup_db() + public function backup_db() { $employee_id = $this->Employee->get_logged_in_employee_info()->person_id; - if($this->Employee->has_module_grant('config',$employee_id)) + if($this->Employee->has_module_grant('config', $employee_id)) { $this->load->dbutil(); + $prefs = array( 'format' => 'zip', 'filename' => 'ospos.sql' @@ -263,12 +279,13 @@ class Config extends Secure_area $backup =& $this->dbutil->backup($prefs); $file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.zip'; - $save = 'uploads/'.$file_name; + $save = 'uploads/' . $file_name; $this->load->helper('download'); - while (ob_get_level()) + while(ob_get_level()) { ob_end_clean(); } + force_download($file_name, $backup); } else diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index 28044eb94..6e4f4b05b 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -1,20 +1,17 @@ -get_controller_name(); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - $customers = $this->Customer->get_all($lines_per_page, $limit_from); - $data['links'] = $this->_initialize_pagination($this->Customer, $lines_per_page, $limit_from); - $data['manage_table'] = get_people_manage_table($customers, $this); + $data['table_headers'] = $this->xss_clean(get_people_manage_table_headers()); $this->load->view('people/manage', $data); } @@ -22,33 +19,41 @@ class Customers extends Person_controller /* Returns customer table data rows. This will be called with AJAX. */ - function search() + public function search() { - $search = $this->input->post('search') != '' ? $this->input->post('search') : null; - $limit_from = $this->input->post('limit_from'); - $lines_per_page = $this->Appconfig->get('lines_per_page'); + $search = $this->input->get('search'); + $limit = $this->input->get('limit'); + $offset = $this->input->get('offset'); + $sort = $this->input->get('sort'); + $order = $this->input->get('order'); - $customers = $this->Customer->search($search, $lines_per_page, $limit_from); + $customers = $this->Customer->search($search, $limit, $offset, $sort, $order); $total_rows = $this->Customer->get_found_rows($search); - $links = $this->_initialize_pagination($this->Customer,$lines_per_page, $limit_from, $total_rows); - $data_rows = get_people_manage_table_data_rows($customers, $this); - echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links)); + $data_rows = array(); + foreach($customers->result() as $person) + { + $data_rows[] = get_person_data_row($person, $this); + } + + $data_rows = $this->xss_clean($data_rows); + + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); } /* Gives search suggestions based on what is being searched for */ - function suggest() + public function suggest() { - $suggestions = $this->Customer->get_search_suggestions($this->input->get('term'), TRUE); + $suggestions = $this->xss_clean($this->Customer->get_search_suggestions($this->input->get('term'), TRUE)); echo json_encode($suggestions); } - function suggest_search() + public function suggest_search() { - $suggestions = $this->Customer->get_search_suggestions($this->input->post('term'), FALSE); + $suggestions = $this->xss_clean($this->Customer->get_search_suggestions($this->input->post('term'), FALSE)); echo json_encode($suggestions); } @@ -56,10 +61,16 @@ class Customers extends Person_controller /* Loads the customer edit form */ - function view($customer_id=-1) + public function view($customer_id = -1) { - $data['person_info'] = $this->Customer->get_info($customer_id); - $data['total'] = $this->Customer->get_totals($customer_id)->total; + $info = $this->Customer->get_info($customer_id); + foreach(get_object_vars($info) as $property => $value) + { + $info->$property = $this->xss_clean($value); + } + $data['person_info'] = $info; + + $data['total'] = $this->xss_clean($this->Customer->get_totals($customer_id)->total); $this->load->view("customers/form", $data); } @@ -67,52 +78,58 @@ class Customers extends Person_controller /* Inserts/updates a customer */ - function save($customer_id=-1) + public function save($customer_id = -1) { $person_data = array( - 'first_name'=>$this->input->post('first_name'), - 'last_name'=>$this->input->post('last_name'), - 'gender'=>$this->input->post('gender'), - 'email'=>$this->input->post('email'), - 'phone_number'=>$this->input->post('phone_number'), - 'address_1'=>$this->input->post('address_1'), - 'address_2'=>$this->input->post('address_2'), - 'city'=>$this->input->post('city'), - 'state'=>$this->input->post('state'), - 'zip'=>$this->input->post('zip'), - 'country'=>$this->input->post('country'), - 'comments'=>$this->input->post('comments') + 'first_name' => $this->input->post('first_name'), + 'last_name' => $this->input->post('last_name'), + 'gender' => $this->input->post('gender'), + 'email' => $this->input->post('email'), + 'phone_number' => $this->input->post('phone_number'), + 'address_1' => $this->input->post('address_1'), + 'address_2' => $this->input->post('address_2'), + 'city' => $this->input->post('city'), + 'state' => $this->input->post('state'), + 'zip' => $this->input->post('zip'), + 'country' => $this->input->post('country'), + 'comments' => $this->input->post('comments') ); - $customer_data=array( - 'account_number'=>$this->input->post('account_number') == '' ? null : $this->input->post('account_number'), - 'company_name'=>$this->input->post('company_name') == '' ? null : $this->input->post('company_name'), - 'discount_percent'=>$this->input->post('discount_percent') == '' ? 0.00 : $this->input->post('discount_percent'), - 'taxable'=>$this->input->post('taxable') != null + $customer_data = array( + 'account_number' => $this->input->post('account_number') == '' ? NULL : $this->input->post('account_number'), + 'company_name' => $this->input->post('company_name') == '' ? NULL : $this->input->post('company_name'), + 'discount_percent' => $this->input->post('discount_percent') == '' ? 0.00 : $this->input->post('discount_percent'), + 'taxable' => $this->input->post('taxable') != NULL ); - if($this->Customer->save_customer($person_data,$customer_data,$customer_id)) + + if($this->Customer->save_customer($person_data, $customer_data, $customer_id)) { + $person_data = $this->xss_clean($person_data); + $customer_data = $this->xss_clean($customer_data); + //New customer - if($customer_id==-1) + if($customer_id == -1) { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('customers_successful_adding').' '. - $person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$customer_data['person_id'])); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_successful_adding').' '. + $person_data['first_name'].' '.$person_data['last_name'], 'id' => $customer_data['person_id'])); } - else //previous customer + else //Existing customer { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('customers_successful_updating').' '. - $person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$customer_id)); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_successful_updating').' '. + $person_data['first_name'].' '.$person_data['last_name'], 'id' => $customer_id)); } } else//failure - { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('customers_error_adding_updating').' '. - $person_data['first_name'].' '.$person_data['last_name'],'person_id'=>-1)); + { + $person_data = $this->xss_clean($person_data); + + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_error_adding_updating').' '. + $person_data['first_name'].' '.$person_data['last_name'], 'id' => -1)); } } - function check_account_number() + public function check_account_number() { - $exists = $this->Customer->account_number_exists($this->input->post('account_number'),$this->input->post('person_id')); + $exists = $this->Customer->account_number_exists($this->input->post('account_number'), $this->input->post('person_id')); echo !$exists ? 'true' : 'false'; } @@ -120,83 +137,93 @@ class Customers extends Person_controller /* This deletes customers from the customers table */ - function delete() + public function delete() { - $customers_to_delete=$this->input->post('ids'); - + $customers_to_delete = $this->xss_clean($this->input->post('ids')); + if($this->Customer->delete_list($customers_to_delete)) { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('customers_successful_deleted').' '. - count($customers_to_delete).' '.$this->lang->line('customers_one_or_multiple'))); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_successful_deleted').' '. + count($customers_to_delete).' '.$this->lang->line('customers_one_or_multiple'))); } else { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('customers_cannot_be_deleted'))); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_cannot_be_deleted'))); } } - - function excel() + + /* + Customer import from excel spreadsheet + */ + public function excel() { - $data = file_get_contents("import_customers.csv"); $name = 'import_customers.csv'; + $data = file_get_contents($name); force_download($name, $data); } - function excel_import() + public function excel_import() { - $this->load->view("customers/form_excel_import", null); + $this->load->view('customers/form_excel_import', NULL); } - function do_excel_import() + public function do_excel_import() { - $msg = 'do_excel_import'; - $failCodes = array(); - if ($_FILES['file_path']['error']!=UPLOAD_ERR_OK) + if($_FILES['file_path']['error'] != UPLOAD_ERR_OK) { - $msg = $this->lang->line('items_excel_import_failed'); - echo json_encode( array('success'=>false,'message'=>$msg) ); - - return; + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_excel_import_failed'))); } else { - if (($handle = fopen($_FILES['file_path']['tmp_name'], "r")) !== FALSE) + if(($handle = fopen($_FILES['file_path']['tmp_name'], 'r')) !== FALSE) { - //Skip first row + // Skip the first row as it's the table description fgetcsv($handle); - - $i=1; - while (($data = fgetcsv($handle)) !== FALSE) + $i = 1; + + $failCodes = array(); + + while(($data = fgetcsv($handle)) !== FALSE) { - $person_data = array( - 'first_name'=>$data[0], - 'last_name'=>$data[1], - 'gender'=>$data[2], - 'email'=>$data[3], - 'phone_number'=>$data[4], - 'address_1'=>$data[5], - 'address_2'=>$data[6], - 'city'=>$data[7], - 'state'=>$data[8], - 'zip'=>$data[9], - 'country'=>$data[10], - 'comments'=>$data[11] - ); - - $customer_data = array( - 'company_name'=>$data[12], - 'discount_percent'=>$data[14], - 'taxable'=>$data[15]=='' ? 0 : 1 - ); - - $account_number = $data[13]; - $invalidated = false; - if ($account_number != "") + // XSS file data sanity check + $data = $this->xss_clean($data); + + if(sizeof($data) >= 15) { - $customer_data['account_number'] = $account_number; - $invalidated = $this->Customer->account_number_exists($account_number); + $person_data = array( + 'first_name' => $data[0], + 'last_name' => $data[1], + 'gender' => $data[2], + 'email' => $data[3], + 'phone_number' => $data[4], + 'address_1' => $data[5], + 'address_2' => $data[6], + 'city' => $data[7], + 'state' => $data[8], + 'zip' => $data[9], + 'country' => $data[10], + 'comments' => $data[11] + ); + + $customer_data = array( + 'company_name' => $data[12], + 'discount_percent' => $data[14], + 'taxable' => $data[15] == '' ? 0 : 1 + ); + + $account_number = $data[13]; + $invalidated = FALSE; + if($account_number != '') + { + $customer_data['account_number'] = $account_number; + $invalidated = $this->Customer->account_number_exists($account_number); + } } - + else + { + $invalidated = TRUE; + } + if($invalidated || !$this->Customer->save_customer($person_data, $customer_data)) { $failCodes[] = $i; @@ -204,27 +231,23 @@ class Customers extends Person_controller $i++; } + + if(count($failCodes) > 0) + { + $message = $this->lang->line('customers_excel_import_partially_failed') . ' (' . count($failCodes) . '): ' . implode(', ', $failCodes); + + echo json_encode(array('success' => FALSE, 'message' => $message)); + } + else + { + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_excel_import_success'))); + } } else { - echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') ); - - return; + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_excel_import_nodata_wrongformat'))); } } - - $success = true; - if(count($failCodes) > 0) - { - $msg = "Most customers imported. But some were not, here is list of their CODE (" .count($failCodes) ."): ".implode(", ", $failCodes); - $success = false; - } - else - { - $msg = "Import Customers successful"; - } - - echo json_encode( array('success'=>$success, 'message'=>$msg) ); } } ?> \ No newline at end of file diff --git a/application/controllers/Employees.php b/application/controllers/Employees.php index 130dc629d..3d98222c3 100644 --- a/application/controllers/Employees.php +++ b/application/controllers/Employees.php @@ -1,130 +1,167 @@ -get_controller_name(); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - $employees = $this->Employee->get_all($lines_per_page, $limit_from); - $data['links'] = $this->_initialize_pagination($this->Employee, $lines_per_page, $limit_from); - $data['manage_table'] = get_people_manage_table($employees, $this); - $this->load->view('people/manage',$data); + $data['table_headers'] = $this->xss_clean(get_people_manage_table_headers()); + + $this->load->view('people/manage', $data); } /* Returns employee table data rows. This will be called with AJAX. */ - function search() + public function search() { - $search = $this->input->post('search') != '' ? $this->input->post('search') : null; - $limit_from = $this->input->post('limit_from'); - $lines_per_page = $this->Appconfig->get('lines_per_page'); + $search = $this->input->get('search'); + $limit = $this->input->get('limit'); + $offset = $this->input->get('offset'); + $sort = $this->input->get('sort'); + $order = $this->input->get('order'); - $employees = $this->Employee->search($search, $limit_from, $lines_per_page); + $employees = $this->Employee->search($search, $limit, $offset, $sort, $order); $total_rows = $this->Employee->get_found_rows($search); - $links = $this->_initialize_pagination($this->Employee, $lines_per_page, $limit_from, $total_rows); - $data_rows = get_people_manage_table_data_rows($employees, $this); - echo json_encode(array('rows' => $data_rows, 'pagination' => $links)); + $data_rows = array(); + foreach($employees->result() as $person) + { + $data_rows[] = get_person_data_row($person, $this); + } + + $data_rows = $this->xss_clean($data_rows); + + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); } /* Gives search suggestions based on what is being searched for */ - function suggest_search() + public function suggest_search() { - $suggestions = $this->Employee->get_search_suggestions($this->input->post('term')); + $suggestions = $this->xss_clean($this->Employee->get_search_suggestions($this->input->post('term'))); + echo json_encode($suggestions); } /* Loads the employee edit form */ - function view($employee_id=-1) + public function view($employee_id = -1) { - $data['person_info']=$this->Employee->get_info($employee_id); - $data['all_modules']=$this->Module->get_all_modules(); - $data['all_subpermissions']=$this->Module->get_all_subpermissions(); - $this->load->view("employees/form",$data); + $person_info = $this->Employee->get_info($employee_id); + foreach(get_object_vars($person_info) as $property => $value) + { + $person_info->$property = $this->xss_clean($value); + } + $data['person_info'] = $person_info; + + $modules = array(); + foreach($this->Module->get_all_modules()->result() as $module) + { + $module->module_id = $this->xss_clean($module->module_id); + $module->grant = $this->xss_clean($this->Employee->has_grant($module->module_id, $person_info->person_id)); + + $modules[] = $module; + } + $data['all_modules'] = $modules; + + $permissions = array(); + foreach($this->Module->get_all_subpermissions()->result() as $permission) + { + $permission->module_id = $this->xss_clean($permission->module_id); + $permission->permission_id = $this->xss_clean($permission->permission_id); + $permission->grant = $this->xss_clean($this->Employee->has_grant($permission->permission_id, $person_info->person_id)); + + $permissions[] = $permission; + } + $data['all_subpermissions'] = $permissions; + + $this->load->view("employees/form", $data); } /* Inserts/updates an employee */ - function save($employee_id=-1) + public function save($employee_id = -1) { $person_data = array( - 'first_name'=>$this->input->post('first_name'), - 'last_name'=>$this->input->post('last_name'), - 'gender'=>$this->input->post('gender'), - 'email'=>$this->input->post('email'), - 'phone_number'=>$this->input->post('phone_number'), - 'address_1'=>$this->input->post('address_1'), - 'address_2'=>$this->input->post('address_2'), - 'city'=>$this->input->post('city'), - 'state'=>$this->input->post('state'), - 'zip'=>$this->input->post('zip'), - 'country'=>$this->input->post('country'), - 'comments'=>$this->input->post('comments') + 'first_name' => $this->input->post('first_name'), + 'last_name' => $this->input->post('last_name'), + 'gender' => $this->input->post('gender'), + 'email' => $this->input->post('email'), + 'phone_number' => $this->input->post('phone_number'), + 'address_1' => $this->input->post('address_1'), + 'address_2' => $this->input->post('address_2'), + 'city' => $this->input->post('city'), + 'state' => $this->input->post('state'), + 'zip' => $this->input->post('zip'), + 'country' => $this->input->post('country'), + 'comments' => $this->input->post('comments') ); - $grants_data = $this->input->post('grants') != null ? $this->input->post('grants') : array(); + $grants_data = $this->input->post('grants') != NULL ? $this->input->post('grants') : array(); //Password has been changed OR first time password set - if ( $this->input->post('password') != '' ) + if($this->input->post('password') != '') { - $employee_data=array( - 'username'=>$this->input->post('username'), - 'password'=>md5($this->input->post('password')) + $employee_data = array( + 'username' => $this->input->post('username'), + 'password' => md5($this->input->post('password')) ); } else //Password not changed { - $employee_data=array('username'=>$this->input->post('username')); + $employee_data = array('username' => $this->input->post('username')); } - if($this->Employee->save_employee($person_data,$employee_data,$grants_data,$employee_id)) + if($this->Employee->save_employee($person_data, $employee_data, $grants_data, $employee_id)) { + $person_data = $this->xss_clean($person_data); + $employee_data = $this->xss_clean($employee_data); + //New employee - if($employee_id==-1) + if($employee_id == -1) { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('employees_successful_adding').' '. - $person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$employee_data['person_id'])); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('employees_successful_adding').' '. + $person_data['first_name'].' '.$person_data['last_name'], 'id' => $employee_data['person_id'])); } - else //previous employee + else //Existing employee { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('employees_successful_updating').' '. - $person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$employee_id)); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('employees_successful_updating').' '. + $person_data['first_name'].' '.$person_data['last_name'], 'id' => $employee_id)); } } else//failure - { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('employees_error_adding_updating').' '. - $person_data['first_name'].' '.$person_data['last_name'],'person_id'=>-1)); + { + $person_data = $this->xss_clean($person_data); + + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('employees_error_adding_updating').' '. + $person_data['first_name'].' '.$person_data['last_name'], 'id' => -1)); } } /* This deletes employees from the employees table */ - function delete() + public function delete() { - $employees_to_delete=$this->input->post('ids'); - + $employees_to_delete = $this->xss_clean($this->input->post('ids')); + if($this->Employee->delete_list($employees_to_delete)) { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('employees_successful_deleted').' '. - count($employees_to_delete).' '.$this->lang->line('employees_one_or_multiple'))); + echo json_encode(array('success' => TRUE,'message' => $this->lang->line('employees_successful_deleted').' '. + count($employees_to_delete).' '.$this->lang->line('employees_one_or_multiple'))); } else { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('employees_cannot_be_deleted'))); + echo json_encode(array('success' => FALSE,'message' => $this->lang->line('employees_cannot_be_deleted'))); } } } diff --git a/application/controllers/Giftcards.php b/application/controllers/Giftcards.php index 6f6b406d4..6c8aeec50 100644 --- a/application/controllers/Giftcards.php +++ b/application/controllers/Giftcards.php @@ -1,111 +1,124 @@ -get_controller_name(); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - $giftcards = $this->Giftcard->get_all($lines_per_page, $limit_from); - $data['links'] = $this->_initialize_pagination($this->Giftcard, $lines_per_page, $limit_from); - $data['manage_table'] = get_giftcards_manage_table($giftcards, $this); + $data['table_headers'] = $this->xss_clean(get_giftcards_manage_table_headers()); + $this->load->view('giftcards/manage', $data); } /* Returns Giftcards table data rows. This will be called with AJAX. */ - function search() + public function search() { - $search = $this->input->post('search') != '' ? $this->input->post('search') : null; - $limit_from = $this->input->post('limit_from'); - $lines_per_page = $this->Appconfig->get('lines_per_page'); + $search = $this->input->get('search'); + $limit = $this->input->get('limit'); + $offset = $this->input->get('offset'); + $sort = $this->input->get('sort'); + $order = $this->input->get('order'); - $giftcards = $this->Giftcard->search($search, $lines_per_page, $limit_from); + $giftcards = $this->Giftcard->search($search, $limit, $offset, $sort, $order); $total_rows = $this->Giftcard->get_found_rows($search); - $links = $this->_initialize_pagination($this->Giftcard, $lines_per_page, $limit_from, $total_rows); - $data_rows = get_giftcards_manage_table_data_rows($giftcards, $this); - echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links)); + $data_rows = array(); + foreach($giftcards->result() as $giftcard) + { + $data_rows[] = get_giftcard_data_row($giftcard, $this); + } + + $data_rows = $this->xss_clean($data_rows); + + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); } /* Gives search suggestions based on what is being searched for */ - function suggest_search() + public function suggest_search() { - $suggestions = $this->Giftcard->get_search_suggestions($this->input->post('term')); + $suggestions = $this->xss_clean($this->Giftcard->get_search_suggestions($this->input->post('term'))); + echo json_encode($suggestions); } - function get_row() + public function get_row($row_id) { - $giftcard_id = $this->input->post('row_id'); - $data_row = get_giftcard_data_row($this->Giftcard->get_info($giftcard_id), $this); - echo $data_row; + $data_row = $this->xss_clean(get_giftcard_data_row($this->Giftcard->get_info($row_id), $this)); + + echo json_encode($data_row); } - function view($giftcard_id=-1) + public function view($giftcard_id = -1) { $giftcard_info = $this->Giftcard->get_info($giftcard_id); - $person_name=$giftcard_id > 0? $giftcard_info->first_name . ' ' . $giftcard_info->last_name : ''; - $data['selected_person_name'] = $giftcard_id > 0 && isset($giftcard_info->person_id) ? $person_name : ''; - $data['selected_person_id'] = $giftcard_info->person_id; - $data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1; - $data['giftcard_info'] = $giftcard_info; - $this->load->view("giftcards/form",$data); + + $data['selected_person_name'] = ($giftcard_id > 0 && isset($giftcard_info->person_id)) ? $giftcard_info->first_name . ' ' . $giftcard_info->last_name : ''; + $data['selected_person_id'] = $giftcard_info->person_id; + $data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1; + $data['giftcard_id'] = $giftcard_id; + $data['giftcard_value'] = $giftcard_info->value; + + $data = $this->xss_clean($data); + + $this->load->view("giftcards/form", $data); } - function save($giftcard_id=-1) + public function save($giftcard_id = -1) { $giftcard_data = array( 'record_time' => date('Y-m-d H:i:s'), - 'giftcard_number'=>$this->input->post('giftcard_number', TRUE), - 'value'=>$this->input->post('value', TRUE), - 'person_id'=>$this->input->post('person_id', TRUE) ? $this->input->post('person_id') : null + 'giftcard_number' => $this->input->post('giftcard_number'), + 'value' => $this->input->post('value'), + 'person_id' => $this->input->post('person_id') ); - if( $this->Giftcard->save( $giftcard_data, $giftcard_id ) ) + if($this->Giftcard->save($giftcard_data, $giftcard_id)) { + $giftcard_data = $this->xss_clean($giftcard_data); + //New giftcard - if($giftcard_id==-1) + if($giftcard_id == -1) { - echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_adding').' '. - $giftcard_data['giftcard_number'], 'giftcard_id'=>$giftcard_data['giftcard_id'])); - $giftcard_id = $giftcard_data['giftcard_id']; + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_adding').' '. + $giftcard_data['giftcard_number'], 'id' => $giftcard_data['giftcard_id'])); } - else //previous giftcard + else //Existing giftcard { - echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_updating').' '. - $giftcard_data['giftcard_number'], 'giftcard_id'=>$giftcard_id)); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_updating').' '. + $giftcard_data['giftcard_number'], 'id' => $giftcard_id)); } } - else//failure + else //failure { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('giftcards_error_adding_updating').' '. - $giftcard_data['giftcard_number'], 'giftcard_id'=>-1)); + $giftcard_data = $this->xss_clean($giftcard_data); + + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('giftcards_error_adding_updating').' '. + $giftcard_data['giftcard_number'], 'id' => -1)); } } - function delete() + public function delete() { - $giftcards_to_delete=$this->input->post('ids'); + $giftcards_to_delete = $this->xss_clean($this->input->post('ids')); if($this->Giftcard->delete_list($giftcards_to_delete)) { - echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_deleted').' '. + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_deleted').' '. count($giftcards_to_delete).' '.$this->lang->line('giftcards_one_or_multiple'))); } else { - echo json_encode(array('success'=>false, 'message'=>$this->lang->line('giftcards_cannot_be_deleted'))); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('giftcards_cannot_be_deleted'))); } } } diff --git a/application/controllers/Home.php b/application/controllers/Home.php index ed78c8161..7688d2dd1 100644 --- a/application/controllers/Home.php +++ b/application/controllers/Home.php @@ -1,19 +1,20 @@ -load->view("home"); + $this->load->view('home'); } - function logout() + public function logout() { $this->Employee->logout(); } diff --git a/application/controllers/Item_kits.php b/application/controllers/Item_kits.php index ca1ac78b3..45fb5d846 100644 --- a/application/controllers/Item_kits.php +++ b/application/controllers/Item_kits.php @@ -1,23 +1,27 @@ -total_cost_price = 0; $item_kit->total_unit_price = 0; - foreach ($this->Item_kit_items->get_info($item_kit->item_kit_id) as $item_kit_item) + foreach($this->Item_kit_items->get_info($item_kit->item_kit_id) as $item_kit_item) { $item_info = $this->Item->get_info($item_kit_item['item_id']); + foreach(get_object_vars($item_info) as $property => $value) + { + $item_info->$property = $this->xss_clean($value); + } $item_kit->total_cost_price += $item_info->cost_price * $item_kit_item['quantity']; $item_kit->total_unit_price += $item_info->unit_price * $item_kit_item['quantity']; @@ -26,96 +30,95 @@ class Item_kits extends Secure_area implements iData_controller return $item_kit; } - function index($limit_from=0) + public function index() { - $data['controller_name'] = $this->get_controller_name(); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - $item_kits = $this->Item_kit->get_all($lines_per_page, $limit_from); - - foreach($item_kits->result() as $item_kit) - { - // calculate the total cost and retail price of the Kit so it can be printed out in the manage table - $item_kit = $this->add_totals_to_item_kit($item_kit); - } - - $data['links'] = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from); - $data['manage_table'] = get_item_kits_manage_table($item_kits, $this); + $data['table_headers'] = $this->xss_clean(get_item_kits_manage_table_headers()); $this->load->view('item_kits/manage', $data); } - + /* Returns Item kits table data rows. This will be called with AJAX. */ - function search() + public function search() { - $search = $this->input->post('search') != '' ? $this->input->post('search') : null; - $limit_from = $this->input->post('limit_from'); - $lines_per_page = $this->Appconfig->get('lines_per_page'); + $search = $this->input->get('search'); + $limit = $this->input->get('limit'); + $offset = $this->input->get('offset'); + $sort = $this->input->get('sort'); + $order = $this->input->get('order'); - $item_kits = $this->Item_kit->search($search, $lines_per_page, $limit_from); + $item_kits = $this->Item_kit->search($search, $limit, $offset, $sort, $order); $total_rows = $this->Item_kit->get_found_rows($search); - $links = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from, $total_rows, 'search'); + $data_rows = array(); foreach($item_kits->result() as $item_kit) { // calculate the total cost and retail price of the Kit so it can be printed out in the manage table - $item_kit = $this->add_totals_to_item_kit($item_kit); + $item_kit = $this->_add_totals_to_item_kit($item_kit); + $data_rows[] = get_item_kit_data_row($item_kit, $this); } - $data_rows = get_item_kits_manage_table_data_rows($item_kits, $this); + $data_rows = $this->xss_clean($data_rows); - echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links)); + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); } - function suggest_search() + public function suggest_search() { - $suggestions = $this->Item_kit->get_search_suggestions($this->input->post('term')); + $suggestions = $this->xss_clean($this->Item_kit->get_search_suggestions($this->input->post('term'))); + echo json_encode($suggestions); } - function get_row() + public function get_row($row_id) { - $item_kit_id = $this->input->post('row_id'); - // calculate the total cost and retail price of the Kit so it can be added to the table refresh - $item_kit = $this->add_totals_to_item_kit($this->Item_kit->get_info($item_kit_id)); + $item_kit = $this->_add_totals_to_item_kit($this->Item_kit->get_info($row_id)); - echo (get_item_kit_data_row($item_kit, $this)); + echo json_encode(get_item_kit_data_row($item_kit, $this)); } - - function view($item_kit_id=-1) + + public function view($item_kit_id = -1) { - $data['item_kit_info'] = $this->Item_kit->get_info($item_kit_id); + $info = $this->Item_kit->get_info($item_kit_id); + foreach(get_object_vars($info) as $property => $value) + { + $info->$property = $this->xss_clean($value); + } + $data['item_kit_info'] = $info; + + $items = array(); + foreach($this->Item_kit_items->get_info($item_kit_id) as $item_kit_item) + { + $item['name'] = $this->xss_clean($this->Item->get_info($item_kit_item['item_id'])->name); + $item['item_id'] = $this->xss_clean($item_kit_item['item_id']); + $item['quantity'] = $this->xss_clean($item_kit_item['quantity']); + + $items[] = $item; + } + $data['item_kit_items'] = $items; + $this->load->view("item_kits/form", $data); } - function save($item_kit_id=-1) + public function save($item_kit_id = -1) { $item_kit_data = array( 'name' => $this->input->post('name'), 'description' => $this->input->post('description') ); - if ($this->Item_kit->save($item_kit_data, $item_kit_id)) + if($this->Item_kit->save($item_kit_data, $item_kit_id)) { + $success = TRUE; //New item kit - if ($item_kit_id==-1) + if ($item_kit_id == -1) { $item_kit_id = $item_kit_data['item_kit_id']; - - echo json_encode(array('success'=>true, - 'message'=>$this->lang->line('item_kits_successful_adding').' '.$item_kit_data['name'], - 'item_kit_id'=>$item_kit_id)); } - else //previous item - { - echo json_encode(array('success'=>true, - 'message'=>$this->lang->line('item_kits_successful_updating').' '.$item_kit_data['name'], - 'item_kit_id'=>$item_kit_id)); - } - - if ( $this->input->post('item_kit_item') != null ) + + if($this->input->post('item_kit_item') != NULL) { $item_kit_items = array(); foreach($this->input->post('item_kit_item') as $item_id => $quantity) @@ -125,46 +128,53 @@ class Item_kits extends Secure_area implements iData_controller 'quantity' => $quantity ); } - - $this->Item_kit_items->save($item_kit_items, $item_kit_id); + + $success = $this->Item_kit_items->save($item_kit_items, $item_kit_id); } + + $item_kit_data = $this->xss_clean($item_kit_data); + + echo json_encode(array('success' => $success, + 'message' => $this->lang->line('item_kits_successful_adding').' '.$item_kit_data['name'], 'id' => $item_kit_id)); } else//failure { - echo json_encode(array('success'=>false, - 'message'=>$this->lang->line('item_kits_error_adding_updating').' '.$item_kit_data['name'], - 'item_kit_id'=>-1)); + $item_kit_data = $this->xss_clean($item_kit_data); + + echo json_encode(array('success' => FALSE, + 'message' => $this->lang->line('item_kits_error_adding_updating').' '.$item_kit_data['name'], 'id' => -1)); } } - function delete() + public function delete() { - $item_kits_to_delete = $this->input->post('ids'); + $item_kits_to_delete = $this->xss_clean($this->input->post('ids')); - if ($this->Item_kit->delete_list($item_kits_to_delete)) + if($this->Item_kit->delete_list($item_kits_to_delete)) { - echo json_encode(array('success'=>true, - 'message'=>$this->lang->line('item_kits_successful_deleted').' '.count($item_kits_to_delete).' '.$this->lang->line('item_kits_one_or_multiple'))); + echo json_encode(array('success' => TRUE, + 'message' => $this->lang->line('item_kits_successful_deleted').' '.count($item_kits_to_delete).' '.$this->lang->line('item_kits_one_or_multiple'))); } else { - echo json_encode(array('success'=>false, - 'message'=>$this->lang->line('item_kits_cannot_be_deleted'))); + echo json_encode(array('success' => FALSE, + 'message' => $this->lang->line('item_kits_cannot_be_deleted'))); } } - function generate_barcodes($item_kit_ids) + public function generate_barcodes($item_kit_ids) { $this->load->library('barcode_lib'); $result = array(); $item_kit_ids = explode(':', $item_kit_ids); - foreach ($item_kit_ids as $item_kid_id) + foreach($item_kit_ids as $item_kid_id) { // calculate the total cost and retail price of the Kit so it can be added to the barcode text at the bottom - $item_kit = $this->add_totals_to_item_kit($this->Item_kit->get_info($item_kid_id)); + $item_kit = $this->_add_totals_to_item_kit($this->Item_kit->get_info($item_kid_id)); - $result[] = array('name'=>$item_kit->name, 'item_id'=>'KIT '.$item_kid_id, 'item_number'=>'KIT '.$item_kid_id, 'cost_price'=>$item_kit->total_cost_price, 'unit_price'=>$item_kit->total_unit_price); + $result[] = array('name' => $item_kit->name, 'item_id' => urldecode($item_kid_id), 'item_number' => urldecode($item_kid_id), + 'cost_price' => $item_kit->total_cost_price, 'unit_price' => $item_kit->total_unit_price); } $data['items'] = $result; @@ -176,7 +186,7 @@ class Item_kits extends Secure_area implements iData_controller $barcode_config['barcode_type'] = 'Code128'; } $data['barcode_config'] = $barcode_config; - + // display barcodes $this->load->view("barcodes/barcode_sheet", $data); } diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 9ada70169..984145e4f 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -1,36 +1,30 @@ -load->library('item_lib'); } - function index($limit_from=0) + public function index() { - $stock_location = $this->item_lib->get_item_location(); - $stock_locations = $this->Stock_location->get_allowed_locations(); + $data['table_headers'] = $this->xss_clean(get_items_manage_table_headers()); - $data['controller_name'] = $this->get_controller_name(); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - $items = $this->Item->get_all($stock_location, $lines_per_page, $limit_from); - $data['links'] = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from); + $data['stock_location'] = $this->xss_clean($this->item_lib->get_item_location()); + $data['stock_locations'] = $this->xss_clean($this->Stock_location->get_allowed_locations()); // filters that will be loaded in the multiselect dropdown $data['filters'] = array('empty_upc' => $this->lang->line('items_empty_upc_items'), - 'low_inventory' => $this->lang->line('items_low_inventory_items'), - 'is_serialized' => $this->lang->line('items_serialized_items'), - 'no_description' => $this->lang->line('items_no_description_items'), - 'search_custom' => $this->lang->line('items_search_custom_items'), - 'is_deleted' => $this->lang->line('items_is_deleted')); - - $data['stock_location'] = $stock_location; - $data['stock_locations'] = $stock_locations; - $data['manage_table'] = get_items_manage_table( $this->Item->get_all($stock_location, $lines_per_page, $limit_from), $this ); + 'low_inventory' => $this->lang->line('items_low_inventory_items'), + 'is_serialized' => $this->lang->line('items_serialized_items'), + 'no_description' => $this->lang->line('items_no_description_items'), + 'search_custom' => $this->lang->line('items_search_custom_items'), + 'is_deleted' => $this->lang->line('items_is_deleted')); $this->load->view('items/manage', $data); } @@ -38,15 +32,18 @@ class Items extends Secure_area implements iData_controller /* Returns Items table data rows. This will be called with AJAX. */ - function search() + public function search() { - $search = $this->input->post('search') != '' ? $this->input->post('search') : null; - $limit_from = $this->input->post('limit_from'); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - $this->item_lib->set_item_location($this->input->post('stock_location')); + $search = $this->input->get('search'); + $limit = $this->input->get('limit'); + $offset = $this->input->get('offset'); + $sort = $this->input->get('sort'); + $order = $this->input->get('order'); - $filters = array('start_date' => $this->input->post('start_date'), - 'end_date' => $this->input->post('end_date'), + $this->item_lib->set_item_location($this->input->get('stock_location')); + + $filters = array('start_date' => $this->input->get('start_date'), + 'end_date' => $this->input->get('end_date'), 'stock_location_id' => $this->item_lib->get_item_location(), 'empty_upc' => FALSE, 'low_inventory' => FALSE, @@ -56,35 +53,33 @@ class Items extends Secure_area implements iData_controller 'is_deleted' => FALSE); // check if any filter is set in the multiselect dropdown - if( $this->input->post('filters') != null ) - { - foreach($this->input->post('filters') as $key) - { - $filters[$key] = TRUE; - } - } - - $items = $this->Item->search($search, $filters, $lines_per_page, $limit_from); - $data_rows = get_items_manage_table_data_rows($items, $this); - $total_rows = $this->Item->get_found_rows($search, $filters); - $links = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from, $total_rows, 'search'); - $data_rows = get_items_manage_table_data_rows($items, $this); + $filledup = array_fill_keys($this->input->get('filters'), TRUE); + $filters = array_merge($filters, $filledup); - echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links)); + $items = $this->Item->search($search, $filters, $limit, $offset, $sort, $order); + $total_rows = $this->xss_clean($this->Item->get_found_rows($search, $filters)); + + $data_rows = array(); + foreach($items->result() as $item) + { + $data_rows[] = $this->xss_clean(get_item_data_row($item, $this)); + } + + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); } - function pic_thumb($pic_id) + public function pic_thumb($pic_id) { $this->load->helper('file'); $this->load->library('image_lib'); $base_path = "uploads/item_pics/" . $pic_id ; $images = glob ($base_path. "*"); - if (sizeof($images) > 0) + if(sizeof($images) > 0) { $image_path = $images[0]; $ext = pathinfo($image_path, PATHINFO_EXTENSION); - $thumb_path = $base_path . $this->image_lib->thumb_marker.'.'.$ext; - if (sizeof($images) < 2) + $thumb_path = $base_path . $this->image_lib->thumb_marker . '.' . $ext; + if(sizeof($images) < 2) { $config['image_library'] = 'gd2'; $config['source_image'] = $image_path; @@ -104,26 +99,18 @@ class Items extends Secure_area implements iData_controller /* Gives search suggestions based on what is being searched for */ - function suggest_search() + public function suggest_search() { - $suggestions = $this->Item->get_search_suggestions($this->input->post_get('term'), - array( - 'search_custom' => $this->input->post('search_custom'), - 'is_deleted' => $this->input->post('is_deleted') != null - ), - FALSE); + $suggestions = $this->xss_clean($this->Item->get_search_suggestions($this->input->post_get('term'), + array('search_custom' => $this->input->post('search_custom'), 'is_deleted' => $this->input->post('is_deleted') != NULL), FALSE)); echo json_encode($suggestions); } - function suggest() + public function suggest() { - $suggestions = $this->Item->get_search_suggestions($this->input->post_get('term'), - array( - 'search_custom' => FALSE, - 'is_deleted' => FALSE - ), - TRUE); + $suggestions = $this->xss_clean($this->Item->get_search_suggestions($this->input->post_get('term'), + array('search_custom' => FALSE, 'is_deleted' => FALSE), TRUE)); echo json_encode($suggestions); } @@ -131,9 +118,9 @@ class Items extends Secure_area implements iData_controller /* Gives search suggestions based on what is being searched for */ - function suggest_category() + public function suggest_category() { - $suggestions = $this->Item->get_category_suggestions($this->input->get('term')); + $suggestions = $this->xss_clean($this->Item->get_category_suggestions($this->input->get('term'))); echo json_encode($suggestions); } @@ -141,9 +128,9 @@ class Items extends Secure_area implements iData_controller /* Gives search suggestions based on what is being searched for */ - function suggest_location() + public function suggest_location() { - $suggestions = $this->Item->get_location_suggestions($this->input->get('term')); + $suggestions = $this->xss_clean($this->Item->get_location_suggestions($this->input->get('term'))); echo json_encode($suggestions); } @@ -151,34 +138,39 @@ class Items extends Secure_area implements iData_controller /* Gives search suggestions based on what is being searched for */ - function suggest_custom() + public function suggest_custom() { - $suggestions = $this->Item->get_custom_suggestions($this->input->post('term'), $this->input->post('field_no')); + $suggestions = $this->xss_clean($this->Item->get_custom_suggestions($this->input->post('term'), $this->input->post('field_no'))); echo json_encode($suggestions); } - function get_row() + public function get_row($item_ids) { - $item_id = $this->input->post('row_id'); - $item_info = $this->Item->get_info($item_id); - $stock_location = $this->item_lib->get_item_location(); - $item_quantity = $this->Item_quantity->get_item_quantity($item_id,$stock_location); - $item_info->quantity = $item_quantity->quantity; - $data_row = get_item_data_row($item_info,$this); - - echo $data_row; + $item_infos = $this->Item->get_multiple_info(explode(":", $item_ids), $this->item_lib->get_item_location()); + + $result = array(); + foreach($item_infos->result() as $item_info) + { + $result[$item_info->item_id] = $this->xss_clean(get_item_data_row($item_info, $this)); + } + + echo json_encode($result); } - function view($item_id=-1) + public function view($item_id = -1) { - $item_info = $this->Item->get_info($item_id); - - $data['item_tax_info'] = $this->Item_taxes->get_info($item_id); + $data['item_tax_info'] = $this->xss_clean($this->Item_taxes->get_info($item_id)); $data['default_tax_1_rate'] = ''; $data['default_tax_2_rate'] = ''; - if($item_id==-1) + $item_info = $this->Item->get_info($item_id); + foreach(get_object_vars($item_info) as $property => $value) + { + $item_info->$property = $this->xss_clean($value); + } + + if($item_id == -1) { $data['default_tax_1_rate'] = $this->Appconfig->get('default_tax_1_rate'); $data['default_tax_2_rate'] = $this->Appconfig->get('default_tax_2_rate'); @@ -188,11 +180,11 @@ class Items extends Secure_area implements iData_controller } $data['item_info'] = $item_info; - - $suppliers = array(''=>$this->lang->line('items_none')); + + $suppliers = array('' => $this->lang->line('items_none')); foreach($this->Supplier->get_all()->result_array() as $row) { - $suppliers[$row['person_id']] = $row['company_name']; + $suppliers[$this->xss_clean($row['person_id'])] = $this->xss_clean($row['company_name']); } $data['suppliers'] = $suppliers; $data['selected_supplier'] = $item_info->supplier_id; @@ -201,64 +193,83 @@ class Items extends Secure_area implements iData_controller $images = glob("uploads/item_pics/" . $item_info->pic_id . ".*"); $data['image_path'] = sizeof($images) > 0 ? base_url($images[0]) : ''; - $locations_data = $this->Stock_location->get_undeleted_all()->result_array(); - foreach($locations_data as $location) + $stock_locations = $this->Stock_location->get_undeleted_all()->result_array(); + foreach($stock_locations as $location) { - $quantity = $this->Item_quantity->get_item_quantity($item_id,$location['location_id'])->quantity; + $location = $this->xss_clean($location); + + $quantity = $this->xss_clean($this->Item_quantity->get_item_quantity($item_id, $location['location_id'])->quantity); $quantity = ($item_id == -1) ? 0 : $quantity; - $location_array[$location['location_id']] = array('location_name'=>$location['location_name'], 'quantity'=>$quantity); + $location_array[$location['location_id']] = array('location_name' => $location['location_name'], 'quantity' => $quantity); $data['stock_locations'] = $location_array; } - $this->load->view("items/form", $data); + $this->load->view('items/form', $data); } - function inventory($item_id=-1) + public function inventory($item_id = -1) { - $data['item_info'] = $this->Item->get_info($item_id); - + $item_info = $this->Item->get_info($item_id); + foreach(get_object_vars($item_info) as $property => $value) + { + $item_info->$property = $this->xss_clean($value); + } + $data['item_info'] = $item_info; + $data['stock_locations'] = array(); $stock_locations = $this->Stock_location->get_undeleted_all()->result_array(); - foreach($stock_locations as $location_data) - { - $data['stock_locations'][$location_data['location_id']] = $location_data['location_name']; - $data['item_quantities'][$location_data['location_id']] = $this->Item_quantity->get_item_quantity($item_id,$location_data['location_id'])->quantity; - } - - $this->load->view("items/form_inventory", $data); + foreach($stock_locations as $location) + { + $location = $this->xss_clean($location); + $quantity = $this->xss_clean($this->Item_quantity->get_item_quantity($item_id, $location['location_id'])->quantity); + + $data['stock_locations'][$location['location_id']] = $location['location_name']; + $data['item_quantities'][$location['location_id']] = $quantity; + } + + $this->load->view('items/form_inventory', $data); } - function count_details($item_id=-1) + public function count_details($item_id = -1) { - $data['item_info'] = $this->Item->get_info($item_id); - + $item_info = $this->Item->get_info($item_id); + foreach(get_object_vars($item_info) as $property => $value) + { + $item_info->$property = $this->xss_clean($value); + } + $data['item_info'] = $item_info; + $data['stock_locations'] = array(); $stock_locations = $this->Stock_location->get_undeleted_all()->result_array(); - foreach($stock_locations as $location_data) - { - $data['stock_locations'][$location_data['location_id']] = $location_data['location_name']; - $data['item_quantities'][$location_data['location_id']] = $this->Item_quantity->get_item_quantity($item_id,$location_data['location_id'])->quantity; - } - - $this->load->view("items/form_count_details", $data); + foreach($stock_locations as $location) + { + $location = $this->xss_clean($location); + $quantity = $this->xss_clean($this->Item_quantity->get_item_quantity($item_id, $location['location_id'])->quantity); + + $data['stock_locations'][$location['location_id']] = $location['location_name']; + $data['item_quantities'][$location['location_id']] = $quantity; + } + + $this->load->view('items/form_count_details', $data); } - function generate_barcodes($item_ids) + public function generate_barcodes($item_ids) { $this->load->library('barcode_lib'); - $result = array(); $item_ids = explode(':', $item_ids); - $result = $this->Item->get_multiple_info($item_ids)->result_array(); + $result = $this->Item->get_multiple_info($item_ids, $this->item_lib->get_item_location())->result_array(); $config = $this->barcode_lib->get_barcode_config(); $data['barcode_config'] = $config; - + // check the list of items to see if any item_number field is empty foreach($result as &$item) { - // update the UPC/EAN/ISBN field if empty / null with the newly generated barcode - if (empty($item['item_number']) && $this->Appconfig->get('barcode_generate_if_empty')) + $item = $this->xss_clean($item); + + // update the UPC/EAN/ISBN field if empty / NULL with the newly generated barcode + if(empty($item['item_number']) && $this->Appconfig->get('barcode_generate_if_empty')) { // get the newly generated barcode $barcode_instance = Barcode_lib::barcode_instance($item, $config); @@ -277,76 +288,81 @@ class Items extends Secure_area implements iData_controller $data['items'] = $result; // display barcodes - $this->load->view("barcodes/barcode_sheet", $data); + $this->load->view('barcodes/barcode_sheet', $data); } - function bulk_edit() + public function bulk_edit() { - $data = array(); $suppliers = array('' => $this->lang->line('items_none')); foreach($this->Supplier->get_all()->result_array() as $row) { + $row = $this->xss_clean($row); + $suppliers[$row['person_id']] = $row['company_name']; } $data['suppliers'] = $suppliers; $data['allow_alt_description_choices'] = array( - ''=>$this->lang->line('items_do_nothing'), - 1 =>$this->lang->line('items_change_all_to_allow_alt_desc'), - 0 =>$this->lang->line('items_change_all_to_not_allow_allow_desc')); - - $data['serialization_choices'] = array( - ''=>$this->lang->line('items_do_nothing'), - 1 =>$this->lang->line('items_change_all_to_serialized'), - 0 =>$this->lang->line('items_change_all_to_unserialized')); + '' => $this->lang->line('items_do_nothing'), + 1 => $this->lang->line('items_change_all_to_allow_alt_desc'), + 0 => $this->lang->line('items_change_all_to_not_allow_allow_desc')); - $this->load->view("items/form_bulk", $data); + $data['serialization_choices'] = array( + '' => $this->lang->line('items_do_nothing'), + 1 => $this->lang->line('items_change_all_to_serialized'), + 0 => $this->lang->line('items_change_all_to_unserialized')); + + $this->load->view('items/form_bulk', $data); } - function save($item_id=-1) + public function save($item_id = -1) { $upload_success = $this->_handle_image_upload(); $upload_data = $this->upload->data(); //Save item data $item_data = array( - 'name'=>$this->input->post('name'), - 'description'=>$this->input->post('description'), - 'category'=>$this->input->post('category'), - 'supplier_id'=>$this->input->post('supplier_id') == '' ? null : $this->input->post('supplier_id'), - 'item_number'=>$this->input->post('item_number') == '' ? null : $this->input->post('item_number'), - 'cost_price'=>$this->input->post('cost_price'), - 'unit_price'=>$this->input->post('unit_price'), - 'reorder_level'=>$this->input->post('reorder_level'), - 'receiving_quantity'=>$this->input->post('receiving_quantity'), - 'allow_alt_description'=>$this->input->post('allow_alt_description') != null, - 'is_serialized'=>$this->input->post('is_serialized') != null, - 'deleted'=>$this->input->post('is_deleted') != null, - 'custom1'=>$this->input->post('custom1') == null ? '' : $this->input->post('custom1'), - 'custom2'=>$this->input->post('custom2') == null ? '' : $this->input->post('custom2'), - 'custom3'=>$this->input->post('custom3') == null ? '' : $this->input->post('custom3'), - 'custom4'=>$this->input->post('custom4') == null ? '' : $this->input->post('custom4'), - 'custom5'=>$this->input->post('custom5') == null ? '' : $this->input->post('custom5'), - 'custom6'=>$this->input->post('custom6') == null ? '' : $this->input->post('custom6'), - 'custom7'=>$this->input->post('custom7') == null ? '' : $this->input->post('custom7'), - 'custom8'=>$this->input->post('custom8') == null ? '' : $this->input->post('custom8'), - 'custom9'=>$this->input->post('custom9') == null ? '' : $this->input->post('custom9'), - 'custom10'=>$this->input->post('custom10') == null ? '' : $this->input->post('custom10') + 'name' => $this->input->post('name'), + 'description' => $this->input->post('description'), + 'category' => $this->input->post('category'), + 'supplier_id' => $this->input->post('supplier_id') == '' ? NULL : $this->input->post('supplier_id'), + 'item_number' => $this->input->post('item_number') == '' ? NULL : $this->input->post('item_number'), + 'cost_price' => $this->input->post('cost_price'), + 'unit_price' => $this->input->post('unit_price'), + 'reorder_level' => $this->input->post('reorder_level'), + 'receiving_quantity' => $this->input->post('receiving_quantity'), + 'allow_alt_description' => $this->input->post('allow_alt_description') != NULL, + 'is_serialized' => $this->input->post('is_serialized') != NULL, + 'deleted' => $this->input->post('is_deleted') != NULL, + 'custom1' => $this->input->post('custom1') == NULL ? '' : $this->input->post('custom1'), + 'custom2' => $this->input->post('custom2') == NULL ? '' : $this->input->post('custom2'), + 'custom3' => $this->input->post('custom3') == NULL ? '' : $this->input->post('custom3'), + 'custom4' => $this->input->post('custom4') == NULL ? '' : $this->input->post('custom4'), + 'custom5' => $this->input->post('custom5') == NULL ? '' : $this->input->post('custom5'), + 'custom6' => $this->input->post('custom6') == NULL ? '' : $this->input->post('custom6'), + 'custom7' => $this->input->post('custom7') == NULL ? '' : $this->input->post('custom7'), + 'custom8' => $this->input->post('custom8') == NULL ? '' : $this->input->post('custom8'), + 'custom9' => $this->input->post('custom9') == NULL ? '' : $this->input->post('custom9'), + 'custom10' => $this->input->post('custom10') == NULL ? '' : $this->input->post('custom10') ); - if (!empty($upload_data['orig_name'])) + if(!empty($upload_data['orig_name'])) { - $item_data['pic_id'] = $upload_data['raw_name']; + // XSS file image sanity check + if($this->xss_clean($upload_data['raw_name'], TRUE) === TRUE) + { + $item_data['pic_id'] = $upload_data['raw_name']; + } } $employee_id = $this->Employee->get_logged_in_employee_info()->person_id; $cur_item_info = $this->Item->get_info($item_id); - if($this->Item->save($item_data,$item_id)) + if($this->Item->save($item_data, $item_id)) { $success = TRUE; $new_item = FALSE; //New item - if ($item_id==-1) + if($item_id == -1) { $item_id = $item_data['item_id']; $new_item = TRUE; @@ -357,62 +373,63 @@ class Items extends Secure_area implements iData_controller $tax_percents = $this->input->post('tax_percents'); for($k = 0; $k < count($tax_percents); $k++) { - if (is_numeric($tax_percents[$k])) + if(is_numeric($tax_percents[$k])) { - $items_taxes_data[] = array('name'=>$tax_names[$k], 'percent'=>$tax_percents[$k] ); + $items_taxes_data[] = array('name' => $tax_names[$k], 'percent' => $tax_percents[$k]); } } $success &= $this->Item_taxes->save($items_taxes_data, $item_id); //Save item quantity $stock_locations = $this->Stock_location->get_undeleted_all()->result_array(); - foreach($stock_locations as $location_data) + foreach($stock_locations as $location) { - $updated_quantity = $this->input->post('quantity_' . $location_data['location_id']); - $location_detail = array('item_id'=>$item_id, - 'location_id'=>$location_data['location_id'], - 'quantity'=>$updated_quantity); - $item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location_data['location_id']); - if ($item_quantity->quantity != $updated_quantity || $new_item) + $updated_quantity = $this->input->post('quantity_' . $location['location_id']); + $location_detail = array('item_id' => $item_id, + 'location_id' => $location['location_id'], + 'quantity' => $updated_quantity); + $item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location['location_id']); + if($item_quantity->quantity != $updated_quantity || $new_item) { - $success &= $this->Item_quantity->save($location_detail, $item_id, $location_data['location_id']); + $success &= $this->Item_quantity->save($location_detail, $item_id, $location['location_id']); $inv_data = array( - 'trans_date'=>date('Y-m-d H:i:s'), - 'trans_items'=>$item_id, - 'trans_user'=>$employee_id, - 'trans_location'=>$location_data['location_id'], - 'trans_comment'=>$this->lang->line('items_manually_editing_of_quantity'), - 'trans_inventory'=>$updated_quantity - $item_quantity->quantity + 'trans_date' => date('Y-m-d H:i:s'), + 'trans_items' => $item_id, + 'trans_user' => $employee_id, + 'trans_location' => $location['location_id'], + 'trans_comment' => $this->lang->line('items_manually_editing_of_quantity'), + 'trans_inventory' => $updated_quantity - $item_quantity->quantity ); $success &= $this->Inventory->insert($inv_data); } } + if($success && $upload_success) { - $success_message = $this->lang->line('items_successful_' . ($new_item ? 'adding' : 'updating')) .' '. $item_data['name']; + $message = $this->xss_clean($this->lang->line('items_successful_' . ($new_item ? 'adding' : 'updating')) . ' ' . $item_data['name']); - echo json_encode(array('success'=>true, 'message'=>$success_message, 'item_id'=>$item_id)); + echo json_encode(array('success' => TRUE, 'message' => $message, 'id' => $item_id)); } else { - $error_message = $upload_success ? - $this->lang->line('items_error_adding_updating') .' '. $item_data['name'] : - $this->upload->display_errors(); + $message = $this->xss_clean($upload_success ? $this->lang->line('items_error_adding_updating') . ' ' . $item_data['name'] : $this->upload->display_errors()); - echo json_encode(array('success'=>false, 'message'=>$error_message, 'item_id'=>$item_id)); + echo json_encode(array('success' => FALSE, 'message' => $message, 'id' => $item_id)); } } else//failure { - echo json_encode(array('success'=>false, 'message'=>$this->lang->line('items_error_adding_updating').' '.$item_data['name'], 'item_id'=>-1)); + $message = $this->xss_clean($this->lang->line('items_error_adding_updating') . ' ' . $item_data['name']); + + echo json_encode(array('success' => FALSE, 'message' => $message, 'id' => -1)); } } - function check_item_number() + public function check_item_number() { - $exists = $this->Item->item_number_exists($this->input->post('item_number'),$this->input->post('item_id')); + $exists = $this->Item->item_number_exists($this->input->post('item_number'), $this->input->post('item_id')); echo !$exists ? 'true' : 'false'; } @@ -424,11 +441,12 @@ class Items extends Secure_area implements iData_controller // load upload library $config = array('upload_path' => './uploads/item_pics/', - 'allowed_types' => 'gif|jpg|png', - 'max_size' => '100', - 'max_width' => '640', - 'max_height' => '480', - 'file_name' => sizeof($map) + 1); + 'allowed_types' => 'gif|jpg|png', + 'max_size' => '100', + 'max_width' => '640', + 'max_height' => '480', + 'file_name' => sizeof($map) + 1 + ); $this->load->library('upload', $config); $this->upload->do_upload('item_image'); @@ -437,54 +455,56 @@ class Items extends Secure_area implements iData_controller public function remove_logo($item_id) { - $item_data = array('pic_id' => null); + $item_data = array('pic_id' => NULL); $result = $this->Item->save($item_data, $item_id); echo json_encode(array('success' => $result)); } - function save_inventory($item_id=-1) + public function save_inventory($item_id = -1) { - $employee_id=$this->Employee->get_logged_in_employee_info()->person_id; + $employee_id = $this->Employee->get_logged_in_employee_info()->person_id; $cur_item_info = $this->Item->get_info($item_id); $location_id = $this->input->post('stock_location'); $inv_data = array( - 'trans_date'=>date('Y-m-d H:i:s'), - 'trans_items'=>$item_id, - 'trans_user'=>$employee_id, - 'trans_location'=>$location_id, - 'trans_comment'=>$this->input->post('trans_comment'), - 'trans_inventory'=>$this->input->post('newquantity') + 'trans_date' => date('Y-m-d H:i:s'), + 'trans_items' => $item_id, + 'trans_user' => $employee_id, + 'trans_location' => $location_id, + 'trans_comment' => $this->input->post('trans_comment'), + 'trans_inventory' => $this->input->post('newquantity') ); $this->Inventory->insert($inv_data); //Update stock quantity - $item_quantity= $this->Item_quantity->get_item_quantity($item_id,$location_id); + $item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location_id); $item_quantity_data = array( - 'item_id'=>$item_id, - 'location_id'=>$location_id, - 'quantity'=>$item_quantity->quantity + $this->input->post('newquantity') + 'item_id' => $item_id, + 'location_id' => $location_id, + 'quantity' => $item_quantity->quantity + $this->input->post('newquantity') ); - if($this->Item_quantity->save($item_quantity_data,$item_id,$location_id)) - { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_updating').' '. - $cur_item_info->name,'item_id'=>$item_id)); + if($this->Item_quantity->save($item_quantity_data, $item_id, $location_id)) + { + $message = $this->xss_clean($this->lang->line('items_successful_updating') . ' ' . $cur_item_info->name); + + echo json_encode(array('success' => TRUE, 'message' => $message, 'id' => $item_id)); } else//failure - { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_error_adding_updating').' '. - $cur_item_info->name,'item_id'=>-1)); + { + $message = $this->xss_clean($this->lang->line('items_error_adding_updating') . ' ' . $cur_item_info->name); + + echo json_encode(array('success' => FALSE, 'message' => $message, 'id' => -1)); } } - function bulk_update() + public function bulk_update() { - $items_to_update=$this->input->post('item_ids'); + $items_to_update = $this->input->post('item_ids'); $item_data = array(); - foreach($_POST as $key=>$value) + foreach($_POST as $key => $value) { //This field is nullable, so treat it differently if($key == 'supplier_id' && $value != '') @@ -503,15 +523,15 @@ class Items extends Secure_area implements iData_controller $items_taxes_data = array(); $tax_names = $this->input->post('tax_names'); $tax_percents = $this->input->post('tax_percents'); - $tax_updated = false; + $tax_updated = FALSE; for($k = 0; $k < count($tax_percents); $k++) { - if( !empty($tax_names[$k]) && is_numeric($tax_percents[$k])) + if(!empty($tax_names[$k]) && is_numeric($tax_percents[$k])) { - $tax_updated = true; + $tax_updated = TRUE; - $items_taxes_data[] = array('name'=>$tax_names[$k], 'percent'=>$tax_percents[$k]); + $items_taxes_data[] = array('name' => $tax_names[$k], 'percent' => $tax_percents[$k]); } } @@ -520,87 +540,88 @@ class Items extends Secure_area implements iData_controller $this->Item_taxes->save_multiple($items_taxes_data, $items_to_update); } - echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_bulk_edit'))); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('items_successful_bulk_edit'), 'id' => $this->xss_clean($items_to_update))); } else { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_error_updating_multiple'))); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_error_updating_multiple'))); } } - function delete() + public function delete() { $items_to_delete = $this->input->post('ids'); if($this->Item->delete_list($items_to_delete)) { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_deleted').' '. - count($items_to_delete).' '.$this->lang->line('items_one_or_multiple'))); + $message = $this->lang->line('items_successful_deleted') . ' ' . count($items_to_delete) . ' ' . $this->lang->line('items_one_or_multiple'); + echo json_encode(array('success' => TRUE, 'message' => $message)); } else { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_cannot_be_deleted'))); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_cannot_be_deleted'))); } } - function excel() + public function excel() { - $data = file_get_contents("import_items.csv"); $name = 'import_items.csv'; + $data = file_get_contents($name); force_download($name, $data); } - function excel_import() + public function excel_import() { - $this->load->view("items/form_excel_import", null); + $this->load->view('items/form_excel_import', NULL); } - function do_excel_import() + public function do_excel_import() { - $msg = 'do_excel_import'; - $failCodes = array(); - if ($_FILES['file_path']['error']!=UPLOAD_ERR_OK) + if($_FILES['file_path']['error'] != UPLOAD_ERR_OK) { - $msg = $this->lang->line('items_excel_import_failed'); - echo json_encode( array('success'=>false,'message'=>$msg) ); - - return; + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_excel_import_failed'))); } else { - if (($handle = fopen($_FILES['file_path']['tmp_name'], "r")) !== FALSE) + if(($handle = fopen($_FILES['file_path']['tmp_name'], 'r')) !== FALSE) { - //Skip first row + // Skip the first row as it's the table description fgetcsv($handle); - - $i=1; - while (($data = fgetcsv($handle)) !== FALSE) + $i = 1; + + $failCodes = array(); + + while(($data = fgetcsv($handle)) !== FALSE) { - if (sizeof($data) >= 23) { + // XSS file data sanity check + $data = $this->xss_clean($data); + + if(sizeof($data) >= 23) + { $item_data = array( - 'name' => $data[1], - 'description' => $data[11], - 'category' => $data[2], - 'cost_price' => $data[4], - 'unit_price' => $data[5], - 'reorder_level' => $data[10], - 'supplier_id' => $this->Supplier->exists($data[3]) ? $data[3] : null, - 'allow_alt_description' => $data[12] != '' ? '1' : '0', - 'is_serialized' => $data[13] != '' ? '1' : '0', - 'custom1' => $data[14], - 'custom2' => $data[15], - 'custom3' => $data[16], - 'custom4' => $data[17], - 'custom5' => $data[18], - 'custom6' => $data[19], - 'custom7' => $data[20], - 'custom8' => $data[21], - 'custom9' => $data[22], - 'custom10' => $data[23] + 'name' => $data[1], + 'description' => $data[11], + 'category' => $data[2], + 'cost_price' => $data[4], + 'unit_price' => $data[5], + 'reorder_level' => $data[10], + 'supplier_id' => $this->Supplier->exists($data[3]) ? $data[3] : NULL, + 'allow_alt_description' => $data[12] != '' ? '1' : '0', + 'is_serialized' => $data[13] != '' ? '1' : '0', + 'custom1' => $data[14], + 'custom2' => $data[15], + 'custom3' => $data[16], + 'custom4' => $data[17], + 'custom5' => $data[18], + 'custom6' => $data[19], + 'custom7' => $data[20], + 'custom8' => $data[21], + 'custom9' => $data[22], + 'custom10' => $data[23] ); $item_number = $data[0]; - $invalidated = false; - if ($item_number != "") + $invalidated = FALSE; + if($item_number != '') { $item_data['item_number'] = $item_number; $invalidated = $this->Item->item_number_exists($item_number); @@ -608,21 +629,22 @@ class Items extends Secure_area implements iData_controller } else { - $invalidated = true; + $invalidated = TRUE; } + if(!$invalidated && $this->Item->save($item_data)) { - $items_taxes_data = null; + $items_taxes_data = NULL; //tax 1 - if( is_numeric($data[7]) && $data[6]!='' ) + if(is_numeric($data[7]) && $data[6] != '') { - $items_taxes_data[] = array('name'=>$data[6], 'percent'=>$data[7] ); + $items_taxes_data[] = array('name' => $data[6], 'percent' => $data[7] ); } //tax 2 - if( is_numeric($data[9]) && $data[8]!='' ) + if(is_numeric($data[9]) && $data[8] != '') { - $items_taxes_data[] = array('name'=>$data[8], 'percent'=>$data[9] ); + $items_taxes_data[] = array('name' => $data[8], 'percent' => $data[9] ); } // save tax values @@ -631,21 +653,21 @@ class Items extends Secure_area implements iData_controller $this->Item_taxes->save($items_taxes_data, $item_data['item_id']); } - // quantities & inventory Info - $employee_id=$this->Employee->get_logged_in_employee_info()->person_id; - $emp_info=$this->Employee->get_info($employee_id); + // quantities & inventory Info + $employee_id = $this->Employee->get_logged_in_employee_info()->person_id; + $emp_info = $this->Employee->get_info($employee_id); $comment ='Qty CSV Imported'; $cols = count($data); // array to store information if location got a quantity $allowed_locations = $this->Stock_location->get_allowed_locations(); - for ($col = 24; $col < $cols; $col = $col + 2) + for($col = 24; $col < $cols; $col = $col + 2) { $location_id = $data[$col]; - if (array_key_exists($location_id, $allowed_locations)) + if(array_key_exists($location_id, $allowed_locations)) { - $item_quantity_data = array ( + $item_quantity_data = array( 'item_id' => $item_data['item_id'], 'location_id' => $location_id, 'quantity' => $data[$col + 1], @@ -653,11 +675,11 @@ class Items extends Secure_area implements iData_controller $this->Item_quantity->save($item_quantity_data, $item_data['item_id'], $location_id); $excel_data = array( - 'trans_items'=>$item_data['item_id'], - 'trans_user'=>$employee_id, - 'trans_comment'=>$comment, - 'trans_location'=>$data[$col], - 'trans_inventory'=>$data[$col + 1] + 'trans_items' => $item_data['item_id'], + 'trans_user' => $employee_id, + 'trans_comment' => $comment, + 'trans_location' => $data[$col], + 'trans_inventory' => $data[$col + 1] ); $this->Inventory->insert($excel_data); @@ -679,45 +701,41 @@ class Items extends Secure_area implements iData_controller ); $this->Item_quantity->save($item_quantity_data, $item_data['item_id'], $data[$col]); - $excel_data = array - ( - 'trans_items'=>$item_data['item_id'], - 'trans_user'=>$employee_id, - 'trans_comment'=>$comment, - 'trans_location'=>$location_id, - 'trans_inventory'=>0 - ); - $this->db->insert('inventory',$excel_data); + $excel_data = array( + 'trans_items' => $item_data['item_id'], + 'trans_user' => $employee_id, + 'trans_comment' => $comment, + 'trans_location' => $location_id, + 'trans_inventory' => 0 + ); + + $this->Inventory->insert($excel_data); } } - else//insert or update item failure + else //insert or update item failure { $failCodes[] = $i; } $i++; } - } - else - { - echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') ); - return; - } + if(count($failCodes) > 0) + { + $message = $this->lang->line('items_excel_import_partially_failed') . ' (' . count($failCodes) . '): ' . implode(', ', $failCodes); + + echo json_encode(array('success' => FALSE, 'message' => $message)); + } + else + { + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('items_excel_import_success'))); + } + } + else + { + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_excel_import_nodata_wrongformat'))); + } } - - $success = true; - if(count($failCodes) > 0) - { - $msg = "Most items imported. But some were not, here is list of their CODE (" .count($failCodes) ."): ".implode(", ", $failCodes); - $success = false; - } - else - { - $msg = "Import items successful"; - } - - echo json_encode( array('success'=>$success, 'message'=>$msg) ); } } ?> diff --git a/application/controllers/Languagecheck.php b/application/controllers/Languagecheck.php deleted file mode 100644 index c0d4eff59..000000000 --- a/application/controllers/Languagecheck.php +++ /dev/null @@ -1,192 +0,0 @@ -load->helper('directory'); - - // for simplicity, we don't use views - $this->output('h1', 'Open Source Point of Sale - Language file checking and validation'); - - // determine the language file path - if ( ! is_dir($this->lang_path) ) - { - $this->lang_path = APPPATH . $this->lang_path; - - if ( ! is_dir($this->lang_path) ) - { - $this->output('h2', 'Defined language path "'.$this->lang_path.'" not found!', TRUE); - exit; - } - } - - // fetch the languages directory map - $languages = directory_map( $this->lang_path, TRUE ); - - // is our reference language present? - if ( ! in_array($this->reference, $languages ) ) - { - $this->output('h2', 'Reference language "'.$this->reference.'" not found!', TRUE); - exit; - } - - // load the list of language files for the reference language - $references = directory_map( $this->lang_path . '/' . $this->reference, TRUE ); - - // now process the list - foreach( $references as $reference ) - { - // skip non-language files in the language directory - if ( strpos($reference, '_lang.php') === FALSE ) - { - continue; - } - - // process it - $this->output('h2', 'Processing '.$this->reference . ' » ' .$reference); - - // load the language file - include $this->lang_path . '/' . $this->reference . '/' . $reference; - - // did the file contain any language strings? - if ( empty($lang) ) - { - // language file was empty or not properly defined - $this->output('h3', 'Language file doesn\'t contain any language strings. Skipping file!', TRUE); - continue; - } - - // store the loaded language strings - $lang_ref = $lang; - unset($lang); - - // now loop through the available languages - foreach ( $languages as $language ) - { - // skip the reference language - if ( $language == $this->reference ) - { - continue; - } - - // language file to check - $file = $this->lang_path . '/' . $language . '/' . $reference; - - // check if the language file exists for this language - if ( ! file_exists( $file ) ) - { - // file not found - $this->output('h3', 'Language file doesn\'t exist for the language '.$language.'!', TRUE); - } - else - { - // load the file to compare - include $file; - - // did the file contain any language strings? - if ( empty($lang) ) - { - // language file was empty or not properly defined - $this->output('h3', 'Language file for the language '.$language.' doesn\'t contain any language strings!', TRUE); - } - else - { - // start comparing - $this->output('h3', 'Comparing with the '.$language.' version:'); - - // assume all goes well - $failures = 0; - - // start comparing language keys - foreach( $lang_ref as $key => $value ) - { - if ( ! isset($lang[$key]) ) - { - // report the missing key - $this->output('', 'Missing language string "'.$key.'"', TRUE); - - // increment the failure counter - $failures++; - } - } - - if ( ! $failures ) - { - $this->output('', 'The two language files have matching strings.'); - } - } - - // make sure the lang array is deleted before the next check - if ( isset($lang) ) - { - unset($lang); - } - } - } - - } - - $this->output('h2', 'Language file checking and validation completed'); - } - - // ----------------------------------------------------------------- - - private function output($type = '', $line = '', $highlight = FALSE) - { - switch ($type) - { - case 'h1': - $html = "

{line}

\n
\n"; - break; - - case 'h2': - $html = "

{line}

\n"; - break; - - case 'h3': - $html = "

   {line}

\n"; - break; - - default: - $html = "    » {line}
"; - break; - } - - if ( $highlight ) - { - $line = '' . $line . ''; - } - - echo str_replace('{line}', $line, $html); - } - // ----------------------------------------------------------------- - -} - -/* End of file languagecheck.php */ -/* Location: ./application/controllers/languagecheck.php */ diff --git a/application/controllers/Login.php b/application/controllers/Login.php index 4ed96794a..52f24d7ce 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -1,12 +1,13 @@ -Employee->is_logged_in()) { @@ -28,7 +29,7 @@ class Login extends CI_Controller } } - function login_check($username) + public function login_check($username) { $password = $this->input->post('password'); @@ -36,10 +37,10 @@ class Login extends CI_Controller { $this->form_validation->set_message('login_check', $this->lang->line('login_invalid_username_and_password')); - return false; + return FALSE; } - return true; + return TRUE; } } ?> \ No newline at end of file diff --git a/application/controllers/Messages.php b/application/controllers/Messages.php index f64b6ace6..e24414c98 100644 --- a/application/controllers/Messages.php +++ b/application/controllers/Messages.php @@ -1,64 +1,73 @@ -get_controller_name(); - $this->load->view('messages/sms'); } - function view($person_id=-1) + public function view($person_id = -1) { - $data['person_info'] = $this->Person->get_info($person_id); + $info = $this->Person->get_info($person_id); + foreach(get_object_vars($info) as $property => $value) + { + $info->$property = $this->xss_clean($value); + } + $data['person_info'] = $info; $this->load->view('messages/form_sms', $data); } - function send() + public function send() { - $username = $this->config->item('msg_uid'); - $password = $this->config->item('msg_pwd'); - $phone = $this->input->post('phone'); - $message = $this->input->post('message'); + $username = $this->config->item('msg_uid'); + $password = $this->config->item('msg_pwd'); + $phone = $this->input->post('phone'); + $message = $this->input->post('message'); $originator = $this->config->item('msg_src'); $response = $this->sms->sendSMS($username, $password, $phone, $message, $originator); + + $phone = $this->xss_clean($phone); if($response) { - echo json_encode(array('success'=>true, 'message'=>$this->lang->line('messages_successfully_sent') . ' ' . $phone)); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('messages_successfully_sent') . ' ' . $phone)); } else { - echo json_encode(array('success'=>false, 'message'=>$this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone)); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone)); } } - function send_form($person_id=-1) + public function send_form($person_id = -1) { - $username = $this->config->item('msg_uid'); - $password = $this->config->item('msg_pwd'); - $phone = $this->input->post('phone'); - $message = $this->input->post('message'); + $username = $this->config->item('msg_uid'); + $password = $this->config->item('msg_pwd'); + $phone = $this->input->post('phone'); + $message = $this->input->post('message'); $originator = $this->config->item('msg_src'); $response = $this->sms->sendSMS($username, $password, $phone, $message, $originator); + + $phone = $this->xss_clean($phone); + $person_id = $this->xss_clean($person_id); if($response) { - echo json_encode(array('success'=>true, 'message'=>$this->lang->line('messages_successfully_sent') . ' ' . $phone, 'person_id'=>$person_id)); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('messages_successfully_sent') . ' ' . $phone, 'person_id' => $person_id)); } else { - echo json_encode(array('success'=>false, 'message'=>$this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone, 'person_id'=>-1)); + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone, 'person_id' => -1)); } } } diff --git a/application/controllers/No_access.php b/application/controllers/No_access.php index 9761c02af..d8efeea69 100644 --- a/application/controllers/No_access.php +++ b/application/controllers/No_access.php @@ -1,16 +1,20 @@ -Module->get_module_name($module_id); - $data['permission_id']=$permission_id; - $this->load->view('no_access',$data); + $data['module_name'] = $this->Module->get_module_name($module_id); + $data['permission_id'] = $permission_id; + + $data = $this->security->xss_clean($data); + + $this->load->view('no_access', $data); } } ?> \ No newline at end of file diff --git a/application/controllers/Person_controller.php b/application/controllers/Person_controller.php deleted file mode 100644 index d09124d56..000000000 --- a/application/controllers/Person_controller.php +++ /dev/null @@ -1,53 +0,0 @@ -input->post('ids'); - - if($people_to_email!=false) - { - $mailto_url='mailto:'; - foreach($this->Person->get_multiple_info($people_to_email)->result() as $person) - { - $mailto_url.=$person->email.','; - } - //remove last comma - $mailto_url=substr($mailto_url,0,strlen($mailto_url)-1); - - echo $mailto_url; - exit; - } - echo '#'; - } - - /* - Gives search suggestions based on what is being searched for - */ - function suggest() - { - $suggestions = $this->Person->get_search_suggestions($this->input->post('q'),$this->input->post('limit')); - echo implode("\n",$suggestions); - } - - /* - Gets one row for a person manage table. This is called using AJAX to update one row. - */ - function get_row() - { - $person_id = $this->input->post('row_id'); - $data_row=get_person_data_row($this->Person->get_info($person_id),$this); - echo $data_row; - } -} -?> \ No newline at end of file diff --git a/application/controllers/Persons.php b/application/controllers/Persons.php new file mode 100644 index 000000000..a5ce8de9f --- /dev/null +++ b/application/controllers/Persons.php @@ -0,0 +1,32 @@ +xss_clean($this->Person->get_search_suggestions($this->input->post('term'))); + + echo json_encode($suggestions); + } + + /* + Gets one row for a person manage table. This is called using AJAX to update one row. + */ + public function get_row($row_id) + { + $data_row = $this->xss_clean(get_person_data_row($this->Person->get_info($row_id), $this)); + + echo json_encode($data_row); + } +} +?> \ No newline at end of file diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index 2d067a6aa..756ef3a28 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -1,10 +1,13 @@ -load->library('receiving_lib'); $this->load->library('barcode_lib'); } @@ -16,7 +19,9 @@ class Receivings extends Secure_area function item_search() { - $suggestions = $this->Item->get_search_suggestions($this->input->get('term')); + $suggestions = $this->Item->get_search_suggestions($this->input->get('term'), array( + 'search_custom' => FALSE, 'is_deleted' => FALSE + ), TRUE); $suggestions = array_merge($suggestions, $this->Item_kit->get_search_suggestions($this->input->get('term'))); echo json_encode($suggestions); } @@ -263,10 +268,9 @@ class Receivings extends Secure_area private function _substitute_invoice_number($supplier_info='') { - $invoice_number=$this->receiving_lib->get_invoice_number(); $invoice_number=$this->config->config['recv_invoice_format']; $invoice_number = $this->_substitute_variables($invoice_number,$supplier_info); - $this->receiving_lib->set_invoice_number($invoice_number); + $this->receiving_lib->set_invoice_number($invoice_number, TRUE); return $this->receiving_lib->get_invoice_number(); } @@ -358,13 +362,13 @@ class Receivings extends Secure_area $this->load->view("receivings/receiving",$data); } - function save($receiving_id) + function save($receiving_id = -1) { - $date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $this->input->post('date', TRUE)); + $date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $this->input->post('date')); $receiving_data = array( 'receiving_time' => $date_formatter->format('Y-m-d H:i:s'), - 'supplier_id' => $this->input->post('supplier_id', TRUE) ? $this->input->post('supplier_id') : null, + 'supplier_id' => $this->input->post('supplier_id') ? $this->input->post('supplier_id') : null, 'employee_id' => $this->input->post('employee_id'), 'comment' => $this->input->post('comment'), 'invoice_number' => $this->input->post('invoice_number') diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 2ddf362fd..00bc8e114 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1,377 +1,378 @@ -uri->segment(2); $exploder = explode('_', $method_name); - preg_match("/(?:inventory)|([^_.]*)(?:_graph|_row)?$/", $method_name, $matches); - preg_match("/^(.*?)([sy])?$/", array_pop($matches), $matches); - $submodule_id = $matches[1] . ((count($matches) > 2) ? $matches[2] : "s"); - $employee_id=$this->Employee->get_logged_in_employee_info()->person_id; - // check access to report submodule - if (sizeof($exploder) > 1 && !$this->Employee->has_grant('reports_' . $submodule_id,$employee_id)) + + if(sizeof($exploder) > 1) { - redirect('no_access/reports/reports_' . $submodule_id); + preg_match("/(?:inventory)|([^_.]*)(?:_graph|_row)?$/", $method_name, $matches); + preg_match("/^(.*?)([sy])?$/", array_pop($matches), $matches); + $submodule_id = $matches[1] . ((count($matches) > 2) ? $matches[2] : "s"); + // check access to report submodule + if(!$this->Employee->has_grant('reports_' . $submodule_id, $this->Employee->get_logged_in_employee_info()->person_id)) + { + redirect('no_access/reports/reports_' . $submodule_id); + } } $this->load->helper('report'); } //Initial report listing screen - function index() + public function index() { - $data['grants'] = $this->Employee->get_employee_grants($this->session->userdata('person_id')); + $data['grants'] = $this->xss_clean($this->Employee->get_employee_grants($this->session->userdata('person_id'))); + $this->load->view("reports/listing", $data); } - //Input for reports that require only a date range and an export to excel. (see routes.php to see that all summary reports route here) - function date_input_excel_export() - { - $data = array(); - $this->load->view("reports/date_input_excel_export", $data); - } - - function get_detailed_sales_row($sale_id) + public function get_detailed_sales_row($sale_id) { $this->load->model('reports/Detailed_sales'); $model = $this->Detailed_sales; $report_data = $model->getDataBySaleId($sale_id); - $summary_data = array(anchor('sales/edit/'.$report_data['sale_id'], - 'POS '.$report_data['sale_id'], - array('class'=>'modal-dlg modal-btn-submit')), - $report_data['sale_date'], - to_quantity_decimals($report_data['items_purchased']), - $report_data['employee_name'], - $report_data['customer_name'], - to_currency($report_data['subtotal']), - to_currency($report_data['total']), - to_currency($report_data['tax']), - to_currency($report_data['cost']), - to_currency($report_data['profit']), - $report_data['payment_type'], - $report_data['comment']); + $summary_data = $this->xss_clean(array( + 'sale_id' => $report_data['sale_id'], + 'sale_date' => $report_data['sale_date'], + 'quantity' => to_quantity_decimals($report_data['items_purchased']), + 'employee' => $report_data['employee_name'], + 'customer' => $report_data['customer_name'], + 'subtotal' => to_currency($report_data['subtotal']), + 'total' => to_currency($report_data['total']), + 'tax' => to_currency($report_data['tax']), + 'cost' => to_currency($report_data['cost']), + 'profit' => to_currency($report_data['profit']), + 'payment_type' => $report_data['payment_type'], + 'comment' => $report_data['comment'], + 'edit' => anchor("sales/edit/". $report_data['sale_id'], '', + array('class'=>"modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title' => $this->lang->line('sales_update')) + ) + )); - echo get_detailed_data_row($summary_data, $this); + echo json_encode(array($sale_id => $summary_data)); } - function get_detailed_receivings_row($receiving_id) + public function get_detailed_receivings_row($receiving_id) { $this->load->model('reports/Detailed_receivings'); $model = $this->Detailed_receivings; $report_data = $model->getDataByReceivingId($receiving_id); - $summary_data = array(anchor('receivings/edit/'.$report_data['receiving_id'], - 'RECV '.$report_data['receiving_id'], - array('class'=>'modal-dlg modal-btn-submit')), - $report_data['receiving_date'], - to_quantity_decimals($report_data['items_purchased']), - $report_data['employee_name'], - $report_data['supplier_name'], - to_currency($report_data['total']), - $report_data['payment_type'] - ); + $summary_data = $this->xss_clean(array( + 'receiving_id' => $report_data['receiving_id'], + 'receiving_date' => $report_data['receiving_date'], + 'quantity' => to_quantity_decimals($report_data['items_purchased']), + 'invoice_number' => $report_data['invoice_number'], + 'employee' => $report_data['employee_name'], + 'supplier' => $report_data['supplier_name'], + 'total' => to_currency($report_data['total']), + 'comment' => $report_data['comment'], + 'payment_type' => $report_data['payment_type'], + 'edit' => anchor("receivings/edit/". $report_data['receiving_id'], '', + array('class'=>"modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title' => $this->lang->line('recvs_update')) + ) + )); if($this->config->item('invoice_enable') == TRUE) { - $summary_data[] = $report_data['invoice_number']; + $summary_data[]['invoice_number'] = $this->xss_clean($report_data['invoice_number']); } - $summary_data[] = $report_data['comment']; + $summary_data[] = $this->xss_clean($report_data['comment']); - echo get_detailed_data_row($summary_data, $this); - } - - function get_summary_data($start_date, $end_date=null, $sale_type=0) - { - $end_date = $end_date ? $end_date : $start_date; - $this->load->model('reports/Summary_sales'); - $model = $this->Summary_sales; - $summary = $model->getSummaryData(array( - 'start_date'=>$start_date, - 'end_date'=>$end_date, - 'sale_type'=>$sale_type)); - - echo get_sales_summary_totals($summary, $this); + echo json_encode(array($receiving_id => $summary_data)); } //Summary sales report - function summary_sales($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_sales($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_sales'); $model = $this->Summary_sales; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['sale_date'], - to_quantity_decimals($row['quantity_purchased']), - to_currency($row['subtotal']), - to_currency($row['total']), - to_currency($row['tax']), - to_currency($row['cost']), - to_currency($row['profit'])); + $tabular_data[] = $this->xss_clean(array($row['sale_date'], + to_quantity_decimals($row['quantity_purchased']), + to_currency($row['subtotal']), + to_currency($row['total']), + to_currency($row['tax']), + to_currency($row['cost']), + to_currency($row['profit']) + )); } $data = array( "title" => $this->lang->line('reports_sales_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary categories report - function summary_categories($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_categories($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_categories'); $model = $this->Summary_categories; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['category'], - to_quantity_decimals($row['quantity_purchased']), - to_currency($row['subtotal']), - to_currency($row['total']), - to_currency($row['tax']), - to_currency($row['cost']), - to_currency($row['profit'])); + $tabular_data[] = $this->xss_clean(array($row['category'], + to_quantity_decimals($row['quantity_purchased']), + to_currency($row['subtotal']), + to_currency($row['total']), + to_currency($row['tax']), + to_currency($row['cost']), + to_currency($row['profit']) + )); } $data = array( "title" => $this->lang->line('reports_categories_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary customers report - function summary_customers($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_customers($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_customers'); $model = $this->Summary_customers; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['customer'], - to_quantity_decimals($row['quantity_purchased']), - to_currency($row['subtotal']), - to_currency($row['total']), - to_currency($row['tax']), - to_currency($row['cost']), - to_currency($row['profit'])); + $tabular_data[] = $this->xss_clean(array($row['customer'], + to_quantity_decimals($row['quantity_purchased']), + to_currency($row['subtotal']), + to_currency($row['total']), + to_currency($row['tax']), + to_currency($row['cost']), + to_currency($row['profit']) + )); } $data = array( "title" => $this->lang->line('reports_customers_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary suppliers report - function summary_suppliers($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_suppliers($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_suppliers'); $model = $this->Summary_suppliers; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['supplier'], - to_quantity_decimals($row['quantity_purchased']), - to_currency($row['subtotal']), - to_currency($row['total']), - to_currency($row['tax']), - to_currency($row['cost']), - to_currency($row['profit'])); + $tabular_data[] = $this->xss_clean(array($row['supplier'], + to_quantity_decimals($row['quantity_purchased']), + to_currency($row['subtotal']), + to_currency($row['total']), + to_currency($row['tax']), + to_currency($row['cost']), + to_currency($row['profit']) + )); } $data = array( "title" => $this->lang->line('reports_suppliers_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary items report - function summary_items($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_items($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_items'); $model = $this->Summary_items; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array(character_limiter($row['name'], 40), - to_quantity_decimals($row['quantity_purchased']), - to_currency($row['subtotal']), - to_currency($row['total']), - to_currency($row['tax']), - to_currency($row['cost']), - to_currency($row['profit'])); + $tabular_data[] = $this->xss_clean(array(character_limiter($row['name'], 50), + to_quantity_decimals($row['quantity_purchased']), + to_currency($row['subtotal']), + to_currency($row['total']), + to_currency($row['tax']), + to_currency($row['cost']), + to_currency($row['profit']) + )); } $data = array( "title" => $this->lang->line('reports_items_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary employees report - function summary_employees($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_employees($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_employees'); $model = $this->Summary_employees; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['employee'], - to_quantity_decimals($row['quantity_purchased']), - to_currency($row['subtotal']), - to_currency($row['total']), - to_currency($row['tax']), - to_currency($row['cost']), - to_currency($row['profit'])); + $tabular_data[] = $this->xss_clean(array($row['employee'], + to_quantity_decimals($row['quantity_purchased']), + to_currency($row['subtotal']), + to_currency($row['total']), + to_currency($row['tax']), + to_currency($row['cost']), + to_currency($row['profit']) + )); } $data = array( "title" => $this->lang->line('reports_employees_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary taxes report - function summary_taxes($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_taxes($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_taxes'); $model = $this->Summary_taxes; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['percent'], + $tabular_data[] = $this->xss_clean(array($row['percent'], $row['count'], to_currency($row['subtotal']), to_currency($row['total']), - to_currency($row['tax'])); + to_currency($row['tax']) + )); } $data = array( "title" => $this->lang->line('reports_taxes_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary discounts report - function summary_discounts($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_discounts($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_discounts'); $model = $this->Summary_discounts; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['discount_percent'], - $row['count']); + $tabular_data[] = $this->xss_clean(array($row['discount_percent'], + $row['count'] + )); } $data = array( "title" => $this->lang->line('reports_discounts_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Summary payments report - function summary_payments($start_date, $end_date, $sale_type, $export_excel=0) + public function summary_payments($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_payments'); $model = $this->Summary_payments; - $tabular_data = array(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['payment_type'], - $row['count'], - to_currency($row['payment_amount'])); + $tabular_data[] = $this->xss_clean(array($row['payment_type'], + $row['count'], + to_currency($row['payment_amount']) + )); } $data = array( "title" => $this->lang->line('reports_payments_summary_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular", $data); } //Input for reports that require only a date range. (see routes.php to see that all graphical summary reports route here) - function date_input() + public function date_input() { $data = array(); $data['mode'] = 'sale'; @@ -380,10 +381,10 @@ class Reports extends Secure_area } //Input for reports that require only a date range. (see routes.php to see that all graphical summary reports route here) - function date_input_sales() + public function date_input_sales() { $data = array(); - $stock_locations = $this->Stock_location->get_allowed_locations('sales'); + $stock_locations = $data = $this->xss_clean($this->Stock_location->get_allowed_locations('sales')); $stock_locations['all'] = $this->lang->line('reports_all'); $data['stock_locations'] = array_reverse($stock_locations, TRUE); $data['mode'] = 'sale'; @@ -391,10 +392,10 @@ class Reports extends Secure_area $this->load->view("reports/date_input", $data); } - function date_input_recv() + public function date_input_recv() { $data = array(); - $stock_locations = $this->Stock_location->get_allowed_locations('receivings'); + $stock_locations = $data = $this->xss_clean($this->Stock_location->get_allowed_locations('receivings')); $stock_locations['all'] = $this->lang->line('reports_all'); $data['stock_locations'] = array_reverse($stock_locations, TRUE); $data['mode'] = 'receiving'; @@ -403,400 +404,348 @@ class Reports extends Secure_area } //Graphical summary sales report - function graphical_summary_sales($start_date, $end_date, $sale_type) + public function graphical_summary_sales($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_sales'); $model = $this->Summary_sales; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); - $data = array( - "title" => $this->lang->line('reports_sales_summary_report'), - "data_file" => site_url("reports/graphical_summary_sales_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_sales_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_sales'); - $model = $this->Summary_sales; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[date($this->config->item('dateformat'), strtotime($row['sale_date']))] = $row['total']; + $row = $this->xss_clean($row); + + $date = date($this->config->item('dateformat'), strtotime($row['sale_date'])); + $labels[] = $date; + $series[] = array('meta' => $date, 'value' => $row['total']); } $data = array( "title" => $this->lang->line('reports_sales_summary_report'), - "yaxis_label"=>$this->lang->line('reports_revenue'), - "xaxis_label"=>$this->lang->line('reports_date'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/line", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))), + "yaxis_title" => $this->lang->line('reports_revenue'), + "xaxis_title" => $this->lang->line('reports_date'), + "show_currency" => TRUE ); - $this->load->view("reports/graphs/line", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary items report - function graphical_summary_items($start_date, $end_date, $sale_type) + public function graphical_summary_items($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_items'); $model = $this->Summary_items; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); - $data = array( - "title" => $this->lang->line('reports_items_summary_report'), - "data_file" => site_url("reports/graphical_summary_items_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_items_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_items'); - $model = $this->Summary_items; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[$row['name']] = $row['total']; + $row = $this->xss_clean($row); + + $labels[] = $row['name']; + $series[] = $row['total']; } $data = array( "title" => $this->lang->line('reports_items_summary_report'), - "xaxis_label"=>$this->lang->line('reports_revenue'), - "yaxis_label"=>$this->lang->line('reports_items'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/hbar", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))), + "yaxis_title" => $this->lang->line('reports_items'), + "xaxis_title" => $this->lang->line('reports_revenue'), + "show_currency" => TRUE ); - $this->load->view("reports/graphs/hbar", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary customers report - function graphical_summary_categories($start_date, $end_date, $sale_type) + public function graphical_summary_categories($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_categories'); $model = $this->Summary_categories; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + $summary = $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))); - $data = array( - "title" => $this->lang->line('reports_categories_summary_report'), - "data_file" => site_url("reports/graphical_summary_categories_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_categories_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_categories'); - $model = $this->Summary_categories; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[$row['category']] = $row['total']; + $row = $this->xss_clean($row); + + $labels[] = $row['category']; + $series[] = array('meta' => $row['category'] . ' ' . round($row['total'] / $summary['total'] * 100, 2) . '%', 'value' => $row['total']); } $data = array( "title" => $this->lang->line('reports_categories_summary_report'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/pie", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $summary, + "show_currency" => TRUE ); - $this->load->view("reports/graphs/pie", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary suppliers report - function graphical_summary_suppliers($start_date, $end_date, $sale_type) + public function graphical_summary_suppliers($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_suppliers'); $model = $this->Summary_suppliers; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + $summary = $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))); - $data = array( - "title" => $this->lang->line('reports_suppliers_summary_report'), - "data_file" => site_url("reports/graphical_summary_suppliers_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_suppliers_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_suppliers'); - $model = $this->Summary_suppliers; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[$row['supplier']] = $row['total']; + $row = $this->xss_clean($row); + + $labels[] = $row['supplier']; + $series[] = array('meta' => $row['supplier'] . ' ' . round($row['total'] / $summary['total'] * 100, 2) . '%', 'value' => $row['total']); } $data = array( "title" => $this->lang->line('reports_suppliers_summary_report'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/pie", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $summary, + "show_currency" => TRUE ); - $this->load->view("reports/graphs/pie", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary employees report - function graphical_summary_employees($start_date, $end_date, $sale_type) + public function graphical_summary_employees($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_employees'); $model = $this->Summary_employees; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + $summary = $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))); - $data = array( - "title" => $this->lang->line('reports_employees_summary_report'), - "data_file" => site_url("reports/graphical_summary_employees_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_employees_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_employees'); - $model = $this->Summary_employees; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[$row['employee']] = $row['total']; + $row = $this->xss_clean($row); + + $labels[] = $row['employee']; + $series[] = array('meta' => $row['employee'] . ' ' . round($row['total'] / $summary['total'] * 100, 2) . '%', 'value' => $row['total']); } $data = array( "title" => $this->lang->line('reports_employees_summary_report'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/pie", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $summary, + "show_currency" => TRUE ); - $this->load->view("reports/graphs/pie", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary taxes report - function graphical_summary_taxes($start_date, $end_date, $sale_type) + public function graphical_summary_taxes($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_taxes'); $model = $this->Summary_taxes; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + $summary = $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))); - $data = array( - "title" => $this->lang->line('reports_taxes_summary_report'), - "data_file" => site_url("reports/graphical_summary_taxes_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_taxes_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_taxes'); - $model = $this->Summary_taxes; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[$row['percent']] = $row['total']; + $row = $this->xss_clean($row); + + $labels[] = $row['percent']; + $series[] = array('meta' => $row['percent'] . ' ' . round($row['total'] / $summary['total'] * 100, 2) . '%', 'value' => $row['total']); } $data = array( "title" => $this->lang->line('reports_taxes_summary_report'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/pie", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $summary, + "show_currency" => TRUE ); - $this->load->view("reports/graphs/pie", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary customers report - function graphical_summary_customers($start_date, $end_date, $sale_type) + public function graphical_summary_customers($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_customers'); $model = $this->Summary_customers; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); - $data = array( - "title" => $this->lang->line('reports_customers_summary_report'), - "data_file" => site_url("reports/graphical_summary_customers_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_customers_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_customers'); - $model = $this->Summary_customers; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[$row['customer']] = $row['total']; + $row = $this->xss_clean($row); + + $labels[] = $row['customer']; + $series[] = $row['total']; } $data = array( "title" => $this->lang->line('reports_customers_summary_report'), - "xaxis_label"=>$this->lang->line('reports_revenue'), - "yaxis_label"=>$this->lang->line('reports_customers'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/hbar", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))), + "yaxis_title" => $this->lang->line('reports_customers'), + "xaxis_title" => $this->lang->line('reports_revenue'), + "show_currency" => TRUE ); - $this->load->view("reports/graphs/hbar", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary discounts report - function graphical_summary_discounts($start_date, $end_date, $sale_type) + public function graphical_summary_discounts($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_discounts'); $model = $this->Summary_discounts; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); - $data = array( - "title" => $this->lang->line('reports_discounts_summary_report'), - "data_file" => site_url("reports/graphical_summary_discounts_graph/$start_date/$end_date/$sale_type"), - "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) - ); - - $this->load->view("reports/graphical", $data); - } - - //The actual graph data - function graphical_summary_discounts_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_discounts'); - $model = $this->Summary_discounts; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); + $labels = array(); + $series = array(); foreach($report_data as $row) { - $graph_data[$row['discount_percent']] = $row['count']; + $row = $this->xss_clean($row); + + $labels[] = $row['discount_percent']; + $series[] = $row['count']; } $data = array( "title" => $this->lang->line('reports_discounts_summary_report'), - "yaxis_label"=>$this->lang->line('reports_count'), - "xaxis_label"=>$this->lang->line('reports_discount_percent'), - "data" => $graph_data + "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), + "chart_type" => "reports/graphs/bar", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))), + "yaxis_title" => $this->lang->line('reports_count'), + "xaxis_title" => $this->lang->line('reports_discount_percent'), + "show_currency" => FALSE ); - $this->load->view("reports/graphs/bar", $data); + $this->load->view("reports/graphical", $data); } //Graphical summary payments report - function graphical_summary_payments($start_date, $end_date, $sale_type) + public function graphical_summary_payments($start_date, $end_date, $sale_type) { $this->load->model('reports/Summary_payments'); $model = $this->Summary_payments; + + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type)); + $summary = $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type))); + + $labels = array(); + $series = array(); + foreach($report_data as $row) + { + $row = $this->xss_clean($row); + + $labels[] = $row['payment_type']; + $series[] = array('meta' => $row['payment_type'] . ' ' . round($row['payment_amount'] / $summary['total'] * 100, 2) . '%', 'value' => $row['payment_amount']); + } $data = array( "title" => $this->lang->line('reports_payments_summary_report'), - "data_file" => site_url("reports/graphical_summary_payments_graph/$start_date/$end_date/$sale_type"), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)) + "chart_type" => "reports/graphs/pie", + "labels_1" => $labels, + "series_data_1" => $series, + "summary_data_1" => $summary, + "show_currency" => TRUE ); $this->load->view("reports/graphical", $data); } - //The actual graph data - function graphical_summary_payments_graph($start_date, $end_date, $sale_type) - { - $this->load->model('reports/Summary_payments'); - $model = $this->Summary_payments; - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type)); - - $graph_data = array(); - foreach($report_data as $row) - { - $graph_data[$row['payment_type']] = $row['payment_amount']; - } - - $data = array( - "title" => $this->lang->line('reports_payments_summary_report'), - "yaxis_label"=>$this->lang->line('reports_revenue'), - "xaxis_label"=>$this->lang->line('reports_payment_type'), - "data" => $graph_data - ); - - $this->load->view("reports/graphs/pie", $data); - } - - function specific_customer_input() + public function specific_customer_input() { $data = array(); $data['specific_input_name'] = $this->lang->line('reports_customer'); $customers = array(); foreach($this->Customer->get_all()->result() as $customer) - { - $customers[$customer->person_id] = $customer->first_name .' '.$customer->last_name; + { + $customers[$customer->person_id] = $this->xss_clean($customer->first_name . ' ' . $customer->last_name); } $data['specific_input_data'] = $customers; $this->load->view("reports/specific_input", $data); } - function specific_customer($start_date, $end_date, $customer_id, $sale_type, $export_excel=0) + public function specific_customer($start_date, $end_date, $customer_id, $sale_type) { $this->load->model('reports/Specific_customer'); $model = $this->Specific_customer; - $headers = $model->getDataColumns(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'customer_id'=>$customer_id, 'sale_type'=>$sale_type)); + $headers = $this->xss_clean($model->getDataColumns()); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'customer_id' => $customer_id, 'sale_type' => $sale_type)); $summary_data = array(); $details_data = array(); - foreach($report_data['summary'] as $key=>$row) + foreach($report_data['summary'] as $key => $row) { - $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); + $summary_data[] = $this->xss_clean(array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment'])); foreach($report_data['details'][$key] as $drow) { - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%'); + $details_data[$row['sale_id']][] = $this->xss_clean(array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%')); } } $customer_info = $this->Customer->get_info($customer_id); $data = array( - "title" => $customer_info->first_name .' '. $customer_info->last_name.' '.$this->lang->line('reports_report'), + "title" => $this->xss_clean($customer_info->first_name . ' ' . $customer_info->last_name . ' ' . $this->lang->line('reports_report')), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $headers, "summary_data" => $summary_data, "details_data" => $details_data, - "header_width" => intval(100 / count($headers['summary'])), - "overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date,'customer_id' =>$customer_id, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "overall_summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'customer_id' => $customer_id, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular_details", $data); } - function specific_employee_input() + public function specific_employee_input() { $data = array(); $data['specific_input_name'] = $this->lang->line('reports_employee'); @@ -804,50 +753,48 @@ class Reports extends Secure_area $employees = array(); foreach($this->Employee->get_all()->result() as $employee) { - $employees[$employee->person_id] = $employee->first_name .' '.$employee->last_name; + $employees[$employee->person_id] = $this->xss_clean($employee->first_name . ' ' . $employee->last_name); } $data['specific_input_data'] = $employees; $this->load->view("reports/specific_input", $data); } - function specific_employee($start_date, $end_date, $employee_id, $sale_type, $export_excel=0) + public function specific_employee($start_date, $end_date, $employee_id, $sale_type) { $this->load->model('reports/Specific_employee'); $model = $this->Specific_employee; - $headers = $model->getDataColumns(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'employee_id' =>$employee_id, 'sale_type'=>$sale_type)); + $headers = $this->xss_clean($model->getDataColumns()); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'employee_id' => $employee_id, 'sale_type' => $sale_type)); $summary_data = array(); $details_data = array(); - foreach($report_data['summary'] as $key=>$row) + foreach($report_data['summary'] as $key => $row) { - $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); + $summary_data[] = $this->xss_clean(array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment'])); foreach($report_data['details'][$key] as $drow) { - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%'); + $details_data[$row['sale_id']][] = $this->xss_clean(array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%')); } } $employee_info = $this->Employee->get_info($employee_id); $data = array( - "title" => $employee_info->first_name .' '. $employee_info->last_name.' '.$this->lang->line('reports_report'), + "title" => $this->xss_clean($employee_info->first_name . ' ' . $employee_info->last_name . ' ' . $this->lang->line('reports_report')), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), + "headers" => $headers, "summary_data" => $summary_data, "details_data" => $details_data, - "header_width" => intval(100 / count($headers)), - "overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date,'employee_id' =>$employee_id, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "overall_summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date,'employee_id' => $employee_id, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular_details", $data); } - function specific_discount_input() + public function specific_discount_input() { $data = array(); $data['specific_input_name'] = $this->lang->line('reports_discount'); @@ -858,131 +805,134 @@ class Reports extends Secure_area $discounts[$i] = $i . '%'; } $data['specific_input_data'] = $discounts; + + $data = $this->xss_clean($data); $this->load->view("reports/specific_input", $data); } - function specific_discount($start_date, $end_date, $discount, $sale_type, $export_excel = 0) + public function specific_discount($start_date, $end_date, $discount, $sale_type) { $this->load->model('reports/Specific_discount'); $model = $this->Specific_discount; - $headers = $model->getDataColumns(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'discount' =>$discount, 'sale_type'=>$sale_type)); + $headers = $this->xss_clean($model->getDataColumns()); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'discount' => $discount, 'sale_type' => $sale_type)); $summary_data = array(); $details_data = array(); - foreach($report_data['summary'] as $key=>$row) + foreach($report_data['summary'] as $key => $row) { - $summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),/*to_currency($row['profit']),*/ $row['payment_type'], $row['comment']); + $summary_data[] = $this->xss_clean(array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),/*to_currency($row['profit']),*/ $row['payment_type'], $row['comment'])); foreach($report_data['details'][$key] as $drow) { - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%'); + $details_data[$row['sale_id']][] = $this->xss_clean(array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity_decimals($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%')); } } $data = array( - "title" => $discount. '% '.$this->lang->line('reports_discount') . ' ' . $this->lang->line('reports_report'), + "title" => $discount . '% ' . $this->lang->line('reports_discount') . ' ' . $this->lang->line('reports_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), "headers" => $headers, "summary_data" => $summary_data, "details_data" => $details_data, - "header_width" => intval(100 / count($headers['summary'])), - "overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date,'discount' =>$discount, 'sale_type'=>$sale_type)), - "export_excel" => $export_excel + "overall_summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date,'discount' => $discount, 'sale_type' => $sale_type))) ); $this->load->view("reports/tabular_details", $data); } - function detailed_sales($start_date, $end_date, $sale_type, $location_id='all', $export_excel=0) + public function detailed_sales($start_date, $end_date, $sale_type, $location_id = 'all') { $this->load->model('reports/Detailed_sales'); $model = $this->Detailed_sales; - $headers = $model->getDataColumns(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type, 'location_id'=>$location_id)); + $headers = $this->xss_clean($model->getDataColumns()); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type, 'location_id' => $location_id)); $summary_data = array(); $details_data = array(); - $show_locations = $this->Stock_location->multiple_locations(); + $show_locations = $this->xss_clean($this->Stock_location->multiple_locations()); - foreach($report_data['summary'] as $key=>$row) + foreach($report_data['summary'] as $key => $row) { - $summary_data[] = array(anchor('sales/edit/'.$row['sale_id'], 'POS '.$row['sale_id'], array('class'=>'modal-dlg modal-btn-delete modal-btn-submit')), $row['sale_date'], to_quantity_decimals($row['items_purchased']), $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']); + $summary_data[] = $this->xss_clean(array( + 'id' => $row['sale_id'], + 'sale_date' => $row['sale_date'], + 'quantity' => to_quantity_decimals($row['items_purchased']), + 'employee' => $row['employee_name'], + 'customer' => $row['customer_name'], + 'subtotal' => to_currency($row['subtotal']), + 'total' => to_currency($row['total']), + 'tax' => to_currency($row['tax']), + 'cost' => to_currency($row['cost']), + 'profit' => to_currency($row['profit']), + 'payment_type' => $row['payment_type'], + 'comment' => $row['comment'], + 'edit' => anchor("sales/edit/".$row['sale_id'], '', + array('class' => "modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title' => $this->lang->line('sales_update')) + ) + )); foreach($report_data['details'][$key] as $drow) { $quantity_purchased = to_quantity_decimals($drow['quantity_purchased']); - if ($show_locations) + if($show_locations) { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $quantity_purchased, to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%'); + $details_data[$row['sale_id']][] = $this->xss_clean(array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $quantity_purchased, to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%')); } } $data = array( "title" => $this->lang->line('reports_detailed_sales_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), - "editable" => "sales", + "headers" => $headers, + "editable" => 'sales', "summary_data" => $summary_data, "details_data" => $details_data, - "header_width" => intval(100 / count($headers['summary'])), - "overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type'=>$sale_type, 'location_id'=>$location_id)), - "export_excel" => $export_excel + "overall_summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type, 'location_id' => $location_id))) ); $this->load->view("reports/tabular_details", $data); } - function detailed_receivings($start_date, $end_date, $receiving_type, $location_id='all', $export_excel=0) + public function detailed_receivings($start_date, $end_date, $receiving_type, $location_id = 'all') { $this->load->model('reports/Detailed_receivings'); $model = $this->Detailed_receivings; - $headers = $model->getDataColumns(); - $report_data = $model->getData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'receiving_type'=>$receiving_type, 'location_id'=>$location_id)); + $headers = $this->xss_clean($model->getDataColumns()); + $report_data = $model->getData(array('start_date' => $start_date, 'end_date' => $end_date, 'receiving_type' => $receiving_type, 'location_id' => $location_id)); $summary_data = array(); $details_data = array(); - $show_locations = $this->Stock_location->multiple_locations(); + $show_locations = $this->xss_clean($this->Stock_location->multiple_locations()); - foreach($report_data['summary'] as $key=>$row) + foreach($report_data['summary'] as $key => $row) { - if($this->config->item('invoice_enable') == TRUE) + $summary_data[] = $this->xss_clean(array( + 'id' => $row['receiving_id'], + 'receiving_date' => $row['receiving_date'], + 'quantity' => to_quantity_decimals($row['items_purchased']), + 'employee' => $row['employee_name'], $row['supplier_name'], + 'total' => to_currency($row['total']), + 'payment_type' => $row['payment_type'], + 'invoice_number' => $row['invoice_number'], + 'comment' => $row['comment'], + 'edit' => anchor("receivings/edit/" . $row['receiving_id'], '', + array('class' => "modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title' => $this->lang->line('receivings_update')) + ) + )); + + if(!$this->config->item('invoice_enable')) { - $summary_data[] = array( - anchor('receivings/edit/'.$row['receiving_id'], - 'RECV '.$row['receiving_id'], - array('class'=>'modal-dlg modal-btn-delete modal-btn-submit')), - $row['receiving_date'], - to_quantity_decimals($row['items_purchased']), - $row['employee_name'], $row['supplier_name'], - to_currency($row['total']), - $row['payment_type'], - $row['invoice_number'], - $row['comment'] - ); - } - else - { - $summary_data[] = array( - anchor('receivings/edit/'.$row['receiving_id'], - 'RECV '.$row['receiving_id'], - array('class'=>'modal-dlg modal-btn-delete modal-btn-submit')), - $row['receiving_date'], - to_quantity_decimals($row['items_purchased']), - $row['employee_name'], $row['supplier_name'], - to_currency($row['total']), - $row['payment_type'], - $row['comment'] - ); + unset($summary_data['invoice_number']); } foreach($report_data['details'][$key] as $drow) @@ -992,100 +942,96 @@ class Reports extends Secure_area { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$key][] = array($drow['item_number'], $drow['name'], $drow['category'], $quantity_purchased, to_currency($drow['total']), $drow['discount_percent'].'%'); + $details_data[$row['receiving_id']][] = $this->xss_clean(array($drow['item_number'], $drow['name'], $drow['category'], $quantity_purchased, to_currency($drow['total']), $drow['discount_percent'].'%')); } } $data = array( "title" => $this->lang->line('reports_detailed_receivings_report'), "subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) . '-' . date($this->config->item('dateformat'), strtotime($end_date)), - "headers" => $model->getDataColumns(), - "header_width" => intval(100 / count($headers['summary'])), - "editable" => "receivings", + "headers" => $headers, + "editable" => 'receivings', "summary_data" => $summary_data, "details_data" => $details_data, - "header_width" => intval(100 / count($headers['summary'])), - "overall_summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'receiving_type'=>$receiving_type, 'location_id'=>$location_id)), - "export_excel" => $export_excel + "overall_summary_data" => $this->xss_clean($model->getSummaryData(array('start_date' => $start_date, 'end_date' => $end_date, 'receiving_type' => $receiving_type, 'location_id' => $location_id))) ); $this->load->view("reports/tabular_details", $data); } - function excel_export() - { - $this->load->view("reports/excel_export", array()); - } - - function inventory_low($export_excel=0) + public function inventory_low() { $this->load->model('reports/Inventory_low'); $model = $this->Inventory_low; - $tabular_data = array(); + $report_data = $model->getData(array()); + + $tabular_data = array(); foreach($report_data as $row) { - $tabular_data[] = array($row['name'], - $row['item_number'], - $row['description'], - to_quantity_decimals($row['quantity']), - to_quantity_decimals($row['reorder_level']), - $row['location_name']); + $tabular_data[] = $this->xss_clean(array($row['name'], + $row['item_number'], + $row['description'], + to_quantity_decimals($row['quantity']), + to_quantity_decimals($row['reorder_level']), + $row['location_name'] + )); } $data = array( "title" => $this->lang->line('reports_inventory_low_report'), "subtitle" => '', - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData(array()), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData(array())) ); $this->load->view("reports/tabular", $data); } - function inventory_summary_input() + public function inventory_summary_input() { + $this->load->model('reports/Inventory_summary'); + $model = $this->Inventory_summary; + $data = array(); - - $this->load->model('reports/Inventory_Summary'); - $model = $this->Inventory_Summary; $data['item_count'] = $model->getItemCountDropdownArray(); - $stock_locations = $this->Stock_location->get_allowed_locations(); - $stock_locations['all'] = $this->lang->line('reports_all'); + $stock_locations = $this->xss_clean($this->Stock_location->get_allowed_locations()); + $stock_locations['all'] = $this->lang->line('reports_all'); $data['stock_locations'] = array_reverse($stock_locations, TRUE); $this->load->view("reports/inventory_summary_input", $data); } - function inventory_summary($export_excel=0, $location_id='all', $item_count='all') + public function inventory_summary($location_id = 'all', $item_count = 'all') { $this->load->model('reports/Inventory_summary'); $model = $this->Inventory_summary; + + $report_data = $model->getData(array('location_id' => $location_id, 'item_count' => $item_count)); + $tabular_data = array(); - $report_data = $model->getData(array('location_id'=>$location_id, 'item_count'=>$item_count)); foreach($report_data as $row) { - $tabular_data[] = array($row['name'], - $row['item_number'], - $row['description'], - to_quantity_decimals($row['quantity']), - to_quantity_decimals($row['reorder_level']), - $row['location_name'], - to_currency($row['cost_price']), - to_currency($row['unit_price']), - to_currency($row['sub_total_value'])); + $tabular_data[] = $this->xss_clean(array($row['name'], + $row['item_number'], + $row['description'], + to_quantity_decimals($row['quantity']), + to_quantity_decimals($row['reorder_level']), + $row['location_name'], + to_currency($row['cost_price']), + to_currency($row['unit_price']), + to_currency($row['sub_total_value']) + )); } $data = array( "title" => $this->lang->line('reports_inventory_summary_report'), "subtitle" => '', - "headers" => $model->getDataColumns(), + "headers" => $this->xss_clean($model->getDataColumns()), "data" => $tabular_data, - "summary_data" => $model->getSummaryData($report_data), - "export_excel" => $export_excel + "summary_data" => $this->xss_clean($model->getSummaryData($report_data)) ); $this->load->view("reports/tabular", $data); diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index ee9929497..70689945b 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -1,11 +1,13 @@ -load->library('sale_lib'); $this->load->library('barcode_lib'); } @@ -15,7 +17,7 @@ class Sales extends Secure_area $this->_reload(); } - function manage($only_invoices = FALSE, $only_cash = FALSE, $limit_from = 0) + function manage() { $person_id = $this->session->userdata('person_id'); @@ -25,36 +27,8 @@ class Sales extends Secure_area } else { - $this->Sale->create_sales_items_temp_table(); + $data['table_headers'] = get_sales_manage_table_headers(); - $data['controller_name'] = $this->get_controller_name(); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - - $today_start = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0)); - $today_end = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(23, 59, 59)); - - $start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $today_start; - $start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $start_date); - $end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today_end; - $end_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $end_date); - - $sale_type = 'all'; - $location_id = 'all'; - $is_valid_receipt = FALSE; - $search = null; - - $filters = array('sale_type' => $sale_type, - 'location_id' => $location_id, - 'start_date' => $start_date_formatter->format('Y-m-d H:i:s'), - 'end_date' => $end_date_formatter->format('Y-m-d H:i:s'), - 'only_cash' => $only_cash, - 'only_invoices' => $only_invoices, - 'is_valid_receipt' => $is_valid_receipt); - - $sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array(); - $payments = $this->Sale->get_payments_summary($search, $filters); - $total_rows = $this->Sale->get_found_rows($search, $filters); - // filters that will be loaded in the multiselect dropdown if($this->config->item('invoice_enable') == TRUE) { @@ -65,98 +39,76 @@ class Sales extends Secure_area { $data['filters'] = array('only_cash' => $this->lang->line('sales_cash_filter')); } - $data['selected'] = array( ($only_cash ? 'only_cash' : ''), ($only_invoices ? 'only_invoices' : '') ); - $data['start_date'] = $start_date; - $data['end_date'] = $end_date; - $data['links'] = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, $total_rows, 'manage', $only_invoices); - $data['manage_table'] = get_sales_manage_table($sales, $this); - $data['payments_summary'] = get_sales_manage_payments_summary($payments, $sales, $this); - - $this->load->view($data['controller_name'] . '/manage', $data); + $this->load->view('sales/manage', $data); } } - function get_row() + function get_row($row_id) { $this->Sale->create_sales_items_temp_table(); - $sale_id = $this->input->post('row_id'); - $sale_info = $this->Sale->get_info($sale_id)->result_array(); - $data_row = get_sales_manage_sale_data_row($sale_info[0], $this); + $sale_info = $this->Sale->get_info($row_id)->row(); + $data_row = get_sale_data_row($sale_info, $this); - echo $data_row; + echo json_encode($data_row); } - /* - Returns Sales table data rows. This will be called with AJAX. - */ function search() { $this->Sale->create_sales_items_temp_table(); - $search = $this->input->post('search') != '' ? $this->input->post('search') : null; - $limit_from = $this->input->post('limit_from'); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - - $today = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat')); - - $start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $today; - $start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $start_date); - $end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today; - $end_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $end_date); + $search = $this->input->get('search'); + $limit = $this->input->get('limit'); + $offset = $this->input->get('offset'); + $sort = $this->input->get('sort'); + $order = $this->input->get('order'); $is_valid_receipt = isset($search) ? $this->sale_lib->is_valid_receipt($search) : FALSE; - $sale_type = 'all'; - $location_id = 'all'; - if($this->config->item('invoice_enable') == TRUE) - { - $only_invoices = $this->input->post('only_invoices') != null; - } - else - { - $only_invoices = FALSE; - } - $only_cash = $this->input->post('only_cash') != null; + $filters = array('sale_type' => 'all', + 'location_id' => 'all', + 'start_date' => $this->input->get('start_date'), + 'end_date' => $this->input->get('end_date'), + 'only_cash' => FALSE, + 'only_invoices' => $this->config->item('invoice_enable') && $this->input->get('only_invoices'), + 'is_valid_receipt' => $is_valid_receipt); - $filters = array('sale_type' => $sale_type, - 'location_id' => $location_id, - 'start_date' => $start_date_formatter->format('Y-m-d H:i:s'), - 'end_date' => $end_date_formatter->format('Y-m-d H:i:s'), - 'only_cash' => FALSE, - 'only_invoices' => FALSE, - 'is_valid_receipt' => $is_valid_receipt); - // check if any filter is set in the multiselect dropdown - if( $this->input->post('filters') != null ) - { - foreach($this->input->post('filters') as $key) - { - $filters[$key] = TRUE; - } - } + $filledup = array_fill_keys($this->input->get('filters'), TRUE); + $filters = array_merge($filters, $filledup); - $sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array(); - $payments = $this->Sale->get_payments_summary($search, $filters); + $sales = $this->Sale->search($search, $filters, $limit, $offset, $sort, $order); $total_rows = $this->Sale->get_found_rows($search, $filters); - $links = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, $total_rows, 'search', $only_invoices); - $sale_rows = get_sales_manage_table_data_rows($sales, $this); + $payments = $this->Sale->get_payments_summary($search, $filters); $payment_summary = get_sales_manage_payments_summary($payments, $sales, $this); - echo json_encode(array('total_rows' => $total_rows, 'rows' => $sale_rows, 'pagination' => $links, 'payment_summary' => $payment_summary)); + $data_rows = array(); + foreach($sales->result() as $sale) + { + $data_rows[] = get_sale_data_row($sale, $this); + } + + if ($total_rows > 0) + { + $total_rows++; + $data_rows[] = get_sale_data_last_row($sales, $this); + } + + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows,'payment_summary' => $payment_summary)); } function item_search() { $suggestions = array(); - $search = $this->input->get('term') != '' ? $this->input->get('term') : null; + $receipt = $search = $this->input->get('term') != '' ? $this->input->get('term') : null; - if ($this->sale_lib->get_mode() == 'return' && $this->sale_lib->is_valid_receipt($search) ) + if ($this->sale_lib->get_mode() == 'return' && $this->sale_lib->is_valid_receipt($receipt) ) { - $suggestions[] = $search; + // if a valid receipt or invoice was found the search term will be replaced with a receipt number (POS #) + $suggestions[] = $receipt; } - $suggestions = array_merge($suggestions, $this->Item->get_search_suggestions($search)); + $suggestions = array_merge($suggestions, $this->Item->get_search_suggestions($search, array('search_custom' => FALSE, 'is_deleted' => FALSE), TRUE)); $suggestions = array_merge($suggestions, $this->Item_kit->get_search_suggestions($search)); echo json_encode($suggestions); @@ -183,10 +135,10 @@ class Sales extends Secure_area function change_mode() { - $stock_location = $this->input->post("stock_location"); + $stock_location = $this->input->post('stock_location'); if (!$stock_location || $stock_location == $this->sale_lib->get_sale_location()) { - $mode = $this->input->post("mode"); + $mode = $this->input->post('mode'); $this->sale_lib->set_mode($mode); } else if ($this->Stock_location->is_allowed_location($stock_location, 'sales')) @@ -440,7 +392,7 @@ class Sales extends Secure_area } else { - $this->email->message($this->load->view("sales/receipt_email", $data, true)); + $this->email->message($this->load->view('sales/receipt_email', $data, true)); } $this->email->send(); } @@ -449,11 +401,11 @@ class Sales extends Secure_area $data['print_after_sale'] = $this->sale_lib->is_print_after_sale(); if ($this->sale_lib->is_invoice_number_enabled() && $this->config->item('use_invoice_template')) { - $this->load->view("sales/invoice", $data); + $this->load->view('sales/invoice', $data); } else { - $this->load->view("sales/receipt", $data); + $this->load->view('sales/receipt', $data); } $this->sale_lib->clear_all(); @@ -609,7 +561,7 @@ class Sales extends Secure_area function receipt($sale_id) { $data = $this->_load_sale_data($sale_id); - $this->load->view("sales/receipt", $data); + $this->load->view('sales/receipt', $data); $this->sale_lib->clear_all(); } @@ -620,7 +572,7 @@ class Sales extends Secure_area $sale_info = $this->_load_sale_data($sale_id); } - $this->load->view("sales/invoice", $sale_info); + $this->load->view('sales/invoice', $sale_info); $this->sale_lib->clear_all(); } @@ -663,7 +615,7 @@ class Sales extends Secure_area } } - function save($sale_id) + function save($sale_id = -1) { $newdate = $this->input->post('date'); diff --git a/application/controllers/Secure_Controller.php b/application/controllers/Secure_Controller.php new file mode 100644 index 000000000..9c588e801 --- /dev/null +++ b/application/controllers/Secure_Controller.php @@ -0,0 +1,52 @@ +load->model('Employee'); + $model = $this->Employee; + + if(!$model->is_logged_in()) + { + redirect('login'); + } + + $logged_in_employee_info = $model->get_logged_in_employee_info(); + if(!$model->has_module_grant($module_id, $logged_in_employee_info->person_id) || + (isset($submodule_id) && !$model->has_module_grant($submodule_id, $logged_in_employee_info->person_id))) + { + redirect('no_access/' . $module_id . '/' . $submodule_id); + } + + // load up global data visible to all the loaded views + $data['allowed_modules'] = $this->Module->get_allowed_modules($logged_in_employee_info->person_id); + $data['user_info'] = $logged_in_employee_info; + $data['controller_name'] = $module_id; + + $this->load->vars($data); + } + + /* + * Internal method to do XSS clean in the derived classes + */ + protected function xss_clean($str, $is_image = FALSE) + { + return $this->security->xss_clean($str, $is_image); + } + + // this is the basic set of methods most OSPOS Controllers will implement + public function index() { return FALSE; } + public function search() { return FALSE; } + public function suggest_search() { return FALSE; } + public function view($data_item_id = -1) { return FALSE; } + public function save($data_item_id = -1) { return FALSE; } + public function delete() { return FALSE; } +} +?> \ No newline at end of file diff --git a/application/controllers/Secure_area.php b/application/controllers/Secure_area.php deleted file mode 100644 index 6484655f3..000000000 --- a/application/controllers/Secure_area.php +++ /dev/null @@ -1,65 +0,0 @@ -load->model('Employee'); - if(!$this->Employee->is_logged_in()) - { - redirect('login'); - } - $employee_id=$this->Employee->get_logged_in_employee_info()->person_id; - if(!$this->Employee->has_module_grant($module_id,$employee_id) || - (isset($submodule_id) && !$this->Employee->has_module_grant($submodule_id,$employee_id))) - { - redirect('no_access/'.$module_id.'/'.$submodule_id); - } - - //load up global data - $logged_in_employee_info=$this->Employee->get_logged_in_employee_info(); - $data['allowed_modules']=$this->Module->get_allowed_modules($logged_in_employee_info->person_id); - $data['backup_allowed']=false; - foreach($data['allowed_modules']->result_array() as $module) - { - $data['backup_allowed']|=$module['module_id']==='config'; - } - $data['user_info']=$logged_in_employee_info; - $data['controller_name']=$module_id; - $this->controller_name=$module_id; - $this->load->vars($data); - } - - function get_controller_name() - { - return strtolower($this->controller_name); - } - - function _initialize_pagination($object, $lines_per_page, $limit_from = 0, $total_rows = -1, $function='index', $filter='') - { - $this->load->library('pagination'); - - $config['base_url'] = site_url($this->get_controller_name() . "/$function/" . $filter); - $config['total_rows'] = $total_rows > -1 ? $total_rows : call_user_func(array($object, 'get_total_rows')); - $config['per_page'] = $lines_per_page; - $config['num_links'] = 2; - $config['last_link'] = $this->lang->line('common_last_page'); - $config['first_link'] = $this->lang->line('common_first_page'); - // page is calculated here instead of in pagination lib - $config['cur_page'] = $limit_from > 0 ? $limit_from : 0; - $config['page_query_string'] = FALSE; - $config['uri_segment'] = 0; - - $this->pagination->initialize($config); - - return $this->pagination->create_links(); - } - -} -?> \ No newline at end of file diff --git a/application/controllers/Suppliers.php b/application/controllers/Suppliers.php index 58d3c492d..1acd5c0a7 100644 --- a/application/controllers/Suppliers.php +++ b/application/controllers/Suppliers.php @@ -1,136 +1,145 @@ -get_controller_name(); - $lines_per_page = $this->Appconfig->get('lines_per_page'); - $suppliers = $this->Supplier->get_all($lines_per_page); - - $data['links'] = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from); - $data['manage_table'] = get_supplier_manage_table($suppliers, $this); - $this->load->view('suppliers/manage', $data); + $data['table_headers'] = $this->xss_clean(get_suppliers_manage_table_headers()); + + $this->load->view('people/manage', $data); } /* Returns Supplier table data rows. This will be called with AJAX. */ - function search() + public function search() { - $search = $this->input->post('search') != '' ? $this->input->post('search') : null; - $limit_from = $this->input->post('limit_from'); - $lines_per_page = $this->Appconfig->get('lines_per_page'); + $search = $this->input->get('search'); + $limit = $this->input->get('limit'); + $offset = $this->input->get('offset'); + $sort = $this->input->get('sort'); + $order = $this->input->get('order'); - $suppliers = $this->Supplier->search($search, $lines_per_page, $limit_from); + $suppliers = $this->Supplier->search($search, $limit, $offset, $sort, $order); $total_rows = $this->Supplier->get_found_rows($search); - $links = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from, $total_rows); - $data_rows = get_supplier_manage_table_data_rows($suppliers, $this); - echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links)); + $data_rows = array(); + foreach($suppliers->result() as $supplier) + { + $data_rows[] = get_supplier_data_row($supplier, $this); + } + + $data_rows = $this->xss_clean($data_rows); + + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); } /* Gives search suggestions based on what is being searched for */ - function suggest() + public function suggest() { - $suggestions = $this->Supplier->get_search_suggestions($this->input->get('term'), TRUE); + $suggestions = $this->xss_clean($this->Supplier->get_search_suggestions($this->input->get('term'), TRUE)); + echo json_encode($suggestions); } - function suggest_search() + public function suggest_search() { - $suggestions = $this->Supplier->get_search_suggestions($this->input->post('term'), FALSE); + $suggestions = $this->xss_clean($this->Supplier->get_search_suggestions($this->input->post('term'), FALSE)); + echo json_encode($suggestions); } /* Loads the supplier edit form */ - function view($supplier_id=-1) + public function view($supplier_id = -1) { - $data['person_info']=$this->Supplier->get_info($supplier_id); - $this->load->view("suppliers/form",$data); + $info = $this->Supplier->get_info($supplier_id); + foreach(get_object_vars($info) as $property => $value) + { + $info->$property = $this->xss_clean($value); + } + $data['person_info'] = $info; + + $this->load->view("suppliers/form", $data); } /* Inserts/updates a supplier */ - function save($supplier_id=-1) + public function save($supplier_id = -1) { $person_data = array( - 'first_name'=>$this->input->post('first_name'), - 'last_name'=>$this->input->post('last_name'), - 'gender'=>$this->input->post('gender'), - 'email'=>$this->input->post('email'), - 'phone_number'=>$this->input->post('phone_number'), - 'address_1'=>$this->input->post('address_1'), - 'address_2'=>$this->input->post('address_2'), - 'city'=>$this->input->post('city'), - 'state'=>$this->input->post('state'), - 'zip'=>$this->input->post('zip'), - 'country'=>$this->input->post('country'), - 'comments'=>$this->input->post('comments') + 'first_name' => $this->input->post('first_name'), + 'last_name' => $this->input->post('last_name'), + 'gender' => $this->input->post('gender'), + 'email' => $this->input->post('email'), + 'phone_number' => $this->input->post('phone_number'), + 'address_1' => $this->input->post('address_1'), + 'address_2' => $this->input->post('address_2'), + 'city' => $this->input->post('city'), + 'state' => $this->input->post('state'), + 'zip' => $this->input->post('zip'), + 'country' => $this->input->post('country'), + 'comments' => $this->input->post('comments') ); - $supplier_data=array( - 'company_name'=>$this->input->post('company_name'), - 'agency_name'=>$this->input->post('agency_name'), - 'account_number'=>$this->input->post('account_number') == '' ? null : $this->input->post('account_number') + $supplier_data = array( + 'company_name' => $this->input->post('company_name'), + 'agency_name' => $this->input->post('agency_name'), + 'account_number' => $this->input->post('account_number') == '' ? NULL : $this->input->post('account_number') ); - if($this->Supplier->save_supplier($person_data,$supplier_data,$supplier_id)) + + if($this->Supplier->save_supplier($person_data, $supplier_data, $supplier_id)) { + $supplier_data = $this->xss_clean($supplier_data); + //New supplier - if($supplier_id==-1) + if($supplier_id == -1) { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('suppliers_successful_adding').' '. - $supplier_data['company_name'],'person_id'=>$supplier_data['person_id'])); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('suppliers_successful_adding').' '. + $supplier_data['company_name'], 'id' => $supplier_data['person_id'])); } - else //previous supplier + else //Existing supplier { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('suppliers_successful_updating').' '. - $supplier_data['company_name'],'person_id'=>$supplier_id)); + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('suppliers_successful_updating').' '. + $supplier_data['company_name'], 'id' => $supplier_id)); } } else//failure - { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('suppliers_error_adding_updating').' '. - $supplier_data['company_name'],'person_id'=>-1)); + { + $supplier_data = $this->xss_clean($supplier_data); + + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('suppliers_error_adding_updating').' '. + $supplier_data['company_name'], 'id' => -1)); } } /* This deletes suppliers from the suppliers table */ - function delete() + public function delete() { - $suppliers_to_delete=$this->input->post('ids'); - + $suppliers_to_delete = $this->xss_clean($this->input->post('ids')); + if($this->Supplier->delete_list($suppliers_to_delete)) { - echo json_encode(array('success'=>true,'message'=>$this->lang->line('suppliers_successful_deleted').' '. - count($suppliers_to_delete).' '.$this->lang->line('suppliers_one_or_multiple'))); + echo json_encode(array('success' => TRUE,'message' => $this->lang->line('suppliers_successful_deleted').' '. + count($suppliers_to_delete).' '.$this->lang->line('suppliers_one_or_multiple'))); } else { - echo json_encode(array('success'=>false,'message'=>$this->lang->line('suppliers_cannot_be_deleted'))); + echo json_encode(array('success' => FALSE,'message' => $this->lang->line('suppliers_cannot_be_deleted'))); } } - /* - Gets one row for a supplier manage table. This is called using AJAX to update one row. - */ - function get_row() - { - $person_id = $this->input->post('row_id'); - $data_row=get_supplier_data_row($this->Supplier->get_info($person_id),$this); - echo $data_row; - } } ?> \ No newline at end of file diff --git a/application/controllers/interfaces/Idata_controller.php b/application/controllers/interfaces/Idata_controller.php deleted file mode 100644 index 8721e6ed4..000000000 --- a/application/controllers/interfaces/Idata_controller.php +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/application/controllers/interfaces/Iperson_controller.php b/application/controllers/interfaces/Iperson_controller.php deleted file mode 100644 index 75d9a0df8..000000000 --- a/application/controllers/interfaces/Iperson_controller.php +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index 598b0aadf..15edbc3b8 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -4,7 +4,7 @@ * Currency locale */ -function to_currency($number, $escape=FALSE) +function to_currency($number, $escape = FALSE) { $CI =& get_instance(); @@ -14,26 +14,40 @@ function to_currency($number, $escape=FALSE) $decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.'; $decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0; + // the conversion function needs a non null var, so if the number is null set it to 0 + if(empty($number)) + { + $number = 0; + } + if($number >= 0) { if(!$CI->config->item('currency_side')) + { return $currency_symbol.number_format($number, $decimals, $decimal_point, $thousands_separator); + } else + { return number_format($number, $decimals, $decimal_point, $thousands_separator).$currency_symbol; + } } else { if(!$CI->config->item('currency_side')) + { return '-'.$currency_symbol.number_format(abs($number), $decimals, $decimal_point, $thousands_separator); + } else + { return '-'.number_format(abs($number), $decimals, $decimal_point, $thousands_separator).$currency_symbol; + } } } function to_currency_no_money($number) { // ignore empty strings as they are just for empty input - if( empty($number) ) + if(empty($number)) { return $number; } diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index d865f167a..79b199db0 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -1,48 +1,32 @@ '; - $headers = array(' ', - $CI->lang->line('sales_receipt_number'), - $CI->lang->line('sales_sale_time'), - $CI->lang->line('customers_customer'), - $CI->lang->line('sales_amount_tendered'), - $CI->lang->line('sales_amount_due'), - $CI->lang->line('sales_change_due'), - $CI->lang->line('sales_payment')); - + $headers = array( + array('sale_id' => $CI->lang->line('common_id')), + array('sale_time' => $CI->lang->line('sales_sale_time')), + array('customer_name' => $CI->lang->line('customers_customer')), + array('amount_tendered' => $CI->lang->line('sales_amount_tendered')), + array('amount_due' => $CI->lang->line('sales_amount_due')), + array('change_due' => $CI->lang->line('sales_change_due')), + array('payment_type' => $CI->lang->line('sales_payment_type')) + ); + if($CI->config->item('invoice_enable') == TRUE) { - $headers[] = $CI->lang->line('sales_invoice_number'); - $headers[] = ' '; - $headers[] = ' '; - $headers[] = ' '; - } - else - { - $headers[] = ' '; - $headers[] = ' '; + $headers[] = array('invoice_number' => $CI->lang->line('sales_invoice_number')); + $headers[] = array('invoice' => ' ', 'sortable' => FALSE); } - $table.=''; - foreach($headers as $header) - { - $table.="$header"; - } - $table.=''; - $table.=get_sales_manage_table_data_rows($sales, $controller); - $table.=''; - - return $table; + return transform_headers(array_merge($headers, array(array('receipt' => ' ', 'sortable' => FALSE)))); } /* Gets the html data rows for the sales. */ -function get_sales_manage_table_data_rows($sales, $controller) +function get_sale_data_last_row($sales, $controller) { $CI =& get_instance(); $table_data_rows = ''; @@ -50,59 +34,52 @@ function get_sales_manage_table_data_rows($sales, $controller) $sum_amount_due = 0; $sum_change_due = 0; - foreach($sales as $key=>$sale) + foreach($sales->result() as $key=>$sale) { - $table_data_rows .= get_sales_manage_sale_data_row($sale, $controller); - - $sum_amount_tendered += $sale['amount_tendered']; - $sum_amount_due += $sale['amount_due']; - $sum_change_due += $sale['change_due']; + $sum_amount_tendered += $sale->amount_tendered; + $sum_amount_due += $sale->amount_due; + $sum_change_due += $sale->change_due; } - if($table_data_rows == '') - { - $table_data_rows .= "
".$CI->lang->line('sales_no_sales_to_display')."
"; - } - else - { - $table_data_rows .= " ".$CI->lang->line('sales_total')."  ".to_currency($sum_amount_tendered)."".to_currency($sum_amount_due)."".to_currency($sum_change_due).""; - } - - return $table_data_rows; + return array( + 'sale_id' => '-', + 'sale_time' => ''.$CI->lang->line('sales_total').'', + 'amount_tendered' => ''. to_currency($sum_amount_tendered).'', + 'amount_due' => ''.to_currency($sum_amount_due).'', + 'change_due' => ''.to_currency($sum_change_due).'' + ); } -function get_sales_manage_sale_data_row($sale, $controller) +function get_sale_data_row($sale, $controller) { $CI =& get_instance(); $controller_name = $CI->uri->segment(1); - $table_data_row=''; - $table_data_row.=''; - $table_data_row.=''.'POS ' . $sale['sale_id'] . ''; - $table_data_row.=''.date( $CI->config->item('dateformat') . ' ' . $CI->config->item('timeformat'), strtotime($sale['sale_time']) ).''; - $table_data_row.=''.character_limiter( $sale['customer_name'], 25).''; - $table_data_row.=''.to_currency( $sale['amount_tendered'] ).''; - $table_data_row.=''.to_currency( $sale['amount_due'] ).''; - $table_data_row.=''.to_currency( $sale['change_due'] ).''; - if($CI->config->item('invoice_enable') == TRUE) - { - $table_data_row.=''.$sale['payment_type'].''; - $table_data_row.=''.$sale['invoice_number'].''; - } - else - { - // this size includes the 8% of invoice number and 5% of the invoice glyphicon, plus of course the 12% for the field itself - $table_data_row.=''.$sale['payment_type'].''; - } - $table_data_row.=''.anchor($controller_name."/edit/" . $sale['sale_id'], '', array('class'=>'modal-dlg modal-btn-delete modal-btn-submit print_hide', 'title'=>$CI->lang->line($controller_name.'_update'))).''; - $table_data_row.=''.anchor($controller_name."/receipt/" . $sale['sale_id'], '', array('class'=>'print_hide', 'title'=>$CI->lang->line('sales_show_receipt'))).''; - if($CI->config->item('invoice_enable') == TRUE) - { - $table_data_row.=''.anchor($controller_name."/invoice/" . $sale['sale_id'], '', array('class'=>'print_hide', 'title'=>$CI->lang->line('sales_show_invoice'))).''; - } - $table_data_row.=''; + $row = array ( + 'sale_id' => $sale->sale_id, + 'sale_time' => date( $CI->config->item('dateformat') . ' ' . $CI->config->item('timeformat'), strtotime($sale->sale_time) ), + 'customer_name' => character_limiter( $sale->customer_name, 25), + 'amount_tendered' => to_currency( $sale->amount_tendered ), + 'amount_due' => to_currency($sale->amount_due), + 'change_due' => to_currency($sale->change_due), + 'payment_type' => $sale->payment_type, + 'invoice_number' => $sale->invoice_number, + 'receipt' => anchor($controller_name."/receipt/$sale->sale_id", '', + array('title'=>$CI->lang->line('sales_show_receipt')) + ), + 'edit' => anchor($controller_name."/edit/$sale->sale_id", '', + array('class'=>"modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title'=>$CI->lang->line($controller_name.'_update')) + ) + ); - return $table_data_row; + if ($CI->config->item('invoice_enable')) + { + $row['invoice'] = anchor($controller_name."/invoice/$sale->sale_id", '', + array('title'=>$CI->lang->line('sales_show_invoice')) + ); + } + + return $row; } /* @@ -121,7 +98,7 @@ function get_sales_manage_payments_summary($payments, $sales, $controller) // therefore we remove from the total cash amount any change due if( $payment['payment_type'] == $CI->lang->line('sales_cash') ) { - foreach($sales as $key=>$sale) + foreach($sales->result_array() as $key=>$sale) { $amount -= $sale['change_due']; } @@ -129,241 +106,145 @@ function get_sales_manage_payments_summary($payments, $sales, $controller) $table.='
'.$payment['payment_type'].': '.to_currency( $amount ) . '
'; } $table.=''; - return $table; -} - -/* -Gets the html table to manage people. -*/ -function get_people_manage_table($people,$controller) -{ - $CI =& get_instance(); - $table=''; - - $headers = array('', - $CI->lang->line('common_last_name'), - $CI->lang->line('common_first_name'), - $CI->lang->line('common_email'), - $CI->lang->line('common_phone_number'), - ' '); - if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) - { - $headers[] = ' '; - } - - $table.=''; - foreach($headers as $header) - { - $table.=""; - } - $table.=''; - $table.=get_people_manage_table_data_rows($people,$controller); - $table.='
$header
'; return $table; } -/* -Gets the html data rows for the people. -*/ -function get_people_manage_table_data_rows($people,$controller) +function transform_headers_readonly($array) { - $CI =& get_instance(); - $table_data_rows=''; - - foreach($people->result() as $person) + $result = array(); + foreach($array as $key => $value) { - $table_data_rows.=get_person_data_row($person,$controller); + $result[] = array('field' => $key, 'title' => $value, 'sortable' => $value != '', 'switchable' => !preg_match('(^$| )', $value)); } - - if($people->num_rows()==0) - { - $table_data_rows.="
".$CI->lang->line('common_no_persons_to_display')."
"; - } - - return $table_data_rows; + + return json_encode($result); } -function get_person_data_row($person,$controller) +function transform_headers($array) { - $CI =& get_instance(); - $controller_name=strtolower(get_class($CI)); - - $table_data_row=''; - $table_data_row.=""; - $table_data_row.=''.character_limiter($person->last_name,13).''; - $table_data_row.=''.character_limiter($person->first_name,13).''; - $table_data_row.=''.mailto($person->email,character_limiter($person->email,22)).''; - $table_data_row.=''.character_limiter($person->phone_number,13).''; - if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) + $result = array(); + $array = array_merge(array(array('checkbox' => 'select', 'sortable' => FALSE)), + $array, array(array('edit' => ''))); + foreach($array as $element) { - $table_data_row.=''.anchor("Messages/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''; - $table_data_row.=''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).''; + $result[] = array('field' => key($element), + 'title' => current($element), + 'switchable' => isset($element['switchable']) ? + $element['switchable'] : !preg_match('(^$| )', current($element)), + 'sortable' => isset($element['sortable']) ? + $element['sortable'] : current($element) != '', + 'checkbox' => isset($element['checkbox']) ? + $element['checkbox'] : FALSE, + 'class' => isset($element['checkbox']) || preg_match('(^$| )', current($element)) ? + 'print_hide' : ''); } - else - { - $table_data_row.=''.anchor($controller_name."/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).''; - } - $table_data_row.=''; - - return $table_data_row; + return json_encode($result); } -function get_detailed_data_row($row, $controller) -{ - $table_data_row=''; - $table_data_row.='+'; - foreach($row as $cell) - { - $table_data_row.=''; - $table_data_row.=$cell; - $table_data_row.=''; - } - $table_data_row.=''; - - return $table_data_row; -} - -/* -Gets the html table to manage suppliers. -*/ -function get_supplier_manage_table($suppliers,$controller) +function get_people_manage_table_headers() { $CI =& get_instance(); - $table=''; - - $headers = array('', - $CI->lang->line('suppliers_company_name'), - $CI->lang->line('suppliers_agency_name'), - $CI->lang->line('common_last_name'), - $CI->lang->line('common_first_name'), - $CI->lang->line('common_email'), - $CI->lang->line('common_phone_number'), - $CI->lang->line('suppliers_supplier_id'), - ' '); - if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) - { - $headers[] = ' '; - } - - $table.=''; - foreach($headers as $header) - { - $table.=""; - } - $table.=''; - $table.=get_supplier_manage_table_data_rows($suppliers,$controller); - $table.='
$header
'; - return $table; -} - -/* -Gets the html data rows for the supplier. -*/ -function get_supplier_manage_table_data_rows($suppliers,$controller) -{ - $CI =& get_instance(); - $table_data_rows=''; - - foreach($suppliers->result() as $supplier) - { - $table_data_rows.=get_supplier_data_row($supplier,$controller); - } - - if($suppliers->num_rows()==0) - { - $table_data_rows.="
".$CI->lang->line('common_no_persons_to_display')."
"; - } - - return $table_data_rows; -} - -function get_supplier_data_row($supplier,$controller) -{ - $CI =& get_instance(); - $controller_name=strtolower(get_class($CI)); - - $table_data_row=''; - $table_data_row.=""; - $table_data_row.=''.character_limiter($supplier->company_name,13).''; - $table_data_row.=''.character_limiter($supplier->agency_name,13).''; - $table_data_row.=''.character_limiter($supplier->last_name,13).''; - $table_data_row.=''.character_limiter($supplier->first_name,13).''; - $table_data_row.=''.mailto($supplier->email,character_limiter($supplier->email,22)).''; - $table_data_row.=''.character_limiter($supplier->phone_number,13).''; - $table_data_row.=''.character_limiter($supplier->person_id,5).''; - if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) - { - $table_data_row.=''.anchor("Messages/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).''; - $table_data_row.=''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''; - } - else - { - $table_data_row.=''.anchor($controller_name."/view/$supplier->person_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''; - } - $table_data_row.=''; - - return $table_data_row; -} - -/* -Gets the html table to manage items. -*/ -function get_items_manage_table($items,$controller) -{ - $CI =& get_instance(); - $table=''; - - $headers = array('', - $CI->lang->line('items_item_number'), - $CI->lang->line('items_name'), - $CI->lang->line('items_category'), - $CI->lang->line('suppliers_company_name'), - $CI->lang->line('items_cost_price'), - $CI->lang->line('items_unit_price'), - $CI->lang->line('items_quantity'), - $CI->lang->line('items_tax_percents'), - $CI->lang->line('items_image'), - ' ', - ' ', - ' ' + $headers = array( + array('people.person_id' => $CI->lang->line('common_id')), + array('last_name' => $CI->lang->line('common_last_name')), + array('first_name' => $CI->lang->line('common_first_name')), + array('email' => $CI->lang->line('common_email')), + array('phone_number' => $CI->lang->line('common_phone_number')) ); - - $table.=''; - foreach($headers as $header) - { - $table.=""; - } - $table.=''; - $table.=get_items_manage_table_data_rows($items,$controller); - $table.='
$header
'; - return $table; + if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) + { + $headers[] = array('messages' => '', 'sortable' => FALSE); + } + + return transform_headers($headers); } -/* -Gets the html data rows for the items. -*/ -function get_items_manage_table_data_rows($items,$controller) +function get_person_data_row($person, $controller) { $CI =& get_instance(); - $table_data_rows=''; - - foreach($items->result() as $item) - { - $table_data_rows.=get_item_data_row($item,$controller); - } - - if($items->num_rows()==0) - { - $table_data_rows.="
".$CI->lang->line('items_no_items_to_display')."
"; - } - - return $table_data_rows; + $controller_name=strtolower(get_class($CI)); + + return array ( + 'people.person_id' => $person->person_id, + 'last_name' => character_limiter($person->last_name,13), + 'first_name' => character_limiter($person->first_name,13), + 'email' => empty($person->email) ? '' : mailto($person->email,character_limiter($person->email,22)), + 'phone_number' => character_limiter($person->phone_number,13), + 'messages' => empty($person->phone_number) ? '' : anchor("Messages/view/$person->person_id", '', + array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))), + 'edit' => anchor($controller_name."/view/$person->person_id", '', + array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update')) + )); } -function get_item_data_row($item,$controller) +function get_suppliers_manage_table_headers() +{ + $CI =& get_instance(); + + $headers = array( + array('people.person_id' => $CI->lang->line('common_id')), + array('company_name' => $CI->lang->line('suppliers_company_name')), + array('agency_name' => $CI->lang->line('suppliers_agency_name')), + array('last_name' => $CI->lang->line('common_last_name')), + array('first_name' => $CI->lang->line('common_first_name')), + array('email' => $CI->lang->line('common_email')), + array('phone_number' => $CI->lang->line('common_phone_number')) + ); + + if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id'))) + { + $headers[] = array('messages' => ''); + } + + return transform_headers($headers); +} + +function get_supplier_data_row($supplier, $controller) +{ + $CI =& get_instance(); + $controller_name=strtolower(get_class($CI)); + + return array ( + 'people.person_id' => $supplier->person_id, + 'company_name' => character_limiter($supplier->company_name,13), + 'agency_name' => character_limiter($supplier->agency_name,13), + 'last_name' => character_limiter($supplier->last_name,13), + 'first_name' => character_limiter($supplier->first_name,13), + 'email' => empty($supplier->email) ? '' : mailto($supplier->email,character_limiter($supplier->email,22)), + 'phone_number' => character_limiter($supplier->phone_number,13), + 'messages' => empty($supplier->phone_number) ? '' : anchor("Messages/view/$supplier->person_id", '', + array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))), + 'edit' => anchor($controller_name."/view/$supplier->person_id", '', + array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update')) + )); +} + +function get_items_manage_table_headers() +{ + $CI =& get_instance(); + + $headers = array( + array('items.item_id' => $CI->lang->line('common_id')), + array('item_number' => $CI->lang->line('items_item_number')), + array('name' => $CI->lang->line('items_name')), + array('category' => $CI->lang->line('items_category')), + array('company_name' => $CI->lang->line('suppliers_company_name')), + array('cost_price' => $CI->lang->line('items_cost_price')), + array('unit_price' => $CI->lang->line('items_unit_price')), + array('quantity' => $CI->lang->line('items_quantity')), + array('tax_percents' => $CI->lang->line('items_tax_percents'), 'sortable' => FALSE), + array('item_pic' => $CI->lang->line('items_image'), 'sortable' => FALSE), + array('inventory' => ''), + array('stock' => '') + ); + + return transform_headers($headers); +} + +function get_item_data_row($item, $controller) { $CI =& get_instance(); $item_tax_info=$CI->Item_taxes->get_info($item->item_id); @@ -376,148 +257,82 @@ function get_item_data_row($item,$controller) $tax_percents=substr($tax_percents, 0, -2); $controller_name=strtolower(get_class($CI)); - $item_quantity=''; - - $table_data_row=''; - $table_data_row.=""; - $table_data_row.=''.$item->item_number.''; - $table_data_row.=''.$item->name.''; - $table_data_row.=''.$item->category.''; - $table_data_row.=''.$item->company_name.''; - $table_data_row.=''.to_currency($item->cost_price).''; - $table_data_row.=''.to_currency($item->unit_price).''; - $table_data_row.=''.to_quantity_decimals($item->quantity).''; - $table_data_row.=''.$tax_percents.''; $image = ''; if (!empty($item->pic_id)) { $images = glob("uploads/item_pics/" . $item->pic_id . ".*"); if (sizeof($images) > 0) { - $image.=''; + $image .= ''; } } - $table_data_row.='' . $image . ''; - $table_data_row.=''.anchor($controller_name."/view/$item->item_id", '', array('class'=>"modal-dlg modal-btn-new modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''; - $table_data_row.=''.anchor($controller_name."/inventory/$item->item_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_count'))).'';//inventory count - $table_data_row.=''.anchor($controller_name."/count_details/$item->item_id", '', array('class'=>"modal-dlg",'title'=>$CI->lang->line($controller_name.'_details_count'))).'';//inventory details - $table_data_row.=''; - return $table_data_row; + return array ( + 'items.item_id' => $item->item_id, + 'item_number' => $item->item_number, + 'name' => character_limiter($item->name,13), + 'category' => character_limiter($item->category,13), + 'company_name' => character_limiter($item->company_name,20), + 'cost_price' => to_currency($item->cost_price), + 'unit_price' => to_currency($item->unit_price), + 'quantity' => to_quantity_decimals($item->quantity), + 'tax_percents' => !$tax_percents ? '-' : $tax_percents, + 'item_pic' => $image, + 'inventory' => anchor($controller_name."/inventory/$item->item_id", '', + array('class' => "modal-dlg modal-btn-submit", 'title' => $CI->lang->line($controller_name.'_count')) + ), + 'stock' => anchor($controller_name."/count_details/$item->item_id", '', + array('class' => "modal-dlg", 'title' => $CI->lang->line($controller_name.'_details_count')) + ), + 'edit' => anchor($controller_name."/view/$item->item_id", '', + array('class' => "modal-dlg modal-btn-submit", 'title' => $CI->lang->line($controller_name.'_update')) + )); } -/* -Gets the html table to manage giftcards. -*/ -function get_giftcards_manage_table( $giftcards, $controller ) +function get_giftcards_manage_table_headers() { $CI =& get_instance(); - $table=''; - - $headers = array('', - $CI->lang->line('common_last_name'), - $CI->lang->line('common_first_name'), - $CI->lang->line('giftcards_giftcard_number'), - $CI->lang->line('giftcards_card_value'), - ' '); - - $table.=''; - foreach($headers as $header) - { - $table.=""; - } - $table.=''; - $table.=get_giftcards_manage_table_data_rows( $giftcards, $controller ); - $table.='
$header
'; - return $table; + $headers = array( + array('giftcard_id' => $CI->lang->line('common_id')), + array('last_name' => $CI->lang->line('common_last_name')), + array('first_name' => $CI->lang->line('common_first_name')), + array('giftcard_number' => $CI->lang->line('giftcards_giftcard_number')), + array('value' => $CI->lang->line('giftcards_card_value')) + ); + + return transform_headers($headers); } -/* -Gets the html data rows for the giftcard. -*/ -function get_giftcards_manage_table_data_rows( $giftcards, $controller ) -{ - $CI =& get_instance(); - $table_data_rows=''; - - foreach($giftcards->result() as $giftcard) - { - $table_data_rows.=get_giftcard_data_row( $giftcard, $controller ); - } - - if($giftcards->num_rows()==0) - { - $table_data_rows.="
".$CI->lang->line('giftcards_no_giftcards_to_display')."
"; - } - - return $table_data_rows; -} - -function get_giftcard_data_row($giftcard,$controller) +function get_giftcard_data_row($giftcard, $controller) { $CI =& get_instance(); $controller_name=strtolower(get_class($CI)); - $table_data_row=''; - $table_data_row.=""; - $table_data_row.=''.$giftcard->last_name.''; - $table_data_row.=''.$giftcard->first_name.''; - $table_data_row.=''.$giftcard->giftcard_number.''; - $table_data_row.=''.to_currency($giftcard->value).''; - $table_data_row.=''.anchor($controller_name."/view/$giftcard->giftcard_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''; - $table_data_row.=''; - - return $table_data_row; + return array ( + 'giftcard_id' => $giftcard->giftcard_id, + 'last_name' => character_limiter($giftcard->last_name,13), + 'first_name' => character_limiter($giftcard->first_name,13), + 'giftcard_number' => $giftcard->giftcard_number, + 'value' => to_currency($giftcard->value), + 'edit' => anchor($controller_name."/view/$giftcard->giftcard_id", '', + array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update')) + )); } -/* -Gets the html table to manage item kits. -*/ -function get_item_kits_manage_table( $item_kits, $controller ) +function get_item_kits_manage_table_headers() { $CI =& get_instance(); - $table=''; - - $headers = array('', - $CI->lang->line('item_kits_kit'), - $CI->lang->line('item_kits_name'), - $CI->lang->line('item_kits_description'), - $CI->lang->line('items_cost_price'), - $CI->lang->line('items_unit_price'), - ' '); - - $table.=''; - foreach($headers as $header) - { - $table.=""; - } - $table.=''; - $table.=get_item_kits_manage_table_data_rows( $item_kits, $controller ); - $table.='
$header
'; - return $table; -} + $headers = array( + array('item_kit_id' => $CI->lang->line('item_kits_kit')), + array('name' => $CI->lang->line('item_kits_name')), + array('description' => $CI->lang->line('item_kits_description')), + array('cost_price' => $CI->lang->line('items_cost_price'), 'sortable' => FALSE), + array('unit_price' => $CI->lang->line('items_unit_price'), 'sortable' => FALSE) + ); -/* -Gets the html data rows for the item kits. -*/ -function get_item_kits_manage_table_data_rows($item_kits, $controller) -{ - $CI =& get_instance(); - $table_data_rows=''; - - foreach($item_kits->result() as $item_kit) - { - $table_data_rows .= get_item_kit_data_row($item_kit, $controller); - } - - if($item_kits->num_rows()==0) - { - $table_data_rows .= "
".$CI->lang->line('item_kits_no_item_kits_to_display')."
"; - } - - return $table_data_rows; + return transform_headers($headers); } function get_item_kit_data_row($item_kit, $controller) @@ -525,17 +340,15 @@ function get_item_kit_data_row($item_kit, $controller) $CI =& get_instance(); $controller_name=strtolower(get_class($CI)); - $table_data_row=''; - $table_data_row.=""; - $table_data_row.=''.'KIT '.$item_kit->item_kit_id.''; - $table_data_row.=''.$item_kit->name.''; - $table_data_row.=''.character_limiter($item_kit->description, 25).''; - $table_data_row.=''.to_currency($item_kit->total_cost_price).''; - $table_data_row.=''.to_currency($item_kit->total_unit_price).''; - $table_data_row.=''.anchor($controller_name."/view/$item_kit->item_kit_id", '', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).''; - $table_data_row.=''; - - return $table_data_row; + return array ( + 'item_kit_id' => $item_kit->item_kit_id, + 'name' => character_limiter($item_kit->name), + 'description' => character_limiter($item_kit->description,13), + 'cost_price' => to_currency($item_kit->total_cost_price), + 'unit_price' => to_currency($item_kit->total_unit_price), + 'edit' => anchor($controller_name."/view/$item_kit->item_kit_id", '', + array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update')) + )); } ?> diff --git a/application/hooks/load_config.php b/application/hooks/load_config.php index d5eff79ce..e61b520bb 100644 --- a/application/hooks/load_config.php +++ b/application/hooks/load_config.php @@ -3,43 +3,44 @@ function load_config() { $CI =& get_instance(); - foreach( $CI->Appconfig->get_all()->result() as $app_config ) - { - $CI->config->set_item( $app_config->key, $app_config->value ); + + foreach($CI->Appconfig->get_all()->result() as $app_config) + { + $CI->config->set_item($CI->security->xss_clean($app_config->key), $CI->security->xss_clean($app_config->value)); } //Set language from config database + $language = $CI->config->item('language'); + //Loads all the language files from the language directory - - if ( $CI->config->item( 'language' ) ) + if(!empty($language)) { - $CI->config->set_item( 'language', $CI->config->item( 'language' ) ); - // fallback to english if language folder does not exist - $language = $CI->config->item( 'language' ); - if (!file_exists('./application/language/' . $language)) + // fallback to English if language folder does not exist + if(!file_exists('./application/language/' . $language)) { $language = 'en'; } + $CI->config->set_item('language', $language); + $map = directory_map('./application/language/' . $language); foreach($map as $file) { - if ( !is_array($file) && substr(strrchr($file,'.'), 1) == "php") + if(!is_array($file) && substr(strrchr($file,'.'), 1) == "php") { - $CI->lang->load( str_replace( '_lang.php', '', $file ), $language); + $CI->lang->load(str_replace('_lang.php', '', $file), $language); } } - } //Set timezone from config database - if ( $CI->config->item( 'timezone' ) ) + if($CI->config->item('timezone')) { - date_default_timezone_set( $CI->config->item( 'timezone' ) ); + date_default_timezone_set($CI->config->item('timezone')); } else { - date_default_timezone_set( 'America/New_York' ); + date_default_timezone_set('America/New_York'); } } ?> \ No newline at end of file diff --git a/application/language/de-CH/bootstrap_tables_lang.php b/application/language/de-CH/bootstrap_tables_lang.php new file mode 100644 index 000000000..37b2862eb --- /dev/null +++ b/application/language/de-CH/bootstrap_tables_lang.php @@ -0,0 +1,10 @@ +set_invoice_number_enabled(FALSE); $this->clear_mode(); $this->empty_cart(); $this->delete_supplier(); diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index b3dd0aeb4..c6d03e391 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -1,5 +1,4 @@ CI->session->userdata('cart')) + { $this->set_cart(array()); + } return $this->CI->session->userdata('cart'); } @@ -26,7 +27,9 @@ class Sale_lib function get_payments() { if(!$this->CI->session->userdata('payments')) + { $this->set_payments(array()); + } return $this->CI->session->userdata('payments'); } @@ -34,13 +37,14 @@ class Sale_lib // Multiple Payments function set_payments($payments_data) { - $this->CI->session->set_userdata('payments',$payments_data); + $this->CI->session->set_userdata('payments', $payments_data); } function get_comment() { - // avoid returning a null that results in a 0 in the comment if nothing is set/available + // avoid returning a NULL that results in a 0 in the comment if nothing is set/available $comment = $this->CI->session->userdata('comment'); + return empty($comment) ? '' : $comment; } @@ -62,7 +66,7 @@ class Sale_lib function set_invoice_number($invoice_number, $keep_custom = FALSE) { $current_invoice_number = $this->CI->session->userdata('sales_invoice_number'); - if (!$keep_custom || empty($current_invoice_number)) + if(!$keep_custom || empty($current_invoice_number)) { $this->CI->session->set_userdata('sales_invoice_number', $invoice_number); } @@ -113,7 +117,7 @@ class Sale_lib function add_payment($payment_id, $payment_amount) { $payments = $this->get_payments(); - if( isset( $payments[$payment_id] ) ) + if(isset($payments[$payment_id])) { //payment_method already exists, add to payment_amount $payments[$payment_id]['payment_amount'] = bcadd($payments[$payment_id]['payment_amount'], $payment_amount, PRECISION); @@ -121,19 +125,14 @@ class Sale_lib else { //add to existing array - $payment = array( $payment_id=> - array( - 'payment_type' => $payment_id, - 'payment_amount' => $payment_amount - ) - ); + $payment = array($payment_id=>array('payment_type' => $payment_id, 'payment_amount' => $payment_amount)); $payments += $payment; } $this->set_payments($payments); - return true; + return TRUE; } // Multiple Payments @@ -147,15 +146,15 @@ class Sale_lib $this->set_payments($payments); } - return false; + return FALSE; } // Multiple Payments function delete_payment($payment_id) { $payments = $this->get_payments(); - unset( $payments[urldecode( $payment_id )] ); - $this->set_payments( $payments ); + unset($payments[urldecode($payment_id)]); + $this->set_payments($payments); } // Multiple Payments @@ -188,20 +187,24 @@ class Sale_lib function get_customer() { if(!$this->CI->session->userdata('customer')) + { $this->set_customer(-1); + } return $this->CI->session->userdata('customer'); } function set_customer($customer_id) { - $this->CI->session->set_userdata('customer',$customer_id); + $this->CI->session->set_userdata('customer', $customer_id); } function get_mode() { if(!$this->CI->session->userdata('sale_mode')) + { $this->set_mode('sale'); + } return $this->CI->session->userdata('sale_mode'); } @@ -215,8 +218,8 @@ class Sale_lib { if(!$this->CI->session->userdata('sale_location')) { - $location_id = $this->CI->Stock_location->get_default_location_id(); - $this->set_sale_location($location_id); + $location_id = $this->CI->Stock_location->get_default_location_id(); + $this->set_sale_location($location_id); } return $this->CI->session->userdata('sale_location'); @@ -247,12 +250,12 @@ class Sale_lib $this->CI->session->unset_userdata('giftcard_remainder'); } - function add_item($item_id, $quantity=1, $item_location, $discount=0, $price=null, $description=null, $serialnumber=null) + function add_item($item_id, $quantity=1, $item_location, $discount=0, $price=NULL, $description=NULL, $serialnumber=NULL) { //make sure item exists - if($this->validate_item($item_id) == false) + if($this->validate_item($item_id) == FALSE) { - return false; + return FALSE; } // Serialization and Description @@ -265,12 +268,12 @@ class Sale_lib //We also need to get the next key that we are going to use in case we need to add the //item to the cart. Since items can be deleted, we can't use a count. we use the highest key + 1. - $maxkey=0; //Highest key so far - $itemalreadyinsale=FALSE; //We did not find the item yet. - $insertkey=0; //Key to use for new entry. - $updatekey=0; //Key to use to update(quantity) - $item_info=$this->CI->Item->get_info($item_id,$item_location); - foreach ($items as $item) + $maxkey = 0; //Highest key so far + $itemalreadyinsale = FALSE; //We did not find the item yet. + $insertkey = 0; //Key to use for new entry. + $updatekey = 0; //Key to use to update(quantity) + $item_info = $this->CI->Item->get_info($item_id,$item_location); + foreach($items as $item) { //We primed the loop so maxkey is 0 the first time. //Also, we have stored the key in the element itself so we can compare. @@ -280,22 +283,22 @@ class Sale_lib $maxkey = $item['line']; } - if($item['item_id']==$item_id && $item['item_location']==$item_location) + if($item['item_id'] == $item_id && $item['item_location']==$item_location) { - $itemalreadyinsale=TRUE; + $itemalreadyinsale = TRUE; $updatekey = $item['line']; - if (!$item_info->is_serialized) + if(!$item_info->is_serialized) { $quantity += $items[$updatekey]['quantity']; } } } - $insertkey=$maxkey+1; + $insertkey = $maxkey+1; //array/cart records are identified by $insertkey and item_id is just another field. - $price=$price!=null?$price:$item_info->unit_price; - $total=$this->get_item_total($quantity, $price, $discount); - $discounted_total=$this->get_item_total($quantity, $price, $discount, TRUE); + $price = $price != NULL ? $price : $item_info->unit_price; + $total = $this->get_item_total($quantity, $price, $discount); + $discounted_total = $this->get_item_total($quantity, $price, $discount, TRUE); //Item already exists and is not serialized, add to quantity if(!$itemalreadyinsale || $item_info->is_serialized) { @@ -307,8 +310,8 @@ class Sale_lib 'line'=>$insertkey, 'name'=>$item_info->name, 'item_number'=>$item_info->item_number, - 'description'=>$description!=null ? $description: $item_info->description, - 'serialnumber'=>$serialnumber!=null ? $serialnumber: '', + 'description'=>$description!=NULL ? $description: $item_info->description, + 'serialnumber'=>$serialnumber!=NULL ? $serialnumber: '', 'allow_alt_description'=>$item_info->allow_alt_description, 'is_serialized'=>$item_info->is_serialized, 'quantity'=>$quantity, @@ -320,7 +323,7 @@ class Sale_lib ) ); //add to existing array - $items+=$item; + $items += $item; } else { @@ -332,15 +335,15 @@ class Sale_lib $this->set_cart($items); - return true; + return TRUE; } function out_of_stock($item_id, $item_location) { //make sure item exists - if($this->validate_item($item_id) == false) + if($this->validate_item($item_id) == FALSE) { - return false; + return FALSE; } $item_info = $this->CI->Item->get_info($item_id); @@ -348,25 +351,25 @@ class Sale_lib $item_quantity = $this->CI->Item_quantity->get_item_quantity($item_id,$item_location)->quantity; $quantity_added = $this->get_quantity_already_added($item_id,$item_location); - if ($item_quantity - $quantity_added < 0) + if($item_quantity - $quantity_added < 0) { return $this->CI->lang->line('sales_quantity_less_than_zero'); } - else if ($item_quantity - $quantity_added < $item_info->reorder_level) + else if($item_quantity - $quantity_added < $item_info->reorder_level) { return $this->CI->lang->line('sales_quantity_less_than_reorder_level'); } - return false; + return FALSE; } function get_quantity_already_added($item_id, $item_location) { $items = $this->get_cart(); $quanity_already_added = 0; - foreach ($items as $item) + foreach($items as $item) { - if($item['item_id']==$item_id && $item['item_location']==$item_location) + if($item['item_id'] == $item_id && $item['item_location'] == $item_location) { $quanity_already_added+=$item['quantity']; } @@ -379,9 +382,9 @@ class Sale_lib { $items = $this->get_cart(); - foreach ($items as $line=>$item) + foreach($items as $line=>$item) { - if($line==$line_to_get) + if($line == $line_to_get) { return $item['item_id']; } @@ -406,48 +409,49 @@ class Sale_lib $this->set_cart($items); } - return false; + return FALSE; } function is_valid_receipt(&$receipt_sale_id) { //POS # - $pieces = explode(' ',$receipt_sale_id); + $pieces = explode(' ', $receipt_sale_id); - if(count($pieces)==2 && strtolower($pieces[0]) == 'pos') + if(count($pieces) == 2 && strtolower($pieces[0]) == 'pos') { return $this->CI->Sale->exists($pieces[1]); } - else + else if($this->CI->config->item('invoice_enable') == TRUE) { $sale_info = $this->CI->Sale->get_sale_by_invoice_number($receipt_sale_id); - if ($sale_info->num_rows() > 0) + if($sale_info->num_rows() > 0) { $receipt_sale_id = 'POS ' . $sale_info->row()->sale_id; - return true; + + return TRUE; } } - return false; + return FALSE; } function is_valid_item_kit($item_kit_id) { //KIT # - $pieces = explode(' ',$item_kit_id); + $pieces = explode(' ', $item_kit_id); - if(count($pieces)==2) + if(count($pieces) == 2) { return $this->CI->Item_kit->exists($pieces[1]); } - return false; + return FALSE; } function return_entire_sale($receipt_sale_id) { //POS # - $pieces = explode(' ',$receipt_sale_id); + $pieces = explode(' ', $receipt_sale_id); $sale_id = $pieces[1]; $this->empty_cart(); @@ -455,7 +459,7 @@ class Sale_lib foreach($this->CI->Sale->get_sale_items($sale_id)->result() as $row) { - $this->add_item($row->item_id,-$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber); + $this->add_item($row->item_id, -$row->quantity_purchased, $row->item_location, $row->discount_percent, $row->item_unit_price, $row->description, $row->serialnumber); } $this->set_customer($this->CI->Sale->get_customer($sale_id)->person_id); } @@ -463,12 +467,12 @@ class Sale_lib function add_item_kit($external_item_kit_id,$item_location) { //KIT # - $pieces = explode(' ',$external_item_kit_id); + $pieces = explode(' ', $external_item_kit_id); $item_kit_id = $pieces[1]; - foreach ($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item) + foreach($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item) { - $this->add_item($item_kit_item['item_id'],$item_kit_item['quantity'],$item_location); + $this->add_item($item_kit_item['item_id'], $item_kit_item['quantity'], $item_location); } } @@ -479,11 +483,11 @@ class Sale_lib foreach($this->CI->Sale->get_sale_items($sale_id)->result() as $row) { - $this->add_item($row->item_id,$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber); + $this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount_percent, $row->item_unit_price, $row->description, $row->serialnumber); } foreach($this->CI->Sale->get_sale_payments($sale_id)->result() as $row) { - $this->add_payment($row->payment_type,$row->payment_amount); + $this->add_payment($row->payment_type, $row->payment_amount); } $this->set_customer($this->CI->Sale->get_customer($sale_id)->person_id); } @@ -495,13 +499,13 @@ class Sale_lib foreach($this->CI->Sale_suspended->get_sale_items($sale_id)->result() as $row) { - $this->add_item($row->item_id,$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber); + $this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount_percent, $row->item_unit_price, $row->description, $row->serialnumber); } foreach($this->CI->Sale_suspended->get_sale_payments($sale_id)->result() as $row) { $this->add_payment($row->payment_type,$row->payment_amount); } - $suspended_sale_info=$this->CI->Sale_suspended->get_info($sale_id)->row(); + $suspended_sale_info = $this->CI->Sale_suspended->get_info($sale_id)->row(); $this->set_customer($suspended_sale_info->person_id); $this->set_comment($suspended_sale_info->comment); $this->set_invoice_number($suspended_sale_info->invoice_number); @@ -531,6 +535,7 @@ class Sale_lib function clear_all() { + $this->set_invoice_number_enabled(FALSE); $this->clear_mode(); $this->empty_cart(); $this->clear_comment(); @@ -552,28 +557,27 @@ class Sale_lib function get_taxes() { - //Do not charge sales tax if we have a customer that is not taxable - if (!$this->is_customer_taxable()) - { - return array(); - } - $taxes = array(); - foreach($this->get_cart() as $line=>$item) + + //Do not charge sales tax if we have a customer that is not taxable + if($this->is_customer_taxable()) { - $tax_info = $this->CI->Item_taxes->get_info($item['item_id']); - - foreach($tax_info as $tax) + foreach($this->get_cart() as $line=>$item) { - $name = to_tax_decimals($tax['percent']) . '% ' . $tax['name']; - $tax_amount = $this->get_item_tax($item['quantity'], $item['price'], $item['discount'], $tax['percent']); + $tax_info = $this->CI->Item_taxes->get_info($item['item_id']); - if (!isset($taxes[$name])) + foreach($tax_info as $tax) { - $taxes[$name] = 0; - } + $name = to_tax_decimals($tax['percent']) . '% ' . $tax['name']; + $tax_amount = $this->get_item_tax($item['quantity'], $item['price'], $item['discount'], $tax['percent']); - $taxes[$name] = bcadd($taxes[$name], $tax_amount, PRECISION); + if(!isset($taxes[$name])) + { + $taxes[$name] = 0; + } + + $taxes[$name] = bcadd($taxes[$name], $tax_amount, PRECISION); + } } } @@ -640,11 +644,12 @@ class Sale_lib { $price = $this->get_item_total($quantity, $price, $discount_percentage, TRUE); - if ($this->CI->config->config['tax_included']) + if($this->CI->config->config['tax_included']) { $tax_fraction = bcadd(100, $tax_percentage, PRECISION); $tax_fraction = bcdiv($tax_fraction, 100, PRECISION); $price_tax_excl = bcdiv($price, $tax_fraction, PRECISION); + return bcsub($price, $price_tax_excl, PRECISION); } $tax_fraction = bcdiv($tax_percentage, 100, PRECISION); @@ -694,10 +699,12 @@ class Sale_lib $item_id = $this->CI->Item->get_item_id($item_id); if(!$item_id) - return false; + { + return FALSE; + } } - return true; + return TRUE; } } ?> diff --git a/application/libraries/Sms.php b/application/libraries/Sms.php index 91030e596..aa43dc144 100644 --- a/application/libraries/Sms.php +++ b/application/libraries/Sms.php @@ -19,11 +19,14 @@ class Sms { $response = TRUE; + // make sure passed string is url encoded + $message = rawurlencode($message); + // add call to send a message via 3rd party API here // Some examples /* - $url = "https://xxx.xxx.xxx.xxx/send_sms?username=$username&password=$password&src=$originator&dst=$phone&msg=$message&dr=1"; + $url = "http://xxx.xxx.xxx.xxx/send_sms?username=$username&password=$password&src=$originator&dst=$phone&msg=$message&dr=1"; $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); diff --git a/application/libraries/ofc-library/Dot_base.php b/application/libraries/ofc-library/Dot_base.php deleted file mode 100644 index 843db7dc8..000000000 --- a/application/libraries/ofc-library/Dot_base.php +++ /dev/null @@ -1,231 +0,0 @@ -type = $type; - if( isset( $value ) ) - $this->value( $value ); - } - - /** - * For line charts that only require a Y position - * for each point. - * @param $value as integer, the Y position - */ - function value( $value ) - { - $this->value = $value; - } - - /** - * For scatter charts that require an X and Y position for - * each point. - * - * @param $x as integer - * @param $y as integer - */ - function position( $x, $y ) - { - $this->x = $x; - $this->y = $y; - } - - /** - * @param $colour is a string, HEX colour, e.g. '#FF0000' red - */ - function colour($colour) - { - $this->colour = $colour; - return $this; - } - - /** - * The tooltip for this dot. - */ - function tooltip( $tip ) - { - $this->tip = $tip; - return $this; - } - - /** - * @param $size is an integer. Size of the dot. - */ - function size($size) - { - $tmp = 'dot-size'; - $this->$tmp = $size; - return $this; - } - - /** - * a private method - */ - function type( $type ) - { - $this->type = $type; - return $this; - } - - /** - * @param $size is an integer. The size of the hollow 'halo' around the dot that masks the line. - */ - function halo_size( $size ) - { - $tmp = 'halo-size'; - $this->$tmp = $size; - return $this; - } - - /** - * @param $do as string. One of three options (examples): - * - "http://example.com" - browse to this URL - * - "https://example.com" - browse to this URL - * - "trace:message" - print this message in the FlashDevelop debug pane - * - all other strings will be called as Javascript functions, so a string "hello_world" - * will call the JS function "hello_world(index)". It passes in the index of the - * point. - */ - function on_click( $do ) - { - $tmp = 'on-click'; - $this->$tmp = $do; - } -} - -/** - * Draw a hollow dot - */ -class hollow_dot extends dot_base -{ - function hollow_dot($value=null) - { - parent::dot_base( 'hollow-dot', $value ); - } -} - -/** - * Draw a star - */ -class star extends dot_base -{ - /** - * The constructor, takes an optional $value - */ - function star($value=null) - { - parent::dot_base( 'star', $value ); - } - - /** - * @param $angle is an integer. - */ - function rotation($angle) - { - $this->rotation = $angle; - return $this; - } - - /** - * @param $is_hollow is a boolean. - */ - function hollow($is_hollow) - { - $this->hollow = $is_hollow; - } -} - -/** - * Draw a 'bow tie' shape. - */ -class bow extends dot_base -{ - /** - * The constructor, takes an optional $value - */ - function bow($value=null) - { - parent::dot_base( 'bow', $value ); - } - - /** - * Rotate the anchor object. - * @param $angle is an integer. - */ - function rotation($angle) - { - $this->rotation = $angle; - return $this; - } -} - -/** - * An n sided shape. - */ -class anchor extends dot_base -{ - /** - * The constructor, takes an optional $value - */ - function anchor($value=null) - { - parent::dot_base( 'anchor', $value ); - } - - /** - * Rotate the anchor object. - * @param $angle is an integer. - */ - function rotation($angle) - { - $this->rotation = $angle; - return $this; - } - - /** - * @param $sides is an integer. Number of sides this shape has. - */ - function sides($sides) - { - $this->sides = $sides; - return $this; - } -} - -/** - * A simple dot - */ -class dot extends dot_base -{ - /** - * The constructor, takes an optional $value - */ - function dot($value=null) - { - parent::dot_base( 'dot', $value ); - } -} - -/** - * A simple dot - */ -class solid_dot extends dot_base -{ - /** - * The constructor, takes an optional $value - */ - function solid_dot($value=null) - { - parent::dot_base( 'solid-dot', $value ); - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/JSON.php b/application/libraries/ofc-library/JSON.php deleted file mode 100644 index 7260001a2..000000000 --- a/application/libraries/ofc-library/JSON.php +++ /dev/null @@ -1,806 +0,0 @@ - - * @author Matt Knapp - * @author Brett Stimmerman - * @copyright 2005 Michal Migurski - * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $ - * @license http://www.opensource.org/licenses/bsd-license.php - * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 - */ - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_SLICE', 1); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_STR', 2); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_ARR', 3); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_OBJ', 4); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_CMT', 5); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_LOOSE_TYPE', 16); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_SUPPRESS_ERRORS', 32); - -/** - * Converts to and from JSON format. - * - * Brief example of use: - * - * - * // create a new instance of Services_JSON - * $json = new Services_JSON(); - * - * // convert a complexe value to JSON notation, and send it to the browser - * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); - * $output = $json->encode($value); - * - * print($output); - * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] - * - * // accept incoming POST data, assumed to be in JSON notation - * $input = file_get_contents('php://input', 1000000); - * $value = $json->decode($input); - * - */ -class Services_JSON -{ - /** - * constructs a new JSON instance - * - * @param int $use object behavior flags; combine with boolean-OR - * - * possible values: - * - SERVICES_JSON_LOOSE_TYPE: loose typing. - * "{...}" syntax creates associative arrays - * instead of objects in decode(). - * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression. - * Values which can't be encoded (e.g. resources) - * appear as NULL instead of throwing errors. - * By default, a deeply-nested resource will - * bubble up with an error, so all return values - * from encode() should be checked with isError() - */ - function Services_JSON($use = 0) - { - $this->use = $use; - } - - /** - * convert a string from one UTF-16 char to one UTF-8 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf16 UTF-16 character - * @return string UTF-8 character - * @access private - */ - function utf162utf8($utf16) - { - // oh please oh please oh please oh please oh please - if(function_exists('mb_convert_encoding')) { - return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); - } - - $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); - - switch(true) { - case ((0x7F & $bytes) == $bytes): - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x7F & $bytes); - - case (0x07FF & $bytes) == $bytes: - // return a 2-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xC0 | (($bytes >> 6) & 0x1F)) - . chr(0x80 | ($bytes & 0x3F)); - - case (0xFFFF & $bytes) == $bytes: - // return a 3-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xE0 | (($bytes >> 12) & 0x0F)) - . chr(0x80 | (($bytes >> 6) & 0x3F)) - . chr(0x80 | ($bytes & 0x3F)); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * convert a string from one UTF-8 char to one UTF-16 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf8 UTF-8 character - * @return string UTF-16 character - * @access private - */ - function utf82utf16($utf8) - { - // oh please oh please oh please oh please oh please - if(function_exists('mb_convert_encoding')) { - return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); - } - - switch(strlen($utf8)) { - case 1: - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return $utf8; - - case 2: - // return a UTF-16 character from a 2-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x07 & (ord($utf8{0}) >> 2)) - . chr((0xC0 & (ord($utf8{0}) << 6)) - | (0x3F & ord($utf8{1}))); - - case 3: - // return a UTF-16 character from a 3-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr((0xF0 & (ord($utf8{0}) << 4)) - | (0x0F & (ord($utf8{1}) >> 2))) - . chr((0xC0 & (ord($utf8{1}) << 6)) - | (0x7F & ord($utf8{2}))); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * encodes an arbitrary variable into JSON format - * - * @param mixed $var any number, boolean, string, array, or object to be encoded. - * see argument 1 to Services_JSON() above for array-parsing behavior. - * if var is a strng, note that encode() always expects it - * to be in ASCII or UTF-8 format! - * - * @return mixed JSON string representation of input var or an error if a problem occurs - * @access public - */ - function encode($var) - { - switch (gettype($var)) { - case 'boolean': - return $var ? 'true' : 'false'; - - case 'NULL': - return 'null'; - - case 'integer': - return (int) $var; - - case 'double': - case 'float': - return (float) $var; - - case 'string': - // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT - $ascii = ''; - $strlen_var = strlen($var); - - /* - * Iterate over every character in the string, - * escaping with a slash or encoding to UTF-8 where necessary - */ - for ($c = 0; $c < $strlen_var; ++$c) { - - $ord_var_c = ord($var{$c}); - - switch (true) { - case $ord_var_c == 0x08: - $ascii .= '\b'; - break; - case $ord_var_c == 0x09: - $ascii .= '\t'; - break; - case $ord_var_c == 0x0A: - $ascii .= '\n'; - break; - case $ord_var_c == 0x0C: - $ascii .= '\f'; - break; - case $ord_var_c == 0x0D: - $ascii .= '\r'; - break; - - case $ord_var_c == 0x22: - case $ord_var_c == 0x2F: - case $ord_var_c == 0x5C: - // double quote, slash, slosh - $ascii .= '\\'.$var{$c}; - break; - - case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): - // characters U-00000000 - U-0000007F (same as ASCII) - $ascii .= $var{$c}; - break; - - case (($ord_var_c & 0xE0) == 0xC0): - // characters U-00000080 - U-000007FF, mask 110XXXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, ord($var{$c + 1})); - $c += 1; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF0) == 0xE0): - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2})); - $c += 2; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF8) == 0xF0): - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3})); - $c += 3; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFC) == 0xF8): - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4})); - $c += 4; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFE) == 0xFC): - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4}), - ord($var{$c + 5})); - $c += 5; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - } - } - - return '"'.$ascii.'"'; - - case 'array': - /* - * As per JSON spec if any array key is not an integer - * we must treat the the whole array as an object. We - * also try to catch a sparsely populated associative - * array with numeric keys here because some JS engines - * will create an array with empty indexes up to - * max_index which can cause memory issues and because - * the keys, which may be relevant, will be remapped - * otherwise. - * - * As per the ECMA and JSON specification an object may - * have any string as a property. Unfortunately due to - * a hole in the ECMA specification if the key is a - * ECMA reserved word or starts with a digit the - * parameter is only accessible using ECMAScript's - * bracket notation. - */ - - // treat as a JSON object - if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { - $properties = array_map(array($this, 'name_value'), - array_keys($var), - array_values($var)); - - foreach($properties as $property) { - if(Services_JSON::isError($property)) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - } - - // treat it like a regular array - $elements = array_map(array($this, 'encode'), $var); - - foreach($elements as $element) { - if(Services_JSON::isError($element)) { - return $element; - } - } - - return '[' . join(',', $elements) . ']'; - - case 'object': - $vars = get_object_vars($var); - - $properties = array_map(array($this, 'name_value'), - array_keys($vars), - array_values($vars)); - - foreach($properties as $property) { - if(Services_JSON::isError($property)) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - - default: - return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) - ? 'null' - : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); - } - } - - /** - * array-walking function for use in generating JSON-formatted name-value pairs - * - * @param string $name name of key to use - * @param mixed $value reference to an array element to be encoded - * - * @return string JSON-formatted name-value pair, like '"name":value' - * @access private - */ - function name_value($name, $value) - { - $encoded_value = $this->encode($value); - - if(Services_JSON::isError($encoded_value)) { - return $encoded_value; - } - - return $this->encode(strval($name)) . ':' . $encoded_value; - } - - /** - * reduce a string by removing leading and trailing comments and whitespace - * - * @param $str string string value to strip of comments and whitespace - * - * @return string string value stripped of comments and whitespace - * @access private - */ - function reduce_string($str) - { - $str = preg_replace(array( - - // eliminate single line comments in '// ...' form - '#^\s*//(.+)$#m', - - // eliminate multi-line comments in '/* ... */' form, at start of string - '#^\s*/\*(.+)\*/#Us', - - // eliminate multi-line comments in '/* ... */' form, at end of string - '#/\*(.+)\*/\s*$#Us' - - ), '', $str); - - // eliminate extraneous space - return trim($str); - } - - /** - * decodes a JSON string into appropriate variable - * - * @param string $str JSON-formatted string - * - * @return mixed number, boolean, string, array, or object - * corresponding to given JSON input string. - * See argument 1 to Services_JSON() above for object-output behavior. - * Note that decode() always returns strings - * in ASCII or UTF-8 format! - * @access public - */ - function decode($str) - { - $str = $this->reduce_string($str); - - switch (strtolower($str)) { - case 'true': - return true; - - case 'false': - return false; - - case 'null': - return null; - - default: - $m = array(); - - if (is_numeric($str)) { - // Lookie-loo, it's a number - - // This would work on its own, but I'm trying to be - // good about returning integers where appropriate: - // return (float)$str; - - // Return float or int, as appropriate - return ((float)$str == (integer)$str) - ? (integer)$str - : (float)$str; - - } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { - // STRINGS RETURNED IN UTF-8 FORMAT - $delim = substr($str, 0, 1); - $chrs = substr($str, 1, -1); - $utf8 = ''; - $strlen_chrs = strlen($chrs); - - for ($c = 0; $c < $strlen_chrs; ++$c) { - - $substr_chrs_c_2 = substr($chrs, $c, 2); - $ord_chrs_c = ord($chrs{$c}); - - switch (true) { - case $substr_chrs_c_2 == '\b': - $utf8 .= chr(0x08); - ++$c; - break; - case $substr_chrs_c_2 == '\t': - $utf8 .= chr(0x09); - ++$c; - break; - case $substr_chrs_c_2 == '\n': - $utf8 .= chr(0x0A); - ++$c; - break; - case $substr_chrs_c_2 == '\f': - $utf8 .= chr(0x0C); - ++$c; - break; - case $substr_chrs_c_2 == '\r': - $utf8 .= chr(0x0D); - ++$c; - break; - - case $substr_chrs_c_2 == '\\"': - case $substr_chrs_c_2 == '\\\'': - case $substr_chrs_c_2 == '\\\\': - case $substr_chrs_c_2 == '\\/': - if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || - ($delim == "'" && $substr_chrs_c_2 != '\\"')) { - $utf8 .= $chrs{++$c}; - } - break; - - case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): - // single, escaped unicode character - $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) - . chr(hexdec(substr($chrs, ($c + 4), 2))); - $utf8 .= $this->utf162utf8($utf16); - $c += 5; - break; - - case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): - $utf8 .= $chrs{$c}; - break; - - case ($ord_chrs_c & 0xE0) == 0xC0: - // characters U-00000080 - U-000007FF, mask 110XXXXX - //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 2); - ++$c; - break; - - case ($ord_chrs_c & 0xF0) == 0xE0: - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 3); - $c += 2; - break; - - case ($ord_chrs_c & 0xF8) == 0xF0: - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 4); - $c += 3; - break; - - case ($ord_chrs_c & 0xFC) == 0xF8: - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 5); - $c += 4; - break; - - case ($ord_chrs_c & 0xFE) == 0xFC: - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 6); - $c += 5; - break; - - } - - } - - return $utf8; - - } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { - // array, or object notation - - if ($str{0} == '[') { - $stk = array(SERVICES_JSON_IN_ARR); - $arr = array(); - } else { - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = array(); - } else { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = new stdClass(); - } - } - - array_push($stk, array('what' => SERVICES_JSON_SLICE, - 'where' => 0, - 'delim' => false)); - - $chrs = substr($str, 1, -1); - $chrs = $this->reduce_string($chrs); - - if ($chrs == '') { - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } else { - return $obj; - - } - } - - //print("\nparsing {$chrs}\n"); - - $strlen_chrs = strlen($chrs); - - for ($c = 0; $c <= $strlen_chrs; ++$c) { - - $top = end($stk); - $substr_chrs_c_2 = substr($chrs, $c, 2); - - if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { - // found a comma that is not inside a string, array, etc., - // OR we've reached the end of the character list - $slice = substr($chrs, $top['where'], ($c - $top['where'])); - array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); - //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - // we are in an array, so just push an element onto the stack - array_push($arr, $this->decode($slice)); - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - // we are in an object, so figure - // out the property name and set an - // element in an associative array, - // for now - $parts = array(); - - if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { - // "name":value pair - $key = $this->decode($parts[1]); - $val = $this->decode($parts[2]); - - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { - // name:value pair, where name is unquoted - $key = $parts[1]; - $val = $this->decode($parts[2]); - - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } - - } - - } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { - // found a quote, and we are not inside a string - array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); - //print("Found start of string at {$c}\n"); - - } elseif (($chrs{$c} == $top['delim']) && - ($top['what'] == SERVICES_JSON_IN_STR) && - ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { - // found a quote, we're in a string, and it's not escaped - // we know that it's not escaped becase there is _not_ an - // odd number of backslashes at the end of the string so far - array_pop($stk); - //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '[') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-bracket, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); - //print("Found start of array at {$c}\n"); - - } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { - // found a right-bracket, and we're in an array - array_pop($stk); - //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '{') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-brace, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); - //print("Found start of object at {$c}\n"); - - } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { - // found a right-brace, and we're in an object - array_pop($stk); - //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($substr_chrs_c_2 == '/*') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a comment start, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); - $c++; - //print("Found start of comment at {$c}\n"); - - } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { - // found a comment end, and we're in one now - array_pop($stk); - $c++; - - for ($i = $top['where']; $i <= $c; ++$i) - $chrs = substr_replace($chrs, ' ', $i, 1); - - //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } - - } - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - return $obj; - - } - - } - } - } - - /** - * @todo Ultimately, this should just call PEAR::isError() - */ - function isError($data, $code = null) - { - if (class_exists('pear')) { - return PEAR::isError($data, $code); - } elseif (is_object($data) && (get_class($data) == 'services_json_error' || - is_subclass_of($data, 'services_json_error'))) { - return true; - } - - return false; - } -} - -if (class_exists('PEAR_Error')) { - - class Services_JSON_Error extends PEAR_Error - { - function Services_JSON_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - parent::PEAR_Error($message, $code, $mode, $options, $userinfo); - } - } - -} else { - - /** - * @todo Ultimately, this class shall be descended from PEAR_Error - */ - class Services_JSON_Error - { - function Services_JSON_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - - } - } - -} - -?> diff --git a/application/libraries/ofc-library/Json_format.php b/application/libraries/ofc-library/Json_format.php deleted file mode 100644 index 61a842ea1..000000000 --- a/application/libraries/ofc-library/Json_format.php +++ /dev/null @@ -1,86 +0,0 @@ - 0 && $json[$c-1] != '\\') - { - $in_string = !$in_string; - } - default: - $new_json .= $char; - break; - } - } - - return $new_json; -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_area_base.php b/application/libraries/ofc-library/Ofc_area_base.php deleted file mode 100644 index 2254935b8..000000000 --- a/application/libraries/ofc-library/Ofc_area_base.php +++ /dev/null @@ -1,40 +0,0 @@ -type = "area"; - } - - /** - * the fill colour - */ - function set_fill_colour( $colour ) - { - $this->fill = $colour; - } - - /** - * sugar: see set_fill_colour - */ - function fill_colour( $colour ) - { - $this->set_fill_colour( $colour ); - return $this; - } - - function set_fill_alpha( $alpha ) - { - $tmp = "fill-alpha"; - $this->$tmp = $alpha; - } - - function set_loop() - { - $this->loop = true; - } -} diff --git a/application/libraries/ofc-library/Ofc_area_hollow.php b/application/libraries/ofc-library/Ofc_area_hollow.php deleted file mode 100644 index ba6c20461..000000000 --- a/application/libraries/ofc-library/Ofc_area_hollow.php +++ /dev/null @@ -1,10 +0,0 @@ -type = "area_hollow"; - parent::area_base(); - } -} diff --git a/application/libraries/ofc-library/Ofc_area_line.php b/application/libraries/ofc-library/Ofc_area_line.php deleted file mode 100644 index c4b2b167e..000000000 --- a/application/libraries/ofc-library/Ofc_area_line.php +++ /dev/null @@ -1,10 +0,0 @@ -type = "area_line"; - parent::area_base(); - } -} diff --git a/application/libraries/ofc-library/Ofc_arrow.php b/application/libraries/ofc-library/Ofc_arrow.php deleted file mode 100644 index 77671c87f..000000000 --- a/application/libraries/ofc-library/Ofc_arrow.php +++ /dev/null @@ -1,27 +0,0 @@ -type = "arrow"; - $this->start = array("x"=>$x, "y"=>$y); - $this->end = array("x"=>$a, "y"=>$b); - $this->colour($colour); - $this->{"barb-length"} = $barb_length; - } - - function colour( $colour ) - { - $this->colour = $colour; - return $this; - } -} diff --git a/application/libraries/ofc-library/Ofc_bar.php b/application/libraries/ofc-library/Ofc_bar.php deleted file mode 100644 index b91914f73..000000000 --- a/application/libraries/ofc-library/Ofc_bar.php +++ /dev/null @@ -1,34 +0,0 @@ -top = $top; - - if( isset( $bottom ) ) - $this->bottom = $bottom; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - -class bar extends bar_base -{ - function bar() - { - $this->type = "bar"; - parent::bar_base(); - } -} - diff --git a/application/libraries/ofc-library/Ofc_bar_3d.php b/application/libraries/ofc-library/Ofc_bar_3d.php deleted file mode 100644 index 37adb215c..000000000 --- a/application/libraries/ofc-library/Ofc_bar_3d.php +++ /dev/null @@ -1,22 +0,0 @@ -top = $top; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - diff --git a/application/libraries/ofc-library/Ofc_bar_base.php b/application/libraries/ofc-library/Ofc_bar_base.php deleted file mode 100644 index ee461063b..000000000 --- a/application/libraries/ofc-library/Ofc_bar_base.php +++ /dev/null @@ -1,97 +0,0 @@ -text = $text; - $tmp = 'font-size'; - $this->$tmp = $size; - } - - /** - * syntatical sugar. - */ - function key( $text, $size ) - { - $this->set_key( $text, $size ); - } - - /** - * @param $v as an array, a mix of: - * - a bar_value class. You can use this to customise the paramters of each bar. - * - integer. This is the Y position of the top of the bar. - */ - function set_values( $v ) - { - $this->values = $v; - } - - /** - * see set_values - */ - function append_value( $v ) - { - $this->values[] = $v; - } - - /** - * @param $colour as string, a HEX colour, e.g. '#ff0000' red - */ - function set_colour( $colour ) - { - $this->colour = $colour; - } - - /** - *syntatical sugar - */ - function colour( $colour ) - { - $this->set_colour( $colour ); - } - - /** - * @param $alpha as real number (range 0 to 1), e.g. 0.5 is half transparent - */ - function set_alpha( $alpha ) - { - $this->alpha = $alpha; - } - - /** - * @param $tip as string, the tip to show. May contain various magic variables. - */ - function set_tooltip( $tip ) - { - $this->tip = $tip; - } - - /** - *@param $on_show as line_on_show object - */ - function set_on_show($on_show) - { - $this->{'on-show'} = $on_show; - } - - function set_on_click( $text ) - { - $tmp = 'on-click'; - $this->$tmp = $text; - } - - function attach_to_right_y_axis() - { - $this->axis = 'right'; - } -} - diff --git a/application/libraries/ofc-library/Ofc_bar_filled.php b/application/libraries/ofc-library/Ofc_bar_filled.php deleted file mode 100644 index e84a55a71..000000000 --- a/application/libraries/ofc-library/Ofc_bar_filled.php +++ /dev/null @@ -1,39 +0,0 @@ -$tmp = $outline_colour; - } -} - -class bar_filled extends bar_base -{ - function bar_filled( $colour=null, $outline_colour=null ) - { - $this->type = "bar_filled"; - parent::bar_base(); - - if( isset( $colour ) ) - $this->set_colour( $colour ); - - if( isset( $outline_colour ) ) - $this->set_outline_colour( $outline_colour ); - } - - function set_outline_colour( $outline_colour ) - { - $tmp = 'outline-colour'; - $this->$tmp = $outline_colour; - } -} - diff --git a/application/libraries/ofc-library/Ofc_bar_glass.php b/application/libraries/ofc-library/Ofc_bar_glass.php deleted file mode 100644 index fdb6cead1..000000000 --- a/application/libraries/ofc-library/Ofc_bar_glass.php +++ /dev/null @@ -1,131 +0,0 @@ -type = $type; - $this->cascade = (float)$cascade; - $this->delay = (float)$delay; - } -} - -class bar_value -{ - /** - * @param $top as integer. The Y value of the top of the bar - * @param OPTIONAL $bottom as integer. The Y value of the bottom of the bar, defaults to Y min. - */ - function bar_value( $top, $bottom=null ) - { - $this->top = $top; - - if( isset( $bottom ) ) - $this->bottom = $bottom; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - -class bar extends bar_base -{ - function bar() - { - $this->type = "bar"; - parent::bar_base(); - } -} - -class bar_glass extends bar_base -{ - function bar_glass() - { - $this->type = "bar_glass"; - parent::bar_base(); - } -} - -class bar_cylinder extends bar_base -{ - function bar_cylinder() - { - $this->type = "bar_cylinder"; - parent::bar_base(); - } -} - -class bar_cylinder_outline extends bar_base -{ - function bar_cylinder_outline() - { - $this->type = "bar_cylinder_outline"; - parent::bar_base(); - } -} - -class bar_rounded_glass extends bar_base -{ - function bar_rounded_glass() - { - $this->type = "bar_round_glass"; - parent::bar_base(); - } -} - -class bar_round extends bar_base -{ - function bar_round() - { - $this->type = "bar_round"; - parent::bar_base(); - } -} - -class bar_dome extends bar_base -{ - function bar_dome() - { - $this->type = "bar_dome"; - parent::bar_base(); - } -} - -class bar_round3d extends bar_base -{ - function bar_round3d() - { - $this->type = "bar_round3d"; - parent::bar_base(); - } -} - -class bar_3d extends bar_base -{ - function bar_3d() - { - $this->type = "bar_3d"; - parent::bar_base(); - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_bar_sketch.php b/application/libraries/ofc-library/Ofc_bar_sketch.php deleted file mode 100644 index 96d16129c..000000000 --- a/application/libraries/ofc-library/Ofc_bar_sketch.php +++ /dev/null @@ -1,29 +0,0 @@ -type = "bar_sketch"; - parent::bar_base(); - - $this->set_colour( $colour ); - $this->set_outline_colour( $outline_colour ); - $this->offset = $fun_factor; - } - - function set_outline_colour( $outline_colour ) - { - $tmp = 'outline-colour'; - $this->$tmp = $outline_colour; - } -} - diff --git a/application/libraries/ofc-library/Ofc_bar_stack.php b/application/libraries/ofc-library/Ofc_bar_stack.php deleted file mode 100644 index fda1fff6d..000000000 --- a/application/libraries/ofc-library/Ofc_bar_stack.php +++ /dev/null @@ -1,55 +0,0 @@ -type = "bar_stack"; - parent::bar_base(); - } - - function append_stack( $v ) - { - $this->append_value( $v ); - } - - // an array of HEX colours strings - // e.g. array( '#ff0000', '#00ff00' ); - function set_colours( $colours ) - { - $this->colours = $colours; - } - - // an array of bar_stack_value - function set_keys( $keys ) - { - $this->keys = $keys; - } -} - -class bar_stack_value -{ - function bar_stack_value( $val, $colour ) - { - $this->val = $val; - $this->colour = $colour; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - -class bar_stack_key -{ - function bar_stack_key( $colour, $text, $font_size ) - { - $this->colour = $colour; - $this->text = $text; - $tmp = 'font-size'; - $this->$tmp = $font_size; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_candle.php b/application/libraries/ofc-library/Ofc_candle.php deleted file mode 100644 index d24a05c79..000000000 --- a/application/libraries/ofc-library/Ofc_candle.php +++ /dev/null @@ -1,41 +0,0 @@ -high = $high; - $this->top = $open; - $this->bottom = $close; - $this->low = $low; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - -class candle extends bar_base -{ - function candle($colour, $negative_colour=null) - { - $this->type = "candle"; - parent::bar_base(); - - $this->set_colour( $colour ); - if(!is_null($negative_colour)) - $this->{'negative-colour'} = $negative_colour; - } -} - diff --git a/application/libraries/ofc-library/Ofc_hbar.php b/application/libraries/ofc-library/Ofc_hbar.php deleted file mode 100644 index a0fffbb55..000000000 --- a/application/libraries/ofc-library/Ofc_hbar.php +++ /dev/null @@ -1,64 +0,0 @@ -left = $left; - $this->right = $right; - } - else - $this->right = $left; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - -class hbar -{ - function hbar( $colour ) - { - $this->type = "hbar"; - $this->values = array(); - $this->set_colour( $colour ); - } - - function append_value( $v ) - { - $this->values[] = $v; - } - - function set_values( $v ) - { - foreach( $v as $val ) - $this->append_value( new hbar_value( $val ) ); - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_key( $text, $size ) - { - $this->text = $text; - $tmp = 'font-size'; - $this->$tmp = $size; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - diff --git a/application/libraries/ofc-library/Ofc_line.php b/application/libraries/ofc-library/Ofc_line.php deleted file mode 100644 index d25c3fef0..000000000 --- a/application/libraries/ofc-library/Ofc_line.php +++ /dev/null @@ -1,157 +0,0 @@ -type = $type; - $this->cascade = (float)$cascade; - $this->delay = (float)$delay; - } -} - -class line -{ - function line() - { - $this->type = "line"; - $this->values = array(); - } - - /** - * Set the default dot that all the real - * dots inherit their properties from. If you set the - * default dot to be red, all values in your chart that - * do not specify a colour will be red. Same for all the - * other attributes such as tooltip, on-click, size etc... - * - * @param $style as any class that inherits base_dot - */ - function set_default_dot_style( $style ) - { - $tmp = 'dot-style'; - $this->$tmp = $style; - } - - /** - * @param $v as array, can contain any combination of: - * - integer, Y position of the point - * - any class that inherits from dot_base - * - null - */ - function set_values( $v ) - { - $this->values = $v; - } - - /** - * Append a value to the line. - * - * @param mixed $v - */ - function append_value($v) - { - $this->values[] = $v; - } - - function set_width( $width ) - { - $this->width = $width; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - /** - * sytnatical sugar for set_colour - */ - function colour( $colour ) - { - $this->set_colour( $colour ); - return $this; - } - - function set_halo_size( $size ) - { - $tmp = 'halo-size'; - $this->$tmp = $size; - } - - function set_key( $text, $font_size ) - { - $this->text = $text; - $tmp = 'font-size'; - $this->$tmp = $font_size; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } - - /** - * @param $text as string. A javascript function name as a string. The chart will - * try to call this function, it will pass the chart id as the only parameter into - * this function. E.g: - * - */ - function set_on_click( $text ) - { - $tmp = 'on-click'; - $this->$tmp = $text; - } - - function loop() - { - $this->loop = true; - } - - function line_style( $s ) - { - $tmp = "line-style"; - $this->$tmp = $s; - } - - /** - * Sets the text for the line. - * - * @param string $text - */ - function set_text($text) - { - $this->text = $text; - } - - function attach_to_right_y_axis() - { - $this->axis = 'right'; - } - - /** - *@param $on_show as line_on_show object - */ - function set_on_show($on_show) - { - $this->{'on-show'} = $on_show; - } - - function on_show($on_show) - { - $this->set_on_show($on_show); - return $this; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_line_base.php b/application/libraries/ofc-library/Ofc_line_base.php deleted file mode 100644 index da58abedc..000000000 --- a/application/libraries/ofc-library/Ofc_line_base.php +++ /dev/null @@ -1,92 +0,0 @@ -type = "line"; - $this->text = "Page views"; - $tmp = 'font-size'; - $this->$tmp = 10; - - $this->values = array(); - } - - function set_values( $v ) - { - $this->values = $v; - } - - /** - * Append a value to the line. - * - * @param mixed $v - */ - function append_value($v) - { - $this->values[] = $v; - } - - function set_width( $width ) - { - $this->width = $width; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_dot_size( $size ) - { - $tmp = 'dot-size'; - $this->$tmp = $size; - } - - function set_halo_size( $size ) - { - $tmp = 'halo-size'; - $this->$tmp = $size; - } - - function set_key( $text, $font_size ) - { - $this->text = $text; - $tmp = 'font-size'; - $this->$tmp = $font_size; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } - - function set_on_click( $text ) - { - $tmp = 'on-click'; - $this->$tmp = $text; - } - - function loop() - { - $this->loop = true; - } - - function line_style( $s ) - { - $tmp = "line-style"; - $this->$tmp = $s; - } - - /** - * Sets the text for the line. - * - * @param string $text - */ - function set_text($text) - { - $this->text = $text; - } - - -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_line_dot.php b/application/libraries/ofc-library/Ofc_line_dot.php deleted file mode 100644 index 52f2ad0eb..000000000 --- a/application/libraries/ofc-library/Ofc_line_dot.php +++ /dev/null @@ -1,33 +0,0 @@ -value = $value; - $this->colour = $colour; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_size( $size ) - { - $this->size = $size; - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } -} - -class line_dot extends line_base -{ - function line_dot() - { - $this->type = "line_dot"; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_line_hollow.php b/application/libraries/ofc-library/Ofc_line_hollow.php deleted file mode 100644 index 783fdf778..000000000 --- a/application/libraries/ofc-library/Ofc_line_hollow.php +++ /dev/null @@ -1,9 +0,0 @@ -type = "line_hollow"; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_line_style.php b/application/libraries/ofc-library/Ofc_line_style.php deleted file mode 100644 index 4ba5ff8b6..000000000 --- a/application/libraries/ofc-library/Ofc_line_style.php +++ /dev/null @@ -1,11 +0,0 @@ -style = "dash"; - $this->on = $on; - $this->off = $off; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_menu.php b/application/libraries/ofc-library/Ofc_menu.php deleted file mode 100644 index c44dd177a..000000000 --- a/application/libraries/ofc-library/Ofc_menu.php +++ /dev/null @@ -1,56 +0,0 @@ -type = "text"; - $this->text = $text; - $tmp = 'javascript-function'; - $this->$tmp = $javascript_function_name; - } -} - -class ofc_menu_item_camera -{ - /** - * @param $text as string. The menu item text. - * @param $javascript_function_name as string. The javascript function name, the - * js function takes one parameter, the chart ID. So for example, our js function - * could look like this: - * - * function save_image( chart_id ) - * { - * alert( chart_id ); - * } - * - * to make a menu item call this: ofc_menu_item_camera('Save chart', 'save_image'); - */ - function ofc_menu_item_camera($text, $javascript_function_name) - { - $this->type = "camera-icon"; - $this->text = $text; - $tmp = 'javascript-function'; - $this->$tmp = $javascript_function_name; - } -} - -class ofc_menu -{ - function ofc_menu($colour, $outline_colour) - { - $this->colour = $colour; - $this->outline_colour = $outline_colour; - } - - function values($values) - { - $this->values = $values; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_pie.php b/application/libraries/ofc-library/Ofc_pie.php deleted file mode 100644 index f3b9d3ed7..000000000 --- a/application/libraries/ofc-library/Ofc_pie.php +++ /dev/null @@ -1,257 +0,0 @@ -value = $value; - $this->label = $label; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_label( $label, $label_colour, $font_size ) - { - $this->label = $label; - - $tmp = 'label-colour'; - $this->$tmp = $label_colour; - - $tmp = 'font-size'; - $this->$tmp = $font_size; - - } - - function set_tooltip( $tip ) - { - $this->tip = $tip; - } - - function on_click( $event ) - { - $tmp = 'on-click'; - $this->$tmp = $event; - } - - - /** - * An object that inherits from base_pie_animation - */ - function add_animation( $animation ) - { - if( !isset( $this->animate ) ) - $this->animate = array(); - - $this->animate[] = $animation; - - return $this; - } -} - -class base_pie_animation{} - -/** - * fade the pie slice from $alpha (pie set_alpha) to 100% opaque. - */ -class pie_fade extends base_pie_animation -{ - function pie_fade() - { - $this->type="fade"; - } -} - -/** - * Bounce the pie slice out a little - */ -class pie_bounce extends base_pie_animation -{ - /** - * @param $distance as integer, distance to bounce in pixels - */ - function pie_bounce( $distance ) - { - $this->type="bounce"; - $this->distance = $distance; - } -} - -/** - * Make a pie chart and fill it with pie slices - */ -class pie -{ - function pie() - { - $this->type = 'pie'; - } - - function set_colours( $colours ) - { - $this->colours = $colours; - } - - /** - * Sugar wrapped around set_colours - */ - function colours( $colours ) - { - $this->set_colours( $colours ); - return $this; - } - - /** - * @param $alpha as float (0-1) 0.75 = 3/4 visible - */ - function set_alpha( $alpha ) - { - $this->alpha = $alpha; - } - - /** - *sugar wrapped set_alpha - **/ - function alpha( $alpha ) - { - $this->set_alpha( $alpha ); - return $this; - } - - /** - * @param $v as array containing one of - * - null - * - real or integer number - * - a pie_value object - */ - function set_values( $v ) - { - $this->values = $v; - } - - /** - * sugar for set_values - */ - function values( $v ) - { - $this->set_values( $v ); - return $this; - } - - /** - * HACK to keep old code working. - */ - function set_animate( $bool ) - { - if( $bool ) - $this->add_animation( new pie_fade() ); - - } - - /** - * An object that inherits from base_pie_animation - */ - function add_animation( $animation ) - { - if( !isset( $this->animate ) ) - $this->animate = array(); - - $this->animate[] = $animation; - - return $this; - } - - /** - * @param $angle as real number - */ - function set_start_angle( $angle ) - { - $tmp = 'start-angle'; - $this->$tmp = $angle; - } - - /** - * sugar for set_start_angle - */ - function start_angle($angle) - { - $this->set_start_angle( $angle ); - return $this; - } - - /** - * @param $tip as string. The tooltip text. May contain magic varibles - */ - function set_tooltip( $tip ) - { - $this->tip = $tip; - } - - /** - * sugar for set_tooltip - */ - function tooltip( $tip ) - { - $this->set_tooltip( $tip ); - return $this; - } - - function set_gradient_fill() - { - $tmp = 'gradient-fill'; - $this->$tmp = true; - } - - function gradient_fill() - { - $this->set_gradient_fill(); - return $this; - } - - /** - * By default each label is the same colour as the slice, - * but you can ovveride that behaviour using this method. - * - * @param $label_colour as string HEX colour; - */ - function set_label_colour( $label_colour ) - { - $tmp = 'label-colour'; - $this->$tmp = $label_colour; - } - - function label_colour( $label_colour ) - { - $this->set_label_colour( $label_colour ); - return $this; - } - - /** - * Turn off the labels - */ - function set_no_labels() - { - $tmp = 'no-labels'; - $this->$tmp = true; - } - - function on_click( $event ) - { - $tmp = 'on-click'; - $this->$tmp = $event; - } - - /** - * Fix the radius of the pie chart. Take a look at the magic variable #radius# - * for helping figure out what radius to set it to. - * - * @param $radius as number - */ - function radius( $radius ) - { - $this->radius = $radius; - return $this; - } -} diff --git a/application/libraries/ofc-library/Ofc_radar_axis.php b/application/libraries/ofc-library/Ofc_radar_axis.php deleted file mode 100644 index 9c8d7885f..000000000 --- a/application/libraries/ofc-library/Ofc_radar_axis.php +++ /dev/null @@ -1,47 +0,0 @@ -set_max( $max ); - } - - function set_max( $max ) - { - $this->max = $max; - } - - function set_steps( $steps ) - { - $this->steps = $steps; - } - - function set_stroke( $s ) - { - $this->stroke = $s; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_grid_colour( $colour ) - { - $tmp = 'grid-colour'; - $this->$tmp = $colour; - } - - function set_labels( $labels ) - { - $this->labels = $labels; - } - - function set_spoke_labels( $labels ) - { - $tmp = 'spoke-labels'; - $this->$tmp = $labels; - } -} - diff --git a/application/libraries/ofc-library/Ofc_radar_axis_labels.php b/application/libraries/ofc-library/Ofc_radar_axis_labels.php deleted file mode 100644 index 1c4321cce..000000000 --- a/application/libraries/ofc-library/Ofc_radar_axis_labels.php +++ /dev/null @@ -1,15 +0,0 @@ -labels = $labels; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_radar_spoke_labels.php b/application/libraries/ofc-library/Ofc_radar_spoke_labels.php deleted file mode 100644 index 11b6682f1..000000000 --- a/application/libraries/ofc-library/Ofc_radar_spoke_labels.php +++ /dev/null @@ -1,15 +0,0 @@ -labels = $labels; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_scatter.php b/application/libraries/ofc-library/Ofc_scatter.php deleted file mode 100644 index ab5f3ba01..000000000 --- a/application/libraries/ofc-library/Ofc_scatter.php +++ /dev/null @@ -1,47 +0,0 @@ -x = $x; - $this->y = $y; - - if( $dot_size > 0 ) - { - $tmp = 'dot-size'; - $this->$tmp = $dot_size; - } - } -} - -class scatter -{ - function scatter( $colour ) - { - $this->type = "scatter"; - $this->set_colour( $colour ); - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_default_dot_style( $style ) - { - $tmp = 'dot-style'; - $this->$tmp = $style; - } - - /** - * @param $v as array, can contain any combination of: - * - integer, Y position of the point - * - any class that inherits from scatter_value - * - null - */ - function set_values( $values ) - { - $this->values = $values; - } -} diff --git a/application/libraries/ofc-library/Ofc_scatter_line.php b/application/libraries/ofc-library/Ofc_scatter_line.php deleted file mode 100644 index c25401898..000000000 --- a/application/libraries/ofc-library/Ofc_scatter_line.php +++ /dev/null @@ -1,49 +0,0 @@ -type = "scatter_line"; - $this->set_colour( $colour ); - $this->set_width( $width ); - } - - function set_default_dot_style( $style ) - { - $tmp = 'dot-style'; - $this->$tmp = $style; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_width( $width ) - { - $this->width = $width; - } - - function set_values( $values ) - { - $this->values = $values; - } - - function set_step_horizontal() - { - $this->stepgraph = 'horizontal'; - } - - function set_step_vertical() - { - $this->stepgraph = 'vertical'; - } - - function set_key( $text, $font_size ) - { - $this->text = $text; - $tmp = 'font-size'; - $this->$tmp = $font_size; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_shape.php b/application/libraries/ofc-library/Ofc_shape.php deleted file mode 100644 index 3bab90790..000000000 --- a/application/libraries/ofc-library/Ofc_shape.php +++ /dev/null @@ -1,25 +0,0 @@ -x = $x; - $this->y = $y; - } -} - -class shape -{ - function shape( $colour ) - { - $this->type = "shape"; - $this->colour = $colour; - $this->values = array(); - } - - function append_value( $p ) - { - $this->values[] = $p; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_sugar.php b/application/libraries/ofc-library/Ofc_sugar.php deleted file mode 100644 index 242182a4c..000000000 --- a/application/libraries/ofc-library/Ofc_sugar.php +++ /dev/null @@ -1,43 +0,0 @@ -colour($colour)->size($size); - } -} - -class s_box extends anchor -{ - /** - * I use this wrapper for default dot types, - * it just makes the code easier to read. - */ - function s_box($colour, $size) - { - parent::anchor(); - $this->colour($colour)->size($size)->rotation(45)->sides(4); - } -} - -class s_hollow_dot extends hollow_dot -{ - /** - * I use this wrapper for default dot types, - * it just makes the code easier to read. - */ - function s_hollow_dot($colour, $size) - { - parent::hollow_dot(); - $this->colour($colour)->size($size); - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_tags.php b/application/libraries/ofc-library/Ofc_tags.php deleted file mode 100644 index e31f7d65c..000000000 --- a/application/libraries/ofc-library/Ofc_tags.php +++ /dev/null @@ -1,133 +0,0 @@ -type = "tags"; - $this->values = array(); - } - - function colour( $colour ) - { - $this->colour = $colour; - return $this; - } - - /** - *@param $font as string. e.g. "Verdana" - *@param $size as integer. Size in px - */ - function font($font, $size) - { - $this->font = $font; - $this->{'font-size'} = $size; - return $this; - } - - /** - *@param $x as integer. Size of x padding in px - *@param $y as integer. Size of y padding in px - */ - function padding($x, $y) - { - $this->{"pad-x"} = $x; - $this->{"pad-y"} = $y; - return $this; - } - - function rotate($angle) - { - $this->rotate($angle); - return $this; - } - - function align_x_center() - { - $this->{"align-x"} = "center"; - return $this; - } - - function align_x_left() - { - $this->{"align-x"} = "left"; - return $this; - } - - function align_x_right() - { - $this->{"align-x"} = "right"; - return $this; - } - - function align_y_above() - { - $this->{"align-y"} = "above"; - return $this; - } - - function align_y_below() - { - $this->{"align-y"} = "below"; - return $this; - } - - function align_y_center() - { - $this->{"align-y"} = "center"; - return $this; - } - - /** - * This can contain some HTML, e.g: - * - "More info" - * - "ofc" - */ - function text($text) - { - $this->text = $text; - return $this; - } - - /** - * This works, but to get the mouse pointer to change - * to a little hand you need to use "stuff"-- see text() - */ - function on_click($on_click) - { - $this->{'on-click'} = $on_click; - return $this; - } - - /** - *@param $bold boolean. - *@param $underline boolean. - *@param $border boolean. - *@prarm $alpha real (0 to 1.0) - */ - function style($bold, $underline, $border, $alpha ) - { - $this->bold = $bold; - $this->border = $underline; - $this->underline = $border; - $this->alpha = $alpha; - return $this; - } - - /** - *@param $tag as ofc_tag - */ - function append_tag($tag) - { - $this->values[] = $tag; - } -} - -class ofc_tag extends ofc_tags -{ - function ofc_tag($x, $y) - { - $this->x = $x; - $this->y = $y; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_title.php b/application/libraries/ofc-library/Ofc_title.php deleted file mode 100644 index 58d817a81..000000000 --- a/application/libraries/ofc-library/Ofc_title.php +++ /dev/null @@ -1,39 +0,0 @@ -text = $text; - } - - /** - * A css string. Can optionally contain: - * - font-size - * - font-family - * - font-weight - * - color - * - background-color - * - text-align - * - margin - * - margin-left - * - margin-right - * - margin-top - * - margin-bottom - * - padding - * - padding-left - * - padding-right - * - padding-top - * - padding-bottom - * just like the css we use all the time :-) - */ - function set_style( $css ) - { - $this->style = $css; - //"{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_tooltip.php b/application/libraries/ofc-library/Ofc_tooltip.php deleted file mode 100644 index fd1ff3059..000000000 --- a/application/libraries/ofc-library/Ofc_tooltip.php +++ /dev/null @@ -1,67 +0,0 @@ -shadow = $shadow; - } - - /** - * @param $stroke as integer, border width in pixels (e.g. 5 ) - */ - function set_stroke( $stroke ) - { - $this->stroke = $stroke; - } - - /** - * @param $colour as string, HEX colour e.g. '#0000ff' - */ - function set_colour( $colour ) - { - $this->colour = $colour; - } - - /** - * @param $bg as string, HEX colour e.g. '#0000ff' - */ - function set_background_colour( $bg ) - { - $this->background = $bg; - } - - /** - * @param $style as string. A css style. - */ - function set_title_style( $style ) - { - $this->title = $style; - } - - /** - * @param $style as string. A css style. - */ - function set_body_style( $style ) - { - $this->body = $style; - } - - function set_proximity() - { - $this->mouse = 1; - } - - function set_hover() - { - $this->mouse = 2; - } -} - diff --git a/application/libraries/ofc-library/Ofc_x_axis.php b/application/libraries/ofc-library/Ofc_x_axis.php deleted file mode 100644 index 3bbaa676d..000000000 --- a/application/libraries/ofc-library/Ofc_x_axis.php +++ /dev/null @@ -1,140 +0,0 @@ -stroke = $stroke; - } - - function stroke( $stroke ) - { - $this->set_stroke( $stroke ); - return $this; - } - - /** - *@param $colour as string HEX colour - *@param $grid_colour as string HEX colour - */ - function set_colours( $colour, $grid_colour ) - { - $this->set_colour( $colour ); - $this->set_grid_colour( $grid_colour ); - } - - /** - *@param $colour as string HEX colour - */ - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function colour( $colour ) - { - $this->set_colour($colour); - return $this; - } - - function set_tick_height( $height ) - { - $tmp = 'tick-height'; - $this->$tmp = $height; - } - - function tick_height( $height ) - { - $this->set_tick_height($height); - return $this; - } - - function set_grid_colour( $colour ) - { - $tmp = 'grid-colour'; - $this->$tmp = $colour; - } - - function grid_colour( $colour ) - { - $this->set_grid_colour($colour); - return $this; - } - - /** - * @param $o is a boolean. If true, the X axis start half a step in - * This defaults to True - */ - function set_offset( $o ) - { - $this->offset = $o?true:false; - } - - function offset( $o ) - { - $this->set_offset($o); - return $this; - } - - /** - * @param $steps as integer. Which grid lines and ticks are visible. - */ - function set_steps( $steps ) - { - $this->steps = $steps; - } - - function steps( $steps ) - { - $this->set_steps($steps); - return $this; - } - - /** - * @param $val as an integer, the height in pixels of the 3D bar. Mostly - * used for the 3D bar chart. - */ - function set_3d( $val ) - { - $tmp = '3d'; - $this->$tmp = $val; - } - - /** - * @param $x_axis_labels as an x_axis_labels object - * Use this to customize the labels (colour, font, etc...) - */ - function set_labels( $x_axis_labels ) - { - //$this->labels = $v; - $this->labels = $x_axis_labels; - } - - /** - * Sugar syntax: helper function to make the examples simpler. - * @param $a is an array of labels - */ - function set_labels_from_array( $a ) - { - $x_axis_labels = new x_axis_labels(); - $x_axis_labels->set_labels( $a ); - $this->labels = $x_axis_labels; - - if( isset( $this->steps ) ) - $x_axis_labels->set_steps( $this->steps ); - } - - /** - * min and max. - */ - function set_range( $min, $max ) - { - $this->min = $min; - $this->max = $max; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_x_axis_label.php b/application/libraries/ofc-library/Ofc_x_axis_label.php deleted file mode 100644 index 2dc1492da..000000000 --- a/application/libraries/ofc-library/Ofc_x_axis_label.php +++ /dev/null @@ -1,45 +0,0 @@ -set_text( $text ); - $this->set_colour( $colour ); - $this->set_size( $size ); - $this->set_rotate( $rotate ); - } - - function set_text( $text ) - { - $this->text = $text; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_size( $size ) - { - $this->size = $size; - } - - function set_rotate( $rotate ) - { - $this->rotate = $rotate; - } - - function set_vertical() - { - $this->rotate = "vertical"; - } - - function set_visible() - { - $this->visible = true; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_x_axis_labels.php b/application/libraries/ofc-library/Ofc_x_axis_labels.php deleted file mode 100644 index fb8e7d7db..000000000 --- a/application/libraries/ofc-library/Ofc_x_axis_labels.php +++ /dev/null @@ -1,69 +0,0 @@ -steps = $steps; - } - - /** - * @param $steps as integer which labels are visible - */ - function visible_steps( $steps ) - { - $this->{"visible-steps"} = $steps; - return $this; - } - - /** - * - * @param $labels as an array of [x_axis_label or string] - */ - function set_labels( $labels ) - { - $this->labels = $labels; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - /** - * font size in pixels - */ - function set_size( $size ) - { - $this->size = $size; - } - - /** - * rotate labels - */ - function set_vertical() - { - $this->rotate = 270; - } - - /** - * @param @angle as real. The angle of the text. - */ - function rotate( $angle ) - { - $this->rotate = $angle; - } - - /** - * @param $text as string. Replace and magic variables with actual x axis position. - */ - function text( $text ) - { - $this->text = $text; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_x_legend.php b/application/libraries/ofc-library/Ofc_x_legend.php deleted file mode 100644 index f36c017f4..000000000 --- a/application/libraries/ofc-library/Ofc_x_legend.php +++ /dev/null @@ -1,15 +0,0 @@ -text = $text; - } - - function set_style( $css ) - { - $this->style = $css; - //"{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_y_axis.php b/application/libraries/ofc-library/Ofc_y_axis.php deleted file mode 100644 index 449bc295b..000000000 --- a/application/libraries/ofc-library/Ofc_y_axis.php +++ /dev/null @@ -1,17 +0,0 @@ -$tmp = $colour; - } - -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_y_axis_base.php b/application/libraries/ofc-library/Ofc_y_axis_base.php deleted file mode 100644 index b99519ec3..000000000 --- a/application/libraries/ofc-library/Ofc_y_axis_base.php +++ /dev/null @@ -1,116 +0,0 @@ -stroke = $s; - } - - /** - * @param $val as integer. The length of the ticks in pixels - */ - function set_tick_length( $val ) - { - $tmp = 'tick-length'; - $this->$tmp = $val; - } - - function set_colours( $colour, $grid_colour ) - { - $this->set_colour( $colour ); - $this->set_grid_colour( $grid_colour ); - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_grid_colour( $colour ) - { - $tmp = 'grid-colour'; - $this->$tmp = $colour; - } - - /** - * Set min and max values, also (optionally) set the steps value. - * You can reverse the chart by setting min larger than max, e.g. min = 10 - * and max = 0. - * - * @param $min as integer - * @param $max as integer - * @param $steps as integer. - */ - function set_range( $min, $max, $steps=1 ) - { - $this->min = $min; - $this->max = $max; - $this->set_steps( $steps ); - } - - /** - * Sugar for set_range - */ - function range( $min, $max, $steps=1 ) - { - $this->set_range( $min, $max, $steps ); - return $this; - } - - /** - * @param $off as Boolean. If true the Y axis is nudged up half a step. - */ - function set_offset( $off ) - { - $this->offset = $off?1:0; - } - - /** - * @param $y_axis_labels as an y_axis_labels object - * Use this to customize the labels (colour, font, etc...) - */ - function set_labels( $y_axis_labels ) - { - $this->labels = $y_axis_labels; - } - - /** - * Pass in some text for each label. This can contain magic variables "#val#" which - * will get replaced with the value for that Y axis label. Useful for: - * - "#val#" - * - "#val#%" - * - "#val# million" - * - * @param $text as string. - */ - function set_label_text( $text ) - { - $tmp = new y_axis_labels(); - $tmp->set_text( $text ); - $this->labels = $tmp; - } - - /** - * @param $steps as integer. - * - * Only show every $steps label, e.g. every 10th - */ - function set_steps( $steps ) - { - $this->steps = $steps; - } - - /** - * Make the labels show vertical - */ - function set_vertical() - { - $this->rotate = "vertical"; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_y_axis_label.php b/application/libraries/ofc-library/Ofc_y_axis_label.php deleted file mode 100644 index bded9b84e..000000000 --- a/application/libraries/ofc-library/Ofc_y_axis_label.php +++ /dev/null @@ -1,38 +0,0 @@ -y = $y; - $this->set_text( $text ); - } - - function set_text( $text ) - { - $this->text = $text; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - function set_size( $size ) - { - $this->size = $size; - } - - function set_rotate( $rotate ) - { - $this->rotate = $rotate; - } - - function set_vertical() - { - $this->rotate = "vertical"; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_y_axis_labels.php b/application/libraries/ofc-library/Ofc_y_axis_labels.php deleted file mode 100644 index 75f777e53..000000000 --- a/application/libraries/ofc-library/Ofc_y_axis_labels.php +++ /dev/null @@ -1,57 +0,0 @@ -steps = $steps; - } - - /** - * - * @param $labels as an array of [y_axis_label or string] - */ - function set_labels( $labels ) - { - $this->labels = $labels; - } - - function set_colour( $colour ) - { - $this->colour = $colour; - } - - /** - * font size in pixels - */ - function set_size( $size ) - { - $this->size = $size; - } - - /** - * rotate labels - */ - function set_vertical() - { - $this->rotate = 270; - } - - function rotate( $angle ) - { - $this->rotate = $angle; - } - - /** - * @param $text default text that all labels inherit - */ - function set_text( $text ) - { - $this->text = $text; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Ofc_y_axis_right.php b/application/libraries/ofc-library/Ofc_y_axis_right.php deleted file mode 100644 index 1e0911194..000000000 --- a/application/libraries/ofc-library/Ofc_y_axis_right.php +++ /dev/null @@ -1,6 +0,0 @@ -text = $text; - } - - function set_style( $css ) - { - $this->style = $css; - //"{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center;}"; - } -} \ No newline at end of file diff --git a/application/libraries/ofc-library/Open-flash-chart-object.php b/application/libraries/ofc-library/Open-flash-chart-object.php deleted file mode 100644 index d3b64aa48..000000000 --- a/application/libraries/ofc-library/Open-flash-chart-object.php +++ /dev/null @@ -1,109 +0,0 @@ -'; - - if( !isset( $open_flash_chart_seqno ) ) - { - $open_flash_chart_seqno = 1; - $out[] = ''; - } - else - { - $open_flash_chart_seqno++; - $obj_id .= '_'. $open_flash_chart_seqno; - $div_name .= '_'. $open_flash_chart_seqno; - } - - if( $use_swfobject ) - { - // Using library for auto-enabling Flash object on IE, disabled-Javascript proof - $out[] = '
'; - $out[] = ''; - $out[] = ''; - } - - return implode("\n",$out); -} -?> \ No newline at end of file diff --git a/application/libraries/ofc-library/Open-flash-chart.php b/application/libraries/ofc-library/Open-flash-chart.php deleted file mode 100644 index c87bc0be1..000000000 --- a/application/libraries/ofc-library/Open-flash-chart.php +++ /dev/null @@ -1,178 +0,0 @@ -title = new title( "Many data lines" ); - $this->elements = array(); - } - - function set_title( $t ) - { - $this->title = $t; - } - - function set_x_axis( $x ) - { - $this->x_axis = $x; - } - - function set_y_axis( $y ) - { - $this->y_axis = $y; - } - - function add_y_axis( $y ) - { - $this->y_axis = $y; - } - - function set_y_axis_right( $y ) - { - $this->y_axis_right = $y; - } - - function add_element( $e ) - { - $this->elements[] = $e; - } - - function set_x_legend( $x ) - { - $this->x_legend = $x; - } - - function set_y_legend( $y ) - { - $this->y_legend = $y; - } - - function set_bg_colour( $colour ) - { - $this->bg_colour = $colour; - } - - function set_radar_axis( $radar ) - { - $this->radar_axis = $radar; - } - - function set_tooltip( $tooltip ) - { - $this->tooltip = $tooltip; - } - - /** - * This is a bit funky :( - * - * @param $num_decimals as integer. Truncate the decimals to $num_decimals, e.g. set it - * to 5 and 3.333333333 will display as 3.33333. 2.0 will display as 2 (or 2.00000 - see below) - * @param $is_fixed_num_decimals_forced as boolean. If true it will pad the decimals. - * @param $is_decimal_separator_comma as boolean - * @param $is_thousand_separator_disabled as boolean - * - * This needs a bit of love and attention - */ - function set_number_format($num_decimals, $is_fixed_num_decimals_forced, $is_decimal_separator_comma, $is_thousand_separator_disabled ) - { - $this->num_decimals = $num_decimals; - $this->is_fixed_num_decimals_forced = $is_fixed_num_decimals_forced; - $this->is_decimal_separator_comma = $is_decimal_separator_comma; - $this->is_thousand_separator_disabled = $is_thousand_separator_disabled; - } - - /** - * This is experimental and will change as we make it work - * - * @param $m as ofc_menu - */ - function set_menu($m) - { - $this->menu = $m; - } - - function toString() - { - if (function_exists('json_encode')) - { - return json_encode($this); - } - else - { - $json = new Services_JSON(); - return $json->encode( $this ); - } - } - - function toPrettyString() - { - return json_format( $this->toString() ); - } -} - - - -// -// there is no PHP end tag so we don't mess the headers up! -// \ No newline at end of file diff --git a/application/libraries/ofc-library/README.txt b/application/libraries/ofc-library/README.txt deleted file mode 100644 index 2d8b6297f..000000000 --- a/application/libraries/ofc-library/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -Open Flash Chart - PHP libraries. These help create data files for Open Flash Chart. -Copyright (C) 2007 - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA \ No newline at end of file diff --git a/application/models/Appconfig.php b/application/models/Appconfig.php index 6f0879148..61dcb3fe4 100644 --- a/application/models/Appconfig.php +++ b/application/models/Appconfig.php @@ -1,81 +1,78 @@ db->from('app_config'); - $this->db->where('app_config.key',$key); - $query = $this->db->get(); - - return ($query->num_rows()==1); + $this->db->where('app_config.key', $key); + + return ($this->db->get()->num_rows() == 1); } - function get_all() + public function get_all() { $this->db->from('app_config'); - $this->db->order_by("key", "asc"); + $this->db->order_by('key', 'asc'); + return $this->db->get(); } - function get($key) + public function get($key) { $query = $this->db->get_where('app_config', array('key' => $key), 1); - - if($query->num_rows()==1) + + if($query->num_rows() == 1) { return $query->row()->value; } - - return ""; - + + return ''; } - function save($key,$value) + public function save($key, $value) { - $config_data=array( - 'key'=>$key, - 'value'=>$value + $config_data = array( + 'key' => $key, + 'value' => $value ); - - if (!$this->exists($key)) + + if(!$this->exists($key)) { - return $this->db->insert('app_config',$config_data); + return $this->db->insert('app_config', $config_data); } - + $this->db->where('key', $key); - return $this->db->update('app_config',$config_data); + + return $this->db->update('app_config', $config_data); } - function batch_save($data) + public function batch_save($data) { - $success=true; + $success = TRUE; //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); + foreach($data as $key=>$value) { - if(!$this->save($key,$value)) - { - $success=false; - break; - } + $success &= $this->save($key, $value); } - - $this->db->trans_complete(); + + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); + return $success; - } - function delete($key) + public function delete($key) { return $this->db->delete('app_config', array('key' => $key)); } - function delete_all() + public function delete_all() { return $this->db->empty_table('app_config'); } } - ?> \ No newline at end of file diff --git a/application/models/Customer.php b/application/models/Customer.php index e0288295a..2a9a86df3 100644 --- a/application/models/Customer.php +++ b/application/models/Customer.php @@ -4,30 +4,35 @@ class Customer extends Person /* Determines if a given person_id is a customer */ - function exists($person_id) + public function exists($person_id) { $this->db->from('customers'); $this->db->join('people', 'people.person_id = customers.person_id'); $this->db->where('customers.person_id', $person_id); - $query = $this->db->get(); - return ($query->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - - function account_number_exists($account_number,$person_id='') + + /* + Checks if account number exists + */ + public function account_number_exists($account_number, $person_id = '') { $this->db->from('customers'); $this->db->where('account_number', $account_number); - if (!empty($person_id)) + + if(!empty($person_id)) { $this->db->where('person_id !=', $person_id); } - $query=$this->db->get(); - return ($query->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - - function get_total_rows() + + /* + Gets total of rows + */ + public function get_total_rows() { $this->db->from('customers'); $this->db->where('deleted', 0); @@ -38,13 +43,14 @@ class Customer extends Person /* Returns all the customers */ - function get_all($rows = 0, $limit_from = 0) - { + public function get_all($rows = 0, $limit_from = 0) + { $this->db->from('customers'); $this->db->join('people', 'customers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->order_by("last_name", "asc"); - if ($rows > 0) + $this->db->order_by('last_name', 'asc'); + + if($rows > 0) { $this->db->limit($rows, $limit_from); } @@ -55,7 +61,7 @@ class Customer extends Person /* Gets information about a particular customer */ - function get_info($customer_id) + public function get_info($customer_id) { $this->db->from('customers'); $this->db->join('people', 'people.person_id = customers.person_id'); @@ -69,15 +75,13 @@ class Customer extends Person else { //Get empty base parent object, as $customer_id is NOT a customer - $person_obj=parent::get_info(-1); + $person_obj = parent::get_info(-1); //Get all the fields from customer table - $fields = $this->db->list_fields('customers'); - //append those fields to base parent object, we we have a complete empty object - foreach ($fields as $field) + foreach($this->db->list_fields('customers') as $field) { - $person_obj->$field=''; + $person_obj->$field = ''; } return $person_obj; @@ -87,9 +91,9 @@ class Customer extends Person /* Gets total about a particular customer */ - function get_totals($customer_id) + public function get_totals($customer_id) { - $this->db->select('sum(payment_amount) as total', false); + $this->db->select('SUM(payment_amount) AS total'); $this->db->from('sales'); $this->db->join('sales_payments', 'sales.sale_id = sales_payments.sale_id'); $this->db->where('sales.customer_id', $customer_id); @@ -100,12 +104,12 @@ class Customer extends Person /* Gets information about multiple customers */ - function get_multiple_info($customer_ids) + public function get_multiple_info($customer_ids) { $this->db->from('customers'); $this->db->join('people', 'people.person_id = customers.person_id'); $this->db->where_in('customers.person_id', $customer_ids); - $this->db->order_by("last_name", "asc"); + $this->db->order_by('last_name', 'asc'); return $this->db->get(); } @@ -113,18 +117,19 @@ class Customer extends Person /* Inserts or updates a customer */ - function save_customer(&$person_data, &$customer_data, $customer_id=false) + public function save_customer(&$person_data, &$customer_data, $customer_id = FALSE) { - $success=false; + $success = FALSE; + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); if(parent::save($person_data, $customer_id)) { - if (!$customer_id or !$this->exists($customer_id)) + if(!$customer_id || !$this->exists($customer_id)) { $customer_data['person_id'] = $person_data['person_id']; - $success = $this->db->insert('customers', $customer_data); + $success = $this->db->insert('customers', $customer_data); } else { @@ -135,13 +140,15 @@ class Customer extends Person $this->db->trans_complete(); + $success &= $this->db->trans_status(); + return $success; } /* Deletes one customer */ - function delete($customer_id) + public function delete($customer_id) { $this->db->where('person_id', $customer_id); @@ -151,7 +158,7 @@ class Customer extends Person /* Deletes a list of customers */ - function delete_list($customer_ids) + public function delete_list($customer_ids) { $this->db->where_in('person_id', $customer_ids); @@ -161,99 +168,105 @@ class Customer extends Person /* Get search suggestions to find customers */ - function get_search_suggestions($search, $unique=TRUE, $limit=25) + public function get_search_suggestions($search, $unique = TRUE, $limit = 25) { $suggestions = array(); $this->db->from('customers'); - $this->db->join('people', 'customers.person_id = people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and - deleted = 0"); - $this->db->order_by("last_name", "asc"); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) + $this->db->join('people', 'customers.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); + $this->db->order_by('last_name', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->first_name.' '.$row->last_name); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->first_name.' '.$row->last_name); } - if (!$unique) + if(!$unique) { $this->db->from('customers'); - $this->db->join('people', 'customers.person_id=people.person_id'); + $this->db->join('people', 'customers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->like("email", $search); - $this->db->order_by("email", "asc"); - $by_email = $this->db->get(); - foreach($by_email->result() as $row) + $this->db->like('email', $search); + $this->db->order_by('email', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->email); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->email); } $this->db->from('customers'); $this->db->join('people', 'customers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->like("phone_number", $search); - $this->db->order_by("phone_number", "asc"); - $by_phone = $this->db->get(); - foreach($by_phone->result() as $row) + $this->db->like('phone_number', $search); + $this->db->order_by('phone_number', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->phone_number); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->phone_number); } $this->db->from('customers'); $this->db->join('people', 'customers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->like("account_number", $search); - $this->db->order_by("account_number", "asc"); - $by_account_number = $this->db->get(); - foreach($by_account_number->result() as $row) + $this->db->like('account_number', $search); + $this->db->order_by('account_number', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]= array('value' => $row->person_id, 'label' => $row->account_number); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->account_number); } } //only return $limit suggestions if(count($suggestions > $limit)) { - $suggestions = array_slice($suggestions, 0,$limit); + $suggestions = array_slice($suggestions, 0, $limit); } return $suggestions; } - function get_found_rows($search) + /* + Gets rows + */ + public function get_found_rows($search) { $this->db->from('customers'); $this->db->join('people', 'customers.person_id = people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - email LIKE '%".$this->db->escape_like_str($search)."%' or - phone_number LIKE '%".$this->db->escape_like_str($search)."%' or - account_number LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and - deleted = 0"); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('email', $search); + $this->db->or_like('phone_number', $search); + $this->db->or_like('account_number', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); return $this->db->get()->num_rows(); } /* - Perform a search on customers + Performs a search on customers */ - function search($search, $rows = 0, $limit_from = 0) + public function search($search, $rows = 0, $limit_from = 0, $sort = 'last_name', $order = 'asc') { $this->db->from('customers'); - $this->db->join('people', 'customers.person_id = people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - email LIKE '%".$this->db->escape_like_str($search)."%' or - phone_number LIKE '%".$this->db->escape_like_str($search)."%' or - account_number LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and - deleted = 0"); - $this->db->order_by("last_name", "asc"); - if ($rows > 0) + $this->db->join('people', 'customers.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('email', $search); + $this->db->or_like('phone_number', $search); + $this->db->or_like('account_number', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); + $this->db->order_by($sort, $order); + + if($rows > 0) { $this->db->limit($rows, $limit_from); } diff --git a/application/models/Employee.php b/application/models/Employee.php index fcd914452..defb30e8d 100644 --- a/application/models/Employee.php +++ b/application/models/Employee.php @@ -4,293 +4,317 @@ class Employee extends Person /* Determines if a given person_id is an employee */ - function exists($person_id) + public function exists($person_id) { $this->db->from('employees'); $this->db->join('people', 'people.person_id = employees.person_id'); - $this->db->where('employees.person_id',$person_id); - $query = $this->db->get(); - - return ($query->num_rows()==1); + $this->db->where('employees.person_id', $person_id); + + return ($this->db->get()->num_rows() == 1); } - - function get_total_rows() + + /* + Gets total of rows + */ + public function get_total_rows() { $this->db->from('employees'); - $this->db->where('deleted',0); + $this->db->where('deleted', 0); + return $this->db->count_all_results(); } + /* Returns all the employees */ - function get_all($limit=10000, $offset=0) + public function get_all($limit = 10000, $offset = 0) { $this->db->from('employees'); - $this->db->where('deleted',0); - $this->db->join('people','employees.person_id=people.person_id'); - $this->db->order_by("last_name", "asc"); + $this->db->where('deleted', 0); + $this->db->join('people', 'employees.person_id = people.person_id'); + $this->db->order_by('last_name', 'asc'); $this->db->limit($limit); $this->db->offset($offset); + return $this->db->get(); } /* Gets information about a particular employee */ - function get_info($employee_id) + public function get_info($employee_id) { $this->db->from('employees'); $this->db->join('people', 'people.person_id = employees.person_id'); - $this->db->where('employees.person_id',$employee_id); + $this->db->where('employees.person_id', $employee_id); $query = $this->db->get(); - - if($query->num_rows()==1) + + if($query->num_rows() == 1) { return $query->row(); } else { //Get empty base parent object, as $employee_id is NOT an employee - $person_obj=parent::get_info(-1); - + $person_obj = parent::get_info(-1); + //Get all the fields from employee table - $fields = $this->db->list_fields('employees'); - //append those fields to base parent object, we we have a complete empty object - foreach ($fields as $field) + foreach($this->db->list_fields('employees') as $field) { - $person_obj->$field=''; + $person_obj->$field = ''; } - + return $person_obj; } } - + /* Gets information about multiple employees */ - function get_multiple_info($employee_ids) + public function get_multiple_info($employee_ids) { $this->db->from('employees'); $this->db->join('people', 'people.person_id = employees.person_id'); - $this->db->where_in('employees.person_id',$employee_ids); - $this->db->order_by("last_name", "asc"); + $this->db->where_in('employees.person_id', $employee_ids); + $this->db->order_by('last_name', 'asc'); + return $this->db->get(); } - + /* Inserts or updates an employee */ - function save_employee(&$person_data, &$employee_data,&$grants_data,$employee_id=false) + public function save_employee(&$person_data, &$employee_data, &$grants_data, $employee_id = FALSE) { - $success=false; - + $success = FALSE; + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); - - if(parent::save($person_data,$employee_id)) + + if(parent::save($person_data, $employee_id)) { - if (!$employee_id or !$this->exists($employee_id)) + if(!$employee_id || !$this->exists($employee_id)) { $employee_data['person_id'] = $employee_id = $person_data['person_id']; - $success = $this->db->insert('employees',$employee_data); + $success = $this->db->insert('employees', $employee_data); } else { $this->db->where('person_id', $employee_id); - $success = $this->db->update('employees',$employee_data); + $success = $this->db->update('employees', $employee_data); } - + //We have either inserted or updated a new employee, now lets set permissions. if($success) { //First lets clear out any grants the employee currently has. - $success=$this->db->delete('grants', array('person_id' => $employee_id)); + $success = $this->db->delete('grants', array('person_id' => $employee_id)); //Now insert the new grants if($success) { foreach($grants_data as $permission_id) { - $success = $this->db->insert('grants', - array( - 'permission_id'=>$permission_id, - 'person_id'=>$employee_id)); + $success = $this->db->insert('grants', array('permission_id' => $permission_id, 'person_id' => $employee_id)); } } } - } - - $this->db->trans_complete(); + + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); + return $success; } - + /* Deletes one employee */ - function delete($employee_id) + public function delete($employee_id) { - $success=false; - - //Don't let employee delete their self - if($employee_id==$this->get_logged_in_employee_info()->person_id) - return false; - + $success = FALSE; + + //Don't let employees delete theirself + if($employee_id == $this->get_logged_in_employee_info()->person_id) + { + return FALSE; + } + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); - + //Delete permissions if($this->db->delete('grants', array('person_id' => $employee_id))) { $this->db->where('person_id', $employee_id); $success = $this->db->update('employees', array('deleted' => 1)); } - $this->db->trans_complete(); + + $this->db->trans_complete(); + return $success; } - + /* Deletes a list of employees */ - function delete_list($employee_ids) + public function delete_list($employee_ids) { - $success=false; - - //Don't let employee delete their self - if(in_array($this->get_logged_in_employee_info()->person_id,$employee_ids)) - return false; + $success = FALSE; + + //Don't let employees delete theirself + if(in_array($this->get_logged_in_employee_info()->person_id, $employee_ids)) + { + return FALSE; + } //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); - $this->db->where_in('person_id',$employee_ids); + $this->db->where_in('person_id', $employee_ids); //Delete permissions - if ($this->db->delete('grants')) + if($this->db->delete('grants')) { //delete from employee table - $this->db->where_in('person_id',$employee_ids); + $this->db->where_in('person_id', $employee_ids); $success = $this->db->update('employees', array('deleted' => 1)); } - $this->db->trans_complete(); + + $this->db->trans_complete(); + return $success; } - + /* Get search suggestions to find employees */ - function get_search_suggestions($search,$limit=5) + public function get_search_suggestions($search, $limit = 5) { $suggestions = array(); - - $this->db->from('employees'); - $this->db->join('people','employees.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); - $this->db->order_by("last_name", "asc"); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) - { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->first_name.' '.$row->last_name); - } - - $this->db->from('employees'); - $this->db->join('people','employees.person_id=people.person_id'); - $this->db->where('deleted', 0); - $this->db->like("email",$search); - $this->db->order_by("email", "asc"); - $by_email = $this->db->get(); - foreach($by_email->result() as $row) - { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->email); - } - - $this->db->from('employees'); - $this->db->join('people','employees.person_id=people.person_id'); - $this->db->where('deleted', 0); - $this->db->like("username",$search); - $this->db->order_by("username", "asc"); - $by_username = $this->db->get(); - foreach($by_username->result() as $row) - { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->username); - } - $this->db->from('employees'); - $this->db->join('people','employees.person_id=people.person_id'); + $this->db->join('people', 'employees.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); $this->db->where('deleted', 0); - $this->db->like("phone_number",$search); - $this->db->order_by("phone_number", "asc"); - $by_phone = $this->db->get(); - foreach($by_phone->result() as $row) + $this->db->order_by('last_name', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->phone_number); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->first_name.' '.$row->last_name); } - - + + $this->db->from('employees'); + $this->db->join('people', 'employees.person_id = people.person_id'); + $this->db->where('deleted', 0); + $this->db->like('email', $search); + $this->db->order_by('email', 'asc'); + foreach($this->db->get()->result() as $row) + { + $suggestions[] = array('value' => $row->person_id, 'label' => $row->email); + } + + $this->db->from('employees'); + $this->db->join('people', 'employees.person_id = people.person_id'); + $this->db->where('deleted', 0); + $this->db->like('username', $search); + $this->db->order_by('username', 'asc'); + foreach($this->db->get()->result() as $row) + { + $suggestions[] = array('value' => $row->person_id, 'label' => $row->username); + } + + $this->db->from('employees'); + $this->db->join('people', 'employees.person_id = people.person_id'); + $this->db->where('deleted', 0); + $this->db->like('phone_number', $search); + $this->db->order_by('phone_number', 'asc'); + foreach($this->db->get()->result() as $row) + { + $suggestions[] = array('value' => $row->person_id, 'label' => $row->phone_number); + } + //only return $limit suggestions if(count($suggestions > $limit)) { - $suggestions = array_slice($suggestions, 0,$limit); + $suggestions = array_slice($suggestions, 0, $limit); } + return $suggestions; - } - - function get_found_rows($search) + + /* + Gets rows + */ + public function get_found_rows($search) { $this->db->from('employees'); - $this->db->join('people','employees.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - email LIKE '%".$this->db->escape_like_str($search)."%' or - phone_number LIKE '%".$this->db->escape_like_str($search)."%' or - username LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); + $this->db->join('people', 'employees.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('email', $search); + $this->db->or_like('phone_number', $search); + $this->db->or_like('username', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); + return $this->db->get()->num_rows(); } - + /* - Preform a search on employees + Performs a search on employees */ - function search($search, $rows = 0, $limit_from = 0) + public function search($search, $rows = 0, $limit_from = 0, $sort = 'last_name', $order = 'asc') { $this->db->from('employees'); - $this->db->join('people','employees.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - email LIKE '%".$this->db->escape_like_str($search)."%' or - phone_number LIKE '%".$this->db->escape_like_str($search)."%' or - username LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); - $this->db->order_by("last_name", "asc"); - if ($rows > 0) { + $this->db->join('people', 'employees.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('email', $search); + $this->db->or_like('phone_number', $search); + $this->db->or_like('username', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); + $this->db->order_by($sort, $order); + + if($rows > 0) + { $this->db->limit($rows, $limit_from); } + return $this->db->get(); } - + /* Attempts to login employee and set session. Returns boolean based on outcome. */ - function login($username, $password) + public function login($username, $password) { - $query = $this->db->get_where('employees', array('username' => $username,'password'=>md5($password), 'deleted'=>0), 1); - if ($query->num_rows() ==1) + $query = $this->db->get_where('employees', array('username' => $username, 'password' => md5($password), 'deleted' => 0), 1); + + if($query->num_rows() == 1) { - $row=$query->row(); + $row = $query->row(); $this->session->set_userdata('person_id', $row->person_id); - return true; + + return TRUE; } - return false; + + return FALSE; } - + /* Logs out a user by destorying all session data and redirect to login */ - function logout() + public function logout() { $this->session->sess_destroy(); redirect('login'); @@ -299,70 +323,78 @@ class Employee extends Person /* Determins if a employee is logged in */ - function is_logged_in() + public function is_logged_in() { - return $this->session->userdata('person_id')!=false; + return ($this->session->userdata('person_id') != FALSE); } - + /* Gets information about the currently logged in employee. */ - function get_logged_in_employee_info() + public function get_logged_in_employee_info() { if($this->is_logged_in()) { return $this->get_info($this->session->userdata('person_id')); } - - return false; + + return FALSE; } - + /* - * Determines whether the employee has access to at least one submodule + Determines whether the employee has access to at least one submodule */ - function has_module_grant($permission_id,$person_id) + public function has_module_grant($permission_id, $person_id) { $this->db->from('grants'); $this->db->like('permission_id', $permission_id, 'after'); - $this->db->where('person_id',$person_id); - $result = $this->db->get(); - $result_count = $result->num_rows(); - if ($result_count != 1) + $this->db->where('person_id', $person_id); + $result_count = $this->db->get()->num_rows(); + + if($result_count != 1) { - return $result_count != 0; + return ($result_count != 0); } + return $this->has_subpermissions($permission_id); } - - function has_subpermissions($permission_id) + + /* + Checks permissions + */ + public function has_subpermissions($permission_id) { $this->db->from('permissions'); $this->db->like('permission_id', $permission_id.'_', 'after'); - $result = $this->db->get(); - return $result->num_rows() == 0; + + return ($this->db->get()->num_rows() == 0); } - + /* Determines whether the employee specified employee has access the specific module. */ - function has_grant($permission_id,$person_id) + public function has_grant($permission_id, $person_id) { //if no module_id is null, allow access - if($permission_id==null) + if($permission_id == null) { - return true; + return TRUE; } - - $query = $this->db->get_where('grants', array('person_id'=>$person_id,'permission_id'=>$permission_id), 1); + + $query = $this->db->get_where('grants', array('person_id' => $person_id, 'permission_id' => $permission_id), 1); + return ($query->num_rows() == 1); } - - function get_employee_grants($person_id) + + /* + Gets employee permission grants + */ + public function get_employee_grants($person_id) { $this->db->from('grants'); - $this->db->where('person_id',$person_id); + $this->db->where('person_id', $person_id); + return $this->db->get()->result_array(); } - } ?> diff --git a/application/models/Giftcard.php b/application/models/Giftcard.php index 2706bf41a..5b3b101ec 100644 --- a/application/models/Giftcard.php +++ b/application/models/Giftcard.php @@ -4,47 +4,29 @@ class Giftcard extends CI_Model /* Determines if a given giftcard_id is an giftcard */ - function exists($giftcard_id) + public function exists($giftcard_id) { $this->db->from('giftcards'); $this->db->where('giftcard_id', $giftcard_id); $this->db->where('deleted', 0); - return ($this->db->get()->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - function get_max_number() + /* + Gets max gift card number + */ + public function get_max_number() { $this->db->select_max('giftcard_number'); - $query = $this->db->get('giftcards'); - return $query->row(); + return $this->db->get('giftcards')->row(); } - function get_total_rows() - { - return $this->db->count_all('giftcards'); - } - /* - Returns all the giftcards + Gets total of rows */ - function get_all($rows=0, $limit_from=0) - { - $this->db->from('giftcards'); - $this->db->join('people', 'people.person_id=giftcards.person_id', 'left'); - $this->db->where('deleted', 0); - $this->db->order_by('giftcard_number'); - - if ($rows > 0) - { - $this->db->limit($rows, $limit_from); - } - - return $this->db->get(); - } - - function count_all() + public function get_total_rows() { $this->db->from('giftcards'); $this->db->where('deleted', 0); @@ -55,16 +37,16 @@ class Giftcard extends CI_Model /* Gets information about a particular giftcard */ - function get_info($giftcard_id) + public function get_info($giftcard_id) { $this->db->from('giftcards'); - $this->db->join('people', 'people.person_id=giftcards.person_id', 'left'); + $this->db->join('people', 'people.person_id = giftcards.person_id', 'left'); $this->db->where('giftcard_id', $giftcard_id); $this->db->where('deleted', 0); - + $query = $this->db->get(); - if($query->num_rows()==1) + if($query->num_rows() == 1) { return $query->row(); } @@ -74,11 +56,9 @@ class Giftcard extends CI_Model $giftcard_obj = new stdClass(); //Get all the fields from giftcards table - $fields = $this->db->list_fields('giftcards'); - - foreach ($fields as $field) + foreach($this->db->list_fields('giftcards') as $field) { - $giftcard_obj->$field=''; + $giftcard_obj->$field = ''; } return $giftcard_obj; @@ -86,9 +66,9 @@ class Giftcard extends CI_Model } /* - Get an giftcard id given an giftcard number + Gets an giftcard id given an giftcard number */ - function get_giftcard_id($giftcard_number) + public function get_giftcard_id($giftcard_number) { $this->db->from('giftcards'); $this->db->where('giftcard_number', $giftcard_number); @@ -96,18 +76,18 @@ class Giftcard extends CI_Model $query = $this->db->get(); - if($query->num_rows()==1) + if($query->num_rows() == 1) { return $query->row()->giftcard_id; } - return false; + return FALSE; } /* Gets information about multiple giftcards */ - function get_multiple_info($giftcard_ids) + public function get_multiple_info($giftcard_ids) { $this->db->from('giftcards'); $this->db->where_in('giftcard_id', $giftcard_ids); @@ -120,29 +100,29 @@ class Giftcard extends CI_Model /* Inserts or updates a giftcard */ - function save(&$giftcard_data, $giftcard_id=false) + public function save(&$giftcard_data, $giftcard_id = -1) { - if (!$giftcard_id or !$this->exists($giftcard_id)) + if($giftcard_id == -1 || !$this->exists($giftcard_id)) { if($this->db->insert('giftcards', $giftcard_data)) { $giftcard_data['giftcard_id'] = $this->db->insert_id(); - return true; + return TRUE; } - return false; + return FALSE; } $this->db->where('giftcard_id', $giftcard_id); - return $this->db->update('giftcards',$giftcard_data); + return $this->db->update('giftcards', $giftcard_data); } /* Updates multiple giftcards at once */ - function update_multiple($giftcard_data, $giftcard_ids) + public function update_multiple($giftcard_data, $giftcard_ids) { $this->db->where_in('giftcard_id', $giftcard_ids); @@ -152,7 +132,7 @@ class Giftcard extends CI_Model /* Deletes one giftcard */ - function delete($giftcard_id) + public function delete($giftcard_id) { $this->db->where('giftcard_id', $giftcard_id); @@ -162,7 +142,7 @@ class Giftcard extends CI_Model /* Deletes a list of giftcards */ - function delete_list($giftcard_ids) + public function delete_list($giftcard_ids) { $this->db->where_in('giftcard_id', $giftcard_ids); @@ -172,7 +152,7 @@ class Giftcard extends CI_Model /* Get search suggestions to find giftcards */ - function get_search_suggestions($search, $limit=25) + public function get_search_suggestions($search, $limit = 25) { $suggestions = array(); @@ -180,25 +160,23 @@ class Giftcard extends CI_Model $this->db->like('giftcard_number', $search); $this->db->where('deleted', 0); $this->db->order_by('giftcard_number', 'asc'); - $by_number = $this->db->get(); - - foreach($by_number->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[]=array('label' => $row->giftcard_number); } $this->db->from('customers'); - $this->db->join('people', 'customers.person_id=people.person_id', 'left'); - $this->db->like('first_name', $this->db->escape_like_str($search)); - $this->db->or_like('last_name', $this->db->escape_like_str($search)); - $this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search)); + $this->db->join('people', 'customers.person_id = people.person_id', 'left'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); $this->db->where('deleted', 0); $this->db->order_by('last_name', 'asc'); - $by_name = $this->db->get(); - - foreach($by_name->result() as $row) + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('label' => $row->first_name.' '.$row->last_name); + $suggestions[] = array('label' => $row->first_name.' '.$row->last_name); } //only return $limit suggestions @@ -211,23 +189,23 @@ class Giftcard extends CI_Model } /* - Preform a search on giftcards + Performs a search on giftcards */ - function search($search, $rows = 0, $limit_from = 0) + public function search($search, $rows = 0, $limit_from = 0, $sort = 'giftcard_number', $order = 'asc') { $this->db->from('giftcards'); - $this->db->join('people', 'giftcards.person_id=people.person_id', 'left'); - $this->db->like('first_name', $this->db->escape_like_str($search)); - $this->db->or_group_start(); - $this->db->or_like('last_name', $this->db->escape_like_str($search)); - $this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search)); - $this->db->or_like('giftcard_number', $this->db->escape_like_str($search)); - $this->db->or_like('giftcards.person_id', $this->db->escape_like_str($search)); + $this->db->join('people', 'giftcards.person_id = people.person_id', 'left'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->or_like('giftcard_number', $search); + $this->db->or_like('giftcards.person_id', $search); $this->db->group_end(); $this->db->where('giftcards.deleted', 0); - $this->db->order_by('giftcard_number', 'asc'); + $this->db->order_by($sort, $order); - if ($rows > 0) + if($rows > 0) { $this->db->limit($rows, $limit_from); } @@ -235,24 +213,31 @@ class Giftcard extends CI_Model return $this->db->get(); } - function get_found_rows($search) + /* + Gets gift cards + */ + public function get_found_rows($search) { $this->db->from('giftcards'); - $this->db->join('people', 'giftcards.person_id=people.person_id', 'left'); - $this->db->like('first_name', $this->db->escape_like_str($search)); - $this->db->or_group_start(); - $this->db->or_like('last_name', $this->db->escape_like_str($search)); - $this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search)); - $this->db->or_like('giftcard_number', $this->db->escape_like_str($search)); - $this->db->or_like('giftcards.person_id', $this->db->escape_like_str($search)); + $this->db->join('people', 'giftcards.person_id = people.person_id', 'left'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->or_like('giftcard_number', $search); + $this->db->or_like('giftcards.person_id', $search); $this->db->group_end(); $this->db->where('giftcards.deleted', 0); + return $this->db->get()->num_rows(); } - public function get_giftcard_value( $giftcard_number ) + /* + Gets gift card value + */ + public function get_giftcard_value($giftcard_number) { - if ( !$this->exists( $this->get_giftcard_id($giftcard_number) ) ) + if( !$this->exists($this->get_giftcard_id($giftcard_number)) ) { return 0; } @@ -263,7 +248,10 @@ class Giftcard extends CI_Model return $this->db->get()->row()->value; } - function update_giftcard_value( $giftcard_number, $value ) + /* + Updates gift card value + */ + public function update_giftcard_value($giftcard_number, $value) { $this->db->where('giftcard_number', $giftcard_number); $this->db->update('giftcards', array('value' => $value)); diff --git a/application/models/Inventory.php b/application/models/Inventory.php index d6e8b5f74..d1f18920c 100644 --- a/application/models/Inventory.php +++ b/application/models/Inventory.php @@ -1,22 +1,22 @@ db->insert('inventory',$inventory_data); + return $this->db->insert('inventory', $inventory_data); } - function get_inventory_data_for_item($item_id, $location_id=false) + public function get_inventory_data_for_item($item_id, $location_id = FALSE) { $this->db->from('inventory'); - $this->db->where('trans_items',$item_id); - if($location_id != false) + $this->db->where('trans_items', $item_id); + if($location_id != FALSE) { - $this->db->where('trans_location',$location_id); + $this->db->where('trans_location', $location_id); } - $this->db->order_by("trans_date", "desc"); + $this->db->order_by('trans_date', 'desc'); + return $this->db->get(); } } - ?> \ No newline at end of file diff --git a/application/models/Item.php b/application/models/Item.php index 7adaa036b..eca147fa5 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -8,24 +8,28 @@ class Item extends CI_Model { $this->db->from('items'); $this->db->where('item_id', $item_id); - $query = $this->db->get(); - return ($query->num_rows() == 1); + return ($this->db->get()->num_rows() == 1); } - - public function item_number_exists($item_number, $item_id='') + + /* + Determines if a given item_number exists + */ + public function item_number_exists($item_number, $item_id = '') { $this->db->from('items'); $this->db->where('item_number', $item_number); - if (!empty($item_id)) + if(!empty($item_id)) { $this->db->where('item_id !=', $item_id); } - $query=$this->db->get(); - return ($query->num_rows() == 1); + return ($this->db->get()->num_rows() == 1); } - + + /* + Gets total of rows + */ public function get_total_rows() { $this->db->from('items'); @@ -35,7 +39,7 @@ class Item extends CI_Model } /* - Get number of rows + Get number of rows */ public function get_found_rows($search, $filters) { @@ -43,75 +47,79 @@ class Item extends CI_Model } /* - Perform a search on items + Perform a search on items */ - public function search($search, $filters, $rows=0, $limit_from=0) + public function search($search, $filters, $rows = 0, $limit_from = 0, $sort = 'items.name', $order = 'asc') { $this->db->from('items'); $this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left'); $this->db->join('inventory', 'inventory.trans_items = items.item_id'); - if ($filters['stock_location_id'] > -1) + if($filters['stock_location_id'] > -1) { $this->db->join('item_quantities', 'item_quantities.item_id = items.item_id'); $this->db->where('location_id', $filters['stock_location_id']); } - if (empty($search)) + if(empty($search)) { $this->db->where('DATE_FORMAT(trans_date, "%Y-%m-%d") BETWEEN ' . $this->db->escape($filters['start_date']) . ' AND ' . $this->db->escape($filters['end_date'])); } else { - if ($filters['search_custom'] == FALSE) + if($filters['search_custom'] == FALSE) { - $this->db->where("(name LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "item_number LIKE '" . $this->db->escape_like_str($search) . "%' OR " . - $this->db->dbprefix('items').".item_id LIKE '" . $this->db->escape_like_str($search) . "%' OR " . - "company_name LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "category LIKE '%" . $this->db->escape_like_str($search) . "%')"); + $this->db->group_start(); + $this->db->like('name', $search); + $this->db->or_like('item_number', $search); + $this->db->or_like('items.item_id', $search); + $this->db->or_like('company_name', $search); + $this->db->or_like('category', $search); + $this->db->group_end(); } else { - $this->db->where("(custom1 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom2 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom3 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom4 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom5 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom6 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom7 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom8 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom9 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " . - "custom10 LIKE '%" . $this->db->escape_like_str($search) . "%')"); + $this->db->group_start(); + $this->db->like('custom1', $search); + $this->db->or_like('custom2', $search); + $this->db->or_like('custom3', $search); + $this->db->or_like('custom4', $search); + $this->db->or_like('custom5', $search); + $this->db->or_like('custom6', $search); + $this->db->or_like('custom7', $search); + $this->db->or_like('custom8', $search); + $this->db->or_like('custom9', $search); + $this->db->or_like('custom10', $search); + $this->db->group_end(); } } $this->db->where('items.deleted', $filters['is_deleted']); - if ($filters['empty_upc'] != FALSE) + if($filters['empty_upc'] != FALSE) { - $this->db->where('item_number', null); + $this->db->where('item_number', NULL); } - if ($filters['low_inventory'] != FALSE) + if($filters['low_inventory'] != FALSE) { $this->db->where('quantity <=', 'reorder_level'); } - if ($filters['is_serialized'] != FALSE) + if($filters['is_serialized'] != FALSE) { $this->db->where('is_serialized', 1); } - if ($filters['no_description'] != FALSE) + if($filters['no_description'] != FALSE) { $this->db->where('items.description', ''); } - // avoid duplicate entry with same name because of inventory reporting multiple changes on the same item in the same date range + // avoid duplicated entries with same name because of inventory reporting multiple changes on the same item in the same date range $this->db->group_by('items.item_id'); // order by name of item - $this->db->order_by('items.name', 'asc'); + $this->db->order_by($sort, $order); - if ($rows > 0) + if($rows > 0) { $this->db->limit($rows, $limit_from); } @@ -120,32 +128,32 @@ class Item extends CI_Model } /* - Returns all the items + Returns all the items */ - public function get_all($stock_location_id=-1, $rows=0, $limit_from=0) + public function get_all($stock_location_id = -1, $rows = 0, $limit_from = 0) { $this->db->from('items'); $this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left'); - if ($stock_location_id > -1) + if($stock_location_id > -1) { $this->db->join('item_quantities', 'item_quantities.item_id=items.item_id'); $this->db->where('location_id', $stock_location_id); } $this->db->where('items.deleted', 0); - + // order by name of item $this->db->order_by('items.name', 'asc'); - if ($rows > 0) + if($rows > 0) { $this->db->limit($rows, $limit_from); } return $this->db->get(); } - + /* Gets information about a particular item */ @@ -156,7 +164,7 @@ class Item extends CI_Model $this->db->from('items'); $this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left'); $this->db->where('item_id', $item_id); - + $query = $this->db->get(); if($query->num_rows() == 1) @@ -169,11 +177,9 @@ class Item extends CI_Model $item_obj = new stdClass(); //Get all the fields from items table - $fields = $this->db->list_fields('items'); - - foreach($fields as $field) + foreach($this->db->list_fields('items') as $field) { - $item_obj->$field=''; + $item_obj->$field = ''; } return $item_obj; @@ -192,7 +198,7 @@ class Item extends CI_Model $query = $this->db->get(); - if($query->num_rows()==1) + if($query->num_rows() == 1) { return $query->row()->item_id; } @@ -203,12 +209,13 @@ class Item extends CI_Model /* Gets information about multiple items */ - public function get_multiple_info($item_ids) + public function get_multiple_info($item_ids, $location_id) { $this->db->from('items'); $this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left'); - $this->db->where_in('item_id', $item_ids); - $this->db->order_by('item_id', 'asc'); + $this->db->join('item_quantities', 'item_quantities.item_id = items.item_id', 'left'); + $this->db->where('location_id', $location_id); + $this->db->where_in('items.item_id', $item_ids); return $this->db->get(); } @@ -216,15 +223,17 @@ class Item extends CI_Model /* Inserts or updates a item */ - public function save(&$item_data, $item_id=FALSE) + public function save(&$item_data, $item_id = FALSE) { - if(!$item_id or !$this->exists($item_id)) + if(!$item_id || !$this->exists($item_id)) { if($this->db->insert('items', $item_data)) { $item_data['item_id'] = $this->db->insert_id(); + return TRUE; } + return FALSE; } @@ -238,7 +247,7 @@ class Item extends CI_Model */ public function update_multiple($item_data, $item_ids) { - $this->db->where_in('item_id', $item_ids); + $this->db->where_in('item_id', explode(':', $item_ids)); return $this->db->update('items', $item_data); } @@ -248,10 +257,19 @@ class Item extends CI_Model */ public function delete($item_id) { + //Run these queries as a transaction, we want to make sure we do all or nothing + $this->db->trans_start(); + // set to 0 quantities $this->Item_quantity->reset_quantity($item_id); $this->db->where('item_id', $item_id); - return $this->db->update('items', array('deleted'=>1)); + $success = $this->db->update('items', array('deleted'=>1)); + + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); + + return $success; } /* @@ -269,13 +287,22 @@ class Item extends CI_Model */ public function delete_list($item_ids) { + //Run these queries as a transaction, we want to make sure we do all or nothing + $this->db->trans_start(); + // set to 0 quantities $this->Item_quantity->reset_quantity_list($item_ids); $this->db->where_in('item_id', $item_ids); - return $this->db->update('items', array('deleted'=>1)); + $success = $this->db->update('items', array('deleted'=>1)); + + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); + + return $success; } - public function get_search_suggestions($search, $filters = array('is_deleted'=>FALSE, 'search_custom'=>FALSE), $unique = FALSE, $limit=25) + public function get_search_suggestions($search, $filters = array('is_deleted'=>FALSE, 'search_custom'=>FALSE), $unique = FALSE, $limit = 25) { $suggestions = array(); @@ -284,8 +311,7 @@ class Item extends CI_Model $this->db->where('deleted', $filters['is_deleted']); $this->db->like('name', $search); $this->db->order_by('name', 'asc'); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('value' => $row->item_id, 'label' => $row->name); } @@ -295,35 +321,34 @@ class Item extends CI_Model $this->db->where('deleted', $filters['is_deleted']); $this->db->like('item_number', $search); $this->db->order_by('item_number', 'asc'); - $by_item_number = $this->db->get(); - foreach($by_item_number->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('value' => $row->item_id, 'label' => $row->item_number); } - if (!$unique) + if(!$unique) { + //Search by category $this->db->select('category'); $this->db->from('items'); $this->db->where('deleted', $filters['is_deleted']); $this->db->distinct(); $this->db->like('category', $search); $this->db->order_by('category', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('label' => $row->category); } + //Search by supplier $this->db->select('company_name'); $this->db->from('suppliers'); $this->db->like('company_name', $search); - // restrict to non deleted companies only if is_deleted if false + // restrict to non deleted companies only if is_deleted is FALSE $this->db->where('deleted', $filters['is_deleted']); $this->db->distinct(); $this->db->order_by('company_name', 'asc'); - $by_company_name = $this->db->get(); - foreach($by_company_name->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('label' => $row->company_name); } @@ -334,34 +359,33 @@ class Item extends CI_Model $this->db->where('deleted', $filters['is_deleted']); $this->db->like('description', $search); $this->db->order_by('description', 'asc'); - $by_description = $this->db->get(); - foreach($by_description->result() as $row) + foreach($this->db->get()->result() as $row) { $entry = array('value' => $row->item_id, 'label' => $row->name); - if (!array_walk($suggestions, function($value, $label) use ($entry) { - return $entry['label'] != $label; - })) { + if(!array_walk($suggestions, function($value, $label) use ($entry) { return $entry['label'] != $label; } )) + { $suggestions[] = $entry; } } //Search by custom fields - if ($filters['search_custom'] != FALSE) + if($filters['search_custom'] != FALSE) { $this->db->from('items'); + $this->db->group_start(); + $this->db->like('custom1', $search); + $this->db->or_like('custom2', $search); + $this->db->or_like('custom3', $search); + $this->db->or_like('custom4', $search); + $this->db->or_like('custom5', $search); + $this->db->or_like('custom6', $search); + $this->db->or_like('custom7', $search); + $this->db->or_like('custom8', $search); + $this->db->or_like('custom9', $search); + $this->db->or_like('custom10', $search); + $this->db->group_end(); $this->db->where('deleted', $filters['is_deleted']); - $this->db->like('custom1', $search); - $this->db->or_like('custom2', $search); - $this->db->or_like('custom3', $search); - $this->db->or_like('custom4', $search); - $this->db->or_like('custom5', $search); - $this->db->or_like('custom6', $search); - $this->db->or_like('custom7', $search); - $this->db->or_like('custom8', $search); - $this->db->or_like('custom9', $search); - $this->db->or_like('custom10', $search); - $by_description = $this->db->get(); - foreach($by_description->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('value' => $row->item_id, 'label' => $row->name); } @@ -386,8 +410,7 @@ class Item extends CI_Model $this->db->like('category', $search); $this->db->where('deleted', 0); $this->db->order_by('category', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('label' => $row->category); } @@ -404,8 +427,7 @@ class Item extends CI_Model $this->db->like('location', $search); $this->db->where('deleted', 0); $this->db->order_by('location', 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('label' => $row->location); } @@ -422,8 +444,7 @@ class Item extends CI_Model $this->db->like('custom'.$field_no, $search); $this->db->where('deleted', 0); $this->db->order_by('custom'.$field_no, 'asc'); - $by_category = $this->db->get(); - foreach($by_category->result() as $row) + foreach($this->db->get()->result() as $row) { $row_array = (array) $row; $suggestions[] = array('label' => $row_array['custom'.$field_no]); diff --git a/application/models/Item_kit.php b/application/models/Item_kit.php index bb11ad8af..8e4202565 100644 --- a/application/models/Item_kit.php +++ b/application/models/Item_kit.php @@ -4,31 +4,18 @@ class Item_kit extends CI_Model /* Determines if a given item_id is an item kit */ - function exists($item_kit_id) + public function exists($item_kit_id) { $this->db->from('item_kits'); $this->db->where('item_kit_id', $item_kit_id); - return ($this->db->get()->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } /* - Returns all the item kits + Gets total of rows */ - function get_all($rows=0, $limit_from=0) - { - $this->db->from('item_kits'); - $this->db->order_by('name', 'asc'); - - if ($rows > 0) - { - $this->db->limit($rows, $limit_from); - } - - return $this->db->get(); - } - - function get_total_rows() + public function get_total_rows() { $this->db->from('item_kits'); @@ -38,7 +25,7 @@ class Item_kit extends CI_Model /* Gets information about a particular item kit */ - function get_info($item_kit_id) + public function get_info($item_kit_id) { $this->db->from('item_kits'); $this->db->where('item_kit_id', $item_kit_id); @@ -55,9 +42,7 @@ class Item_kit extends CI_Model $item_obj = new stdClass(); //Get all the fields from items table - $fields = $this->db->list_fields('item_kits'); - - foreach ($fields as $field) + foreach($this->db->list_fields('item_kits') as $field) { $item_obj->$field = ''; } @@ -69,7 +54,7 @@ class Item_kit extends CI_Model /* Gets information about multiple item kits */ - function get_multiple_info($item_kit_ids) + public function get_multiple_info($item_kit_ids) { $this->db->from('item_kits'); $this->db->where_in('item_kit_id', $item_kit_ids); @@ -81,18 +66,18 @@ class Item_kit extends CI_Model /* Inserts or updates an item kit */ - function save(&$item_kit_data, $item_kit_id=false) + public function save(&$item_kit_data, $item_kit_id = FALSE) { - if (!$item_kit_id or !$this->exists($item_kit_id)) + if(!$item_kit_id || !$this->exists($item_kit_id)) { if($this->db->insert('item_kits', $item_kit_data)) { $item_kit_data['item_kit_id'] = $this->db->insert_id(); - return true; + return TRUE; } - return false; + return FALSE; } $this->db->where('item_kit_id', $item_kit_id); @@ -103,7 +88,7 @@ class Item_kit extends CI_Model /* Deletes one item kit */ - function delete($item_kit_id) + public function delete($item_kit_id) { return $this->db->delete('item_kits', array('item_kit_id' => $id)); } @@ -111,28 +96,26 @@ class Item_kit extends CI_Model /* Deletes a list of item kits */ - function delete_list($item_kit_ids) + public function delete_list($item_kit_ids) { $this->db->where_in('item_kit_id', $item_kit_ids); return $this->db->delete('item_kits'); } - function get_search_suggestions($search, $limit=25) + public function get_search_suggestions($search, $limit = 25) { $suggestions = array(); $this->db->from('item_kits'); //KIT # - if (stripos($search, 'KIT ') !== false) + if(stripos($search, 'KIT ') !== FALSE) { $this->db->like('item_kit_id', str_ireplace('KIT ', '', $search)); - $this->db->order_by('item_kit_id', 'asc'); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('value' => 'KIT '. $row->item_kit_id, 'label' => 'KIT ' . $row->item_kit_id); } @@ -140,11 +123,9 @@ class Item_kit extends CI_Model else { $this->db->like('name', $search); - $this->db->order_by('name', 'asc'); - $by_name = $this->db->get(); - foreach($by_name->result() as $row) + foreach($this->db->get()->result() as $row) { $suggestions[] = array('value' => 'KIT ' . $row->item_kit_id, 'label' => $row->name); } @@ -162,21 +143,21 @@ class Item_kit extends CI_Model /* Perform a search on items */ - function search($search, $rows=0, $limit_from=0) + public function search($search, $rows=0, $limit_from=0, $sort='name', $order='asc') { $this->db->from('item_kits'); $this->db->like('name', $search); $this->db->or_like('description', $search); - + //KIT # - if (stripos($search, 'KIT ') !== false) + if(stripos($search, 'KIT ') !== FALSE) { $this->db->or_like('item_kit_id', str_ireplace('KIT ', '', $search)); } - $this->db->order_by('name', 'asc'); + $this->db->order_by($sort, $order); - if ($rows > 0) + if($rows > 0) { $this->db->limit($rows, $limit_from); } @@ -184,14 +165,14 @@ class Item_kit extends CI_Model return $this->db->get(); } - function get_found_rows($search) + public function get_found_rows($search) { $this->db->from('item_kits'); $this->db->like('name', $search); $this->db->or_like('description', $search); - + //KIT # - if (stripos($search, 'KIT ') !== false) + if(stripos($search, 'KIT ') !== FALSE) { $this->db->or_like('item_kit_id', str_ireplace('KIT ', '', $search)); } diff --git a/application/models/Item_kit_items.php b/application/models/Item_kit_items.php index 284b5b98d..ab4e0b3fa 100644 --- a/application/models/Item_kit_items.php +++ b/application/models/Item_kit_items.php @@ -4,7 +4,7 @@ class Item_kit_items extends CI_Model /* Gets item kit items for a particular item kit */ - function get_info($item_kit_id) + public function get_info($item_kit_id) { $this->db->from('item_kit_items'); $this->db->where('item_kit_id', $item_kit_id); @@ -16,28 +16,32 @@ class Item_kit_items extends CI_Model /* Inserts or updates an item kit's items */ - function save(&$item_kit_items_data, $item_kit_id) + public function save(&$item_kit_items_data, $item_kit_id) { + $success = TRUE; + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); $this->delete($item_kit_id); - foreach ($item_kit_items_data as $row) + foreach($item_kit_items_data as $row) { $row['item_kit_id'] = $item_kit_id; - $this->db->insert('item_kit_items', $row); + $success &= $this->db->insert('item_kit_items', $row); } $this->db->trans_complete(); - return true; + $success &= $this->db->trans_status(); + + return $success; } /* Deletes item kit items given an item kit */ - function delete($item_kit_id) + public function delete($item_kit_id) { return $this->db->delete('item_kit_items', array('item_kit_id' => $item_kit_id)); } diff --git a/application/models/Item_quantity.php b/application/models/Item_quantity.php index 9bebaed2e..ac9ef37f0 100644 --- a/application/models/Item_quantity.php +++ b/application/models/Item_quantity.php @@ -1,25 +1,20 @@ db->from('item_quantities'); $this->db->where('item_id', $item_id); $this->db->where('location_id', $location_id); - $query = $this->db->get(); - return ($query->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - function save($location_detail, $item_id, $location_id) + public function save($location_detail, $item_id, $location_id) { - if (!$this->exists($item_id, $location_id)) + if(!$this->exists($item_id, $location_id)) { - if($this->db->insert('item_quantities', $location_detail)) - { - return true; - } - return false; + return $this->db->insert('item_quantities', $location_detail); } $this->db->where('item_id', $item_id); @@ -28,22 +23,23 @@ class Item_quantity extends CI_Model return $this->db->update('item_quantities', $location_detail); } - function get_item_quantity($item_id, $location_id) + public function get_item_quantity($item_id, $location_id) { $this->db->from('item_quantities'); $this->db->where('item_id', $item_id); $this->db->where('location_id', $location_id); $result = $this->db->get()->row(); - if(empty($result) == true) + if(empty($result) == TRUE) { //Get empty base parent object, as $item_id is NOT an item $result = new stdClass(); + //Get all the fields from items table (TODO to be reviewed) - $fields = $this->db->list_fields('item_quantities'); - foreach($fields as $field) + foreach($this->db->list_fields('item_quantities') as $field) { $result->$field = ''; } + $result->quantity = 0; } @@ -55,11 +51,11 @@ class Item_quantity extends CI_Model * if $quantity_change is negative, it will be subtracted, * if it is positive, it will be added to the current quantity */ - function change_quantity($item_id, $location_id, $quantity_change) + public function change_quantity($item_id, $location_id, $quantity_change) { $quantity_old = $this->get_item_quantity($item_id, $location_id); $quantity_new = $quantity_old->quantity + intval($quantity_change); - $location_detail = array('item_id'=>$item_id, 'location_id'=>$location_id, 'quantity'=>$quantity_new); + $location_detail = array('item_id' => $item_id, 'location_id' => $location_id, 'quantity' => $quantity_new); return $this->save($location_detail, $item_id, $location_id); } @@ -67,21 +63,21 @@ class Item_quantity extends CI_Model /* * Set to 0 all quantity in the given item */ - function reset_quantity($item_id) + public function reset_quantity($item_id) { $this->db->where('item_id', $item_id); - return $this->db->update('item_quantities', array('quantity'=>0)); + return $this->db->update('item_quantities', array('quantity' => 0)); } /* * Set to 0 all quantity in the given list of items */ - function reset_quantity_list($item_ids) + public function reset_quantity_list($item_ids) { $this->db->where_in('item_id', $item_ids); - return $this->db->update('item_quantities', array('quantity'=>0)); + return $this->db->update('item_quantities', array('quantity' => 0)); } } ?> \ No newline at end of file diff --git a/application/models/Item_taxes.php b/application/models/Item_taxes.php index badc43b7a..270a6925f 100644 --- a/application/models/Item_taxes.php +++ b/application/models/Item_taxes.php @@ -4,10 +4,11 @@ class Item_taxes extends CI_Model /* Gets tax info for a particular item */ - function get_info($item_id) + public function get_info($item_id) { $this->db->from('items_taxes'); $this->db->where('item_id',$item_id); + //return an array of taxes for an item return $this->db->get()->result_array(); } @@ -15,35 +16,60 @@ class Item_taxes extends CI_Model /* Inserts or updates an item's taxes */ - function save(&$items_taxes_data, $item_id) + public function save(&$items_taxes_data, $item_id) { + $success = TRUE; + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); $this->delete($item_id); - $result = TRUE; - foreach ($items_taxes_data as $row) + + foreach($items_taxes_data as $row) { $row['item_id'] = $item_id; - $result &= $this->db->insert('items_taxes',$row); + $success &= $this->db->insert('items_taxes', $row); } $this->db->trans_complete(); - return $result; + + $success &= $this->db->trans_status(); + + return $success; } - - function save_multiple(&$items_taxes_data, $item_ids) + + /* + Saves taxes for multiple items + */ + public function save_multiple(&$items_taxes_data, $item_ids) { - foreach($item_ids as $item_id) + $success = TRUE; + + //Run these queries as a transaction, we want to make sure we do all or nothing + $this->db->trans_start(); + + foreach(explode(':', $item_ids) as $item_id) { - $this->save($items_taxes_data, $item_id); + $this->delete($item_id); + + foreach($items_taxes_data as $row) + { + $row['item_id'] = $item_id; + $success &= $this->db->insert('items_taxes', $row); + } } + + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); + + return $success; } /* Deletes taxes given an item */ - function delete($item_id) + public function delete($item_id) { return $this->db->delete('items_taxes', array('item_id' => $item_id)); } diff --git a/application/models/Module.php b/application/models/Module.php index 32d5365d1..e89a9bc57 100644 --- a/application/models/Module.php +++ b/application/models/Module.php @@ -6,62 +6,68 @@ class Module extends CI_Model parent::__construct(); } - function get_module_name($module_id) + public function get_module_name($module_id) { $query = $this->db->get_where('modules', array('module_id' => $module_id), 1); - if ($query->num_rows() ==1) + if($query->num_rows() == 1) { $row = $query->row(); + return $this->lang->line($row->name_lang_key); } return $this->lang->line('error_unknown'); } - function get_module_desc($module_id) + public function get_module_desc($module_id) { $query = $this->db->get_where('modules', array('module_id' => $module_id), 1); - if ($query->num_rows() ==1) + + if($query->num_rows() == 1) { $row = $query->row(); + return $this->lang->line($row->desc_lang_key); } return $this->lang->line('error_unknown'); } - function get_all_permissions() + public function get_all_permissions() { $this->db->from('permissions'); + return $this->db->get(); } - function get_all_subpermissions() + public function get_all_subpermissions() { $this->db->from('permissions'); - $this->db->join('modules', 'modules.module_id=permissions.module_id'); + $this->db->join('modules', 'modules.module_id = permissions.module_id'); // can't quote the parameters correctly when using different operators.. - $this->db->where($this->db->dbprefix('modules').'.module_id!=', 'permission_id', FALSE); + $this->db->where($this->db->dbprefix('modules') . '.module_id!=', 'permission_id', FALSE); + return $this->db->get(); } - function get_all_modules() + public function get_all_modules() { $this->db->from('modules'); - $this->db->order_by("sort", "asc"); + $this->db->order_by('sort', 'asc'); + return $this->db->get(); } - function get_allowed_modules($person_id) + public function get_allowed_modules($person_id) { $this->db->from('modules'); - $this->db->join('permissions','permissions.permission_id=modules.module_id'); - $this->db->join('grants','permissions.permission_id=grants.permission_id'); - $this->db->where("person_id",$person_id); - $this->db->order_by("sort", "asc"); + $this->db->join('permissions', 'permissions.permission_id = modules.module_id'); + $this->db->join('grants', 'permissions.permission_id = grants.permission_id'); + $this->db->where('person_id', $person_id); + $this->db->order_by('sort', 'asc'); + return $this->db->get(); } - } ?> diff --git a/application/models/Person.php b/application/models/Person.php index 20f39e73c..2ae0dff13 100644 --- a/application/models/Person.php +++ b/application/models/Person.php @@ -1,53 +1,60 @@ db->from('people'); - $this->db->where('people.person_id',$person_id); - $query = $this->db->get(); + $this->db->where('people.person_id', $person_id); - return ($query->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - /*Gets all people*/ - function get_all($limit=10000, $offset=0) + /* + Gets all people + */ + public function get_all($limit = 10000, $offset = 0) { $this->db->from('people'); - $this->db->order_by("last_name", "asc"); + $this->db->order_by('last_name', 'asc'); $this->db->limit($limit); $this->db->offset($offset); + return $this->db->get(); } - - function count_all() + + /* + Gets total of rows + */ + public function get_total_rows() { $this->db->from('people'); - $this->db->where('deleted',0); + $this->db->where('deleted', 0); + return $this->db->count_all_results(); } /* Gets information about a person as an array. */ - function get_info($person_id) + public function get_info($person_id) { $query = $this->db->get_where('people', array('person_id' => $person_id), 1); - if($query->num_rows()==1) + if($query->num_rows() == 1) { return $query->row(); } else { //create object with empty properties. - $fields = $this->db->list_fields('people'); $person_obj = new stdClass; - foreach ($fields as $field) + foreach($this->db->list_fields('people') as $field) { - $person_obj->$field=''; + $person_obj->$field = ''; } return $person_obj; @@ -57,62 +64,66 @@ class Person extends CI_Model /* Get people with specific ids */ - function get_multiple_info($person_ids) + public function get_multiple_info($person_ids) { $this->db->from('people'); - $this->db->where_in('person_id',$person_ids); - $this->db->order_by("last_name", "asc"); + $this->db->where_in('person_id', $person_ids); + $this->db->order_by('last_name', 'asc'); + return $this->db->get(); } /* Inserts or updates a person */ - function save(&$person_data,$person_id=false) + public function save(&$person_data, $person_id = FALSE) { - if (!$person_id or !$this->exists($person_id)) + if(!$person_id || !$this->exists($person_id)) { - if ($this->db->insert('people',$person_data)) + if($this->db->insert('people', $person_data)) { - $person_data['person_id']=$this->db->insert_id(); - return true; + $person_data['person_id'] = $this->db->insert_id(); + + return TRUE; } - - return false; + + return FALSE; } $this->db->where('person_id', $person_id); - return $this->db->update('people',$person_data); + + return $this->db->update('people', $person_data); } /* - Get search suggestions to find customers + Get search suggestions to find person */ - function get_search_suggestions($search,$limit=25) + public function get_search_suggestions($search, $limit = 25) { $suggestions = array(); -// $this->db->select("person_id"); +// $this->db->select('person_id'); // $this->db->from('people'); -// $this->db->where('deleted',0); -// $this->db->where('person_id',$this->db->escape($search)); -// $this->db->like('first_name',$this->db->escape_like_str($search)); -// $this->db->or_like('last_name',$this->db->escape_like_str($search)); -// $this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db->escape_like_str($search)); -// $this->db->or_like('email',$search); -// $this->db->or_like('phone_number',$search); -// $this->db->order_by('last_name', "asc"); - $by_person_id = $this->db->get(); +// $this->db->where('deleted', 0); +// $this->db->where('person_id', $search); +// $this->db->group_start(); +// $this->db->like('first_name', $search); +// $this->db->or_like('last_name', $search); +// $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); +// $this->db->or_like('email', $search); +// $this->db->or_like('phone_number', $search); +// $this->db->group_end(); +// $this->db->order_by('last_name', 'asc'); - foreach($by_person_id->result() as $row) + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('label' => $row->person_id); + $suggestions[] = array('label' => $row->person_id); } //only return $limit suggestions if(count($suggestions > $limit)) { - $suggestions = array_slice($suggestions, 0,$limit); + $suggestions = array_slice($suggestions, 0, $limit); } return $suggestions; @@ -121,18 +132,17 @@ class Person extends CI_Model /* Deletes one Person (doesn't actually do anything) */ - function delete($person_id) + public function delete($person_id) { - return true; + return TRUE; } /* Deletes a list of people (doesn't actually do anything) */ - function delete_list($person_ids) + public function delete_list($person_ids) { - return true; + return TRUE; } - } ?> diff --git a/application/models/Receiving.php b/application/models/Receiving.php index 5f8783e3d..7c03909f5 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -1,73 +1,80 @@ db->from('receivings'); $this->db->join('people', 'people.person_id = receivings.supplier_id', 'LEFT'); - $this->db->where('receiving_id',$receiving_id); + $this->db->where('receiving_id', $receiving_id); + return $this->db->get(); } - - function get_invoice_count() + + /* + Gets total of invoice rows + */ + public function get_invoice_count() { $this->db->from('receivings'); - $this->db->where('invoice_number is not null'); + $this->db->where('invoice_number IS NOT NULL'); + return $this->db->count_all_results(); } - function get_receiving_by_invoice_number($invoice_number) + public function get_receiving_by_invoice_number($invoice_number) { $this->db->from('receivings'); $this->db->where('invoice_number', $invoice_number); + return $this->db->get(); } - function get_invoice_number_for_year($year='', $start_from = 0) + public function get_invoice_number_for_year($year = '', $start_from = 0) { $year = $year == '' ? date('Y') : $year; - $this->db->select("COUNT( 1 ) AS invoice_number_year", FALSE); + $this->db->select('COUNT( 1 ) AS invoice_number_year'); $this->db->from('receivings'); - $this->db->where("DATE_FORMAT(receiving_time, '%Y' ) = ", $year, FALSE); - $this->db->where("invoice_number IS NOT ", "NULL", FALSE); + $this->db->where('DATE_FORMAT(receiving_time, "%Y" ) = ', $year); + $this->db->where('invoice_number IS NOT NULL'); $result = $this->db->get()->row_array(); - return ($start_from + $result[ 'invoice_number_year' ] + 1); + + return ($start_from + $result['invoice_number_year'] + 1); } - function exists($receiving_id) + public function exists($receiving_id) { $this->db->from('receivings'); $this->db->where('receiving_id',$receiving_id); - $query = $this->db->get(); - return ($query->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - function update($receiving_data, $receiving_id) + public function update($receiving_data, $receiving_id) { $this->db->where('receiving_id', $receiving_id); - $success = $this->db->update('receivings',$receiving_data); - - return $success; + + return $this->db->update('receivings', $receiving_data); } - function save($items, $supplier_id, $employee_id, $comment, $invoice_number, $payment_type, $receiving_id=false) + public function save($items, $supplier_id, $employee_id, $comment, $invoice_number, $payment_type, $receiving_id = FALSE) { - if(count($items)==0) + if(count($items) == 0) + { return -1; + } $receivings_data = array( - 'supplier_id'=>$this->Supplier->exists($supplier_id) ? $supplier_id : null, - 'employee_id'=>$employee_id, - 'payment_type'=>$payment_type, - 'comment'=>$comment, - 'invoice_number'=>$invoice_number + 'supplier_id' => $this->Supplier->exists($supplier_id) ? $supplier_id : null, + 'employee_id' => $employee_id, + 'payment_type' => $payment_type, + 'comment' => $comment, + 'invoice_number' => $invoice_number ); //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); - $this->db->insert('receivings',$receivings_data); + $this->db->insert('receivings', $receivings_data); $receiving_id = $this->db->insert_id(); foreach($items as $line=>$item) @@ -93,8 +100,7 @@ class Receiving extends CI_Model $items_received = $item['receiving_quantity'] != 0 ? $item['quantity'] * $item['receiving_quantity'] : $item['quantity']; // update cost price, if changed AND is set in config as wanted - if($cur_item_info->cost_price != $item['price'] - AND $this->config->item('receiving_calculate_average_price') != FALSE) + if($cur_item_info->cost_price != $item['price'] AND $this->config->item('receiving_calculate_average_price') != FALSE) { $this->Item->change_cost_price($item['item_id'], $items_received, @@ -107,11 +113,9 @@ class Receiving extends CI_Model $this->Item_quantity->save(array('quantity'=>$item_quantity->quantity + $items_received, 'item_id'=>$item['item_id'], 'location_id'=>$item['item_location']), $item['item_id'], $item['item_location']); - - + $recv_remarks ='RECV '.$receiving_id; - $inv_data = array - ( + $inv_data = array( 'trans_date'=>date('Y-m-d H:i:s'), 'trans_items'=>$item['item_id'], 'trans_user'=>$employee_id, @@ -119,13 +123,15 @@ class Receiving extends CI_Model 'trans_comment'=>$recv_remarks, 'trans_inventory'=>$items_received ); + $this->Inventory->insert($inv_data); $supplier = $this->Supplier->get_info($supplier_id); } + $this->db->trans_complete(); - if ($this->db->trans_status() === FALSE) + if($this->db->trans_status() === FALSE) { return -1; } @@ -133,34 +139,46 @@ class Receiving extends CI_Model return $receiving_id; } - function delete_list($receiving_ids,$employee_id,$update_inventory=TRUE) + public function delete_list($receiving_ids, $employee_id, $update_inventory = TRUE) { - $result = TRUE; - foreach($receiving_ids as $receiving_id) { - $result &= $this->delete($receiving_id,$employee_id,$update_inventory); + $success = TRUE; + + // start a transaction to assure data integrity + $this->db->trans_start(); + + foreach($receiving_ids as $receiving_id) + { + $success &= $this->delete($receiving_id, $employee_id, $update_inventory); } - return $result; + + // execute transaction + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); + + return $success; } - function delete($receiving_id,$employee_id,$update_inventory=TRUE) + public function delete($receiving_id, $employee_id, $update_inventory = TRUE) { // start a transaction to assure data integrity $this->db->trans_start(); - if ($update_inventory) { + + if($update_inventory) + { // defect, not all item deletions will be undone?? // get array with all the items involved in the sale to update the inventory tracking $items = $this->get_receiving_items($receiving_id)->result_array(); - foreach($items as $item) { + foreach($items as $item) + { // create query to update inventory tracking - $inv_data = array - ( + $inv_data = array( 'trans_date'=>date('Y-m-d H:i:s'), 'trans_items'=>$item['item_id'], 'trans_user'=>$employee_id, 'trans_comment'=>'Deleting receiving ' . $receiving_id, 'trans_location'=>$item['item_location'], 'trans_inventory'=>$item['quantity_purchased']*-1 - ); // update inventory $this->Inventory->insert($inv_data); @@ -171,58 +189,80 @@ class Receiving extends CI_Model $item['quantity_purchased']*-1); } } + // delete all items $this->db->delete('receivings_items', array('receiving_id' => $receiving_id)); // delete sale itself $this->db->delete('receivings', array('receiving_id' => $receiving_id)); + // execute transaction $this->db->trans_complete(); return $this->db->trans_status(); } - function get_receiving_items($receiving_id) + public function get_receiving_items($receiving_id) { $this->db->from('receivings_items'); - $this->db->where('receiving_id',$receiving_id); + $this->db->where('receiving_id', $receiving_id); + return $this->db->get(); } - function get_supplier($receiving_id) + public function get_supplier($receiving_id) { $this->db->from('receivings'); - $this->db->where('receiving_id',$receiving_id); + $this->db->where('receiving_id', $receiving_id); + return $this->Supplier->get_info($this->db->get()->row()->supplier_id); } - function invoice_number_exists($invoice_number,$receiving_id='') + public function invoice_number_exists($invoice_number, $receiving_id = '') { $this->db->from('receivings'); $this->db->where('invoice_number', $invoice_number); - if (!empty($receiving_id)) + if(!empty($receiving_id)) { $this->db->where('receiving_id !=', $receiving_id); } - $query=$this->db->get(); - return ($query->num_rows()==1); + $query = $this->db->get(); + + return ($query->num_rows() == 1); } - //We create a temp table that allows us to do easy report/receiving queries - function create_receivings_items_temp_table() + /* + We create a temp table that allows us to do easy report/receiving queries + */ + public function create_receivings_items_temp_table() { - $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS ".$this->db->dbprefix('receivings_items_temp')." - (SELECT date(receiving_time) as receiving_date, ".$this->db->dbprefix('receivings_items').".receiving_id, comment, item_location, invoice_number, payment_type, employee_id, - ".$this->db->dbprefix('items').".item_id, ".$this->db->dbprefix('receivings').".supplier_id, quantity_purchased, ".$this->db->dbprefix('receivings_items').".receiving_quantity, - item_cost_price, item_unit_price, discount_percent, (item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) as subtotal, - ".$this->db->dbprefix('receivings_items').".line as line, serialnumber, ".$this->db->dbprefix('receivings_items').".description as description, - (item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) as total, - (item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) - (item_cost_price*quantity_purchased) as profit, - (item_cost_price*quantity_purchased) as cost - FROM ".$this->db->dbprefix('receivings_items')." - INNER JOIN ".$this->db->dbprefix('receivings')." ON ".$this->db->dbprefix('receivings_items').'.receiving_id='.$this->db->dbprefix('receivings').'.receiving_id'." - INNER JOIN ".$this->db->dbprefix('items')." ON ".$this->db->dbprefix('receivings_items').'.item_id='.$this->db->dbprefix('items').'.item_id'." - GROUP BY receiving_id, item_id, line)"); + $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS " . $this->db->dbprefix('receivings_items_temp') . " + (SELECT + date(receiving_time) AS receiving_date, + " . $this->db->dbprefix('receivings_items') . " . receiving_id, + comment, + item_location, + invoice_number, + payment_type, + employee_id, + " . $this->db->dbprefix('items') . " . item_id, + " . $this->db->dbprefix('receivings') . " . supplier_id, + quantity_purchased, + " . $this->db->dbprefix('receivings_items') . " . receiving_quantity, + item_cost_price, + item_unit_price, + discount_percent, + (item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent / 100) AS subtotal, + " . $this->db->dbprefix('receivings_items') . " . line AS line, + serialnumber, + " . $this->db->dbprefix('receivings_items') . " . description AS description, + (item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent / 100) AS total, + (item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent / 100) - (item_cost_price * quantity_purchased) AS profit, + (item_cost_price * quantity_purchased) AS cost + FROM " . $this->db->dbprefix('receivings_items') . " + INNER JOIN " . $this->db->dbprefix('receivings') . " ON " . $this->db->dbprefix('receivings_items') . '.receiving_id=' . $this->db->dbprefix('receivings') . '.receiving_id' . " + INNER JOIN " . $this->db->dbprefix('items') . " ON " . $this->db->dbprefix('receivings_items') . '.item_id=' . $this->db->dbprefix('items') . '.item_id' . " + GROUP BY receiving_id, item_id, line)" + ); } - } ?> diff --git a/application/models/Sale.php b/application/models/Sale.php index 1304d0f5c..2450c607c 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -4,9 +4,9 @@ class Sale extends CI_Model public function get_info($sale_id) { $this->db->select('first_name, last_name, email, comment, sale_payment_amount AS amount_tendered, payment_type, - invoice_number, sale_time, employee_id, customer_id, comments, sale_id, (sale_payment_amount - total) AS change_due', FALSE); - $this->db->select('DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date', FALSE); - $this->db->select('CONCAT(first_name, " ", last_name) AS customer_name', FALSE); + invoice_number, sale_time, employee_id, customer_id, comments, sale_id, (sale_payment_amount - total) AS change_due'); + $this->db->select('DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date'); + $this->db->select('CONCAT(first_name, " ", last_name) AS customer_name'); $this->db->select('SUM(item_unit_price * quantity_purchased * (1 - discount_percent / 100)) AS amount_due'); $this->db->from('sales_items_temp'); $this->db->join('people', 'people.person_id = sales_items_temp.customer_id', 'left'); @@ -28,23 +28,23 @@ class Sale extends CI_Model /* Get the sales data for the takings (sales/manage) view */ - public function search($search, $filters, $rows=0, $limit_from=0) + public function search($search, $filters, $rows = 0, $limit_from = 0, $sort = 'sale_date', $order = 'desc') { $this->db->select('sale_id, sale_date, sale_time, SUM(quantity_purchased) AS items_purchased, CONCAT(customer.first_name, " ", customer.last_name) AS customer_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit, sale_payment_amount AS amount_tendered, SUM(total) AS amount_due, (sale_payment_amount - SUM(total)) AS change_due, - payment_type, invoice_number', FALSE); + payment_type, invoice_number'); $this->db->from('sales_items_temp'); $this->db->join('people AS customer', 'sales_items_temp.customer_id = customer.person_id', 'left'); - if (empty($search)) + if(empty($search)) { - $this->db->where('sale_time BETWEEN ' . $this->db->escape($filters['start_date']) . ' AND ' . $this->db->escape($filters['end_date'])); + $this->db->where('DATE(sale_time) BETWEEN ' . $this->db->escape($filters['start_date']) . ' AND ' . $this->db->escape($filters['end_date'])); } else { - if ($filters['is_valid_receipt'] != FALSE) + if($filters['is_valid_receipt'] != FALSE) { $pieces = explode(' ', $search); $this->db->where('sales_items_temp.sale_id', $pieces[1]); @@ -52,40 +52,43 @@ class Sale extends CI_Model else { - $this->db->like('last_name', $search); - $this->db->or_like('first_name', $search); - $this->db->or_like('CONCAT(customer.first_name, " ", last_name)', $search); + $this->db->group_start(); + $this->db->like('last_name', $search); + $this->db->or_like('first_name', $search); + $this->db->or_like('CONCAT(customer.first_name, " ", last_name)', $search); + $this->db->or_like('company_name', $search); + $this->db->group_end(); } } - if ($filters['location_id'] != 'all') + if($filters['location_id'] != 'all') { $this->db->where('item_location', $filters['location_id']); } - if ($filters['sale_type'] == 'sales') + if($filters['sale_type'] == 'sales') { $this->db->where('quantity_purchased > 0'); } - elseif ($filters['sale_type'] == 'returns') + elseif($filters['sale_type'] == 'returns') { $this->db->where('quantity_purchased < 0'); } - if ($filters['only_invoices'] != FALSE) + if($filters['only_invoices'] != FALSE) { - $this->db->where('invoice_number <> ', 'NULL'); + $this->db->where('invoice_number IS NOT NULL'); } - if ($filters['only_cash'] != FALSE) + if($filters['only_cash'] != FALSE) { $this->db->like('payment_type ', $this->lang->line('sales_cash'), 'after'); } $this->db->group_by('sale_id'); - $this->db->order_by('sale_date', 'asc'); + $this->db->order_by($sort, $order); - if ($rows > 0) + if($rows > 0) { $this->db->limit($rows, $limit_from); } @@ -99,45 +102,47 @@ class Sale extends CI_Model public function get_payments_summary($search, $filters) { // get payment summary - $this->db->select('payment_type, count(*) AS count, SUM(payment_amount) AS payment_amount', FALSE); + $this->db->select('payment_type, count(*) AS count, SUM(payment_amount) AS payment_amount'); $this->db->from('sales'); - $this->db->join('sales_payments', 'sales_payments.sale_id=sales.sale_id'); + $this->db->join('sales_payments', 'sales_payments.sale_id = sales.sale_id'); $this->db->join('people', 'people.person_id = sales.customer_id', 'left'); - if (empty($search)) + if(empty($search)) { - $this->db->where('sale_time BETWEEN '. $this->db->escape($filters['start_date']). ' AND '. $this->db->escape($filters['end_date'])); + $this->db->where('DATE(sale_time) BETWEEN ' . $this->db->escape($filters['start_date']) . ' AND ' . $this->db->escape($filters['end_date'])); } else { - if ($filters['is_valid_receipt'] != FALSE) + if($filters['is_valid_receipt'] != FALSE) { $pieces = explode(' ',$search); $this->db->where('sales.sale_id', $pieces[1]); } else { - $this->db->like('last_name', $search); - $this->db->or_like('first_name', $search); - $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_start(); + $this->db->like('last_name', $search); + $this->db->or_like('first_name', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); } } - if ($filters['sale_type'] == 'sales') + if($filters['sale_type'] == 'sales') { $this->db->where('payment_amount > 0'); } - elseif ($filters['sale_type'] == 'returns') + elseif($filters['sale_type'] == 'returns') { $this->db->where('payment_amount < 0'); } - if ($filters['only_invoices'] != FALSE) + if($filters['only_invoices'] != FALSE) { - $this->db->where('invoice_number <> ', 'NULL'); + $this->db->where('invoice_number IS NOT NULL'); } - if ($filters['only_cash'] != FALSE) + if($filters['only_cash'] != FALSE) { $this->db->like('payment_type ', $this->lang->line('sales_cash'), 'after'); } @@ -168,7 +173,10 @@ class Sale extends CI_Model return $payments; } - + + /* + Gets total of rows + */ public function get_total_rows() { $this->db->from('sales'); @@ -176,11 +184,11 @@ class Sale extends CI_Model return $this->db->count_all_results(); } - public function get_search_suggestions($search, $limit=25) + public function get_search_suggestions($search, $limit = 25) { $suggestions = array(); - if (!$this->sale_lib->is_valid_receipt($search)) + if(!$this->sale_lib->is_valid_receipt($search)) { $this->db->distinct(); $this->db->select('first_name, last_name'); @@ -189,6 +197,7 @@ class Sale extends CI_Model $this->db->like('last_name', $search); $this->db->or_like('first_name', $search); $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->or_like('company_name', $search); $this->db->order_by('last_name', 'asc'); foreach($this->db->get()->result_array() as $result) @@ -204,10 +213,13 @@ class Sale extends CI_Model return $suggestions; } + /* + Gets total of invoice rows + */ public function get_invoice_count() { $this->db->from('sales'); - $this->db->where('invoice_number is not null'); + $this->db->where('invoice_number IS NOT NULL'); return $this->db->count_all_results(); } @@ -223,10 +235,10 @@ class Sale extends CI_Model public function get_invoice_number_for_year($year = '', $start_from = 0) { $year = $year == '' ? date('Y') : $year; - $this->db->select("COUNT( 1 ) AS invoice_number_year", FALSE); + $this->db->select('COUNT( 1 ) AS invoice_number_year'); $this->db->from('sales'); - $this->db->where("DATE_FORMAT(sale_time, '%Y' ) = ", $year, FALSE); - $this->db->where("invoice_number IS NOT ", "NULL", FALSE); + $this->db->where('DATE_FORMAT(sale_time, "%Y" ) = ', $year); + $this->db->where('invoice_number IS NOT NULL'); $result = $this->db->get()->row_array(); return ($start_from + $result['invoice_number_year']); @@ -252,7 +264,7 @@ class Sale extends CI_Model $this->db->trans_start(); // first delete all payments - $this->db->delete('sales_payments', array('sale_id'=>$sale_id)); + $this->db->delete('sales_payments', array('sale_id' => $sale_id)); // add new payments foreach($payments as $payment) @@ -261,22 +273,22 @@ class Sale extends CI_Model 'sale_id'=>$sale_id, 'payment_type'=>$payment['payment_type'], 'payment_amount'=>$payment['payment_amount'] - ); + ); $success = $this->db->insert('sales_payments', $sales_payments_data); } $this->db->trans_complete(); - $success = $this->db->trans_status(); + $success &= $this->db->trans_status(); } return $success; } - public function save($items, $customer_id, $employee_id, $comment, $invoice_number, $payments, $sale_id=false) + public function save($items, $customer_id, $employee_id, $comment, $invoice_number, $payments, $sale_id = FALSE) { - if(count($items)==0) + if(count($items) == 0) { return -1; } @@ -297,7 +309,7 @@ class Sale extends CI_Model foreach($payments as $payment_id=>$payment) { - if ( substr( $payment['payment_type'], 0, strlen( $this->lang->line('sales_giftcard') ) ) == $this->lang->line('sales_giftcard') ) + if( substr( $payment['payment_type'], 0, strlen( $this->lang->line('sales_giftcard') ) ) == $this->lang->line('sales_giftcard') ) { // We have a gift card and we have to deduct the used value from the total value of the card. $splitpayment = explode( ':', $payment['payment_type'] ); @@ -310,7 +322,7 @@ class Sale extends CI_Model 'payment_type' => $payment['payment_type'], 'payment_amount'=> $payment['payment_amount'] ); - $this->db->insert('sales_payments',$sales_payments_data); + $this->db->insert('sales_payments', $sales_payments_data); } foreach($items as $line=>$item) @@ -330,7 +342,7 @@ class Sale extends CI_Model 'item_location' => $item['item_location'] ); - $this->db->insert('sales_items',$sales_items_data); + $this->db->insert('sales_items', $sales_items_data); // Update stock quantity $item_quantity = $this->Item_quantity->get_item_quantity($item['item_id'], $item['item_location']); @@ -357,7 +369,7 @@ class Sale extends CI_Model $this->Inventory->insert($inv_data); $customer = $this->Customer->get_info($customer_id); - if ($customer_id == -1 or $customer->taxable) + if($customer_id == -1 || $customer->taxable) { foreach($this->Item_taxes->get_info($item['item_id']) as $row) { @@ -371,9 +383,10 @@ class Sale extends CI_Model } } } + $this->db->trans_complete(); - if ($this->db->trans_status() === FALSE) + if($this->db->trans_status() === FALSE) { return -1; } @@ -381,7 +394,7 @@ class Sale extends CI_Model return $sale_id; } - public function delete_list($sale_ids, $employee_id, $update_inventory=TRUE) + public function delete_list($sale_ids, $employee_id, $update_inventory = TRUE) { $result = TRUE; @@ -393,16 +406,17 @@ class Sale extends CI_Model return $result; } - public function delete($sale_id, $employee_id, $update_inventory=TRUE) + public function delete($sale_id, $employee_id, $update_inventory = TRUE) { // start a transaction to assure data integrity $this->db->trans_start(); + // first delete all payments $this->db->delete('sales_payments', array('sale_id' => $sale_id)); // then delete all taxes on items $this->db->delete('sales_items_taxes', array('sale_id' => $sale_id)); - if ($update_inventory) + if($update_inventory) { // defect, not all item deletions will be undone?? // get array with all the items involved in the sale to update the inventory tracking @@ -453,14 +467,14 @@ class Sale extends CI_Model return $this->db->get(); } - public function get_payment_options($giftcard=true) + public function get_payment_options($giftcard = TRUE) { $payments = array( - $this->lang->line('sales_debit') => $this->lang->line('sales_debit'), - $this->lang->line('sales_credit') => $this->lang->line('sales_credit'), - $this->lang->line('sales_cash') => $this->lang->line('sales_cash'), - $this->lang->line('sales_check') => $this->lang->line('sales_check') - ); + $this->lang->line('sales_debit') => $this->lang->line('sales_debit'), + $this->lang->line('sales_credit') => $this->lang->line('sales_credit'), + $this->lang->line('sales_cash') => $this->lang->line('sales_cash'), + $this->lang->line('sales_check') => $this->lang->line('sales_check') + ); if($giftcard) { @@ -478,11 +492,11 @@ class Sale extends CI_Model return $this->Customer->get_info($this->db->get()->row()->customer_id); } - public function invoice_number_exists($invoice_number, $sale_id='') + public function invoice_number_exists($invoice_number, $sale_id = '') { $this->db->from('sales'); $this->db->where('invoice_number', $invoice_number); - if (!empty($sale_id)) + if(!empty($sale_id)) { $this->db->where('sale_id !=', $sale_id); } @@ -490,9 +504,9 @@ class Sale extends CI_Model return ($this->db->get()->num_rows()==1); } - public function get_giftcard_value( $giftcardNumber ) + public function get_giftcard_value($giftcardNumber) { - if ( !$this->Giftcard->exists($this->Giftcard->get_giftcard_id($giftcardNumber)) ) + if(!$this->Giftcard->exists($this->Giftcard->get_giftcard_id($giftcardNumber))) { return 0; } @@ -506,43 +520,61 @@ class Sale extends CI_Model //We create a temp table that allows us to do easy report/sales queries public function create_sales_items_temp_table() { - if ($this->config->item('tax_included')) + if($this->config->item('tax_included')) { - $total = "1"; - $subtotal = "(1 - (SUM(1 - 100/(100+percent))))"; - $tax="(SUM(1 - 100/(100+percent)))"; + $total = '1'; + $subtotal = '(1 - (SUM(1 - 100 / (100 + percent))))'; + $tax = '(SUM(1 - 100 / (100 + percent)))'; } else { - $tax = "(SUM(percent)/100)"; - $total = "(1+(SUM(percent/100)))"; - $subtotal = "1"; + $tax = '(SUM(percent) / 100)'; + $total = '(1 + (SUM(percent / 100)))'; + $subtotal = '1'; } $decimals = totals_decimals(); - $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS ".$this->db->dbprefix('sales_items_temp')." - (SELECT date(sale_time) as sale_date, sale_time, ".$this->db->dbprefix('sales_items').".sale_id, comment, payments.payment_type, payments.sale_payment_amount, item_location, customer_id, employee_id, - ".$this->db->dbprefix('items').".item_id, supplier_id, quantity_purchased, item_cost_price, item_unit_price, SUM(percent) as item_tax_percent, - discount_percent, ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $subtotal, $decimals) as subtotal, - ".$this->db->dbprefix('sales_items').".line as line, serialnumber, ".$this->db->dbprefix('sales_items').".description as description, - ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $total, $decimals) as total, - ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $tax, $decimals) as tax, - ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100)- (item_cost_price*quantity_purchased), $decimals) as profit, - (item_cost_price * quantity_purchased) as cost, - invoice_number - FROM ".$this->db->dbprefix('sales_items')." - INNER JOIN ".$this->db->dbprefix('sales')." ON ".$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales').'.sale_id'." - INNER JOIN ".$this->db->dbprefix('items')." ON ".$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('items').'.item_id'." - INNER JOIN (SELECT sale_id, SUM(payment_amount) AS sale_payment_amount, - GROUP_CONCAT(CONCAT(payment_type,' ',payment_amount) SEPARATOR ', ') AS payment_type FROM " . $this->db->dbprefix('sales_payments') . " GROUP BY sale_id) AS payments - ON " . $this->db->dbprefix('sales_items') . '.sale_id'. "=" . "payments.sale_id - LEFT OUTER JOIN ".$this->db->dbprefix('suppliers')." ON ".$this->db->dbprefix('items').'.supplier_id='.$this->db->dbprefix('suppliers').'.person_id'." - LEFT OUTER JOIN ".$this->db->dbprefix('sales_items_taxes')." ON " - .$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales_items_taxes').'.sale_id'." and " - .$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('sales_items_taxes').'.item_id'." and " - .$this->db->dbprefix('sales_items').'.line='.$this->db->dbprefix('sales_items_taxes').'.line'." - GROUP BY sale_id, item_id, line)"); + $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS " . $this->db->dbprefix('sales_items_temp') . " + (SELECT + date(sale_time) AS sale_date, + sale_time, + ".$this->db->dbprefix('sales_items').".sale_id, + comment, + payments.payment_type, + payments.sale_payment_amount, + item_location, + customer_id, + employee_id, + ".$this->db->dbprefix('items').".item_id, + supplier_id, + quantity_purchased, + item_cost_price, + item_unit_price, + SUM(percent) AS item_tax_percent, + discount_percent, + ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $subtotal, $decimals) AS subtotal, + ".$this->db->dbprefix('sales_items').".line AS line, + serialnumber, + ".$this->db->dbprefix('sales_items').".description AS description, + ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $total, $decimals) AS total, + ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100) * $tax, $decimals) AS tax, + ROUND((item_unit_price * quantity_purchased-item_unit_price * quantity_purchased * discount_percent / 100)- (item_cost_price * quantity_purchased), $decimals) AS profit, + (item_cost_price * quantity_purchased) AS cost, + invoice_number + FROM ".$this->db->dbprefix('sales_items')." + INNER JOIN ".$this->db->dbprefix('sales')." ON ".$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales').'.sale_id'." + INNER JOIN ".$this->db->dbprefix('items')." ON ".$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('items').'.item_id'." + INNER JOIN (SELECT sale_id, SUM(payment_amount) AS sale_payment_amount, + GROUP_CONCAT(CONCAT(payment_type,' ',payment_amount) SEPARATOR ', ') AS payment_type + FROM " . $this->db->dbprefix('sales_payments') . " GROUP BY sale_id) AS payments ON " . $this->db->dbprefix('sales_items').'.sale_id'."=payments.sale_id + LEFT OUTER JOIN ".$this->db->dbprefix('suppliers')." ON ".$this->db->dbprefix('items').'.supplier_id='.$this->db->dbprefix('suppliers').'.person_id'." + LEFT OUTER JOIN ".$this->db->dbprefix('sales_items_taxes')." ON " + .$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales_items_taxes').'.sale_id'." AND " + .$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('sales_items_taxes').'.item_id'." AND " + .$this->db->dbprefix('sales_items').'.line='.$this->db->dbprefix('sales_items_taxes').'.line'." + GROUP BY sale_id, item_id, line)" + ); //Update null item_tax_percents to be 0 instead of null $this->db->where('item_tax_percent IS NULL'); diff --git a/application/models/Sale_suspended.php b/application/models/Sale_suspended.php index 933f867d1..c80609d3d 100644 --- a/application/models/Sale_suspended.php +++ b/application/models/Sale_suspended.php @@ -1,120 +1,129 @@ db->from('sales_suspended'); $this->db->order_by('sale_id'); + return $this->db->get(); } public function get_info($sale_id) { $this->db->from('sales_suspended'); - $this->db->where('sale_id',$sale_id); + $this->db->where('sale_id', $sale_id); $this->db->join('people', 'people.person_id = sales_suspended.customer_id', 'LEFT'); + return $this->db->get(); } - - function get_invoice_count() + + /* + Gets total of invocie rows + */ + public function get_invoice_count() { $this->db->from('sales_suspended'); - $this->db->where('invoice_number is not null'); + $this->db->where('invoice_number IS NOT NULL'); + return $this->db->count_all_results(); } - function get_sale_by_invoice_number($invoice_number) + public function get_sale_by_invoice_number($invoice_number) { $this->db->from('sales_suspended'); $this->db->where('invoice_number', $invoice_number); + return $this->db->get(); } - function exists($sale_id) + public function exists($sale_id) { $this->db->from('sales_suspended'); - $this->db->where('sale_id',$sale_id); - $query = $this->db->get(); + $this->db->where('sale_id', $sale_id); - return ($query->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - function update($sale_data, $sale_id) + public function update($sale_data, $sale_id) { $this->db->where('sale_id', $sale_id); - $success = $this->db->update('sales_suspended',$sale_data); - - return $success; + + return $this->db->update('sales_suspended', $sale_data); } - function save($items,$customer_id,$employee_id,$comment,$invoice_number,$payments,$sale_id=false) + public function save($items, $customer_id, $employee_id, $comment, $invoice_number, $payments, $sale_id = FALSE) { - if(count($items)==0) + if(count($items) == 0) + { return -1; + } $sales_data = array( - 'sale_time' => date('Y-m-d H:i:s'), - 'customer_id'=> $this->Customer->exists($customer_id) ? $customer_id : null, - 'employee_id'=>$employee_id, - 'comment'=>$comment, - 'invoice_number'=>$invoice_number + 'sale_time' => date('Y-m-d H:i:s'), + 'customer_id' => $this->Customer->exists($customer_id) ? $customer_id : null, + 'employee_id' => $employee_id, + 'comment' => $comment, + 'invoice_number' => $invoice_number ); //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); - $this->db->insert('sales_suspended',$sales_data); + $this->db->insert('sales_suspended', $sales_data); $sale_id = $this->db->insert_id(); foreach($payments as $payment_id=>$payment) { - $sales_payments_data = array - ( - 'sale_id'=>$sale_id, - 'payment_type'=>$payment['payment_type'], - 'payment_amount'=>$payment['payment_amount'] + $sales_payments_data = array( + 'sale_id' => $sale_id, + 'payment_type' => $payment['payment_type'], + 'payment_amount' => $payment['payment_amount'] ); - $this->db->insert('sales_suspended_payments',$sales_payments_data); + + $this->db->insert('sales_suspended_payments', $sales_payments_data); } foreach($items as $line=>$item) { $cur_item_info = $this->Item->get_info($item['item_id']); - $sales_items_data = array - ( - 'sale_id'=>$sale_id, - 'item_id'=>$item['item_id'], - 'line'=>$item['line'], - 'description'=>character_limiter($item['description'], 30), - 'serialnumber'=>character_limiter($item['serialnumber'], 30), - 'quantity_purchased'=>$item['quantity'], - 'discount_percent'=>$item['discount'], - 'item_cost_price' => $cur_item_info->cost_price, - 'item_unit_price'=>$item['price'], - 'item_location'=>$item['item_location'] + $sales_items_data = array( + 'sale_id' => $sale_id, + 'item_id' => $item['item_id'], + 'line' => $item['line'], + 'description' => character_limiter($item['description'], 30), + 'serialnumber' => character_limiter($item['serialnumber'], 30), + 'quantity_purchased' => $item['quantity'], + 'discount_percent' => $item['discount'], + 'item_cost_price' => $cur_item_info->cost_price, + 'item_unit_price' => $item['price'], + 'item_location' => $item['item_location'] ); - $this->db->insert('sales_suspended_items',$sales_items_data); + $this->db->insert('sales_suspended_items', $sales_items_data); $customer = $this->Customer->get_info($customer_id); - if ($customer_id == -1 or $customer->taxable) + if($customer_id == -1 || $customer->taxable) { foreach($this->Item_taxes->get_info($item['item_id']) as $row) { - $this->db->insert('sales_suspended_items_taxes', array( - 'sale_id' =>$sale_id, - 'item_id' =>$item['item_id'], - 'line' =>$item['line'], - 'name' =>$row['name'], - 'percent' =>$row['percent'] - )); + $sales_items_taxes = array( + 'sale_id' => $sale_id, + 'item_id' => $item['item_id'], + 'line' => $item['line'], + 'name' => $row['name'], + 'percent' => $row['percent'] + ); + + $this->db->insert('sales_suspended_items_taxes', $sales_items_taxes); } } } + $this->db->trans_complete(); - if ($this->db->trans_status() === FALSE) + if($this->db->trans_status() === FALSE) { return -1; } @@ -122,7 +131,7 @@ class Sale_suspended extends CI_Model return $sale_id; } - function delete($sale_id) + public function delete($sale_id) { //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); @@ -137,36 +146,39 @@ class Sale_suspended extends CI_Model return $this->db->trans_status(); } - function get_sale_items($sale_id) + public function get_sale_items($sale_id) { $this->db->from('sales_suspended_items'); - $this->db->where('sale_id',$sale_id); + $this->db->where('sale_id', $sale_id); + return $this->db->get(); } - function get_sale_payments($sale_id) + public function get_sale_payments($sale_id) { $this->db->from('sales_suspended_payments'); - $this->db->where('sale_id',$sale_id); + $this->db->where('sale_id', $sale_id); + return $this->db->get(); } - function invoice_number_exists($invoice_number,$sale_id='') + public function invoice_number_exists($invoice_number, $sale_id = '') { $this->db->from('sales_suspended'); $this->db->where('invoice_number', $invoice_number); - if (!empty($sale_id)) + if(!empty($sale_id)) { $this->db->where('sale_id !=', $sale_id); } - $query=$this->db->get(); - return ($query->num_rows()==1); + + return ($this->db->get()->num_rows() == 1); } - function get_comment($sale_id) + public function get_comment($sale_id) { $this->db->from('sales_suspended'); - $this->db->where('sale_id',$sale_id); + $this->db->where('sale_id', $sale_id); + return $this->db->get()->row()->comment; } } diff --git a/application/models/Stock_location.php b/application/models/Stock_location.php index f355ad612..9c533147a 100644 --- a/application/models/Stock_location.php +++ b/application/models/Stock_location.php @@ -1,46 +1,48 @@ db->from('stock_locations'); - $this->db->where('location_name',$location_name); - $query = $this->db->get(); + $this->db->where('location_name', $location_name); - return ($query->num_rows()>=1); + return ($this->db->get()->num_rows() >= 1); } - function get_all($limit=10000, $offset=0) + public function get_all($limit = 10000, $offset = 0) { $this->db->from('stock_locations'); $this->db->limit($limit); $this->db->offset($offset); + return $this->db->get(); } - function get_undeleted_all($module_id='items') + public function get_undeleted_all($module_id = 'items') { $this->db->from('stock_locations'); - $this->db->join('permissions','permissions.location_id=stock_locations.location_id'); - $this->db->join('grants','grants.permission_id=permissions.permission_id'); + $this->db->join('permissions', 'permissions.location_id = stock_locations.location_id'); + $this->db->join('grants', 'grants.permission_id = permissions.permission_id'); $this->db->where('person_id', $this->session->userdata('person_id')); $this->db->like('permissions.permission_id', $module_id, 'after'); - $this->db->where('deleted',0); + $this->db->where('deleted', 0); + return $this->db->get(); } - function show_locations($module_id='items') + public function show_locations($module_id = 'items') { $stock_locations = $this->get_allowed_locations($module_id); + return count($stock_locations) > 1; } - function multiple_locations() + public function multiple_locations() { return $this->get_all()->num_rows() > 1; } - function get_allowed_locations($module_id='items') + public function get_allowed_locations($module_id = 'items') { $stock = $this->get_undeleted_all($module_id)->result_array(); $stock_locations = array(); @@ -48,102 +50,111 @@ class Stock_location extends CI_Model { $stock_locations[$location_data['location_id']] = $location_data['location_name']; } + return $stock_locations; } - function is_allowed_location($location_id, $module_id='items') + public function is_allowed_location($location_id, $module_id = 'items') { $this->db->from('stock_locations'); - $this->db->join('permissions','permissions.location_id=stock_locations.location_id'); - $this->db->join('grants','grants.permission_id=permissions.permission_id'); + $this->db->join('permissions', 'permissions.location_id = stock_locations.location_id'); + $this->db->join('grants', 'grants.permission_id = permissions.permission_id'); $this->db->where('person_id', $this->session->userdata('person_id')); $this->db->like('permissions.permission_id', $module_id, 'after'); - $this->db->where('deleted',0); + $this->db->where('deleted', 0); $this->db->where('stock_locations.location_id', $location_id); - $query = $this->db->get(); - return ($query->num_rows()==1); + + return ($this->db->get()->num_rows() == 1); } - function get_default_location_id() + public function get_default_location_id() { $this->db->from('stock_locations'); - $this->db->join('permissions','permissions.location_id=stock_locations.location_id'); - $this->db->join('grants','grants.permission_id=permissions.permission_id'); + $this->db->join('permissions', 'permissions.location_id = stock_locations.location_id'); + $this->db->join('grants', 'grants.permission_id = permissions.permission_id'); $this->db->where('person_id', $this->session->userdata('person_id')); - $this->db->where('deleted',0); + $this->db->where('deleted', 0); $this->db->limit(1); + return $this->db->get()->row()->location_id; } - function get_location_name($location_id) + public function get_location_name($location_id) { $this->db->from('stock_locations'); - $this->db->where('location_id',$location_id); + $this->db->where('location_id', $location_id); + return $this->db->get()->row()->location_name; } - function save(&$location_data,$location_id) + public function save(&$location_data, $location_id) { $location_name = $location_data['location_name']; - if (!$this->exists($location_name)) + + if(!$this->exists($location_name)) { $this->db->trans_start(); - $location_data = array('location_name'=>$location_name,'deleted'=>0); - $this->db->insert('stock_locations',$location_data); + + $location_data = array('location_name'=>$location_name, 'deleted'=>0); + $this->db->insert('stock_locations', $location_data); $location_id = $this->db->insert_id(); $this->_insert_new_permission('items', $location_id, $location_name); $this->_insert_new_permission('sales', $location_id, $location_name); $this->_insert_new_permission('receivings', $location_id, $location_name); - // insert quantities for existing items $items = $this->Item->get_all(); - foreach ($items->result_array() as $item) + foreach($items->result_array() as $item) { $quantity_data = array('item_id' => $item['item_id'], 'location_id' => $location_id, 'quantity' => 0); $this->db->insert('item_quantities', $quantity_data); } + $this->db->trans_complete(); + + return $this->db->trans_status(); } else { $this->db->where('location_id', $location_id); - return $this->db->update('stock_locations',$location_data); + + return $this->db->update('stock_locations', $location_data); } } - function _insert_new_permission($module, $location_id, $location_name) + private function _insert_new_permission($module, $location_id, $location_name) { // insert new permission for stock location - $permission_id = $module."_".$location_name; - $permission_data = array('permission_id'=>$permission_id,'module_id'=>$module,'location_id' => $location_id); + $permission_id = $module . '_' . $location_name; + $permission_data = array('permission_id' => $permission_id, 'module_id' => $module, 'location_id' => $location_id); $this->db->insert('permissions', $permission_data); // insert grants for new permission $employees = $this->Employee->get_all(); - foreach ($employees->result_array() as $employee) + foreach($employees->result_array() as $employee) { $grants_data = array('permission_id' => $permission_id, 'person_id' => $employee['person_id']); $this->db->insert('grants', $grants_data); } - } /* Deletes one item */ - function delete($location_id) + public function delete($location_id) { $this->db->trans_start(); + $this->db->where('location_id', $location_id); $this->db->update('stock_locations', array('deleted' => 1)); $this->db->where('location_id', $location_id); $this->db->delete('permissions'); + $this->db->trans_complete(); + + return $this->db->trans_status(); } - - } ?> \ No newline at end of file diff --git a/application/models/Supplier.php b/application/models/Supplier.php index 562d49db1..03d130f6d 100644 --- a/application/models/Supplier.php +++ b/application/models/Supplier.php @@ -4,71 +4,67 @@ class Supplier extends Person /* Determines if a given person_id is a customer */ - function exists($person_id) + public function exists($person_id) { $this->db->from('suppliers'); $this->db->join('people', 'people.person_id = suppliers.person_id'); - $this->db->where('suppliers.person_id',$person_id); - $query = $this->db->get(); + $this->db->where('suppliers.person_id', $person_id); - return ($query->num_rows()==1); + return ($this->db->get()->num_rows() == 1); } - - function get_total_rows() + + /* + Gets total of rows + */ + public function get_total_rows() { $this->db->from('suppliers'); - $this->db->where('deleted',0); + $this->db->where('deleted', 0); + return $this->db->count_all_results(); } /* Returns all the suppliers */ - function get_all($limit_from = 0, $rows = 0) + public function get_all($limit_from = 0, $rows = 0) { $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->order_by("company_name", "asc"); - if ($rows > 0) { + $this->db->order_by('company_name', 'asc'); + if($rows > 0) + { $this->db->limit($rows, $limit_from); } + return $this->db->get(); } - function count_all() - { - $this->db->from('suppliers'); - $this->db->where('deleted',0); - return $this->db->count_all_results(); - } - /* Gets information about a particular supplier */ - function get_info($supplier_id) + public function get_info($supplier_id) { $this->db->from('suppliers'); $this->db->join('people', 'people.person_id = suppliers.person_id'); - $this->db->where('suppliers.person_id',$supplier_id); + $this->db->where('suppliers.person_id', $supplier_id); $query = $this->db->get(); - if($query->num_rows()==1) + if($query->num_rows() == 1) { return $query->row(); } else { //Get empty base parent object, as $supplier_id is NOT an supplier - $person_obj=parent::get_info(-1); - - //Get all the fields from supplier table - $fields = $this->db->list_fields('suppliers'); + $person_obj = parent::get_info(-1); + //Get all the fields from supplier table //append those fields to base parent object, we we have a complete empty object - foreach ($fields as $field) + foreach($this->db->list_fields('suppliers') as $field) { - $person_obj->$field=''; + $person_obj->$field = ''; } return $person_obj; @@ -78,182 +74,201 @@ class Supplier extends Person /* Gets information about multiple suppliers */ - function get_multiple_info($suppliers_ids) + public function get_multiple_info($suppliers_ids) { $this->db->from('suppliers'); $this->db->join('people', 'people.person_id = suppliers.person_id'); - $this->db->where_in('suppliers.person_id',$suppliers_ids); - $this->db->order_by("last_name", "asc"); - return $this->db->get(); + $this->db->where_in('suppliers.person_id', $suppliers_ids); + $this->db->order_by('last_name', 'asc'); + + return $this->db->get(); } /* Inserts or updates a suppliers */ - function save_supplier(&$person_data, &$supplier_data,$supplier_id=false) + public function save_supplier(&$person_data, &$supplier_data, $supplier_id = FALSE) { - $success=false; + $success = FALSE; + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); if(parent::save($person_data,$supplier_id)) { - if (!$supplier_id or !$this->exists($supplier_id)) + if(!$supplier_id || !$this->exists($supplier_id)) { $supplier_data['person_id'] = $person_data['person_id']; - $success = $this->db->insert('suppliers',$supplier_data); + $success = $this->db->insert('suppliers', $supplier_data); } else { $this->db->where('person_id', $supplier_id); - $success = $this->db->update('suppliers',$supplier_data); + $success = $this->db->update('suppliers', $supplier_data); } - } - $this->db->trans_complete(); + $this->db->trans_complete(); + + $success &= $this->db->trans_status(); + return $success; } /* Deletes one supplier */ - function delete($supplier_id) + public function delete($supplier_id) { $this->db->where('person_id', $supplier_id); + return $this->db->update('suppliers', array('deleted' => 1)); } /* Deletes a list of suppliers */ - function delete_list($supplier_ids) + public function delete_list($supplier_ids) { - $this->db->where_in('person_id',$supplier_ids); + $this->db->where_in('person_id', $supplier_ids); + return $this->db->update('suppliers', array('deleted' => 1)); } /* Get search suggestions to find suppliers */ - function get_search_suggestions($search, $unique = FALSE, $limit = 25) + public function get_search_suggestions($search, $unique = FALSE, $limit = 25) { $suggestions = array(); $this->db->from('suppliers'); - $this->db->join('people', 'suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->like("company_name", $search); - $this->db->order_by("company_name", "asc"); - $by_company_name = $this->db->get(); - foreach ($by_company_name->result() as $row) { + $this->db->like('company_name', $search); + $this->db->order_by('company_name', 'asc'); + foreach($this->db->get()->result() as $row) + { $suggestions[] = array('value' => $row->person_id, 'label' => $row->company_name); } $this->db->from('suppliers'); - $this->db->join('people', 'suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id = people.person_id'); $this->db->where('deleted', 0); $this->db->distinct(); - $this->db->like("agency_name", $search); - $this->db->where("agency_name", "<> null"); - $this->db->order_by("agency_name", "asc"); - $by_agency_name = $this->db->get(); - foreach ($by_agency_name->result() as $row) { + $this->db->like('agency_name', $search); + $this->db->where('agency_name IS NOT NULL'); + $this->db->order_by('agency_name', 'asc'); + foreach($this->db->get()->result() as $row) + { $suggestions[] = array('value' => $row->person_id, 'label' => $row->agency_name); } $this->db->from('suppliers'); - $this->db->join('people', 'suppliers.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%" . $this->db->escape_like_str($search) . "%' or - last_name LIKE '%" . $this->db->escape_like_str($search) . "%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%" . $this->db->escape_like_str($search) . "%') and deleted=0"); - $this->db->order_by("last_name", "asc"); - $by_name = $this->db->get(); - foreach ($by_name->result() as $row) { + $this->db->join('people', 'suppliers.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); + $this->db->order_by('last_name', 'asc'); + foreach($this->db->get()->result() as $row) + { $suggestions[] = array('value' => $row->person_id, 'label' => $row->first_name . ' ' . $row->last_name); } - if (!$unique) + if(!$unique) { $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->like("email",$search); - $this->db->order_by("email", "asc"); - $by_email = $this->db->get(); - foreach($by_email->result() as $row) + $this->db->like('email', $search); + $this->db->order_by('email', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->email); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->email); } $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->like("phone_number",$search); - $this->db->order_by("phone_number", "asc"); - $by_phone = $this->db->get(); - foreach($by_phone->result() as $row) + $this->db->like('phone_number', $search); + $this->db->order_by('phone_number', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->phone_number); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->phone_number); } $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); + $this->db->join('people', 'suppliers.person_id = people.person_id'); $this->db->where('deleted', 0); - $this->db->like("account_number",$search); - $this->db->order_by("account_number", "asc"); - $by_account_number = $this->db->get(); - foreach($by_account_number->result() as $row) + $this->db->like('account_number', $search); + $this->db->order_by('account_number', 'asc'); + foreach($this->db->get()->result() as $row) { - $suggestions[]=array('value' => $row->person_id, 'label' => $row->account_number); + $suggestions[] = array('value' => $row->person_id, 'label' => $row->account_number); } } //only return $limit suggestions if(count($suggestions > $limit)) { - $suggestions = array_slice($suggestions, 0,$limit); + $suggestions = array_slice($suggestions, 0, $limit); } + return $suggestions; - } - function get_found_rows($search) + /* + Gets rows + */ + public function get_found_rows($search) { $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - company_name LIKE '%".$this->db->escape_like_str($search)."%' or - agency_name LIKE '%".$this->db->escape_like_str($search)."%' or - email LIKE '%".$this->db->escape_like_str($search)."%' or - phone_number LIKE '%".$this->db->escape_like_str($search)."%' or - account_number LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); + $this->db->join('people', 'suppliers.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('company_name', $search); + $this->db->or_like('agency_name', $search); + $this->db->or_like('email', $search); + $this->db->or_like('phone_number', $search); + $this->db->or_like('account_number', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); + return $this->db->get()->num_rows(); } /* Perform a search on suppliers */ - function search($search, $rows = 0, $limit_from = 0) + public function search($search, $rows = 0, $limit_from = 0, $sort = 'last_name', $order = 'asc') { $this->db->from('suppliers'); - $this->db->join('people','suppliers.person_id=people.person_id'); - $this->db->where("(first_name LIKE '%".$this->db->escape_like_str($search)."%' or - last_name LIKE '%".$this->db->escape_like_str($search)."%' or - company_name LIKE '%".$this->db->escape_like_str($search)."%' or - agency_name LIKE '%".$this->db->escape_like_str($search)."%' or - email LIKE '%".$this->db->escape_like_str($search)."%' or - phone_number LIKE '%".$this->db->escape_like_str($search)."%' or - account_number LIKE '%".$this->db->escape_like_str($search)."%' or - CONCAT(`first_name`,' ',`last_name`) LIKE '%".$this->db->escape_like_str($search)."%') and deleted=0"); - $this->db->order_by("last_name", "asc"); - if ($rows > 0) { + $this->db->join('people', 'suppliers.person_id = people.person_id'); + $this->db->group_start(); + $this->db->like('first_name', $search); + $this->db->or_like('last_name', $search); + $this->db->or_like('company_name', $search); + $this->db->or_like('agency_name', $search); + $this->db->or_like('email', $search); + $this->db->or_like('phone_number', $search); + $this->db->or_like('account_number', $search); + $this->db->or_like('CONCAT(first_name, " ", last_name)', $search); + $this->db->group_end(); + $this->db->where('deleted', 0); + + $this->db->order_by($sort, $order); + + if($rows > 0) + { $this->db->limit($rows, $limit_from); } - return $this->db->get(); - } + return $this->db->get(); + } } ?> diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 20e35085b..ce9df2327 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -9,26 +9,40 @@ class Detailed_receivings extends Report public function getDataColumns() { - if(get_instance()->config->item('invoice_enable') == TRUE) + $columns = array( + 'summary' => array( + 'id' => $this->lang->line('reports_receiving_id'), + 'receiving_date' => $this->lang->line('reports_date'), + 'quantity' => $this->lang->line('reports_quantity'), + 'employee' => $this->lang->line('reports_received_by'), + 'supplier' => $this->lang->line('reports_supplied_by'), + 'total' => $this->lang->line('reports_total'), + 'payment_type' => $this->lang->line('reports_payment_type'), + 'invoice_number' => $this->lang->line('recvs_invoice_number'), + 'comment' => $this->lang->line('reports_comments'), + 'edit' => ''), + 'details' => array( + $this->lang->line('reports_item_number'), + $this->lang->line('reports_name'), + $this->lang->line('reports_category'), + $this->lang->line('reports_quantity'), + $this->lang->line('reports_total'), + $this->lang->line('reports_discount')) + ); + + if (!get_instance()->config->item('invoice_enable')) { - return array('summary' => array($this->lang->line('reports_receiving_id'), $this->lang->line('reports_date'), $this->lang->line('reports_quantity'), $this->lang->line('reports_received_by'), $this->lang->line('reports_supplied_by'), $this->lang->line('reports_total'), $this->lang->line('reports_payment_type'), $this->lang->line('recvs_invoice_number'), $this->lang->line('reports_comments')), - 'details' => array($this->lang->line('reports_item_number'), $this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_quantity'), $this->lang->line('reports_total'), $this->lang->line('reports_discount')) - ); - } - else - { - return array('summary' => array($this->lang->line('reports_receiving_id'), $this->lang->line('reports_date'), $this->lang->line('reports_quantity'), $this->lang->line('reports_received_by'), $this->lang->line('reports_supplied_by'), $this->lang->line('reports_total'), $this->lang->line('reports_payment_type'), $this->lang->line('reports_comments')), - 'details' => array($this->lang->line('reports_item_number'), $this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_quantity'), $this->lang->line('reports_total'), $this->lang->line('reports_discount')) - ); + unset($columns['summary']['invoice_number']); } + return $columns; } public function getDataByReceivingId($receiving_id) { - $this->db->select('receiving_id, DATE_FORMAT(receiving_date, "%d-%m-%Y") AS receiving_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name, " ", employee.last_name) as employee_name, suppliers.company_name as supplier_name, sum(subtotal) as subtotal, sum(total) as total, sum(profit) as profit, payment_type, comment, invoice_number', false); + $this->db->select('receiving_id, DATE_FORMAT(receiving_date, "%d-%m-%Y") AS receiving_date, SUM(quantity_purchased) AS items_purchased, CONCAT(employee.first_name, " ", employee.last_name) AS employee_name, suppliers.company_name AS supplier_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(profit) AS profit, payment_type, comment, invoice_number'); $this->db->from('receivings_items_temp'); - $this->db->join('people as employee', 'receivings_items_temp.employee_id = employee.person_id'); - $this->db->join('suppliers as suppliers', 'receivings_items_temp.supplier_id = suppliers.person_id', 'left'); + $this->db->join('people AS employee', 'receivings_items_temp.employee_id = employee.person_id'); + $this->db->join('suppliers AS suppliers', 'receivings_items_temp.supplier_id = suppliers.person_id', 'left'); $this->db->where('receiving_id', $receiving_id); return $this->db->get()->row_array(); @@ -36,11 +50,12 @@ class Detailed_receivings extends Report public function getData(array $inputs) { - $this->db->select('receiving_id, receiving_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name," ",employee.last_name) as employee_name, CONCAT(supplier.first_name," ",supplier.last_name) as supplier_name, sum(total) as total, sum(profit) as profit, payment_type, comment, invoice_number', false); + $this->db->select('receiving_id, receiving_date, SUM(quantity_purchased) AS items_purchased, CONCAT(employee.first_name," ",employee.last_name) AS employee_name, CONCAT(supplier.first_name," ",supplier.last_name) AS supplier_name, SUM(total) AS total, SUM(profit) AS profit, payment_type, comment, invoice_number'); $this->db->from('receivings_items_temp'); - $this->db->join('people as employee', 'receivings_items_temp.employee_id = employee.person_id'); - $this->db->join('people as supplier', 'receivings_items_temp.supplier_id = supplier.person_id', 'left'); - $this->db->where('receiving_date BETWEEN '. $this->db->escape($inputs['start_date']). ' and '. $this->db->escape($inputs['end_date'])); + $this->db->join('people AS employee', 'receivings_items_temp.employee_id = employee.person_id'); + $this->db->join('people AS supplier', 'receivings_items_temp.supplier_id = supplier.person_id', 'left'); + $this->db->where('receiving_date BETWEEN '. $this->db->escape($inputs['start_date']). ' AND '. $this->db->escape($inputs['end_date'])); + if ($inputs['location_id'] != 'all') { $this->db->where('item_location', $inputs['location_id']); @@ -79,9 +94,9 @@ class Detailed_receivings extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(total) as total'); + $this->db->select('SUM(total) AS total'); $this->db->from('receivings_items_temp'); - $this->db->where('receiving_date BETWEEN '. $this->db->escape($inputs['start_date']). ' and '. $this->db->escape($inputs['end_date'])); + $this->db->where('receiving_date BETWEEN '. $this->db->escape($inputs['start_date']). ' AND '. $this->db->escape($inputs['end_date'])); if ($inputs['location_id'] != 'all') { diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index bf1ef3d37..79513c5d1 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -9,17 +9,42 @@ class Detailed_sales extends Report public function getDataColumns() { - return array('summary' => array($this->lang->line('reports_sale_id'), $this->lang->line('reports_date'), $this->lang->line('reports_quantity'), $this->lang->line('reports_sold_by'), $this->lang->line('reports_sold_to'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_cost'), $this->lang->line('reports_profit'), $this->lang->line('reports_payment_type'), $this->lang->line('reports_comments')), - 'details' => array($this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_serial_number'), $this->lang->line('reports_description'), $this->lang->line('reports_quantity'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_cost'), $this->lang->line('reports_profit'), $this->lang->line('reports_discount')) + return array( + 'summary' => array( + 'id' => $this->lang->line('reports_sale_id'), + 'sale_date' => $this->lang->line('reports_date'), + 'quantity' => $this->lang->line('reports_quantity'), + 'employee' => $this->lang->line('reports_sold_by'), + 'customer' => $this->lang->line('reports_sold_to'), + 'subtotal' => $this->lang->line('reports_subtotal'), + 'total' => $this->lang->line('reports_total'), + 'tax' => $this->lang->line('reports_tax'), + 'cost' => $this->lang->line('reports_cost'), + 'profit' => $this->lang->line('reports_profit'), + 'payment_type' => $this->lang->line('reports_payment_type'), + 'comment' => $this->lang->line('reports_comments'), + 'edit' => ''), + 'details' => array( + $this->lang->line('reports_name'), + $this->lang->line('reports_category'), + $this->lang->line('reports_serial_number'), + $this->lang->line('reports_description'), + $this->lang->line('reports_quantity'), + $this->lang->line('reports_subtotal'), + $this->lang->line('reports_total'), + $this->lang->line('reports_tax'), + $this->lang->line('reports_cost'), + $this->lang->line('reports_profit'), + $this->lang->line('reports_discount')) ); } public function getDataBySaleId($sale_id) { - $this->db->select('sale_id, DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name, " ", employee.last_name) as employee_name, CONCAT(customer.first_name," ",customer.last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit, payment_type, comment', false); + $this->db->select('sale_id, DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date, SUM(quantity_purchased) AS items_purchased, CONCAT(employee.first_name, " ", employee.last_name) AS employee_name, CONCAT(customer.first_name," ",customer.last_name) AS customer_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit, payment_type, comment'); $this->db->from('sales_items_temp'); - $this->db->join('people as employee', 'sales_items_temp.employee_id = employee.person_id'); - $this->db->join('people as customer', 'sales_items_temp.customer_id = customer.person_id', 'left'); + $this->db->join('people AS employee', 'sales_items_temp.employee_id = employee.person_id'); + $this->db->join('people AS customer', 'sales_items_temp.customer_id = customer.person_id', 'left'); $this->db->where('sale_id', $sale_id); return $this->db->get()->row_array(); @@ -27,11 +52,11 @@ class Detailed_sales extends Report public function getData(array $inputs) { - $this->db->select('sale_id, sale_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name," ",employee.last_name) as employee_name, CONCAT(customer.first_name," ",customer.last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit, payment_type, comment', false); + $this->db->select('sale_id, sale_date, SUM(quantity_purchased) AS items_purchased, CONCAT(employee.first_name," ",employee.last_name) AS employee_name, CONCAT(customer.first_name," ",customer.last_name) AS customer_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit, payment_type, comment'); $this->db->from('sales_items_temp'); - $this->db->join('people as employee', 'sales_items_temp.employee_id = employee.person_id'); - $this->db->join('people as customer', 'sales_items_temp.customer_id = customer.person_id', 'left'); - $this->db->where('sale_date BETWEEN '. $this->db->escape($inputs['start_date']). ' and '. $this->db->escape($inputs['end_date'])); + $this->db->join('people AS employee', 'sales_items_temp.employee_id = employee.person_id'); + $this->db->join('people AS customer', 'sales_items_temp.customer_id = customer.person_id', 'left'); + $this->db->where('sale_date BETWEEN '. $this->db->escape($inputs['start_date']). ' AND '. $this->db->escape($inputs['end_date'])); if ($inputs['location_id'] != 'all') { @@ -68,9 +93,9 @@ class Detailed_sales extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); - $this->db->where('sale_date BETWEEN '. $this->db->escape($inputs['start_date']). ' and '. $this->db->escape($inputs['end_date'])); + $this->db->where('sale_date BETWEEN '. $this->db->escape($inputs['start_date']). ' AND '. $this->db->escape($inputs['end_date'])); if ($inputs['location_id'] != 'all') { diff --git a/application/models/reports/Inventory_low.php b/application/models/reports/Inventory_low.php index 668a82f2c..13687a17e 100644 --- a/application/models/reports/Inventory_low.php +++ b/application/models/reports/Inventory_low.php @@ -20,8 +20,8 @@ class Inventory_low extends Report public function getData(array $inputs) { $this->db->from('items'); - $this->db->join('item_quantities','items.item_id=item_quantities.item_id'); - $this->db->join('stock_locations','item_quantities.location_id=stock_locations.location_id'); + $this->db->join('item_quantities', 'items.item_id=item_quantities.item_id'); + $this->db->join('stock_locations', 'item_quantities.location_id=stock_locations.location_id'); $this->db->select('name, item_number, reorder_level, item_quantities.quantity, description, location_name'); $this->db->where('item_quantities.quantity <= reorder_level'); $this->db->where('items.deleted', 0); diff --git a/application/models/reports/Inventory_summary.php b/application/models/reports/Inventory_summary.php index fd00927fe..845e88beb 100644 --- a/application/models/reports/Inventory_summary.php +++ b/application/models/reports/Inventory_summary.php @@ -23,23 +23,24 @@ class Inventory_summary extends Report public function getData(array $inputs) { $this->db->from('items'); - $this->db->join('item_quantities','items.item_id=item_quantities.item_id'); - $this->db->join('stock_locations','item_quantities.location_id=stock_locations.location_id'); - $this->db->select('name, item_number, reorder_level, item_quantities.quantity, description, location_name, cost_price, unit_price, (cost_price*quantity) as sub_total_value'); + $this->db->join('item_quantities', 'items.item_id=item_quantities.item_id'); + $this->db->join('stock_locations', 'item_quantities.location_id=stock_locations.location_id'); + $this->db->select('name, item_number, reorder_level, item_quantities.quantity, description, location_name, cost_price, unit_price, (cost_price*quantity) AS sub_total_value'); $this->db->where('items.deleted', 0); + // should be corresponding to values Inventory_summary::getItemCountDropdownArray() returns... if($inputs['item_count'] == 'zero_and_less') { - $this->db->where('quantity <=', 0); + $this->db->where('quantity <= 0'); } elseif($inputs['item_count'] == 'more_than_zero') { - $this->db->where('quantity >', 0); + $this->db->where('quantity > 0'); } if($inputs['location_id'] != 'all') { - $this->db->where('item_quantities.location_id',$inputs['location_id']); + $this->db->where('item_quantities.location_id', $inputs['location_id']); } $this->db->order_by('name'); @@ -48,7 +49,7 @@ class Inventory_summary extends Report } /** - * calulcates the total value of the given inventory summary by summing all sub_total_values (see Inventory_summary::getData()) + * calculates the total value of the given inventory summary by summing all sub_total_values (see Inventory_summary::getData()) * * @param array $inputs expects the reports-data-array which Inventory_summary::getData() returns * @return array @@ -70,8 +71,7 @@ class Inventory_summary extends Report */ public function getItemCountDropdownArray() { - return array( - 'all' => $this->lang->line('reports_all'), + return array('all' => $this->lang->line('reports_all'), 'zero_and_less' => $this->lang->line('reports_zero_and_less'), 'more_than_zero' => $this->lang->line('reports_more_than_zero')); } diff --git a/application/models/reports/Report.php b/application/models/reports/Report.php index 0a7f6e31a..f89f6bd77 100644 --- a/application/models/reports/Report.php +++ b/application/models/reports/Report.php @@ -8,7 +8,7 @@ abstract class Report extends CI_Model //Make sure the report is not cached by the browser $this->output->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate"); - $this->output->set_header("Cache-Control: post-check=0, pre-check=0", false); + $this->output->set_header("Cache-Control: post-check=0, pre-check=0", FALSE); $this->output->set_header("Pragma: no-cache"); //Create our temp tables to work with the data in our report diff --git a/application/models/reports/Specific_customer.php b/application/models/reports/Specific_customer.php index 7a71dc3de..4c5d57442 100644 --- a/application/models/reports/Specific_customer.php +++ b/application/models/reports/Specific_customer.php @@ -16,10 +16,10 @@ class Specific_customer extends Report public function getData(array $inputs) { - $this->db->select('sale_id, sale_date, sum(quantity_purchased) as items_purchased, CONCAT(first_name, " ", last_name) as employee_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit, payment_type, comment', false); + $this->db->select('sale_id, sale_date, SUM(quantity_purchased) AS items_purchased, CONCAT(first_name, " ", last_name) AS employee_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit, payment_type, comment'); $this->db->from('sales_items_temp'); $this->db->join('people', 'sales_items_temp.employee_id = people.person_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and customer_id='.$inputs['customer_id']); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date']) . " AND customer_id=" . $this->db->escape($inputs['customer_id'])); if ($inputs['sale_type'] == 'sales') { @@ -51,9 +51,9 @@ class Specific_customer extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and customer_id='.$inputs['customer_id']); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date']) . " AND customer_id=" . $this->db->escape($inputs['customer_id'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Specific_discount.php b/application/models/reports/Specific_discount.php index 36c7b1271..156d2a915 100755 --- a/application/models/reports/Specific_discount.php +++ b/application/models/reports/Specific_discount.php @@ -16,10 +16,10 @@ class Specific_discount extends Report public function getData(array $inputs) { - $this->db->select('sale_id, DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date, sum(quantity_purchased) as items_purchased, CONCAT(first_name, " ", last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit, payment_type, comment', false); + $this->db->select('sale_id, DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date, SUM(quantity_purchased) AS items_purchased, CONCAT(first_name, " ", last_name) AS customer_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit, payment_type, comment'); $this->db->from('sales_items_temp'); - $this->db->join('people as customer', 'sales_items_temp.customer_id = customer.person_id', 'left'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and discount_percent >='.$inputs['discount']); + $this->db->join('people AS customer', 'sales_items_temp.customer_id = customer.person_id', 'left'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date']) . " AND discount_percent >=" . $this->db->escape($inputs['discount'])); if ($inputs['sale_type'] == 'sales') { @@ -42,7 +42,7 @@ class Specific_discount extends Report $this->db->select('name, serialnumber, category, sales_items_temp.description, quantity_purchased, subtotal, total, tax, cost, profit, discount_percent'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); - $this->db->where('sale_id = '.$value['sale_id'] . " AND discount_percent >= " . $inputs['discount']); + $this->db->where('sale_id = ' . $value['sale_id'] . " AND discount_percent >= " . $this->db->escape($inputs['discount'])); $data['details'][$key] = $this->db->get()->result_array(); } @@ -51,9 +51,9 @@ class Specific_discount extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and discount_percent >= '.$inputs['discount']); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date']) . " AND discount_percent >=" . $this->db->escape($inputs['discount'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Specific_employee.php b/application/models/reports/Specific_employee.php index e5a971291..1d1615f3d 100644 --- a/application/models/reports/Specific_employee.php +++ b/application/models/reports/Specific_employee.php @@ -16,10 +16,10 @@ class Specific_employee extends Report public function getData(array $inputs) { - $this->db->select('sale_id, sale_date, sum(quantity_purchased) as items_purchased, CONCAT(first_name, " ", last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit, payment_type, comment', false); + $this->db->select('sale_id, sale_date, SUM(quantity_purchased) AS items_purchased, CONCAT(first_name, " ", last_name) AS customer_name, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit, payment_type, comment'); $this->db->from('sales_items_temp'); $this->db->join('people', 'sales_items_temp.customer_id = people.person_id', 'left'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and employee_id='.$inputs['employee_id']); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date']) . " AND employee_id=" . $this->db->escape($inputs['employee_id'])); if ($inputs['sale_type'] == 'sales') { @@ -51,9 +51,9 @@ class Specific_employee extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and employee_id='.$inputs['employee_id']); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date']) . " AND employee_id=" . $this->db->escape($inputs['employee_id'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_categories.php b/application/models/reports/Summary_categories.php index 10b481c7f..5f0c79c68 100644 --- a/application/models/reports/Summary_categories.php +++ b/application/models/reports/Summary_categories.php @@ -14,10 +14,10 @@ class Summary_categories extends Report public function getData(array $inputs) { - $this->db->select('category, sum(quantity_purchased) as quantity_purchased, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('category, SUM(quantity_purchased) AS quantity_purchased, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { @@ -36,10 +36,10 @@ class Summary_categories extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_customers.php b/application/models/reports/Summary_customers.php index f1b1f0f58..cb2ccf979 100644 --- a/application/models/reports/Summary_customers.php +++ b/application/models/reports/Summary_customers.php @@ -14,11 +14,11 @@ class Summary_customers extends Report public function getData(array $inputs) { - $this->db->select('CONCAT(first_name, " ", last_name) as customer, sum(quantity_purchased) as quantity_purchased, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit', false); + $this->db->select('CONCAT(first_name, " ", last_name) AS customer, SUM(quantity_purchased) AS quantity_purchased, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('customers', 'customers.person_id = sales_items_temp.customer_id'); $this->db->join('people', 'customers.person_id = people.person_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { @@ -37,11 +37,11 @@ class Summary_customers extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('customers', 'customers.person_id = sales_items_temp.customer_id'); $this->db->join('people', 'customers.person_id = people.person_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_discounts.php b/application/models/reports/Summary_discounts.php index b54dd242c..d69c3ece8 100644 --- a/application/models/reports/Summary_discounts.php +++ b/application/models/reports/Summary_discounts.php @@ -14,9 +14,10 @@ class Summary_discounts extends Report public function getData(array $inputs) { - $this->db->select('CONCAT(discount_percent, "%") as discount_percent, count(*) as count', false); + $this->db->select('CONCAT(discount_percent, "%") AS discount_percent, count(*) AS count'); $this->db->from('sales_items_temp'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and discount_percent > 0'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); + $this->db->where('discount_percent > 0'); if ($inputs['sale_type'] == 'sales') { @@ -35,9 +36,9 @@ class Summary_discounts extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_employees.php b/application/models/reports/Summary_employees.php index 5582c3f68..7cd316fda 100644 --- a/application/models/reports/Summary_employees.php +++ b/application/models/reports/Summary_employees.php @@ -14,11 +14,11 @@ class Summary_employees extends Report public function getData(array $inputs) { - $this->db->select('CONCAT(first_name, " ", last_name) as employee, sum(quantity_purchased) as quantity_purchased, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit', false); + $this->db->select('CONCAT(first_name, " ", last_name) AS employee, SUM(quantity_purchased) AS quantity_purchased, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('employees', 'employees.person_id = sales_items_temp.employee_id'); $this->db->join('people', 'employees.person_id = people.person_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { @@ -37,11 +37,11 @@ class Summary_employees extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('employees', 'employees.person_id = sales_items_temp.employee_id'); $this->db->join('people', 'employees.person_id = people.person_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_items.php b/application/models/reports/Summary_items.php index 352f713ec..241efb136 100644 --- a/application/models/reports/Summary_items.php +++ b/application/models/reports/Summary_items.php @@ -14,10 +14,10 @@ class Summary_items extends Report public function getData(array $inputs) { - $this->db->select('name, sum(quantity_purchased) as quantity_purchased, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('name, SUM(quantity_purchased) AS quantity_purchased, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { @@ -36,10 +36,10 @@ class Summary_items extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_payments.php b/application/models/reports/Summary_payments.php index 22c92b51a..76eed64eb 100644 --- a/application/models/reports/Summary_payments.php +++ b/application/models/reports/Summary_payments.php @@ -14,10 +14,10 @@ class Summary_payments extends Report public function getData(array $inputs) { - $this->db->select('sales_payments.payment_type, count(*) AS count, SUM(payment_amount) AS payment_amount', false); + $this->db->select('sales_payments.payment_type, count(*) AS count, SUM(payment_amount) AS payment_amount'); $this->db->from('sales_payments'); $this->db->join('sales', 'sales.sale_id=sales_payments.sale_id'); - $this->db->where('date(sale_time) BETWEEN "'. $inputs['start_date']. '" AND "'. $inputs['end_date'].'"'); + $this->db->where("date(sale_time) BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { @@ -57,10 +57,10 @@ class Summary_payments extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) AS subtotal, sum(total) AS total, sum(tax) AS tax, sum(cost) AS cost, sum(profit) AS profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" AND "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_sales.php b/application/models/reports/Summary_sales.php index 83f5eb619..bc10bd6e9 100644 --- a/application/models/reports/Summary_sales.php +++ b/application/models/reports/Summary_sales.php @@ -14,8 +14,9 @@ class Summary_sales extends Report public function getData(array $inputs) { - $this->db->select('sale_date, sum(quantity_purchased) as quantity_purchased, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('sale_date, SUM(quantity_purchased) AS quantity_purchased, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { @@ -27,7 +28,6 @@ class Summary_sales extends Report } $this->db->group_by('sale_date'); - $this->db->having('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); $this->db->order_by('sale_date'); return $this->db->get()->result_array(); @@ -35,9 +35,9 @@ class Summary_sales extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_suppliers.php b/application/models/reports/Summary_suppliers.php index b0ce5dd31..225cac213 100644 --- a/application/models/reports/Summary_suppliers.php +++ b/application/models/reports/Summary_suppliers.php @@ -14,11 +14,11 @@ class Summary_suppliers extends Report public function getData(array $inputs) { - $this->db->select('CONCAT(company_name, " (", first_name, " ",last_name, ")") as supplier, sum(quantity_purchased) as quantity_purchased, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit', false); + $this->db->select('CONCAT(company_name, " (", first_name, " ", last_name, ")") AS supplier, SUM(quantity_purchased) AS quantity_purchased, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('suppliers', 'suppliers.person_id = sales_items_temp.supplier_id'); $this->db->join('people', 'suppliers.person_id = people.person_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { @@ -37,11 +37,11 @@ class Summary_suppliers extends Report public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('suppliers', 'suppliers.person_id = sales_items_temp.supplier_id'); $this->db->join('people', 'suppliers.person_id = people.person_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/models/reports/Summary_taxes.php b/application/models/reports/Summary_taxes.php index 3ab456747..c3304ac70 100644 --- a/application/models/reports/Summary_taxes.php +++ b/application/models/reports/Summary_taxes.php @@ -26,42 +26,42 @@ class Summary_taxes extends Report if ($this->config->item('tax_included')) { - $total = "1"; + $total = "1"; $subtotal = "(100/(100+percent))"; - $tax="(1 - (100/(100 +percent)))"; + $tax = "(1 - (100/(100 +percent)))"; } else { - $tax = "(percent/100)"; - $total = "(1+(percent/100))"; + $tax = "(percent/100)"; + $total = "(1+(percent/100))"; $subtotal = "1"; } $decimals = totals_decimals(); - $query = $this->db->query("SELECT percent, count(*) as count, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax - FROM (SELECT name, CONCAT(ROUND(percent, $decimals), '%') AS percent, - ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $subtotal, $decimals) AS subtotal, - ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $total, $decimals) AS total, - ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $tax, $decimals) AS tax - FROM ".$this->db->dbprefix('sales_items_taxes')." - JOIN ".$this->db->dbprefix('sales_items')." ON " - .$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales_items_taxes').'.sale_id'." and " - .$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('sales_items_taxes').'.item_id'." and " - .$this->db->dbprefix('sales_items').'.line='.$this->db->dbprefix('sales_items_taxes').'.line' - ." JOIN ".$this->db->dbprefix('sales')." ON ".$this->db->dbprefix('sales_items_taxes').".sale_id=".$this->db->dbprefix('sales').".sale_id - WHERE date(sale_time) BETWEEN '".$inputs['start_date']."' and '".$inputs['end_date']."' $quantity_cond) as temp_taxes - GROUP BY percent"); + $query = $this->db->query("SELECT percent, count(*) AS count, SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax + FROM (SELECT name, CONCAT(ROUND(percent, $decimals), '%') AS percent, + ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $subtotal, $decimals) AS subtotal, + ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $total, $decimals) AS total, + ROUND((item_unit_price * quantity_purchased - item_unit_price * quantity_purchased * discount_percent /100) * $tax, $decimals) AS tax + FROM ".$this->db->dbprefix('sales_items_taxes')." + JOIN ".$this->db->dbprefix('sales_items')." ON " + .$this->db->dbprefix('sales_items').'.sale_id='.$this->db->dbprefix('sales_items_taxes').'.sale_id'." AND " + .$this->db->dbprefix('sales_items').'.item_id='.$this->db->dbprefix('sales_items_taxes').'.item_id'." AND " + .$this->db->dbprefix('sales_items').'.line='.$this->db->dbprefix('sales_items_taxes').'.line' + ." JOIN ".$this->db->dbprefix('sales')." ON ".$this->db->dbprefix('sales_items_taxes').".sale_id=".$this->db->dbprefix('sales').".sale_id + WHERE date(sale_time) BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date']) . " $quantity_cond) AS temp_taxes + GROUP BY percent"); return $query->result_array(); } public function getSummaryData(array $inputs) { - $this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit'); + $this->db->select('SUM(subtotal) AS subtotal, SUM(total) AS total, SUM(tax) AS tax, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); $this->db->join('items', 'sales_items_temp.item_id = items.item_id'); - $this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"'); + $this->db->where("sale_date BETWEEN " . $this->db->escape($inputs['start_date']) . " AND " . $this->db->escape($inputs['end_date'])); if ($inputs['sale_type'] == 'sales') { diff --git a/application/views/configs/barcode_config.php b/application/views/configs/barcode_config.php index f90344433..f6e98602a 100644 --- a/application/views/configs/barcode_config.php +++ b/application/views/configs/barcode_config.php @@ -194,39 +194,15 @@ - diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index 49232c99e..bb290c2c6 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -95,6 +95,29 @@ +
+ lang->line('config_notify_alignment'), 'config_notify_horizontal_position', array('class'=>'control-label col-xs-2')); ?> +
+
+
+ 'Top', + 'bottom' => 'Bottom' + ), + $this->config->item('config_notify_vertical_position'), array('class'=>'form-control input-sm')); ?> +
+
+ 'Left', + 'center' => 'Center', + 'right' => 'Right' + ), + $this->config->item('config_notify_horizontal_position'), array('class'=>'form-control input-sm')); ?> +
+
+
+
+
lang->line('config_custom1'), 'config_custom1', array('class'=>'control-label col-xs-2')); ?>
@@ -227,36 +250,14 @@ //validation and submit handling $(document).ready(function() { + $("#backup_db").click(function() { window.location=''; }); - $('#general_config_form').validate({ - submitHandler: function(form) { - $(form).ajaxSubmit({ - success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } - }, - dataType: 'json' - }); - }, + $('#general_config_form').validate($.extend(form_support.handler, { - errorClass: "has-error", errorLabelContainer: "#general_error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - }, rules: { @@ -301,6 +302,6 @@ $(document).ready(function() number: "lang->line('config_lines_per_page_number'); ?>" } } - }); + })); }); diff --git a/application/views/configs/info_config.php b/application/views/configs/info_config.php index 3e94311cf..2fee142f8 100644 --- a/application/views/configs/info_config.php +++ b/application/views/configs/info_config.php @@ -140,34 +140,11 @@ $(document).ready(function() }) }); - $('#info_config_form').validate({ - submitHandler: function(form) { - $(form).ajaxSubmit({ - success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } - }, - dataType: 'json' - }); - }, + $('#info_config_form').validate($.extend(form_support.handler, { - errorClass: "has-error", errorLabelContainer: "#general_error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - }, - rules: + rules: { company: "required", address: "required", @@ -184,6 +161,6 @@ $(document).ready(function() email: "lang->line('common_email_invalid_format'); ?>", return_policy: "lang->line('config_return_policy_required'); ?>" } - }); + })); }); diff --git a/application/views/configs/invoice_config.php b/application/views/configs/invoice_config.php index 4313d0433..cd81dd2c4 100644 --- a/application/views/configs/invoice_config.php +++ b/application/views/configs/invoice_config.php @@ -97,7 +97,7 @@ $(document).ready(function() })(); $("#use_invoice_template").change(enable_disable_use_invoice_template); - $('#invoice_config_form').validate({ + $('#invoice_config_form').validate($.extend(form_support.handler, { submitHandler: function(form) { $(form).ajaxSubmit({ beforeSerialize: function(arr, $form, options) { @@ -105,14 +105,7 @@ $(document).ready(function() return true; }, success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } + $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); // set back disabled state enable_disable_invoice_enable(); enable_disable_use_invoice_template(); @@ -121,25 +114,8 @@ $(document).ready(function() }); }, - errorClass: "has-error", - errorLabelContainer: "#receipt_error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - }, + errorLabelContainer: "#receipt_error_message_box" - rules: - { - - }, - - messages: - { - - } - }); + })); }); diff --git a/application/views/configs/locale_config.php b/application/views/configs/locale_config.php index cb11a3418..294f3cdd1 100644 --- a/application/views/configs/locale_config.php +++ b/application/views/configs/locale_config.php @@ -26,7 +26,7 @@
- lang->line('config_currency_decimals'), 'language', array('class'=>'control-label col-xs-2')); ?> + lang->line('config_currency_decimals'), 'currency_decimals', array('class'=>'control-label col-xs-2')); ?>
'0', @@ -53,7 +53,7 @@
- lang->line('config_decimal_point'), 'language', array('class'=>'control-label col-xs-2')); ?> + lang->line('config_decimal_point'), 'decimal_point', array('class'=>'control-label col-xs-2')); ?>
'. (dot)', @@ -65,7 +65,7 @@
- lang->line('config_thousands_separator'), 'language', array('class'=>'control-label col-xs-2')); ?> + lang->line('config_thousands_separator'), 'thousands_separator', array('class'=>'control-label col-xs-2')); ?>
'' (apostrophe)', @@ -79,7 +79,7 @@
- lang->line('config_quantity_decimals'), 'language', array('class'=>'control-label col-xs-2')); ?> + lang->line('config_quantity_decimals'), 'quantity_decimals', array('class'=>'control-label col-xs-2')); ?>
'0', @@ -92,6 +92,16 @@
+
+ lang->line('config_country_codes'), 'country_codes', array('class'=>'control-label col-xs-2')); ?> +
+ config->item('country_codes'), array('class'=>'form-control input-sm')); ?> +
+
+ +
+
+
lang->line('config_language'), 'language', array('class'=>'control-label col-xs-2')); ?>
@@ -256,42 +266,9 @@ //validation and submit handling $(document).ready(function() { - $('#locale_config_form').validate({ - submitHandler: function(form) { - $(form).ajaxSubmit({ - success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } - }, - dataType: 'json' - }); - }, - - errorClass: "has-error", - errorLabelContainer: "#locale_error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - }, - - rules: - { - - }, - - messages: - { - - } - }); + $("span").tooltip(); + $('#locale_config_form').validate($.extend(form_support.handler, { + errorLabelContainer: "#locale_error_message_box" + })); }); diff --git a/application/views/configs/manage.php b/application/views/configs/manage.php index 08c615825..efca39f32 100644 --- a/application/views/configs/manage.php +++ b/application/views/configs/manage.php @@ -22,16 +22,9 @@
  • lang->line('config_invoice'); ?>
  • - Employee->has_grant('messages', $this->session->userdata('person_id'))) - { - ?> -
  • - lang->line('config_message'); ?> -
  • - +
  • + lang->line('config_message'); ?> +
  • @@ -56,16 +49,9 @@
    load->view("configs/invoice_config"); ?>
    - Employee->has_grant('messages', $this->session->userdata('person_id'))) - { - ?> -
    - load->view("configs/message_config"); ?> -
    - +
    + load->view("configs/message_config"); ?> +
    load->view("partial/footer"); ?> diff --git a/application/views/configs/message_config.php b/application/views/configs/message_config.php index 0861e3d8a..43967a455 100755 --- a/application/views/configs/message_config.php +++ b/application/views/configs/message_config.php @@ -71,32 +71,9 @@ //validation and submit handling $(document).ready(function() { - $('#message_config_form').validate({ - submitHandler: function(form) { - $(form).ajaxSubmit({ - success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } - }, - dataType: 'json' - }); - }, + $('#message_config_form').validate($.extend(form_support.handler, { - errorClass: "has-error", errorLabelContainer: "#general_error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - }, rules: { @@ -111,6 +88,6 @@ $(document).ready(function() msg_pwd: "lang->line('config_msg_pwd_required'); ?>", msg_src: "lang->line('config_msg_src_required'); ?>" } - }); + })); }); diff --git a/application/views/configs/receipt_config.php b/application/views/configs/receipt_config.php index 8d8521882..36a6574dd 100644 --- a/application/views/configs/receipt_config.php +++ b/application/views/configs/receipt_config.php @@ -211,38 +211,22 @@ $(document).ready(function() var dialog_confirmed = window.jsPrintSetup; - $('#receipt_config_form').validate({ + $('#receipt_config_form').validate($.extend(form_support.handler, { submitHandler: function(form) { $(form).ajaxSubmit({ beforeSerialize: function(arr, $form, options) { return ( dialog_confirmed || confirm('lang->line('config_jsprintsetup_required'); ?>') ); }, success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } + $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); }, dataType:'json' }); }, - errorClass: "has-error", errorLabelContainer: "#receipt_error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - }, - - rules: + rules: { print_top_margin: { @@ -289,6 +273,6 @@ $(document).ready(function() number:"lang->line('config_print_right_margin_number'); ?>" } } - }); + })); }); diff --git a/application/views/configs/stock_config.php b/application/views/configs/stock_config.php index a588a9337..2d720e44a 100644 --- a/application/views/configs/stock_config.php +++ b/application/views/configs/stock_config.php @@ -71,36 +71,20 @@ $(document).ready(function() return value.indexOf('_') === -1; }, "lang->line('config_stock_location_invalid_chars'); ?>"); - $('#location_config_form').validate({ + $('#location_config_form').validate($.extend(form_support.handler, { submitHandler: function(form) { $(form).ajaxSubmit({ success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } - + $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); $("#stock_locations").load('', init_add_remove_locations); }, dataType: 'json' }); }, - errorClass: "has-error", errorLabelContainer: "#stock_error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - }, - rules: + rules: { } - }); + })); }); diff --git a/application/views/customers/form.php b/application/views/customers/form.php index 463ae7815..48d9da5cc 100644 --- a/application/views/customers/form.php +++ b/application/views/customers/form.php @@ -86,7 +86,7 @@ $(document).ready(function() success:function(response) { dialog_support.hide(); - post_person_form_submit(response); + table_support.handle_submit('', response); }, dataType:'json' }); @@ -120,6 +120,6 @@ $(document).ready(function() email: "lang->line('common_email_invalid_format'); ?>", account_number: "lang->line('customers_account_number_duplicate'); ?>" } - }, dialog_support.error)); + }, form_support.error)); }); \ No newline at end of file diff --git a/application/views/customers/form_excel_import.php b/application/views/customers/form_excel_import.php index 35d45409f..5419c8fdf 100644 --- a/application/views/customers/form_excel_import.php +++ b/application/views/customers/form_excel_import.php @@ -1,6 +1,6 @@
      -'item_form', 'class'=>'form-horizontal')); ?> +'excel_form', 'class'=>'form-horizontal')); ?>
      @@ -24,29 +24,27 @@ //validation and submit handling $(document).ready(function() { - $('#item_form').validate($.extend({ - submitHandler:function(form) - { + $('#excel_form').validate($.extend({ + submitHandler:function(form) { $(form).ajaxSubmit({ - success:function(response) - { - dialog_support.hide(); - post_person_form_submit(response); - }, - dataType:'json' - }); - + success:function(response) + { + dialog_support.hide(); + $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); + }, + dataType: 'json' + }); }, errorLabelContainer: "#error_message_box", wrapper: "li", rules: { - file_path:"required" + file_path: "required" }, messages: { - file_path:"lang->line('common_import_full_path'); ?>" + file_path: "lang->line('common_import_full_path'); ?>" } - }, dialog_support.error)); + }, form_support.error)); }); diff --git a/application/views/employees/form.php b/application/views/employees/form.php index d21d6ddb5..f0ebfae65 100644 --- a/application/views/employees/form.php +++ b/application/views/employees/form.php @@ -77,34 +77,33 @@
        result() as $module) + foreach($all_modules as $module) { ?>
      • - module_id,$this->Employee->has_grant($module->module_id,$person_info->person_id),"class='module'"); ?> + module_id, $module->grant, "class='module'"); ?> lang->line('module_'.$module->module_id);?>: lang->line('module_'.$module->module_id.'_desc');?> result() as $permission) + foreach($all_subpermissions as $permission) { $exploded_permission = explode('_', $permission->permission_id); - if ($permission->module_id == $module->module_id) + if($permission->module_id == $module->module_id) { $lang_key = $module->module_id.'_'.$exploded_permission[1]; $lang_line = $this->lang->line($lang_key); $lang_line = ($this->lang->line_tbd($lang_key) == $lang_line) ? $exploded_permission[1] : $lang_line; - if (empty($lang_line)) + if(!empty($lang_line)) { - continue; - } ?> -
          -
        • - permission_id, $this->Employee->has_grant($permission->permission_id,$person_info->person_id)); ?> - -
        • -
        - +
      • + permission_id, $permission->grant); ?> + +
      • +
      + @@ -163,7 +162,7 @@ $(document).ready(function() success:function(response) { dialog_support.hide(); - post_person_form_submit(response); + table_support.handle_submit('', response); }, dataType:'json' }); @@ -224,6 +223,6 @@ $(document).ready(function() }, email: "lang->line('common_email_invalid_format'); ?>" } - }, dialog_support.error)); + }, form_support.error)); }); \ No newline at end of file diff --git a/application/views/giftcards/form.php b/application/views/giftcards/form.php index 3d408ad87..0383150ac 100644 --- a/application/views/giftcards/form.php +++ b/application/views/giftcards/form.php @@ -2,7 +2,7 @@
        -giftcard_id, array('id'=>'giftcard_form', 'class'=>'form-horizontal')); ?> +'giftcard_form', 'class'=>'form-horizontal')); ?>
        lang->line('giftcards_person_id'), 'name', array('class'=>'control-label col-xs-3')); ?> @@ -40,7 +40,7 @@ 'name'=>'value', 'id'=>'value', 'class'=>'form-control input-sm', - 'value'=>to_currency_no_money($giftcard_info->value)) + 'value'=>to_currency_no_money($giftcard_value)) );?> config->item('currency_side')): ?> config->item('currency_symbol'); ?> @@ -80,11 +80,11 @@ $(document).ready(function() success:function(response) { dialog_support.hide(); - post_giftcard_form_submit(response); + table_support.handle_submit('', response); }, error: function(jqXHR, textStatus, errorThrown) { - post_giftcard_form_submit({message: errorThrown}); + table_support.handle_submit('', {message: errorThrown}); }, dataType:'json' }); @@ -121,6 +121,6 @@ $(document).ready(function() number:"lang->line('giftcards_value'); ?>" } } - }, dialog_support.error)); + }, form_support.error)); }); \ No newline at end of file diff --git a/application/views/giftcards/manage.php b/application/views/giftcards/manage.php index dd2d31735..51b43ce95 100644 --- a/application/views/giftcards/manage.php +++ b/application/views/giftcards/manage.php @@ -2,85 +2,33 @@ -
        - - - " . $this->lang->line($controller_name . '_new') . "
        ", - array('class'=>'modal-dlg modal-btn-submit', 'title'=>$this->lang->line($controller_name.'_new'))); ?> +
        +
        -'search_form', 'class'=>'form-horizontal')); ?> -
        -
        -
          -
        • ' . $this->lang->line("common_delete") . '
        ', array('id'=>'delete')); ?> - -
      • - 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> - 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> -
      • - -
        -
        - +
        +
        + +
        +
        - +
        load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/item_kits/form.php b/application/views/item_kits/form.php index 5fcb3a43d..d2bd5a924 100644 --- a/application/views/item_kits/form.php +++ b/application/views/item_kits/form.php @@ -49,13 +49,12 @@ Item_kit_items->get_info($item_kit_info->item_kit_id) as $item_kit_item) + foreach($item_kit_items as $item_kit_item) { ?> - Item->get_info($item_kit_item['item_id']); ?> - name; ?> + ' name=item_kit_item[] value=''/> ', response); }, dataType:'json' }); @@ -114,7 +113,7 @@ $(document).ready(function() name:"lang->line('items_name_required'); ?>", category:"lang->line('items_category_required'); ?>" } - }, dialog_support.error)); + }, form_support.error)); }); function delete_item_kit_row(link) diff --git a/application/views/item_kits/manage.php b/application/views/item_kits/manage.php index 98cbe243a..78c69b843 100644 --- a/application/views/item_kits/manage.php +++ b/application/views/item_kits/manage.php @@ -3,98 +3,47 @@ -
        - - - " . $this->lang->line($controller_name . '_new') . "
        ", - array('class'=>'modal-dlg modal-btn-submit none', 'title'=>$this->lang->line($controller_name . '_new'))); ?> +
        +
        -'search_form', 'class'=>'form-horizontal')); ?> -
        -
        -
          -
        • ' . $this->lang->line("common_delete") . '
        ', array('id'=>'delete')); ?> -
      • ' . $this->lang->line("items_generate_barcodes") . '
      • ', array('id'=>'generate_barcodes', 'target' =>'_blank', 'title'=>$this->lang->line('items_generate_barcodes'))); ?> +
        +
        + -
      • - 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> - 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> -
      • - -
        -
        - + +
        +
        - +
        load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/items/form.php b/application/views/items/form.php index 9d7db0ef9..ddc04d637 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -346,7 +346,7 @@ { dialog_support.hide(); } - post_item_form_submit(response, stay_open); + table_support.handle_submit('', response, stay_open); }, dataType: 'json' }); @@ -455,7 +455,7 @@ number:"lang->line('items_tax_percent_number'); ?>" } } - }, dialog_support.error)); + }, form_support.error)); }); diff --git a/application/views/items/form_bulk.php b/application/views/items/form_bulk.php index ba97abe9a..730d1b976 100644 --- a/application/views/items/form_bulk.php +++ b/application/views/items/form_bulk.php @@ -177,18 +177,14 @@ $(document).ready(function() { if(!confirm_message || confirm(confirm_message)) { - //Get the selected ids and create hidden fields to send with ajax submit. - var selected_item_ids=get_selected_values(); - for(k=0;k"); - } - $(form).ajaxSubmit({ + beforeSubmit: function(arr, $form, options) { + arr.push({name: 'item_ids', value: table_support.selected_ids().join(":")}); + }, success:function(response) { dialog_support.hide(); - post_bulk_form_submit(response); + table_support.handle_submit('', response); }, dataType:'json' }); @@ -233,6 +229,6 @@ $(document).ready(function() } } - }, dialog_support.error)); + }, form_support.error)); }); diff --git a/application/views/items/form_count_details.php b/application/views/items/form_count_details.php index 197c75c02..c46363922 100644 --- a/application/views/items/form_count_details.php +++ b/application/views/items/form_count_details.php @@ -66,7 +66,7 @@
        - + diff --git a/application/views/items/form_excel_import.php b/application/views/items/form_excel_import.php index cbf3bc5f7..95daf7618 100644 --- a/application/views/items/form_excel_import.php +++ b/application/views/items/form_excel_import.php @@ -1,6 +1,6 @@
          -'item_form', 'class'=>'form-horizontal')); ?> +'excel_form', 'class'=>'form-horizontal')); ?>
          @@ -24,29 +24,27 @@ //validation and submit handling $(document).ready(function() { - $('#item_form').validate($.extend({ - submitHandler:function(form) - { + $('#excel_form').validate($.extend({ + submitHandler:function(form) { $(form).ajaxSubmit({ - success:function(response) - { - dialog_support.hide(); - post_item_form_submit(response); - }, - dataType:'json' - }); - + success:function(response) + { + dialog_support.hide(); + $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); + }, + dataType: 'json' + }); }, errorLabelContainer: "#error_message_box", wrapper: "li", rules: { - file_path:"required" + file_path: "required" }, messages: { - file_path:"lang->line('common_import_full_path'); ?>" + file_path: "lang->line('common_import_full_path'); ?>" } - }, dialog_support.error)); + }, form_support.error)); }); diff --git a/application/views/items/form_inventory.php b/application/views/items/form_inventory.php index 91074367e..b7bc24305 100644 --- a/application/views/items/form_inventory.php +++ b/application/views/items/form_inventory.php @@ -104,7 +104,7 @@ $(document).ready(function() success:function(response) { dialog_support.hide(); - post_item_form_submit(response); + table_support.handle_submit('', response); }, dataType:'json' }); diff --git a/application/views/items/manage.php b/application/views/items/manage.php index 24c21f34d..a44b4d42a 100644 --- a/application/views/items/manage.php +++ b/application/views/items/manage.php @@ -3,190 +3,97 @@ -
          - +", - array('class'=>'modal-dlg modal-btn-submit none', 'title'=>$this->lang->line('items_import_items_excel'))); ?> - - " . $this->lang->line($controller_name . '_new') . "
          ", - array('class'=>'modal-dlg modal-btn-new modal-btn-submit', 'title'=>$this->lang->line($controller_name . '_new'))); ?> +
          -'search_form', 'class'=>'form-horizontal')); ?> -
          -
          -
            -
          • ' . $this->lang->line("common_delete") . '
          ', array('id'=>'delete')); ?> -
        • ' . $this->lang->line("items_bulk_edit") . '
        • ', array('id'=>'bulk_edit', 'class'=>'modal-dlg modal-btn-submit', 'title'=>$this->lang->line('items_edit_multiple_items'))); ?> -
        • ' . $this->lang->line("items_generate_barcodes") . '', array('id'=>'generate_barcodes', 'target' =>'_blank', 'title'=>$this->lang->line('items_generate_barcodes'))); ?>
        • - -
        • - 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> - 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> -
        • -
        • - 'daterangepicker', 'class'=>'form-control input-sm pull-right', 'id'=>'daterangepicker')); ?> - 'start_date', 'type'=>'hidden', 'id'=>'start_date')); ?> - 'end_date', 'type'=>'hidden', 'id'=>'end_date')); ?> -
        • -
        • 'filters', 'class'=>'selectpicker show-menu-arrow', 'data-selected-text-format'=>'count > 1', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
        • - 1) - { - ?> -
        • 'stock_location', 'onchange'=>"$('#search_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
        • - - - -
          - +
          + +
          - +
          load->view("partial/footer"); ?> diff --git a/application/views/login.php b/application/views/login.php index f18784fbe..9b25c243d 100644 --- a/application/views/login.php +++ b/application/views/login.php @@ -6,7 +6,7 @@ Open Source Point Of Sale <?php echo $this->lang->line('login_login'); ?> - + diff --git a/application/views/messages/form_sms.php b/application/views/messages/form_sms.php index 94c416699..b730939a0 100644 --- a/application/views/messages/form_sms.php +++ b/application/views/messages/form_sms.php @@ -44,7 +44,7 @@ $(document).ready(function() success:function(response) { dialog_support.hide(); - post_person_form_submit(response); + table_support.handle_submit('', response); }, dataType:'json' }); @@ -74,6 +74,6 @@ $(document).ready(function() required:"lang->line('messages_message_required'); ?>" } } - }, dialog_support.error)); + }, form_support.error)); }); \ No newline at end of file diff --git a/application/views/messages/sms.php b/application/views/messages/sms.php index 48679adba..0b6b4d1e5 100755 --- a/application/views/messages/sms.php +++ b/application/views/messages/sms.php @@ -38,14 +38,7 @@ $(document).ready(function() submitHandler: function(form) { $(form).ajaxSubmit({ success: function(response) { - if(response.success) - { - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } + $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); }, dataType: 'json' }); diff --git a/application/views/partial/bootstrap_tables_locale.php b/application/views/partial/bootstrap_tables_locale.php new file mode 100644 index 000000000..2a4df7935 --- /dev/null +++ b/application/views/partial/bootstrap_tables_locale.php @@ -0,0 +1,43 @@ +(function ($) { + 'use strict'; + + $.fn.bootstrapTable.locales['config->item('language'); ?>'] = { + formatLoadingMessage: function () { + return 'lang->line('tables_loading');?>'; + }, + formatRecordsPerPage: function (pageNumber) { + return 'lang->line('tables_rows_per_page'); ?>'.replace('{0}', pageNumber); + }, + formatShowingRows: function (pageFrom, pageTo, totalRows) { + return 'lang->line('tables_page_from_to'); ?>'.replace('{0}', pageFrom).replace('{1}', pageTo).replace('{2}', totalRows); + }, + formatSearch: function () { + return 'lang->line('common_search'); ?>'; + }, + formatNoMatches: function () { + return 'lang->line(preg_match('(customers|suppliers|employees)', $controller_name) ? + 'common_no_persons_to_display' : $controller_name . '_no_' . $controller_name .'_to_display'); ?>'; + }, + formatPaginationSwitch: function () { + return 'lang->line('tables_hide_show_pagination'); ?>'; + }, + formatRefresh: function () { + return 'lang->line('tables_refresh'); ?>'; + }, + formatToggle: function () { + return 'lang->line('tables_toggle'); ?>'; + }, + formatColumns: function () { + return 'lang->line('tables_columns'); ?>'; + }, + formatAllRows: function () { + return 'lang->line('tables_all'); ?>'; + }, + formatConfirmDelete : function() { + return 'lang->line((isset($editable) ? $editable : $controller_name). "_confirm_delete")?>'; + } + }; + + $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['config->item('language');?>']); + +})(jQuery); \ No newline at end of file diff --git a/application/views/partial/footer.php b/application/views/partial/footer.php index b2cdfd0d5..7badc01ec 100644 --- a/application/views/partial/footer.php +++ b/application/views/partial/footer.php @@ -1,9 +1,8 @@ -
          - - +
          +
          + + +
          +
          - +
          load->view("partial/footer"); ?> diff --git a/application/views/receivings/form.php b/application/views/receivings/form.php index c191076f5..31146a287 100755 --- a/application/views/receivings/form.php +++ b/application/views/receivings/form.php @@ -54,10 +54,6 @@ -'recvs_delete_form')); ?> - - - diff --git a/application/views/receivings/receipt.php b/application/views/receivings/receipt.php index 668c4264d..f1282c1e8 100644 --- a/application/views/receivings/receipt.php +++ b/application/views/receivings/receipt.php @@ -71,7 +71,7 @@ if (isset($error_message)) { ?> - +    x diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 1c0db1618..7db42ad01 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -11,7 +11,7 @@ if (isset($error)) - 'mode_form', 'class'=>'form-horizontal panel panel-default')); ?> + 'mode_form', 'class'=>'form-horizontal panel panel-default')); ?>
          • @@ -50,7 +50,7 @@ if (isset($error))
          - 'add_item_form', 'class'=>'form-horizontal panel panel-default')); ?> + 'add_item_form', 'class'=>'form-horizontal panel panel-default')); ?>
          • @@ -75,8 +75,10 @@ if (isset($error)) 'item', 'id'=>'item', 'class'=>'form-control input-sm', 'size'=>'50', 'tabindex'=>'1')); ?>
          • - lang->line('sales_new_item'), - array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-new modal-btn-submit', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item'))); ?> +
          @@ -94,7 +96,7 @@ if (isset($error)) lang->line('recvs_discount'); ?> lang->line('recvs_total'); ?> - lang->line('recvs_update'); ?> + lang->line('receivings_update'); ?> @@ -115,9 +117,9 @@ if (isset($error)) foreach(array_reverse($cart, true) as $line=>$item) { ?> - 'form-horizontal', 'id'=>'cart_'.$line)); ?> + 'form-horizontal', 'id'=>'cart_'.$line)); ?> - ');?> + ');?>
          @@ -173,7 +175,7 @@ if (isset($error)) } ?> - lang->line('recvs_update')?> > + lang->line('receivings_update')?> > lang->line("recvs_supplier").': '.$supplier. '
          '; - echo anchor("receivings/delete_supplier",'['.$this->lang->line('common_delete').' '.$this->lang->line('suppliers_supplier').']'); + echo $this->lang->line("recvs_supplier").': '.$supplier. '
          '; + echo anchor($controller_name."/delete_supplier", ' ' . $this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier'), + array('class'=>'btn btn-danger btn-sm', 'id'=>'remove_supplier_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier'))); } else { ?> - 'select_supplier_form', 'class'=>'form-horizontal')); ?> + 'select_supplier_form', 'class'=>'form-horizontal')); ?>
          'supplier', 'id'=>'supplier', 'class'=>'form-control input-sm', 'value'=>$this->lang->line('recvs_start_typing_supplier_name'))); ?> - - lang->line('recvs_new_supplier'), - array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-submit none', 'id'=>'new_supplier_button', 'title'=>$this->lang->line('recvs_new_supplier'))); ?> + + +
          - 'finish_receiving_form', 'class'=>'form-horizontal')); ?> + 'finish_receiving_form', 'class'=>'form-horizontal')); ?>
          'comment', 'id'=>'comment', 'class'=>'form-control input-sm', 'value'=>$comment, 'rows'=>'4')); ?> -
          lang->line('recvs_cancel_receiving'); ?>
          +
           lang->line('recvs_cancel_receiving'); ?>
          -
          lang->line('recvs_complete_receiving'); ?>
          +
           lang->line('recvs_complete_receiving'); ?>
          - 'finish_receiving_form', 'class'=>'form-horizontal')); ?> + 'finish_receiving_form', 'class'=>'form-horizontal')); ?>
          'comment', 'id'=>'comment', 'class'=>'form-control input-sm', 'value'=>$comment, 'rows'=>'4'));?> @@ -334,9 +340,9 @@ if (isset($error)) -
          lang->line('recvs_cancel_receiving') ?>
          +
           lang->line('recvs_cancel_receiving') ?>
          -
          lang->line('recvs_complete_receiving') ?>
          +
           lang->line('recvs_complete_receiving') ?>
          ', + source: '', minChars:0, delay:10, autoFocus: false, @@ -366,6 +372,13 @@ $(document).ready(function() $('#item').focus(); + $('#item').keypress(function (e) { + if (e.which == 13) { + $('#add_item_form').submit(); + return false; + } + }); + $('#item').blur(function() { $(this).attr('value',"lang->line('sales_start_typing_item_name'); ?>"); @@ -373,7 +386,7 @@ $(document).ready(function() $('#comment').keyup(function() { - $.post('', {comment: $('#comment').val()}); + $.post('', {comment: $('#comment').val()}); }); $('#recv_invoice_number').keyup(function() { - $.post('', {recv_invoice_number: $('#recv_invoice_number').val()}); + $.post('', {recv_invoice_number: $('#recv_invoice_number').val()}); }); $("#recv_print_after_sale").change(function() { - $.post('', {recv_print_after_sale: $(this).is(":checked")}); + $.post('', {recv_print_after_sale: $(this).is(":checked")}); }); var enable_invoice_number = function() @@ -402,7 +415,7 @@ $(document).ready(function() $("#recv_invoice_enable").change(function() { var enabled = enable_invoice_number(); - $.post('', {recv_invoice_number_enabled: enabled}); + $.post('', {recv_invoice_number_enabled: enabled}); }); lang->line('recvs_start_typing_supplier_name'); ?>"); }); @@ -439,36 +454,44 @@ $(document).ready(function() { if (confirm('lang->line("recvs_confirm_cancel_receiving"); ?>')) { - $('#finish_receiving_form').attr('action', ''); + $('#finish_receiving_form').attr('action', ''); $('#finish_receiving_form').submit(); } }); + + $("#cart_contents input").keypress(function(event) + { + if (event.which == 13) + { + $('#cart_' + (1 + $(this).index() / 2 )).submit(); + } + }); + + table_support.handle_submit = function(resource, response, stay_open) + { + if(response.success) + { + if (resource.match(/suppliers$/)) + { + $("#supplier").attr("value",response.id); + $("#select_supplier_form").submit(); + } + else + { + $("#item").attr("value",response.id); + if (stay_open) + { + $("#add_item_form").ajaxSubmit(); + } + else + { + $("#add_item_form").submit(); + } + } + } + } }); -function post_item_form_submit(response, stay_open) -{ - if(response.success) - { - $("#item").attr("value",response.item_id); - if (stay_open) - { - $("#add_item_form").ajaxSubmit(); - } - else - { - $("#add_item_form").submit(); - } - } -} - -function post_person_form_submit(response) -{ - if(response.success) - { - $("#supplier").attr("value",response.person_id); - $("#select_supplier_form").submit(); - } -} load->view("partial/footer"); ?> diff --git a/application/views/reports/date_input_excel_export.php b/application/views/reports/date_input_excel_export.php deleted file mode 100644 index 67b272e9d..000000000 --- a/application/views/reports/date_input_excel_export.php +++ /dev/null @@ -1,63 +0,0 @@ -load->view("partial/header"); ?> - -
          lang->line('reports_report_input'); ?>
          - -".$error.""; -} -?> - -'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> -
          - lang->line('reports_date_range'), 'report_date_range_label', array('class'=>'control-label col-xs-2 required')); ?> -
          - 'daterangepicker', 'class'=>'form-control input-sm', 'id'=>'daterangepicker')); ?> -
          -
          - -
          - lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required control-label col-xs-2')); ?> -
          - $this->lang->line('reports_all'), - 'sales' => $this->lang->line('reports_sales'), - 'returns' => $this->lang->line('reports_returns')), 'all', array('id'=>'input_type', 'class'=>'form-control')); ?> -
          -
          - -
          - lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> -
          - - -
          -
          - - 'generate_report', - 'id'=>'generate_report', - 'content'=>$this->lang->line('common_submit'), - 'class'=>'btn btn-primary btn-sm') - ); - ?> - - -load->view("partial/footer"); ?> - - \ No newline at end of file diff --git a/application/views/reports/excel_export.php b/application/views/reports/excel_export.php deleted file mode 100644 index 90b8b1386..000000000 --- a/application/views/reports/excel_export.php +++ /dev/null @@ -1,45 +0,0 @@ -load->view("partial/header"); ?> - -
          lang->line('reports_report_input'); ?>
          - -".$error.""; -} -?> - -'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> -
          - lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> -
          - - -
          -
          - -'generate_report', - 'id'=>'generate_report', - 'content'=>$this->lang->line('common_submit'), - 'class'=>'btn btn-primary btn-sm') - ); -?> - - -load->view("partial/footer"); ?> - - \ No newline at end of file diff --git a/application/views/reports/graphical.php b/application/views/reports/graphical.php index 46d66d336..d5401e05a 100644 --- a/application/views/reports/graphical.php +++ b/application/views/reports/graphical.php @@ -4,19 +4,13 @@
          -
          - -
          +
          -
          -
          -
          +load->view($chart_type); ?> -
          +
          $value) + foreach($summary_data_1 as $name=>$value) { ?>
          lang->line('reports_'.$name). ': ' . to_currency($value); ?>
          diff --git a/application/views/reports/graphs/bar.php b/application/views/reports/graphs/bar.php index c42baf1cf..7f5a63fc8 100644 --- a/application/views/reports/graphs/bar.php +++ b/application/views/reports/graphs/bar.php @@ -1,46 +1,111 @@ -output->set_header("Cache-Control: no-store, no-cache, must-revalidate"); -$this->output->set_header("Pragma: public"); -$bar = new bar_filled( '#4386a1', '#577261' ); + \ No newline at end of file diff --git a/application/views/reports/graphs/hbar.php b/application/views/reports/graphs/hbar.php index 10463f5c4..026423fd5 100644 --- a/application/views/reports/graphs/hbar.php +++ b/application/views/reports/graphs/hbar.php @@ -1,61 +1,114 @@ -output->set_header("Cache-Control: no-store, no-cache, must-revalidate"); -$this->output->set_header("Pragma: public"); + \ No newline at end of file diff --git a/application/views/reports/graphs/line.php b/application/views/reports/graphs/line.php index 62fa570e6..310e89c13 100644 --- a/application/views/reports/graphs/line.php +++ b/application/views/reports/graphs/line.php @@ -1,49 +1,189 @@ -output->set_header("Cache-Control: no-store, no-cache, must-revalidate"); -$this->output->set_header("Pragma: public"); -$line_data = array(); -$labels = array(); -foreach($data as $label=>$value) -{ - $line_data[] = (float)$value; - $labels[] = (string)$label; -} + \ No newline at end of file diff --git a/application/views/reports/graphs/pie.php b/application/views/reports/graphs/pie.php index fda94d8b6..cfb4de336 100644 --- a/application/views/reports/graphs/pie.php +++ b/application/views/reports/graphs/pie.php @@ -1,25 +1,87 @@ -output->set_header("Cache-Control: no-store, no-cache, must-revalidate"); -$this->output->set_header("Pragma: public"); -$title = new title($title); + \ No newline at end of file diff --git a/application/views/reports/inventory_summary_input.php b/application/views/reports/inventory_summary_input.php index b2e7f0d57..41e5a9228 100644 --- a/application/views/reports/inventory_summary_input.php +++ b/application/views/reports/inventory_summary_input.php @@ -10,17 +10,6 @@ if(isset($error)) ?> 'item_form', 'enctype'=>'multipart/form-data', 'class'=>'form-horizontal')); ?> -
          - lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> -
          - - -
          -
          lang->line('reports_stock_location'), 'reports_stock_location_label', array('class'=>'required control-label col-xs-2')); ?> @@ -53,7 +42,7 @@ $(document).ready(function() { $("#generate_report").click(function() { - window.location = [window.location, $("input[name='export_excel']").is(':checked'), $("#location_id").val(), $("#item_count").val()].join("/"); - }); + window.location = [window.location, $("#location_id").val(), $("#item_count").val()].join("/"); + }); }); \ No newline at end of file diff --git a/application/views/reports/specific_input.php b/application/views/reports/specific_input.php index bb59451ac..5022b1fd8 100644 --- a/application/views/reports/specific_input.php +++ b/application/views/reports/specific_input.php @@ -33,18 +33,6 @@ if(isset($error))
          -
          - lang->line('common_export_excel'), 'export_excel', !empty($basic_version) ? array('class'=>'control-label required col-xs-3') : array('class'=>'control-label col-xs-2')); ?> -
          - - -
          -
          - 'generate_report', @@ -64,7 +52,7 @@ $(document).ready(function() $("#generate_report").click(function() { - window.location = [window.location, start_date, end_date, $('#specific_input_data').val(), $("#sale_type").val(), $("input[name='export_excel']").val()].join("/"); + window.location = [window.location, start_date, end_date, $('#specific_input_data').val(), $("#sale_type").val() || 0].join("/"); }); }); \ No newline at end of file diff --git a/application/views/reports/tabular.php b/application/views/reports/tabular.php index f39f3f01b..297780cd3 100644 --- a/application/views/reports/tabular.php +++ b/application/views/reports/tabular.php @@ -1,54 +1,11 @@ -load->view("partial/header_excel"); - } - else - { - $this->load->view("partial/header"); - } -?> +load->view("partial/header"); ?>
          - - - - - - - - - - - - - - - - - -
          +
          @@ -62,39 +19,27 @@ ?>
          -load->view("partial/footer_excel"); - $content = ob_end_flush(); - - $filename = trim($filename); - $filename = str_replace(array(' ', '/', '\\'), '', $title); - $filename .= "_Export.xls"; - header('Content-type: application/ms-excel'); - header('Content-Disposition: attachment; filename='.$filename); - echo $content; - - die(); -} -else -{ - $this->load->view("partial/footer"); -?> - - \ No newline at end of file + + +load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/reports/tabular_details.php b/application/views/reports/tabular_details.php index 1d57668d0..833106d1f 100644 --- a/application/views/reports/tabular_details.php +++ b/application/views/reports/tabular_details.php @@ -1,94 +1,11 @@ -load->view("partial/header_excel"); - } - else - { - $this->load->view("partial/header"); - } -?> +load->view("partial/header"); ?>
          - - - - - - - - - - - $row) - { - ?> - - - - - - - - - - - -
          +
          +
          - - - - - - - - - - - - - - - - - - -
          -
          +
          @@ -102,93 +19,50 @@ ?>
          -load->view("partial/footer_excel"); - $content = ob_end_flush(); - - $filename = trim($filename); - $filename = str_replace(array(' ', '/', '\\'), '', $title); - $filename .= "_Export.xls"; - header('Content-type: application/ms-excel'); - header('Content-Disposition: attachment; filename='.$filename); - echo $content; - die(); -} -else -{ - $this->load->view("partial/footer"); -?> - - \ No newline at end of file + + +load->view("partial/footer"); ?> \ No newline at end of file diff --git a/application/views/sales/form.php b/application/views/sales/form.php index d463c1a6c..0a19d6c1c 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -93,9 +93,6 @@ -'sales_delete_form')); ?> - - diff --git a/application/views/sales/invoice.php b/application/views/sales/invoice.php index 9c3b0333d..84716a3ab 100755 --- a/application/views/sales/invoice.php +++ b/application/views/sales/invoice.php @@ -81,7 +81,7 @@ if (isset($error_message)) ?> - + @@ -89,8 +89,8 @@ if (isset($error_message)) - - + + - + diff --git a/application/views/sales/manage.php b/application/views/sales/manage.php index 723dc6483..2caa01b5e 100755 --- a/application/views/sales/manage.php +++ b/application/views/sales/manage.php @@ -3,228 +3,77 @@ load->view('partial/print_receipt', array('print_after_sale'=>false, 'selected_printer'=>'takings_printer')); ?> - - - +
          + + +
          +
          -
          + + load->view("partial/footer"); ?> diff --git a/application/views/sales/register.php b/application/views/sales/register.php index df5d14064..ec1a73dbc 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -21,7 +21,7 @@ if (isset($success)) - 'mode_form', 'class'=>'form-horizontal panel panel-default')); ?> + 'mode_form', 'class'=>'form-horizontal panel panel-default')); ?>
          • @@ -46,16 +46,18 @@ if (isset($success)) ?>
          • - lang->line('sales_suspended_sales'), - array('class'=>'btn btn-default btn-sm modal-dlg none', 'id'=>'show_suspended_sales_button', 'title'=>$this->lang->line('sales_suspended_sales'))); ?> +
          • Employee->has_grant('reports_sales', $this->session->userdata('person_id'))) { ?> -
          • - lang->line('sales_takings'), +
          • +  ' . $this->lang->line('sales_takings'), array('class'=>'btn btn-primary btn-sm', 'id'=>'sales_takings_button', 'title'=>$this->lang->line('sales_takings'))); ?>
          • - 'add_item_form', 'class'=>'form-horizontal panel panel-default')); ?> + 'add_item_form', 'class'=>'form-horizontal panel panel-default')); ?>
            • - +
            • 'item', 'id'=>'item', 'class'=>'form-control input-sm', 'size'=>'50', 'tabindex'=>'1')); ?>
            • - lang->line('sales_new_item'), - array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-new modal-btn-submit', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item'))); ?> +
            + @@ -113,17 +118,13 @@ if (isset($success)) } else { - $tabindex = 2; + $tabindex = 2; foreach(array_reverse($cart, true) as $line=>$item) { - if($tabindex == 3) - { - $tabindex = 5; - } ?> - 'form-horizontal', 'id'=>'cart_'.$line)); ?> + 'form-horizontal', 'id'=>'cart_'.$line)); ?> - +
            ');?>');?>
            @@ -285,21 +286,24 @@ if (isset($success))
            - lang->line('common_remove').' '.$this->lang->line('customers_customer'), - array('class'=>'btn btn-danger btn-xs', 'id'=>'remove_customer_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('customers_customer'))); ?> +  ' . $this->lang->line('common_remove').' '.$this->lang->line('customers_customer'), + array('class'=>'btn btn-danger btn-sm', 'id'=>'remove_customer_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('customers_customer'))); ?> - 'select_customer_form', 'class'=>'form-horizontal')); ?> + 'select_customer_form', 'class'=>'form-horizontal')); ?>
            'customer', 'id'=>'customer', 'class'=>'form-control input-sm', 'value'=>$this->lang->line('sales_start_typing_customer_name')));?> - lang->line('sales_new_customer'), - array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-submit none', 'id'=>'new_customer_button', 'title'=>$this->lang->line('sales_new_customer'))); ?> -
            + + +
          - 'add_payment_form', 'class'=>'form-horizontal')); ?> + 'add_payment_form', 'class'=>'form-horizontal')); ?>
          lang->line('sales_payment');?> - 'payment_types', 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'auto', 'disabled'=>'')); ?> + 'payment_types', 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'auto', 'disabled'=>'disabled')); ?>
          lang->line('sales_amount_tendered'); ?> - 'amount_tendered', 'id'=>'amount_tendered', 'class'=>'form-control input-sm disabled', 'disabled'=>'', 'value'=>to_currency_no_money($amount_due), 'size'=>'5', 'tabindex'=>3)); ?> + 'amount_tendered', 'id'=>'amount_tendered', 'class'=>'form-control input-sm disabled', 'disabled'=>'disabled', 'value'=>to_currency_no_money($amount_due), 'size'=>'5', 'tabindex'=>$tabindex)); ?>
          - -
          lang->line('sales_complete_sale'); ?>
          + + +
           lang->line('sales_complete_sale'); ?>
          + 'add_payment_form', 'class'=>'form-horizontal')); ?> @@ -383,16 +389,17 @@ if (isset($success))
          lang->line('sales_payment');?>
          lang->line('sales_amount_tendered'); ?> - 'amount_tendered', 'id'=>'amount_tendered', 'class'=>'form-control input-sm', 'value'=>to_currency_no_money($amount_due), 'size'=>'5', 'tabindex'=>3)); ?> + 'amount_tendered', 'id'=>'amount_tendered', 'class'=>'form-control input-sm', 'value'=>to_currency_no_money($amount_due), 'size'=>'5', 'tabindex'=>5)); ?>
          -
          lang->line('sales_add_payment'); ?>
          - '> lang->line('sales_add_payment'); ?>
          + + + - - ' ); ?> + '); ?> @@ -428,11 +435,11 @@ if (isset($success)) ?>
          - 'buttons_form', 'class'=>'form-horizontal')); ?> + 'buttons_form', 'class'=>'form-horizontal')); ?>
          -
          lang->line('sales_suspend_sale'); ?>
          +
           lang->line('sales_suspend_sale'); ?>
          -
          lang->line('sales_cancel_sale'); ?>
          +
           lang->line('sales_cancel_sale'); ?>
          config->item('invoice_enable') == TRUE) + if ($mode == "sale" && $this->config->item('invoice_enable') == TRUE) { ?> @@ -512,11 +519,11 @@ if (isset($success)) $(document).ready(function() { $("#item").autocomplete( - { - source: '', - minChars:0, + { + source: '', + minChars: 0, autoFocus: false, - delay:10, + delay: 10, select: function (a, ui) { $(this).val(ui.item.value); $("#add_item_form").submit(); @@ -525,6 +532,13 @@ $(document).ready(function() $('#item').focus(); + $('#item').keypress(function (e) { + if (e.which == 13) { + $('#add_item_form').submit(); + return false; + } + }); + $('#item').blur(function() { $(this).val("lang->line('sales_start_typing_item_name'); ?>"); @@ -541,8 +555,8 @@ $(document).ready(function() $("#customer").autocomplete( { source: '', - minChars:0, - delay:10, + minChars: 0, + delay: 10, select: function (a, ui) { $(this).val(ui.item.value); $("#select_customer_form").submit(); @@ -561,7 +575,7 @@ $(document).ready(function() $('#comment').keyup(function() { - $.post('', {comment: $('#comment').val()}); + $.post('', {comment: $('#comment').val()}); }); $('#sales_invoice_number').keyup(function() { - $.post('', {sales_invoice_number: $('#sales_invoice_number').val()}); + $.post('', {sales_invoice_number: $('#sales_invoice_number').val()}); }); var enable_invoice_number = function() @@ -585,7 +599,7 @@ $(document).ready(function() $("#sales_invoice_enable").change(function() { var enabled = enable_invoice_number(); - $.post('', {sales_invoice_number_enabled: enabled}); + $.post('', {sales_invoice_number_enabled: enabled}); }); ', {sales_print_after_sale: $(this).is(":checked")}); + $.post('', {sales_print_after_sale: $(this).is(":checked")}); }); $('#email_receipt').change(function() { - $.post('', {email_receipt: $('#email_receipt').is(':checked') ? '1' : '0'}); + $.post('', {email_receipt: $('#email_receipt').is(':checked') ? '1' : '0'}); }); $("#finish_sale_button").click(function() { - $('#buttons_form').attr('action', ''); + $('#buttons_form').attr('action', ''); $('#buttons_form').submit(); }); $("#suspend_sale_button").click(function() { - $('#buttons_form').attr('action', ''); + $('#buttons_form').attr('action', ''); $('#buttons_form').submit(); }); @@ -617,7 +631,7 @@ $(document).ready(function() { if (confirm('lang->line("sales_confirm_cancel_sale"); ?>')) { - $('#buttons_form').attr('action', ''); + $('#buttons_form').attr('action', ''); $('#buttons_form').submit(); } }); @@ -627,8 +641,16 @@ $(document).ready(function() $('#add_payment_form').submit(); }); - $("#payment_types").change(check_payment_type_giftcard).ready(check_payment_type_giftcard) - + $("#payment_types").change(check_payment_type_giftcard).ready(check_payment_type_giftcard); + + $("#cart_contents input").keypress(function(event) + { + if (event.which == 13) + { + $('#cart_' + (1 + $(this).index() / 2 )).submit(); + } + }); + $("#amount_tendered").keypress(function(event) { if( event.which == 13 ) @@ -644,35 +666,35 @@ $(document).ready(function() $('#finish_sale_form').submit(); } }); + + dialog_support.init("a.modal-dlg, button.modal-dlg"); + + table_support.handle_submit = function(resource, response, stay_open) + { + if(response.success) { + if (resource.match(/customers$/)) + { + $("#customer").val(response.id); + $("#select_customer_form").submit(); + } + else + { + var $stock_location = $("select[name='stock_location']").val(); + $("#item_location").val($stock_location); + $("#item").val(response.id); + if (stay_open) + { + $("#add_item_form").ajaxSubmit(); + } + else + { + $("#add_item_form").submit(); + } + } + } + } }); -function post_item_form_submit(response, stay_open) -{ - if(response.success) - { - var $stock_location = $("select[name='stock_location']").val(); - $("#item_location").val($stock_location); - $("#item").val(response.item_id); - if (stay_open) - { - $("#add_item_form").ajaxSubmit(); - } - else - { - $("#add_item_form").submit(); - } - } -} - -function post_person_form_submit(response) -{ - if(response.success) - { - $("#customer").val(response.person_id); - $("#select_customer_form").submit(); - } -} - function check_payment_type_giftcard() { if ($("#payment_types").val() == "lang->line('sales_giftcard'); ?>") diff --git a/application/views/suppliers/form.php b/application/views/suppliers/form.php index 6e808e1d5..41eddce55 100644 --- a/application/views/suppliers/form.php +++ b/application/views/suppliers/form.php @@ -55,7 +55,7 @@ $(document).ready(function() success:function(response) { dialog_support.hide(); - post_person_form_submit(response); + table_support.handle_submit('', response); }, dataType:'json' }); @@ -75,7 +75,7 @@ $(document).ready(function() last_name: "lang->line('common_last_name_required'); ?>", email: "lang->line('common_email_invalid_format'); ?>" } - }, dialog_support.error)); + }, form_support.error)); }); \ No newline at end of file diff --git a/application/views/suppliers/manage.php b/application/views/suppliers/manage.php deleted file mode 100644 index 1bc7e9145..000000000 --- a/application/views/suppliers/manage.php +++ /dev/null @@ -1,88 +0,0 @@ -load->view("partial/header"); ?> - - - -
          - - - " . $this->lang->line($controller_name . '_new') . "
          ", - array('class'=>'modal-dlg modal-btn-submit none', 'title'=>$this->lang->line($controller_name . '_new'))); ?> -
          - -'search_form', 'class'=>'form-horizontal')); ?> -
          -
          -
            -
          • ' . $this->lang->line("common_delete") . '
          ', array('id'=>'delete')); ?> -
        • lang->line("common_email");?>
        • - -
        • - 'search', 'class'=>'form-control input-sm', 'id'=>'search')); ?> - 'limit_from', 'type'=>'hidden', 'id'=>'limit_from')); ?> -
        • - - -
          - - -
          - -
          - -load->view("partial/footer"); ?> \ No newline at end of file diff --git a/bower.json b/bower.json index ec3b93413..d56b9c0f4 100644 --- a/bower.json +++ b/bower.json @@ -24,20 +24,24 @@ "tests" ], "dependencies": { - "jquery-color": "~2.1.2", "jquery-form": "~3.46.0", "jquery-validate": "~1.13.1", - "jquery": "~1.12.3", + "jquery": "~1.12.4", "jquery-ui": "1.11.4", - "swfobject-bower": "2.3.0", - "tablesorter": "jquery.tablesorter#^2.25.8", "bootstrap3-dialog": "bootstrap-dialog#^1.35.1", "jasny-bootstrap": "^3.1.3", "bootswatch-dist": "3.3.6-flatly", - "smalot-bootstrap-datetimepicker": "^2.3.10", + "smalot-bootstrap-datetimepicker": "^2.3.11", "bootstrap-select": "^1.10.0", "bootstrap-table": "^1.10.1", - "bootstrap-daterangepicker": "^2.1.19" + "bootstrap-daterangepicker": "^2.1.21", + "table-export": "*", + "jquery.base64": "https://raw.githubusercontent.com/carlo/jquery-base64/master/jquery.base64.js", + "chartist": "^0.9.7", + "chartist-plugin-axistitle": "^0.1.0", + "chartist-plugin-pointlabels": "^0.0.4", + "chartist-plugin-tooltip": "https://github.com/Globegitter/chartist-plugin-tooltip/archive/master.zip", + "remarkable-bootstrap-notify": "^3.1.3" }, "overrides": { "bootswatch-dist": { @@ -51,6 +55,19 @@ "themes/base/jquery-ui.css", "jquery-ui.js" ] + }, + "table-export": { + "main": [ + "tableExport.js" + ] + }, + "bootstrap-table": { + "main": [ + "src/bootstrap-table.js", + "src/bootstrap-table.css", + "dist/extensions/export/bootstrap-table-export.js", + "dist/extensions/mobile/bootstrap-table-mobile.js" + ] } } } diff --git a/css/ospos.css b/css/ospos.css index c8f85ad22..c623fa8f1 100644 --- a/css/ospos.css +++ b/css/ospos.css @@ -29,6 +29,11 @@ a.none background-color: #FFFFFF; } +.jumbotron.push-spaces +{ + margin:0; /*add this*/ +} + .navbar .menu-icon { text-align: center; @@ -45,11 +50,6 @@ a.none font-size: 14px; } -.pagination -{ - margin: 0 !important; -} - #title_bar { position: relative; @@ -72,17 +72,6 @@ a.none text-align: center; } -#feedback_bar -{ - position: fixed; - bottom: 0; - left: 0; - width: 100%; - z-index: 1; - line-height: 3.3; - text-align: center; -} - #home_module_list { position: relative; @@ -132,6 +121,11 @@ a.rollover img padding: 3px; } +#filters.btn-group +{ + vertical-align: none; +} + button.btn.dropdown-toggle.btn-sm { background-color: white; @@ -172,3 +166,13 @@ label.required max-height: calc(100vh - 212px); overflow-y: auto; } + +#payment_summary +{ + position: relative; + top: 100px; +} + +.no-gutter [class*="-1"] { + padding-right:0; +} diff --git a/css/ospos_print.css b/css/ospos_print.css index 163272add..d7c4a4a69 100644 --- a/css/ospos_print.css +++ b/css/ospos_print.css @@ -5,7 +5,7 @@ display: none !important; } - #receipt_wrapper + #receipt_wrapper, #table { /*background-color:#FFFFFF;*/ font-size:75%; @@ -27,11 +27,6 @@ text-align:center; } - .short_name - { - display:inline; - } - #receipt_items td { white-space:nowrap; @@ -74,4 +69,14 @@ { display:none !important; } + + .fixed-table-container + { + border: none; + } + + .fixed-table-container thead th .sortable + { + padding-right: 10px; + } } \ No newline at end of file diff --git a/css/receipt.css b/css/receipt.css index 7df92cafb..e20f8e64c 100644 --- a/css/receipt.css +++ b/css/receipt.css @@ -52,11 +52,6 @@ margin-bottom:5px; } -.short_name -{ - display:none; -} - #sale_return_policy { width:80%; diff --git a/css/register.css b/css/register.css index ae04ff77b..434e45143 100644 --- a/css/register.css +++ b/css/register.css @@ -71,7 +71,7 @@ #overall_sale { - width: 28%; + width: 29%; float: left; margin-left: 0.1em; padding-bottom: 1em; @@ -110,13 +110,13 @@ #sale_totals, #payment_totals { - border-top: 2px solid #000; + border-top: 1px solid #000; } #payment_details { float: left; - border-top: 2px solid #000; + border-top: 1px solid #000; background-color: #DDD; margin-top: 0.2em; padding: 0.5em; diff --git a/css/reports.css b/css/reports.css index 3fd3f328a..898386585 100644 --- a/css/reports.css +++ b/css/reports.css @@ -23,7 +23,49 @@ { } -#chart_wrapper +#chart_report_summary { text-align: center; + margin-top: -100px; +} + +#chart_report_summary .summary_row +{ +} + +.ct-chart +{ +} + +/* style chart X axis labels to be rotated of 60 degrees */ +.ct-label.ct-horizontal +{ + -webkit-transform: rotate(-60deg); + -moz-transform: rotate(-60deg); + -ms-transform: rotate(-60deg); + -o-transform: rotate(-60deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} + +/* set all labels to be black with font size 1.2rem */ +.ct-label +{ + fill: rgba(0,0,0,1); + color: rgba(0,0,0,1); + font-size: 1.2rem; +} + +.ct-tooltip-point +{ + fill-opacity: 1!important; + stroke-width: 0px; + stroke: red; + transition: all 0.2s linear; +} + +.ct-tooltip-point:hover +{ + r: 7; + stroke-opacity: 0.2; + stroke-width: 20px; } \ No newline at end of file diff --git a/css/tables.css b/css/tables.css deleted file mode 100644 index a0f2983cf..000000000 --- a/css/tables.css +++ /dev/null @@ -1,125 +0,0 @@ -#table_action_header -{ - position: relative; - width: 100%; - height: 2em; - border: 0; - margin-top: 1em; - margin-left: 0; - background-color: transparent; - background-image: url(../images/checkbox_arrow.gif); - background-position: 0.5em 1.2em; - background-repeat: no-repeat; -} - -#table_action_header ul -{ - list-style: none; - padding: 0; - margin: 0; - margin-left: 1em; -} - -#table_action_header ul.dropdown-menu.inner -{ - margin-left: -1em !important; -} - -#table_action_header ul li -{ - margin-left: 1em; -} - -#table_action_header ul li label -{ - margin-top: 0.5em; -} - -#table_holder -{ - position: relative; - margin-bottom: 50px; -} - -table.tablesorter -{ - position: relative; - width: 100%; - border: 0; - border-collapse: collapse; -} - -table.tablesorter thead tr th, table.tablesorter tfoot tr th -{ - color: #FFFFFF; - text-align: left; - background-color: #999999; - padding: 8px; -} - -table.tablesorter thead tr .header -{ - background-image: url(../images/tables/bg.gif); - background-repeat: no-repeat; - background-position: center right; - cursor: pointer; -} - -table.tablesorter tbody td -{ - color: #3D3D3D; - background-color: #FFF; - vertical-align: top; - padding: 8px; - border-bottom:1px solid #DDDDDD; -} - -table.tablesorter tbody td.over -{ - background-color: #F5F5F5; -} - -table.tablesorter tbody td.selected -{ - background-color: #ECECEC; -} - -table.tablesorter thead tr .tablesorter-headerAsc -{ - background-image: url(../images/tables/asc.gif); - background-repeat: no-repeat; - background-position: right; -} - -table.tablesorter thead .tablesorter-headerDesc -{ - background-image: url(../images/tables/desc.gif); - background-repeat: no-repeat; - background-position: right; -} - -table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp -{ - background-color: #555555; -} - -table.innertable -{ - display: none; - width: 100%; -} - -table.innertable thead tr th -{ - background-color: #999999; -} - -table.innertable tbody tr td -{ - background-color: #DDD; -} - -.totals table tr:last-child td -{ - font-weight: bold; -} \ No newline at end of file diff --git a/database/2.0_to_2.1.sql b/database/2.0_to_2.1.sql new file mode 100644 index 000000000..32546c24e --- /dev/null +++ b/database/2.0_to_2.1.sql @@ -0,0 +1,13 @@ +ALTER TABLE ospos_items +ADD custom1 VARCHAR(25) NOT NULL, +ADD custom2 VARCHAR(25) NOT NULL, +ADD custom3 VARCHAR(25) NOT NULL, +ADD custom4 VARCHAR(25) NOT NULL, +ADD custom5 VARCHAR(25) NOT NULL, +ADD custom6 VARCHAR(25) NOT NULL, +ADD custom7 VARCHAR(25) NOT NULL, +ADD custom8 VARCHAR(25) NOT NULL, +ADD custom9 VARCHAR(25) NOT NULL, +ADD custom10 VARCHAR(25) NOT NULL; + +ALTER TABLE ospos_giftcards ADD person_id INT NOT NULL; diff --git a/database/2.1_to_2.2.sql b/database/2.1_to_2.2.sql new file mode 100644 index 000000000..4f6d66606 --- /dev/null +++ b/database/2.1_to_2.2.sql @@ -0,0 +1,3 @@ +-- +-- No changes +-- diff --git a/database/2.4_to_3.0.sql b/database/2.4_to_3.0.sql index 6d403cd4e..c5b3cf168 100644 --- a/database/2.4_to_3.0.sql +++ b/database/2.4_to_3.0.sql @@ -37,7 +37,10 @@ UPDATE `ospos_app_config` SET `key` = 'receipt_show_total_discount' WHERE `key` INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_show_description', '1'), ('receipt_show_serialnumber', '1'), - ('invoice_enable', '1'); + ('invoice_enable', '1'), + ('country_codes', 'us'), + ('notify_horziontal_position', 'right'), + ('notify_vertical_position', 'top'); UPDATE `ospos_modules` SET `sort` = 110 WHERE `name_lang_key` = 'module_config'; diff --git a/database/database.sql b/database/database.sql index c7dca68b2..2b6572c0d 100644 --- a/database/database.sql +++ b/database/database.sql @@ -1,3 +1,4 @@ +USE ospos; -- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << -- -- -- Table structure for table `ospos_app_config` @@ -65,10 +66,13 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_decimals', '2'), ('tax_decimals', '2'), ('quantity_decimals', '0'), +('country_codes', 'us'), ('msg_msg', ''), ('msg_uid', ''), ('msg_src', ''), -('msg_pwd', ''); +('msg_pwd', ''), +('notify_horziontal_position', 'right'), +('notify_vertical_position', 'top'); -- -------------------------------------------------------- diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index c7a33b729..1cc7ce030 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -65,10 +65,13 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_decimals', '2'), ('tax_decimals', '2'), ('quantity_decimals', '0'), +('country_codes', 'us'), ('msg_msg', ''), ('msg_uid', ''), ('msg_src', ''), -('msg_pwd', ''); +('msg_pwd', ''), +('notify_horziontal_position', 'right'), +('notify_vertical_position', 'top'); -- -------------------------------------------------------- diff --git a/database/tables.sql b/database/tables.sql index 8de566d84..e0d3f2691 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -65,10 +65,13 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('currency_decimals', '2'), ('tax_decimals', '2'), ('quantity_decimals', '0'), +('country_codes', 'us'), ('msg_msg', ''), ('msg_uid', ''), ('msg_src', ''), -('msg_pwd', ''); +('msg_pwd', ''), +('notify_horziontal_position', 'right'), +('notify_vertical_position', 'top'); -- -------------------------------------------------------- diff --git a/dist/bootstrap.min.css b/dist/bootstrap.min.css index ac5afc246..f30f26345 100644 --- a/dist/bootstrap.min.css +++ b/dist/bootstrap.min.css @@ -1,11 +1,11 @@ @import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic");/*! * bootswatch v3.3.6 * Homepage: http://bootswatch.com - * Copyright 2012-2015 Thomas Park + * Copyright 2012-2016 Thomas Park * Licensed under MIT * Based on Bootstrap *//*! * Bootstrap v3.3.6 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#18bc9c;text-decoration:none}a:hover,a:focus{color:#18bc9c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid #ecf0f1}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#b4bcc2}h1,.h1,h2,.h2,h3,.h3{margin-top:21px;margin-bottom:10.5px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10.5px;margin-bottom:10.5px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:39px}h2,.h2{font-size:32px}h3,.h3{font-size:26px}h4,.h4{font-size:19px}h5,.h5{font-size:15px}h6,.h6{font-size:13px}p{margin:0 0 10.5px}.lead{margin-bottom:21px;font-size:17px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:22.5px}}small,.small{font-size:86%}mark,.mark{background-color:#f39c12;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#b4bcc2}.text-primary{color:#2c3e50}a.text-primary:hover,a.text-primary:focus{color:#1a242f}.text-success{color:#ffffff}a.text-success:hover,a.text-success:focus{color:#e6e6e6}.text-info{color:#ffffff}a.text-info:hover,a.text-info:focus{color:#e6e6e6}.text-warning{color:#ffffff}a.text-warning:hover,a.text-warning:focus{color:#e6e6e6}.text-danger{color:#ffffff}a.text-danger:hover,a.text-danger:focus{color:#e6e6e6}.bg-primary{color:#fff;background-color:#2c3e50}a.bg-primary:hover,a.bg-primary:focus{background-color:#1a242f}.bg-success{background-color:#18bc9c}a.bg-success:hover,a.bg-success:focus{background-color:#128f76}.bg-info{background-color:#3498db}a.bg-info:hover,a.bg-info:focus{background-color:#217dbb}.bg-warning{background-color:#f39c12}a.bg-warning:hover,a.bg-warning:focus{background-color:#c87f0a}.bg-danger{background-color:#e74c3c}a.bg-danger:hover,a.bg-danger:focus{background-color:#d62c1a}.page-header{padding-bottom:9.5px;margin:42px 0 21px;border-bottom:1px solid transparent}ul,ol{margin-top:0;margin-bottom:10.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:21px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #b4bcc2}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10.5px 21px;margin:0 0 21px;font-size:18.75px;border-left:5px solid #ecf0f1}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#b4bcc2}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #ecf0f1;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:21px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#ffffff;background-color:#333333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#7b8a8b;background-color:#ecf0f1;border:1px solid #cccccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0%}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#b4bcc2;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:21px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ecf0f1}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ecf0f1}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ecf0f1}.table .table{background-color:#ffffff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#ecf0f1}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#ecf0f1}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#dde4e6}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#18bc9c}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#15a589}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#3498db}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#258cd1}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#f39c12}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#e08e0b}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#e74c3c}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#e43725}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15.75px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ecf0f1}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:21px;font-size:22.5px;line-height:inherit;color:#2c3e50;border:0;border-bottom:1px solid transparent}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:11px;font-size:15px;line-height:1.42857143;color:#2c3e50}.form-control{display:block;width:100%;height:45px;padding:10px 15px;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff;background-image:none;border:1px solid #dce4ec;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#2c3e50;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6)}.form-control::-moz-placeholder{color:#acb6c0;opacity:1}.form-control:-ms-input-placeholder{color:#acb6c0}.form-control::-webkit-input-placeholder{color:#acb6c0}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#ecf0f1;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:45px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:35px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:66px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:21px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:11px;padding-bottom:11px;margin-bottom:0;min-height:36px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-sm{height:35px;line-height:35px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:35px;line-height:35px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:35px;min-height:34px;padding:7px 9px;font-size:13px;line-height:1.5}.input-lg{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}select.input-lg{height:66px;line-height:66px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:66px;line-height:66px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:66px;min-height:40px;padding:19px 27px;font-size:19px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:56.25px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:45px;height:45px;line-height:45px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:66px;height:66px;line-height:66px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:35px;height:35px;line-height:35px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#ffffff}.has-success .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-success .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#18bc9c}.has-success .form-control-feedback{color:#ffffff}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#ffffff}.has-warning .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-warning .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#f39c12}.has-warning .form-control-feedback{color:#ffffff}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#ffffff}.has-error .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-error .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#e74c3c}.has-error .form-control-feedback{color:#ffffff}.has-feedback label~.form-control-feedback{top:26px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#597ea2}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:11px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:32px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:11px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:19px;font-size:19px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:7px;font-size:13px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:10px 15px;font-size:15px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#ffffff;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#ffffff;background-color:#95a5a6;border-color:#95a5a6}.btn-default:focus,.btn-default.focus{color:#ffffff;background-color:#798d8f;border-color:#566566}.btn-default:hover{color:#ffffff;background-color:#798d8f;border-color:#74898a}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#ffffff;background-color:#798d8f;border-color:#74898a}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#ffffff;background-color:#687b7c;border-color:#566566}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#95a5a6;border-color:#95a5a6}.btn-default .badge{color:#95a5a6;background-color:#ffffff}.btn-primary{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.btn-primary:focus,.btn-primary.focus{color:#ffffff;background-color:#1a242f;border-color:#000000}.btn-primary:hover{color:#ffffff;background-color:#1a242f;border-color:#161f29}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#ffffff;background-color:#1a242f;border-color:#161f29}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#ffffff;background-color:#0d1318;border-color:#000000}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#2c3e50;border-color:#2c3e50}.btn-primary .badge{color:#2c3e50;background-color:#ffffff}.btn-success{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.btn-success:focus,.btn-success.focus{color:#ffffff;background-color:#128f76;border-color:#0a4b3e}.btn-success:hover{color:#ffffff;background-color:#128f76;border-color:#11866f}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#ffffff;background-color:#128f76;border-color:#11866f}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#ffffff;background-color:#0e6f5c;border-color:#0a4b3e}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#18bc9c;border-color:#18bc9c}.btn-success .badge{color:#18bc9c;background-color:#ffffff}.btn-info{color:#ffffff;background-color:#3498db;border-color:#3498db}.btn-info:focus,.btn-info.focus{color:#ffffff;background-color:#217dbb;border-color:#16527a}.btn-info:hover{color:#ffffff;background-color:#217dbb;border-color:#2077b2}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#ffffff;background-color:#217dbb;border-color:#2077b2}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#ffffff;background-color:#1c699d;border-color:#16527a}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#3498db;border-color:#3498db}.btn-info .badge{color:#3498db;background-color:#ffffff}.btn-warning{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.btn-warning:focus,.btn-warning.focus{color:#ffffff;background-color:#c87f0a;border-color:#7f5006}.btn-warning:hover{color:#ffffff;background-color:#c87f0a;border-color:#be780a}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#ffffff;background-color:#c87f0a;border-color:#be780a}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#ffffff;background-color:#a66908;border-color:#7f5006}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#f39c12;border-color:#f39c12}.btn-warning .badge{color:#f39c12;background-color:#ffffff}.btn-danger{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.btn-danger:focus,.btn-danger.focus{color:#ffffff;background-color:#d62c1a;border-color:#921e12}.btn-danger:hover{color:#ffffff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#ffffff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#ffffff;background-color:#b62516;border-color:#921e12}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#e74c3c;border-color:#e74c3c}.btn-danger .badge{color:#e74c3c;background-color:#ffffff}.btn-link{color:#18bc9c;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#18bc9c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#b4bcc2;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:13px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:0.35s;-o-transition-duration:0.35s;transition-duration:0.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:15px;text-align:left;background-color:#ffffff;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#7b8a8b;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#ffffff;background-color:#2c3e50}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#2c3e50}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#b4bcc2}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:13px;line-height:1.42857143;color:#b4bcc2;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:66px;line-height:66px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:35px;line-height:35px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:10px 15px;font-size:15px;font-weight:normal;line-height:1;color:#2c3e50;text-align:center;background-color:#ecf0f1;border:1px solid #dce4ec;border-radius:4px}.input-group-addon.input-sm{padding:6px 9px;font-size:13px;border-radius:3px}.input-group-addon.input-lg{padding:18px 27px;font-size:19px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#ecf0f1}.nav>li.disabled>a{color:#b4bcc2}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#b4bcc2;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#ecf0f1;border-color:#18bc9c}.nav .nav-divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ecf0f1}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#ecf0f1 #ecf0f1 #ecf0f1}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#2c3e50;background-color:#ffffff;border:1px solid #ecf0f1;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#ffffff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#ffffff;background-color:#2c3e50}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#ffffff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:60px;margin-bottom:21px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:19.5px 15px;font-size:19px;line-height:21px;height:60px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:13px;margin-bottom:13px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:9.75px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:21px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:21px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:19.5px;padding-bottom:19.5px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:7.5px;margin-bottom:7.5px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:7.5px;margin-bottom:7.5px}.navbar-btn.btn-sm{margin-top:12.5px;margin-bottom:12.5px}.navbar-btn.btn-xs{margin-top:19px;margin-bottom:19px}.navbar-text{margin-top:19.5px;margin-bottom:19.5px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#2c3e50;border-color:transparent}.navbar-default .navbar-brand{color:#ffffff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-text{color:#777777}.navbar-default .navbar-nav>li>a{color:#ffffff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#1a242f}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#1a242f}.navbar-default .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#1a242f;color:#ffffff}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-default .navbar-link{color:#ffffff}.navbar-default .navbar-link:hover{color:#18bc9c}.navbar-default .btn-link{color:#ffffff}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#18bc9c}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#cccccc}.navbar-inverse{background-color:#18bc9c;border-color:transparent}.navbar-inverse .navbar-brand{color:#ffffff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-text{color:#ffffff}.navbar-inverse .navbar-nav>li>a{color:#ffffff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#128f76}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#128f76}.navbar-inverse .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#149c82}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#15a589;color:#ffffff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-inverse .navbar-link{color:#ffffff}.navbar-inverse .navbar-link:hover{color:#2c3e50}.navbar-inverse .btn-link{color:#ffffff}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#2c3e50}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#cccccc}.breadcrumb{padding:8px 15px;margin-bottom:21px;list-style:none;background-color:#ecf0f1;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#cccccc}.breadcrumb>.active{color:#95a5a6}.pagination{display:inline-block;padding-left:0;margin:21px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:10px 15px;line-height:1.42857143;text-decoration:none;color:#ffffff;background-color:#18bc9c;border:1px solid transparent;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#ffffff;background-color:#0f7864;border-color:transparent}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#ffffff;background-color:#0f7864;border-color:transparent;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#ecf0f1;background-color:#3be6c4;border-color:transparent;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:18px 27px;font-size:19px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:6px 9px;font-size:13px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:21px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#18bc9c;border:1px solid transparent;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#0f7864}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#ffffff;background-color:#18bc9c;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#ffffff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#95a5a6}.label-default[href]:hover,.label-default[href]:focus{background-color:#798d8f}.label-primary{background-color:#2c3e50}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#1a242f}.label-success{background-color:#18bc9c}.label-success[href]:hover,.label-success[href]:focus{background-color:#128f76}.label-info{background-color:#3498db}.label-info[href]:hover,.label-info[href]:focus{background-color:#217dbb}.label-warning{background-color:#f39c12}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#c87f0a}.label-danger{background-color:#e74c3c}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#d62c1a}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:13px;font-weight:bold;color:#ffffff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#2c3e50;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#2c3e50;background-color:#ffffff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#ecf0f1}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:23px;font-weight:200}.jumbotron>hr{border-top-color:#cfd9db}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:68px}}.thumbnail{display:block;padding:4px;margin-bottom:21px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#18bc9c}.thumbnail .caption{padding:9px;color:#2c3e50}.alert{padding:15px;margin-bottom:21px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#18bc9c;border-color:#18bc9c;color:#ffffff}.alert-success hr{border-top-color:#15a589}.alert-success .alert-link{color:#e6e6e6}.alert-info{background-color:#3498db;border-color:#3498db;color:#ffffff}.alert-info hr{border-top-color:#258cd1}.alert-info .alert-link{color:#e6e6e6}.alert-warning{background-color:#f39c12;border-color:#f39c12;color:#ffffff}.alert-warning hr{border-top-color:#e08e0b}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{background-color:#e74c3c;border-color:#e74c3c;color:#ffffff}.alert-danger hr{border-top-color:#e43725}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:21px;margin-bottom:21px;background-color:#ecf0f1;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:13px;line-height:21px;color:#ffffff;text-align:center;background-color:#2c3e50;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#18bc9c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#3498db}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#f39c12}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#e74c3c}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#ffffff;border:1px solid #ecf0f1}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333333}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{text-decoration:none;color:#555555;background-color:#ecf0f1}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#ecf0f1;color:#b4bcc2;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#b4bcc2}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#8aa4be}.list-group-item-success{color:#ffffff;background-color:#18bc9c}a.list-group-item-success,button.list-group-item-success{color:#ffffff}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,button.list-group-item-success:hover,a.list-group-item-success:focus,button.list-group-item-success:focus{color:#ffffff;background-color:#15a589}a.list-group-item-success.active,button.list-group-item-success.active,a.list-group-item-success.active:hover,button.list-group-item-success.active:hover,a.list-group-item-success.active:focus,button.list-group-item-success.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-info{color:#ffffff;background-color:#3498db}a.list-group-item-info,button.list-group-item-info{color:#ffffff}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,button.list-group-item-info:hover,a.list-group-item-info:focus,button.list-group-item-info:focus{color:#ffffff;background-color:#258cd1}a.list-group-item-info.active,button.list-group-item-info.active,a.list-group-item-info.active:hover,button.list-group-item-info.active:hover,a.list-group-item-info.active:focus,button.list-group-item-info.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-warning{color:#ffffff;background-color:#f39c12}a.list-group-item-warning,button.list-group-item-warning{color:#ffffff}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,button.list-group-item-warning:hover,a.list-group-item-warning:focus,button.list-group-item-warning:focus{color:#ffffff;background-color:#e08e0b}a.list-group-item-warning.active,button.list-group-item-warning.active,a.list-group-item-warning.active:hover,button.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus,button.list-group-item-warning.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-danger{color:#ffffff;background-color:#e74c3c}a.list-group-item-danger,button.list-group-item-danger{color:#ffffff}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,button.list-group-item-danger:hover,a.list-group-item-danger:focus,button.list-group-item-danger:focus{color:#ffffff;background-color:#e43725}a.list-group-item-danger.active,button.list-group-item-danger.active,a.list-group-item-danger.active:hover,button.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus,button.list-group-item-danger.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:21px;background-color:#ffffff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:17px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#ecf0f1;border-top:1px solid #ecf0f1;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ecf0f1}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:21px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ecf0f1}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ecf0f1}.panel-default{border-color:#ecf0f1}.panel-default>.panel-heading{color:#2c3e50;background-color:#ecf0f1;border-color:#ecf0f1}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ecf0f1}.panel-default>.panel-heading .badge{color:#ecf0f1;background-color:#2c3e50}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ecf0f1}.panel-primary{border-color:#2c3e50}.panel-primary>.panel-heading{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#2c3e50}.panel-primary>.panel-heading .badge{color:#2c3e50;background-color:#ffffff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#2c3e50}.panel-success{border-color:#18bc9c}.panel-success>.panel-heading{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#18bc9c}.panel-success>.panel-heading .badge{color:#18bc9c;background-color:#ffffff}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#18bc9c}.panel-info{border-color:#3498db}.panel-info>.panel-heading{color:#ffffff;background-color:#3498db;border-color:#3498db}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3498db}.panel-info>.panel-heading .badge{color:#3498db;background-color:#ffffff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3498db}.panel-warning{border-color:#f39c12}.panel-warning>.panel-heading{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#f39c12}.panel-warning>.panel-heading .badge{color:#f39c12;background-color:#ffffff}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#f39c12}.panel-danger{border-color:#e74c3c}.panel-danger>.panel-heading{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#e74c3c}.panel-danger>.panel-heading .badge{color:#e74c3c;background-color:#ffffff}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#e74c3c}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#ecf0f1;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:22.5px;font-weight:bold;line-height:1;color:#000000;text-shadow:none;opacity:0.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#ffffff;border:1px solid #999999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:0.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{padding:20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:13px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:0.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;background-color:#000000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:15px;background-color:#ffffff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:15px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#ffffff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:0.5;filter:alpha(opacity=50);font-size:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #ffffff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#ffffff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-header:before,.modal-header:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-header:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}}.navbar{border-width:0}.navbar-default .badge{background-color:#fff;color:#2c3e50}.navbar-inverse .badge{background-color:#fff;color:#18bc9c}.navbar-brand{line-height:1}.btn{border-width:2px}.btn:active{-webkit-box-shadow:none;box-shadow:none}.btn-group.open .dropdown-toggle{-webkit-box-shadow:none;box-shadow:none}.text-primary,.text-primary:hover{color:#2c3e50}.text-success,.text-success:hover{color:#18bc9c}.text-danger,.text-danger:hover{color:#e74c3c}.text-warning,.text-warning:hover{color:#f39c12}.text-info,.text-info:hover{color:#3498db}table a:not(.btn),.table a:not(.btn){text-decoration:underline}table .dropdown-menu a,.table .dropdown-menu a{text-decoration:none}table .success,.table .success,table .warning,.table .warning,table .danger,.table .danger,table .info,.table .info{color:#fff}table .success>th>a,.table .success>th>a,table .warning>th>a,.table .warning>th>a,table .danger>th>a,.table .danger>th>a,table .info>th>a,.table .info>th>a,table .success>td>a,.table .success>td>a,table .warning>td>a,.table .warning>td>a,table .danger>td>a,.table .danger>td>a,table .info>td>a,.table .info>td>a,table .success>a,.table .success>a,table .warning>a,.table .warning>a,table .danger>a,.table .danger>a,table .info>a,.table .info>a{color:#fff}table>thead>tr>th,.table>thead>tr>th,table>tbody>tr>th,.table>tbody>tr>th,table>tfoot>tr>th,.table>tfoot>tr>th,table>thead>tr>td,.table>thead>tr>td,table>tbody>tr>td,.table>tbody>tr>td,table>tfoot>tr>td,.table>tfoot>tr>td{border:none}table-bordered>thead>tr>th,.table-bordered>thead>tr>th,table-bordered>tbody>tr>th,.table-bordered>tbody>tr>th,table-bordered>tfoot>tr>th,.table-bordered>tfoot>tr>th,table-bordered>thead>tr>td,.table-bordered>thead>tr>td,table-bordered>tbody>tr>td,.table-bordered>tbody>tr>td,table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.form-control,input{border-width:2px;-webkit-box-shadow:none;box-shadow:none}.form-control:focus,input:focus{-webkit-box-shadow:none;box-shadow:none}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label,.has-warning .form-control-feedback{color:#f39c12}.has-warning .form-control,.has-warning .form-control:focus{border:2px solid #f39c12}.has-warning .input-group-addon{border-color:#f39c12}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label,.has-error .form-control-feedback{color:#e74c3c}.has-error .form-control,.has-error .form-control:focus{border:2px solid #e74c3c}.has-error .input-group-addon{border-color:#e74c3c}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label,.has-success .form-control-feedback{color:#18bc9c}.has-success .form-control,.has-success .form-control:focus{border:2px solid #18bc9c}.has-success .input-group-addon{border-color:#18bc9c}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{border-color:transparent}.pager a,.pager a:hover{color:#fff}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{background-color:#3be6c4}.close{color:#fff;text-decoration:none;opacity:0.4}.close:hover,.close:focus{color:#fff;opacity:1}.alert .alert-link{color:#fff;text-decoration:underline}.progress{height:10px;-webkit-box-shadow:none;box-shadow:none}.progress .progress-bar{font-size:10px;line-height:10px}.well{-webkit-box-shadow:none;box-shadow:none}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{border-color:#ecf0f1}a.list-group-item-success.active{background-color:#18bc9c}a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{background-color:#15a589}a.list-group-item-warning.active{background-color:#f39c12}a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{background-color:#e08e0b}a.list-group-item-danger.active{background-color:#e74c3c}a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{background-color:#e43725}.panel-default .close{color:#2c3e50}.modal .close{color:#2c3e50}.popover{color:#2c3e50} \ No newline at end of file + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#18bc9c;text-decoration:none}a:hover,a:focus{color:#18bc9c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:21px;margin-bottom:21px;border:0;border-top:1px solid #ecf0f1}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#b4bcc2}h1,.h1,h2,.h2,h3,.h3{margin-top:21px;margin-bottom:10.5px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10.5px;margin-bottom:10.5px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:39px}h2,.h2{font-size:32px}h3,.h3{font-size:26px}h4,.h4{font-size:19px}h5,.h5{font-size:15px}h6,.h6{font-size:13px}p{margin:0 0 10.5px}.lead{margin-bottom:21px;font-size:17px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:22.5px}}small,.small{font-size:86%}mark,.mark{background-color:#f39c12;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#b4bcc2}.text-primary{color:#2c3e50}a.text-primary:hover,a.text-primary:focus{color:#1a242f}.text-success{color:#ffffff}a.text-success:hover,a.text-success:focus{color:#e6e6e6}.text-info{color:#ffffff}a.text-info:hover,a.text-info:focus{color:#e6e6e6}.text-warning{color:#ffffff}a.text-warning:hover,a.text-warning:focus{color:#e6e6e6}.text-danger{color:#ffffff}a.text-danger:hover,a.text-danger:focus{color:#e6e6e6}.bg-primary{color:#fff;background-color:#2c3e50}a.bg-primary:hover,a.bg-primary:focus{background-color:#1a242f}.bg-success{background-color:#18bc9c}a.bg-success:hover,a.bg-success:focus{background-color:#128f76}.bg-info{background-color:#3498db}a.bg-info:hover,a.bg-info:focus{background-color:#217dbb}.bg-warning{background-color:#f39c12}a.bg-warning:hover,a.bg-warning:focus{background-color:#c87f0a}.bg-danger{background-color:#e74c3c}a.bg-danger:hover,a.bg-danger:focus{background-color:#d62c1a}.page-header{padding-bottom:9.5px;margin:42px 0 21px;border-bottom:1px solid transparent}ul,ol{margin-top:0;margin-bottom:10.5px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:21px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #b4bcc2}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10.5px 21px;margin:0 0 21px;font-size:18.75px;border-left:5px solid #ecf0f1}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#b4bcc2}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #ecf0f1;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:21px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#ffffff;background-color:#333333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#7b8a8b;background-color:#ecf0f1;border:1px solid #cccccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0%}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#b4bcc2;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:21px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ecf0f1}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ecf0f1}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ecf0f1}.table .table{background-color:#ffffff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#ecf0f1}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#ecf0f1}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#dde4e6}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#18bc9c}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#15a589}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#3498db}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#258cd1}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#f39c12}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#e08e0b}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#e74c3c}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#e43725}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15.75px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ecf0f1}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:21px;font-size:22.5px;line-height:inherit;color:#2c3e50;border:0;border-bottom:1px solid transparent}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:11px;font-size:15px;line-height:1.42857143;color:#2c3e50}.form-control{display:block;width:100%;height:45px;padding:10px 15px;font-size:15px;line-height:1.42857143;color:#2c3e50;background-color:#ffffff;background-image:none;border:1px solid #dce4ec;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#2c3e50;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(44,62,80,0.6)}.form-control::-moz-placeholder{color:#acb6c0;opacity:1}.form-control:-ms-input-placeholder{color:#acb6c0}.form-control::-webkit-input-placeholder{color:#acb6c0}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#ecf0f1;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:45px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:35px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:66px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:21px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:11px;padding-bottom:11px;margin-bottom:0;min-height:36px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-sm{height:35px;line-height:35px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:35px;line-height:35px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:35px;min-height:34px;padding:7px 9px;font-size:13px;line-height:1.5}.input-lg{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}select.input-lg{height:66px;line-height:66px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:66px;line-height:66px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:66px;min-height:40px;padding:19px 27px;font-size:19px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:56.25px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:45px;height:45px;line-height:45px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:66px;height:66px;line-height:66px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:35px;height:35px;line-height:35px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#ffffff}.has-success .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-success .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#18bc9c}.has-success .form-control-feedback{color:#ffffff}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#ffffff}.has-warning .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-warning .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#f39c12}.has-warning .form-control-feedback{color:#ffffff}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#ffffff}.has-error .form-control{border-color:#ffffff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #fff}.has-error .input-group-addon{color:#ffffff;border-color:#ffffff;background-color:#e74c3c}.has-error .form-control-feedback{color:#ffffff}.has-feedback label~.form-control-feedback{top:26px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#597ea2}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:11px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:32px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:11px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:19px;font-size:19px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:7px;font-size:13px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:10px 15px;font-size:15px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#ffffff;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#ffffff;background-color:#95a5a6;border-color:#95a5a6}.btn-default:focus,.btn-default.focus{color:#ffffff;background-color:#798d8f;border-color:#566566}.btn-default:hover{color:#ffffff;background-color:#798d8f;border-color:#74898a}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#ffffff;background-color:#798d8f;border-color:#74898a}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#ffffff;background-color:#687b7c;border-color:#566566}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#95a5a6;border-color:#95a5a6}.btn-default .badge{color:#95a5a6;background-color:#ffffff}.btn-primary{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.btn-primary:focus,.btn-primary.focus{color:#ffffff;background-color:#1a242f;border-color:#000000}.btn-primary:hover{color:#ffffff;background-color:#1a242f;border-color:#161f29}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#ffffff;background-color:#1a242f;border-color:#161f29}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#ffffff;background-color:#0d1318;border-color:#000000}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#2c3e50;border-color:#2c3e50}.btn-primary .badge{color:#2c3e50;background-color:#ffffff}.btn-success{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.btn-success:focus,.btn-success.focus{color:#ffffff;background-color:#128f76;border-color:#0a4b3e}.btn-success:hover{color:#ffffff;background-color:#128f76;border-color:#11866f}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#ffffff;background-color:#128f76;border-color:#11866f}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#ffffff;background-color:#0e6f5c;border-color:#0a4b3e}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#18bc9c;border-color:#18bc9c}.btn-success .badge{color:#18bc9c;background-color:#ffffff}.btn-info{color:#ffffff;background-color:#3498db;border-color:#3498db}.btn-info:focus,.btn-info.focus{color:#ffffff;background-color:#217dbb;border-color:#16527a}.btn-info:hover{color:#ffffff;background-color:#217dbb;border-color:#2077b2}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#ffffff;background-color:#217dbb;border-color:#2077b2}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#ffffff;background-color:#1c699d;border-color:#16527a}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#3498db;border-color:#3498db}.btn-info .badge{color:#3498db;background-color:#ffffff}.btn-warning{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.btn-warning:focus,.btn-warning.focus{color:#ffffff;background-color:#c87f0a;border-color:#7f5006}.btn-warning:hover{color:#ffffff;background-color:#c87f0a;border-color:#be780a}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#ffffff;background-color:#c87f0a;border-color:#be780a}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#ffffff;background-color:#a66908;border-color:#7f5006}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#f39c12;border-color:#f39c12}.btn-warning .badge{color:#f39c12;background-color:#ffffff}.btn-danger{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.btn-danger:focus,.btn-danger.focus{color:#ffffff;background-color:#d62c1a;border-color:#921e12}.btn-danger:hover{color:#ffffff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#ffffff;background-color:#d62c1a;border-color:#cd2a19}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#ffffff;background-color:#b62516;border-color:#921e12}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#e74c3c;border-color:#e74c3c}.btn-danger .badge{color:#e74c3c;background-color:#ffffff}.btn-link{color:#18bc9c;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#18bc9c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#b4bcc2;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:13px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:0.35s;-o-transition-duration:0.35s;transition-duration:0.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:15px;text-align:left;background-color:#ffffff;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#7b8a8b;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#ffffff;background-color:#2c3e50}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#ffffff;text-decoration:none;outline:0;background-color:#2c3e50}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#b4bcc2}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:13px;line-height:1.42857143;color:#b4bcc2;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:66px;padding:18px 27px;font-size:19px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:66px;line-height:66px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:35px;padding:6px 9px;font-size:13px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:35px;line-height:35px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:10px 15px;font-size:15px;font-weight:normal;line-height:1;color:#2c3e50;text-align:center;background-color:#ecf0f1;border:1px solid #dce4ec;border-radius:4px}.input-group-addon.input-sm{padding:6px 9px;font-size:13px;border-radius:3px}.input-group-addon.input-lg{padding:18px 27px;font-size:19px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#ecf0f1}.nav>li.disabled>a{color:#b4bcc2}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#b4bcc2;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#ecf0f1;border-color:#18bc9c}.nav .nav-divider{height:1px;margin:9.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ecf0f1}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#ecf0f1 #ecf0f1 #ecf0f1}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#2c3e50;background-color:#ffffff;border:1px solid #ecf0f1;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#ffffff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#ffffff;background-color:#2c3e50}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ecf0f1}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ecf0f1;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#ffffff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:60px;margin-bottom:21px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:19.5px 15px;font-size:19px;line-height:21px;height:60px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:13px;margin-bottom:13px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:9.75px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:21px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:21px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:19.5px;padding-bottom:19.5px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:7.5px;margin-bottom:7.5px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:7.5px;margin-bottom:7.5px}.navbar-btn.btn-sm{margin-top:12.5px;margin-bottom:12.5px}.navbar-btn.btn-xs{margin-top:19px;margin-bottom:19px}.navbar-text{margin-top:19.5px;margin-bottom:19.5px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#2c3e50;border-color:transparent}.navbar-default .navbar-brand{color:#ffffff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-text{color:#ffffff}.navbar-default .navbar-nav>li>a{color:#ffffff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#1a242f}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#1a242f}.navbar-default .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#1a242f;color:#ffffff}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#18bc9c;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#1a242f}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-default .navbar-link{color:#ffffff}.navbar-default .navbar-link:hover{color:#18bc9c}.navbar-default .btn-link{color:#ffffff}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#18bc9c}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#cccccc}.navbar-inverse{background-color:#18bc9c;border-color:transparent}.navbar-inverse .navbar-brand{color:#ffffff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-text{color:#ffffff}.navbar-inverse .navbar-nav>li>a{color:#ffffff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#cccccc;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#128f76}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#128f76}.navbar-inverse .navbar-toggle .icon-bar{background-color:#ffffff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#149c82}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#15a589;color:#ffffff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#ffffff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#2c3e50;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#ffffff;background-color:#15a589}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#cccccc;background-color:transparent}}.navbar-inverse .navbar-link{color:#ffffff}.navbar-inverse .navbar-link:hover{color:#2c3e50}.navbar-inverse .btn-link{color:#ffffff}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#2c3e50}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#cccccc}.breadcrumb{padding:8px 15px;margin-bottom:21px;list-style:none;background-color:#ecf0f1;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#cccccc}.breadcrumb>.active{color:#95a5a6}.pagination{display:inline-block;padding-left:0;margin:21px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:10px 15px;line-height:1.42857143;text-decoration:none;color:#ffffff;background-color:#18bc9c;border:1px solid transparent;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#ffffff;background-color:#0f7864;border-color:transparent}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#ffffff;background-color:#0f7864;border-color:transparent;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#ecf0f1;background-color:#3be6c4;border-color:transparent;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:18px 27px;font-size:19px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:6px 9px;font-size:13px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:21px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#18bc9c;border:1px solid transparent;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#0f7864}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#ffffff;background-color:#18bc9c;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#ffffff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#ffffff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#95a5a6}.label-default[href]:hover,.label-default[href]:focus{background-color:#798d8f}.label-primary{background-color:#2c3e50}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#1a242f}.label-success{background-color:#18bc9c}.label-success[href]:hover,.label-success[href]:focus{background-color:#128f76}.label-info{background-color:#3498db}.label-info[href]:hover,.label-info[href]:focus{background-color:#217dbb}.label-warning{background-color:#f39c12}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#c87f0a}.label-danger{background-color:#e74c3c}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#d62c1a}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:13px;font-weight:bold;color:#ffffff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#2c3e50;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#2c3e50;background-color:#ffffff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#ecf0f1}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:23px;font-weight:200}.jumbotron>hr{border-top-color:#cfd9db}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:68px}}.thumbnail{display:block;padding:4px;margin-bottom:21px;line-height:1.42857143;background-color:#ffffff;border:1px solid #ecf0f1;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#18bc9c}.thumbnail .caption{padding:9px;color:#2c3e50}.alert{padding:15px;margin-bottom:21px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#18bc9c;border-color:#18bc9c;color:#ffffff}.alert-success hr{border-top-color:#15a589}.alert-success .alert-link{color:#e6e6e6}.alert-info{background-color:#3498db;border-color:#3498db;color:#ffffff}.alert-info hr{border-top-color:#258cd1}.alert-info .alert-link{color:#e6e6e6}.alert-warning{background-color:#f39c12;border-color:#f39c12;color:#ffffff}.alert-warning hr{border-top-color:#e08e0b}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{background-color:#e74c3c;border-color:#e74c3c;color:#ffffff}.alert-danger hr{border-top-color:#e43725}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:21px;margin-bottom:21px;background-color:#ecf0f1;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:13px;line-height:21px;color:#ffffff;text-align:center;background-color:#2c3e50;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#18bc9c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#3498db}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#f39c12}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#e74c3c}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#ffffff;border:1px solid #ecf0f1}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333333}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{text-decoration:none;color:#555555;background-color:#ecf0f1}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#ecf0f1;color:#b4bcc2;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#b4bcc2}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#8aa4be}.list-group-item-success{color:#ffffff;background-color:#18bc9c}a.list-group-item-success,button.list-group-item-success{color:#ffffff}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,button.list-group-item-success:hover,a.list-group-item-success:focus,button.list-group-item-success:focus{color:#ffffff;background-color:#15a589}a.list-group-item-success.active,button.list-group-item-success.active,a.list-group-item-success.active:hover,button.list-group-item-success.active:hover,a.list-group-item-success.active:focus,button.list-group-item-success.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-info{color:#ffffff;background-color:#3498db}a.list-group-item-info,button.list-group-item-info{color:#ffffff}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,button.list-group-item-info:hover,a.list-group-item-info:focus,button.list-group-item-info:focus{color:#ffffff;background-color:#258cd1}a.list-group-item-info.active,button.list-group-item-info.active,a.list-group-item-info.active:hover,button.list-group-item-info.active:hover,a.list-group-item-info.active:focus,button.list-group-item-info.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-warning{color:#ffffff;background-color:#f39c12}a.list-group-item-warning,button.list-group-item-warning{color:#ffffff}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,button.list-group-item-warning:hover,a.list-group-item-warning:focus,button.list-group-item-warning:focus{color:#ffffff;background-color:#e08e0b}a.list-group-item-warning.active,button.list-group-item-warning.active,a.list-group-item-warning.active:hover,button.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus,button.list-group-item-warning.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-danger{color:#ffffff;background-color:#e74c3c}a.list-group-item-danger,button.list-group-item-danger{color:#ffffff}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,button.list-group-item-danger:hover,a.list-group-item-danger:focus,button.list-group-item-danger:focus{color:#ffffff;background-color:#e43725}a.list-group-item-danger.active,button.list-group-item-danger.active,a.list-group-item-danger.active:hover,button.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus,button.list-group-item-danger.active:focus{color:#fff;background-color:#ffffff;border-color:#ffffff}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:21px;background-color:#ffffff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:17px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#ecf0f1;border-top:1px solid #ecf0f1;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ecf0f1}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:21px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ecf0f1}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ecf0f1}.panel-default{border-color:#ecf0f1}.panel-default>.panel-heading{color:#2c3e50;background-color:#ecf0f1;border-color:#ecf0f1}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ecf0f1}.panel-default>.panel-heading .badge{color:#ecf0f1;background-color:#2c3e50}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ecf0f1}.panel-primary{border-color:#2c3e50}.panel-primary>.panel-heading{color:#ffffff;background-color:#2c3e50;border-color:#2c3e50}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#2c3e50}.panel-primary>.panel-heading .badge{color:#2c3e50;background-color:#ffffff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#2c3e50}.panel-success{border-color:#18bc9c}.panel-success>.panel-heading{color:#ffffff;background-color:#18bc9c;border-color:#18bc9c}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#18bc9c}.panel-success>.panel-heading .badge{color:#18bc9c;background-color:#ffffff}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#18bc9c}.panel-info{border-color:#3498db}.panel-info>.panel-heading{color:#ffffff;background-color:#3498db;border-color:#3498db}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3498db}.panel-info>.panel-heading .badge{color:#3498db;background-color:#ffffff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3498db}.panel-warning{border-color:#f39c12}.panel-warning>.panel-heading{color:#ffffff;background-color:#f39c12;border-color:#f39c12}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#f39c12}.panel-warning>.panel-heading .badge{color:#f39c12;background-color:#ffffff}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#f39c12}.panel-danger{border-color:#e74c3c}.panel-danger>.panel-heading{color:#ffffff;background-color:#e74c3c;border-color:#e74c3c}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#e74c3c}.panel-danger>.panel-heading .badge{color:#e74c3c;background-color:#ffffff}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#e74c3c}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#ecf0f1;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:22.5px;font-weight:bold;line-height:1;color:#000000;text-shadow:none;opacity:0.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#ffffff;border:1px solid #999999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:0.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{padding:20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:13px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:0.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;background-color:#000000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Lato","Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:15px;background-color:#ffffff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #cccccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:15px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#ffffff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:0.5;filter:alpha(opacity=50);font-size:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #ffffff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#ffffff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#ffffff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-header:before,.modal-header:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-header:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}}.navbar{border-width:0}.navbar-default .badge{background-color:#fff;color:#2c3e50}.navbar-inverse .badge{background-color:#fff;color:#18bc9c}.navbar-brand{line-height:1}.btn{border-width:2px}.btn:active{-webkit-box-shadow:none;box-shadow:none}.btn-group.open .dropdown-toggle{-webkit-box-shadow:none;box-shadow:none}.text-primary,.text-primary:hover{color:#2c3e50}.text-success,.text-success:hover{color:#18bc9c}.text-danger,.text-danger:hover{color:#e74c3c}.text-warning,.text-warning:hover{color:#f39c12}.text-info,.text-info:hover{color:#3498db}table a:not(.btn),.table a:not(.btn){text-decoration:underline}table .dropdown-menu a,.table .dropdown-menu a{text-decoration:none}table .success,.table .success,table .warning,.table .warning,table .danger,.table .danger,table .info,.table .info{color:#fff}table .success>th>a,.table .success>th>a,table .warning>th>a,.table .warning>th>a,table .danger>th>a,.table .danger>th>a,table .info>th>a,.table .info>th>a,table .success>td>a,.table .success>td>a,table .warning>td>a,.table .warning>td>a,table .danger>td>a,.table .danger>td>a,table .info>td>a,.table .info>td>a,table .success>a,.table .success>a,table .warning>a,.table .warning>a,table .danger>a,.table .danger>a,table .info>a,.table .info>a{color:#fff}table>thead>tr>th,.table>thead>tr>th,table>tbody>tr>th,.table>tbody>tr>th,table>tfoot>tr>th,.table>tfoot>tr>th,table>thead>tr>td,.table>thead>tr>td,table>tbody>tr>td,.table>tbody>tr>td,table>tfoot>tr>td,.table>tfoot>tr>td{border:none}table-bordered>thead>tr>th,.table-bordered>thead>tr>th,table-bordered>tbody>tr>th,.table-bordered>tbody>tr>th,table-bordered>tfoot>tr>th,.table-bordered>tfoot>tr>th,table-bordered>thead>tr>td,.table-bordered>thead>tr>td,table-bordered>tbody>tr>td,.table-bordered>tbody>tr>td,table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ecf0f1}.form-control,input{border-width:2px;-webkit-box-shadow:none;box-shadow:none}.form-control:focus,input:focus{-webkit-box-shadow:none;box-shadow:none}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label,.has-warning .form-control-feedback{color:#f39c12}.has-warning .form-control,.has-warning .form-control:focus{border:2px solid #f39c12}.has-warning .input-group-addon{border-color:#f39c12}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label,.has-error .form-control-feedback{color:#e74c3c}.has-error .form-control,.has-error .form-control:focus{border:2px solid #e74c3c}.has-error .input-group-addon{border-color:#e74c3c}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label,.has-success .form-control-feedback{color:#18bc9c}.has-success .form-control,.has-success .form-control:focus{border:2px solid #18bc9c}.has-success .input-group-addon{border-color:#18bc9c}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{border-color:transparent}.pager a,.pager a:hover{color:#fff}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{background-color:#3be6c4}.close{color:#fff;text-decoration:none;opacity:0.4}.close:hover,.close:focus{color:#fff;opacity:1}.alert .alert-link{color:#fff;text-decoration:underline}.progress{height:10px;-webkit-box-shadow:none;box-shadow:none}.progress .progress-bar{font-size:10px;line-height:10px}.well{-webkit-box-shadow:none;box-shadow:none}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{border-color:#ecf0f1}a.list-group-item-success.active{background-color:#18bc9c}a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{background-color:#15a589}a.list-group-item-warning.active{background-color:#f39c12}a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{background-color:#e08e0b}a.list-group-item-danger.active{background-color:#e74c3c}a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{background-color:#e43725}.panel-default .close{color:#2c3e50}.modal .close{color:#2c3e50}.popover{color:#2c3e50} \ No newline at end of file diff --git a/dist/opensourcepos.js b/dist/opensourcepos.js index 675265084..9b0005246 100644 --- a/dist/opensourcepos.js +++ b/dist/opensourcepos.js @@ -1,5 +1,5 @@ /*! - * jQuery JavaScript Library v1.12.3 + * jQuery JavaScript Library v1.12.4 * http://jquery.com/ * * Includes Sizzle.js @@ -9,7 +9,7 @@ * Released under the MIT license * http://jquery.org/license * - * Date: 2016-04-05T19:16Z + * Date: 2016-05-20T17:17Z */ (function( global, factory ) { @@ -65,7 +65,7 @@ var support = {}; var - version = "1.12.3", + version = "1.12.4", // Define a local copy of jQuery jQuery = function( selector, context ) { @@ -6672,6 +6672,7 @@ var documentElement = document.documentElement; if ( reliableHiddenOffsetsVal ) { div.style.display = ""; div.innerHTML = "
          t
          "; + div.childNodes[ 0 ].style.borderCollapse = "separate"; contents = div.getElementsByTagName( "td" ); contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; @@ -6996,19 +6997,6 @@ function getWidthOrHeight( elem, name, extra ) { isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - // Support: IE11 only - // In IE 11 fullscreen elements inside of an iframe have - // 100x too small dimensions (gh-1764). - if ( document.msFullscreenElement && window.top !== window ) { - - // Support: IE11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - if ( elem.getClientRects().length ) { - val = Math.round( elem.getBoundingClientRect()[ name ] * 100 ); - } - } - // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 @@ -9999,6 +9987,11 @@ function getDisplay( elem ) { } function filterHidden( elem ) { + + // Disconnected elements are considered hidden + if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) { + return true; + } while ( elem && elem.nodeType === 1 ) { if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) { return true; @@ -11015,7 +11008,7 @@ return jQuery; })); //! moment.js -//! version : 2.12.0 +//! version : 2.13.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com @@ -11092,7 +11085,9 @@ return jQuery; invalidMonth : null, invalidFormat : false, userInvalidated : false, - iso : false + iso : false, + parsedDateParts : [], + meridiem : null }; } @@ -11103,9 +11098,30 @@ return jQuery; return m._pf; } + var some; + if (Array.prototype.some) { + some = Array.prototype.some; + } else { + some = function (fun) { + var t = Object(this); + var len = t.length >>> 0; + + for (var i = 0; i < len; i++) { + if (i in t && fun.call(this, t[i], i, t)) { + return true; + } + } + + return false; + }; + } + function valid__isValid(m) { if (m._isValid == null) { var flags = getParsingFlags(m); + var parsedParts = some.call(flags.parsedDateParts, function (i) { + return i != null; + }); m._isValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && @@ -11113,7 +11129,8 @@ return jQuery; !flags.invalidWeekday && !flags.nullInput && !flags.invalidFormat && - !flags.userInvalidated; + !flags.userInvalidated && + (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { m._isValid = m._isValid && @@ -11256,6 +11273,9 @@ return jQuery; var firstTime = true; return extend(function () { + if (utils_hooks__hooks.deprecationHandler != null) { + utils_hooks__hooks.deprecationHandler(null, msg); + } if (firstTime) { warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); firstTime = false; @@ -11267,6 +11287,9 @@ return jQuery; var deprecations = {}; function deprecateSimple(name, msg) { + if (utils_hooks__hooks.deprecationHandler != null) { + utils_hooks__hooks.deprecationHandler(name, msg); + } if (!deprecations[name]) { warn(msg); deprecations[name] = true; @@ -11274,6 +11297,7 @@ return jQuery; } utils_hooks__hooks.suppressDeprecationWarnings = false; + utils_hooks__hooks.deprecationHandler = null; function isFunction(input) { return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; @@ -11323,6 +11347,22 @@ return jQuery; } } + var keys; + + if (Object.keys) { + keys = Object.keys; + } else { + keys = function (obj) { + var i, res = []; + for (i in obj) { + if (hasOwnProp(obj, i)) { + res.push(i); + } + } + return res; + }; + } + // internal storage for locale config files var locales = {}; var globalLocale; @@ -11477,7 +11517,7 @@ return jQuery; } function locale_locales__listLocales() { - return Object.keys(locales); + return keys(locales); } var aliases = {}; @@ -11556,7 +11596,7 @@ return jQuery; Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -11609,7 +11649,7 @@ return jQuery; } return function (mom) { - var output = ''; + var output = '', i; for (i = 0; i < length; i++) { output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; } @@ -11738,6 +11778,23 @@ return jQuery; var WEEK = 7; var WEEKDAY = 8; + var indexOf; + + if (Array.prototype.indexOf) { + indexOf = Array.prototype.indexOf; + } else { + indexOf = function (o) { + // I know + var i; + for (i = 0; i < this.length; ++i) { + if (this[i] === o) { + return i; + } + } + return -1; + }; + } + function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); } @@ -11800,15 +11857,63 @@ return jQuery; this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } + function units_month__handleStrictParse(monthName, format, strict) { + var i, ii, mom, llc = monthName.toLocaleLowerCase(); + if (!this._monthsParse) { + // this is not used + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + for (i = 0; i < 12; ++i) { + mom = create_utc__createUTC([2000, i]); + this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); + this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } + } + function localeMonthsParse (monthName, format, strict) { var i, mom, regex; + if (this._monthsParseExact) { + return units_month__handleStrictParse.call(this, monthName, format, strict); + } + if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } + // TODO: add sorting + // Sorting makes sure if one month (or abbr) is a prefix of another + // see sorting in computeMonthsParse for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = create_utc__createUTC([2000, i]); @@ -11934,8 +12039,8 @@ return jQuery; this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._monthsShortRegex = this._monthsRegex; - this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i'); - this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i'); + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); } function checkOverflow (m) { @@ -12162,7 +12267,7 @@ return jQuery; // MOMENTS - var getSetYear = makeGetSet('FullYear', false); + var getSetYear = makeGetSet('FullYear', true); function getIsLeapYear () { return isLeapYear(this.year()); @@ -12431,6 +12536,9 @@ return jQuery; config._a[HOUR] > 0) { getParsingFlags(config).bigHour = undefined; } + + getParsingFlags(config).parsedDateParts = config._a.slice(0); + getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); @@ -12571,7 +12679,7 @@ return jQuery; if (input === undefined) { config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { - config._d = new Date(+input); + config._d = new Date(input.valueOf()); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { @@ -12691,7 +12799,7 @@ return jQuery; this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 - hours * 36e5; // 1000 * 60 * 60 + hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + @@ -12761,9 +12869,9 @@ return jQuery; var res, diff; if (model._isUTC) { res = model.clone(); - diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res); + diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. - res._d.setTime(+res._d + diff); + res._d.setTime(res._d.valueOf() + diff); utils_hooks__hooks.updateOffset(res, false); return res; } else { @@ -12924,7 +13032,7 @@ return jQuery; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day - var isoRegex = /^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/; + var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/; function create__createDuration (input, key) { var duration = input, @@ -13068,7 +13176,7 @@ return jQuery; updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { - mom._d.setTime(+mom._d + milliseconds * isAdding); + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); } if (days) { get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding); @@ -13113,9 +13221,9 @@ return jQuery; } units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - return +this > +localInput; + return this.valueOf() > localInput.valueOf(); } else { - return +localInput < +this.clone().startOf(units); + return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } @@ -13126,14 +13234,16 @@ return jQuery; } units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - return +this < +localInput; + return this.valueOf() < localInput.valueOf(); } else { - return +this.clone().endOf(units) < +localInput; + return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } - function isBetween (from, to, units) { - return this.isAfter(from, units) && this.isBefore(to, units); + function isBetween (from, to, units, inclusivity) { + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && + (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); } function isSame (input, units) { @@ -13144,10 +13254,10 @@ return jQuery; } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - return +this === +localInput; + return this.valueOf() === localInput.valueOf(); } else { - inputMs = +localInput; - return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); + inputMs = localInput.valueOf(); + return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); } } @@ -13214,10 +13324,12 @@ return jQuery; adjust = (b - anchor) / (anchor2 - anchor); } - return -(wholeMonthDiff + adjust); + //check for negative zero, return zero if negative zero + return -(wholeMonthDiff + adjust) || 0; } utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; function toString () { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); @@ -13238,7 +13350,10 @@ return jQuery; } function format (inputString) { - var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat); + if (!inputString) { + inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat; + } + var output = formatMoment(this, inputString); return this.localeData().postformat(output); } @@ -13317,6 +13432,7 @@ return jQuery; case 'week': case 'isoWeek': case 'day': + case 'date': this.hours(0); /* falls through */ case 'hour': @@ -13350,19 +13466,25 @@ return jQuery; if (units === undefined || units === 'millisecond') { return this; } + + // 'date' is an alias for 'day', so it should be considered as such. + if (units === 'date') { + units = 'day'; + } + return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); } function to_type__valueOf () { - return +this._d - ((this._offset || 0) * 60000); + return this._d.valueOf() - ((this._offset || 0) * 60000); } function unix () { - return Math.floor(+this / 1000); + return Math.floor(this.valueOf() / 1000); } function toDate () { - return this._offset ? new Date(+this) : this._d; + return this._offset ? new Date(this.valueOf()) : this._d; } function toArray () { @@ -13631,9 +13753,15 @@ return jQuery; addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); - addRegexToken('dd', matchWord); - addRegexToken('ddd', matchWord); - addRegexToken('dddd', matchWord); + addRegexToken('dd', function (isStrict, locale) { + return locale.weekdaysMinRegex(isStrict); + }); + addRegexToken('ddd', function (isStrict, locale) { + return locale.weekdaysShortRegex(isStrict); + }); + addRegexToken('dddd', function (isStrict, locale) { + return locale.weekdaysRegex(isStrict); + }); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { var weekday = config._locale.weekdaysParse(input, token, config._strict); @@ -13686,9 +13814,77 @@ return jQuery; return this._weekdaysMin[m.day()]; } + function day_of_week__handleStrictParse(weekdayName, format, strict) { + var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._shortWeekdaysParse = []; + this._minWeekdaysParse = []; + + for (i = 0; i < 7; ++i) { + mom = create_utc__createUTC([2000, 1]).day(i); + this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); + this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); + this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } + } + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; + if (this._weekdaysParseExact) { + return day_of_week__handleStrictParse.call(this, weekdayName, format, strict); + } + if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; @@ -13699,7 +13895,7 @@ return jQuery; for (i = 0; i < 7; i++) { // make the regex if we don't have it already - mom = local__createLocal([2000, 1]).day(i); + mom = create_utc__createUTC([2000, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); @@ -13755,6 +13951,99 @@ return jQuery; return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } + var defaultWeekdaysRegex = matchWord; + function weekdaysRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysStrictRegex; + } else { + return this._weekdaysRegex; + } + } else { + return this._weekdaysStrictRegex && isStrict ? + this._weekdaysStrictRegex : this._weekdaysRegex; + } + } + + var defaultWeekdaysShortRegex = matchWord; + function weekdaysShortRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysShortStrictRegex; + } else { + return this._weekdaysShortRegex; + } + } else { + return this._weekdaysShortStrictRegex && isStrict ? + this._weekdaysShortStrictRegex : this._weekdaysShortRegex; + } + } + + var defaultWeekdaysMinRegex = matchWord; + function weekdaysMinRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysMinStrictRegex; + } else { + return this._weekdaysMinRegex; + } + } else { + return this._weekdaysMinStrictRegex && isStrict ? + this._weekdaysMinStrictRegex : this._weekdaysMinRegex; + } + } + + + function computeWeekdaysParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], + i, mom, minp, shortp, longp; + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, 1]).day(i); + minp = this.weekdaysMin(mom, ''); + shortp = this.weekdaysShort(mom, ''); + longp = this.weekdays(mom, ''); + minPieces.push(minp); + shortPieces.push(shortp); + longPieces.push(longp); + mixedPieces.push(minp); + mixedPieces.push(shortp); + mixedPieces.push(longp); + } + // Sorting makes sure if one weekday (or abbr) is a prefix of another it + // will match the longer piece. + minPieces.sort(cmpLenRev); + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 7; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._weekdaysShortRegex = this._weekdaysRegex; + this._weekdaysMinRegex = this._weekdaysRegex; + + this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); + } + // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); @@ -13786,8 +14075,13 @@ return jQuery; return this.hours() % 12 || 12; } + function kFormat() { + return this.hours() || 24; + } + addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, hFormat); + addFormatToken('k', ['kk', 2], 0, kFormat); addFormatToken('hmm', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); @@ -14248,6 +14542,13 @@ return jQuery; prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort; prototype__proto.weekdaysParse = localeWeekdaysParse; + prototype__proto._weekdaysRegex = defaultWeekdaysRegex; + prototype__proto.weekdaysRegex = weekdaysRegex; + prototype__proto._weekdaysShortRegex = defaultWeekdaysShortRegex; + prototype__proto.weekdaysShortRegex = weekdaysShortRegex; + prototype__proto._weekdaysMinRegex = defaultWeekdaysMinRegex; + prototype__proto.weekdaysMinRegex = weekdaysMinRegex; + // Hours prototype__proto.isPM = localeIsPM; prototype__proto._meridiemParse = defaultLocaleMeridiemParse; @@ -14259,7 +14560,7 @@ return jQuery; return locale[field](utc, format); } - function list (format, index, field, count, setter) { + function listMonthsImpl (format, index, field) { if (typeof format === 'number') { index = format; format = undefined; @@ -14268,35 +14569,79 @@ return jQuery; format = format || ''; if (index != null) { - return lists__get(format, index, field, setter); + return lists__get(format, index, field, 'month'); } var i; var out = []; - for (i = 0; i < count; i++) { - out[i] = lists__get(format, i, field, setter); + for (i = 0; i < 12; i++) { + out[i] = lists__get(format, i, field, 'month'); + } + return out; + } + + // () + // (5) + // (fmt, 5) + // (fmt) + // (true) + // (true, 5) + // (true, fmt, 5) + // (true, fmt) + function listWeekdaysImpl (localeSorted, format, index, field) { + if (typeof localeSorted === 'boolean') { + if (typeof format === 'number') { + index = format; + format = undefined; + } + + format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; + + if (typeof format === 'number') { + index = format; + format = undefined; + } + + format = format || ''; + } + + var locale = locale_locales__getLocale(), + shift = localeSorted ? locale._week.dow : 0; + + if (index != null) { + return lists__get(format, (index + shift) % 7, field, 'day'); + } + + var i; + var out = []; + for (i = 0; i < 7; i++) { + out[i] = lists__get(format, (i + shift) % 7, field, 'day'); } return out; } function lists__listMonths (format, index) { - return list(format, index, 'months', 12, 'month'); + return listMonthsImpl(format, index, 'months'); } function lists__listMonthsShort (format, index) { - return list(format, index, 'monthsShort', 12, 'month'); + return listMonthsImpl(format, index, 'monthsShort'); } - function lists__listWeekdays (format, index) { - return list(format, index, 'weekdays', 7, 'day'); + function lists__listWeekdays (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); } - function lists__listWeekdaysShort (format, index) { - return list(format, index, 'weekdaysShort', 7, 'day'); + function lists__listWeekdaysShort (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); } - function lists__listWeekdaysMin (format, index) { - return list(format, index, 'weekdaysMin', 7, 'day'); + function lists__listWeekdaysMin (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); } locale_locales__getSetGlobalLocale('en', { @@ -14667,7 +15012,7 @@ return jQuery; // Side effect imports - utils_hooks__hooks.version = '2.12.0'; + utils_hooks__hooks.version = '2.13.0'; setHookCallback(local__createLocal); @@ -14703,41 +15048,33 @@ return jQuery; })); /** -* @version: 2.1.19 +* @version: 2.1.21 * @author: Dan Grossman http://www.dangrossman.info/ -* @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved. +* @copyright: Copyright (c) 2012-2016 Dan Grossman. All rights reserved. * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php * @website: https://www.improvely.com/ */ - -(function(root, factory) { - - if (typeof define === 'function' && define.amd) { - define(['moment', 'jquery', 'exports'], function(momentjs, $, exports) { - root.daterangepicker = factory(root, exports, momentjs, $); - }); - - } else if (typeof exports !== 'undefined') { - var momentjs = require('moment'); - var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined; //isomorphic issue - if (!jQuery) { - try { - jQuery = require('jquery'); - if (!jQuery.fn) jQuery.fn = {}; //isomorphic issue - } catch (err) { - if (!jQuery) throw new Error('jQuery dependency not found'); - } - } - - factory(root, exports, momentjs, jQuery); - - // Finally, as a browser global. - } else { - root.daterangepicker = factory(root, {}, root.moment || moment, (root.jQuery || root.Zepto || root.ender || root.$)); - } - -}(this || {}, function(root, daterangepicker, moment, $) { // 'this' doesn't exist on a server - +// Follow the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Make globaly available as well + define(['moment', 'jquery'], function (moment, jquery) { + return (root.daterangepicker = factory(moment, jquery)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node / Browserify + //isomorphic issue + var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined; + if (!jQuery) { + jQuery = require('jquery'); + if (!jQuery.fn) jQuery.fn = {}; + } + module.exports = factory(require('moment'), jQuery); + } else { + // Browser globals + root.daterangepicker = factory(root.moment, root.jQuery); + } +}(this, function(moment, $) { var DateRangePicker = function(element, options, cb) { //default settings for options @@ -14775,6 +15112,7 @@ return jQuery; this.cancelClass = 'btn-default'; this.locale = { + direction: 'ltr', format: 'MM/DD/YYYY', separator: ' - ', applyLabel: 'Apply', @@ -14806,7 +15144,7 @@ return jQuery; options.template = '