├── dbname ├── q.php ├── .gitignore ├── test.txt.txt ├── images ├── bg.gif ├── images.jpg ├── posnic.png ├── save.png ├── add_new.png ├── checked.gif ├── edit_new.png ├── loading.gif ├── close_new.png ├── login-icon.png ├── report-icon.png ├── sales-icon.png ├── stock-icon.png ├── unchecked.gif ├── company-logo.png ├── customer-icon.png ├── icons │ ├── ic_add.png │ ├── ic_edit.png │ ├── ic_left.png │ ├── ic_lock.png │ ├── ic_zoom.png │ ├── ic_cancel.png │ ├── ic_delete.png │ ├── ic_power.png │ ├── ic_print.png │ ├── ic_refresh.png │ ├── ic_right.png │ ├── ic_upload.png │ ├── ic_download.png │ ├── ic_favorite.png │ ├── ic_settings.png │ ├── ic_up_circle.png │ ├── information.png │ ├── menu │ │ ├── menu-email.png │ │ ├── menu-user.png │ │ ├── menu-logoff.png │ │ ├── menu-email-over.png │ │ ├── menu-settings.png │ │ ├── menu-logoff-over.png │ │ ├── menu-email-special.png │ │ └── menu-settings-over.png │ ├── message-boxes │ │ ├── error.png │ │ ├── warning.png │ │ ├── information.png │ │ └── confirmation.png │ └── table │ │ ├── actions-delete.png │ │ └── actions-edit.png ├── payment-icon.png ├── posnic - Copy.png ├── purchase-icon.png ├── separator-bg.png ├── supplier-icon.png ├── tab-dashboard.png ├── artwork-pattern.png ├── cmxform-divider.gif ├── cmxform-fieldset.gif ├── menu-indicator.png ├── menu-dark-indicator.png └── posnic - Copy - Copy.png ├── js ├── date_pic │ ├── bg_hover.png │ ├── bg_selected.png │ ├── bg_selectable.png │ └── date_input.css ├── script.js ├── index.js ├── install_step1.js ├── update_category.js ├── install_step2.js ├── add_category.js ├── install_step3.js ├── update_stock.js ├── update_out_standing.js ├── update_supplier.js ├── update_payment.js ├── add_stock.js ├── update_customer_details.js ├── add_customer.js ├── add_supplier.js ├── update_details.js ├── install_step4.js ├── logo_set.js ├── view_payments.js ├── view_out_standing.js ├── view_stock_availability.js ├── view_category.js ├── view_report.js ├── lib │ └── jquery.hotkeys-0.7.9.min.js ├── view_purchase.js └── view_product.js ├── my_data.php ├── config.php.sample ├── logout.php ├── css ├── screen.css ├── cmxform.css ├── core.css ├── reset.css ├── b.css ├── cmxformTemplate.css └── add_customer.css ├── server.php ├── stock.php ├── stock_purchse.php ├── category.php ├── customer1.php ├── supplier1.php ├── db.php ├── session.php ├── check_customer_details.php ├── check_supplier_details.php ├── tpl ├── auto.php ├── header.php ├── top_bar.php └── common_js.php ├── check_item_details.php ├── Readme.md ├── Readme.txt ├── deleteall.php ├── deleterecords.php ├── lib ├── auto │ └── css │ │ └── jquery.autocomplete.css └── db.help.txt ├── checklogin.php ├── shortcuts.html ├── init.php ├── setup_page.php ├── deleteselected.php ├── delete.php ├── install_step1.php ├── install_step3.php ├── index.php ├── logo_set.php ├── install_step2.php ├── forget_pass.php ├── payment_receipt_print.php ├── update_category.php ├── view_report.php ├── add_category.php ├── update_supplier.php └── update_customer_details.php /dbname: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /q.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/q.php -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.idea/* 3 | /config.php 4 | /upload 5 | /nbproject -------------------------------------------------------------------------------- /test.txt.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sdfsdfsdfsd 5 | 6 | customer order change. 7 | -------------------------------------------------------------------------------- /images/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/bg.gif -------------------------------------------------------------------------------- /images/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/images.jpg -------------------------------------------------------------------------------- /images/posnic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/posnic.png -------------------------------------------------------------------------------- /images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/save.png -------------------------------------------------------------------------------- /images/add_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/add_new.png -------------------------------------------------------------------------------- /images/checked.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/checked.gif -------------------------------------------------------------------------------- /images/edit_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/edit_new.png -------------------------------------------------------------------------------- /images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/loading.gif -------------------------------------------------------------------------------- /images/close_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/close_new.png -------------------------------------------------------------------------------- /images/login-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/login-icon.png -------------------------------------------------------------------------------- /images/report-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/report-icon.png -------------------------------------------------------------------------------- /images/sales-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/sales-icon.png -------------------------------------------------------------------------------- /images/stock-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/stock-icon.png -------------------------------------------------------------------------------- /images/unchecked.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/unchecked.gif -------------------------------------------------------------------------------- /images/company-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/company-logo.png -------------------------------------------------------------------------------- /images/customer-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/customer-icon.png -------------------------------------------------------------------------------- /images/icons/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_add.png -------------------------------------------------------------------------------- /images/icons/ic_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_edit.png -------------------------------------------------------------------------------- /images/icons/ic_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_left.png -------------------------------------------------------------------------------- /images/icons/ic_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_lock.png -------------------------------------------------------------------------------- /images/icons/ic_zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_zoom.png -------------------------------------------------------------------------------- /images/payment-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/payment-icon.png -------------------------------------------------------------------------------- /images/posnic - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/posnic - Copy.png -------------------------------------------------------------------------------- /images/purchase-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/purchase-icon.png -------------------------------------------------------------------------------- /images/separator-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/separator-bg.png -------------------------------------------------------------------------------- /images/supplier-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/supplier-icon.png -------------------------------------------------------------------------------- /images/tab-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/tab-dashboard.png -------------------------------------------------------------------------------- /js/date_pic/bg_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/js/date_pic/bg_hover.png -------------------------------------------------------------------------------- /images/artwork-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/artwork-pattern.png -------------------------------------------------------------------------------- /images/cmxform-divider.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/cmxform-divider.gif -------------------------------------------------------------------------------- /images/cmxform-fieldset.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/cmxform-fieldset.gif -------------------------------------------------------------------------------- /images/icons/ic_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_cancel.png -------------------------------------------------------------------------------- /images/icons/ic_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_delete.png -------------------------------------------------------------------------------- /images/icons/ic_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_power.png -------------------------------------------------------------------------------- /images/icons/ic_print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_print.png -------------------------------------------------------------------------------- /images/icons/ic_refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_refresh.png -------------------------------------------------------------------------------- /images/icons/ic_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_right.png -------------------------------------------------------------------------------- /images/icons/ic_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_upload.png -------------------------------------------------------------------------------- /images/menu-indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/menu-indicator.png -------------------------------------------------------------------------------- /js/date_pic/bg_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/js/date_pic/bg_selected.png -------------------------------------------------------------------------------- /images/icons/ic_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_download.png -------------------------------------------------------------------------------- /images/icons/ic_favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_favorite.png -------------------------------------------------------------------------------- /images/icons/ic_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_settings.png -------------------------------------------------------------------------------- /images/icons/ic_up_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/ic_up_circle.png -------------------------------------------------------------------------------- /images/icons/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/information.png -------------------------------------------------------------------------------- /js/date_pic/bg_selectable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/js/date_pic/bg_selectable.png -------------------------------------------------------------------------------- /images/icons/menu/menu-email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-email.png -------------------------------------------------------------------------------- /images/icons/menu/menu-user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-user.png -------------------------------------------------------------------------------- /images/menu-dark-indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/menu-dark-indicator.png -------------------------------------------------------------------------------- /images/posnic - Copy - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/posnic - Copy - Copy.png -------------------------------------------------------------------------------- /images/icons/menu/menu-logoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-logoff.png -------------------------------------------------------------------------------- /images/icons/menu/menu-email-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-email-over.png -------------------------------------------------------------------------------- /images/icons/menu/menu-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-settings.png -------------------------------------------------------------------------------- /images/icons/message-boxes/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/message-boxes/error.png -------------------------------------------------------------------------------- /images/icons/table/actions-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/table/actions-delete.png -------------------------------------------------------------------------------- /images/icons/table/actions-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/table/actions-edit.png -------------------------------------------------------------------------------- /images/icons/menu/menu-logoff-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-logoff-over.png -------------------------------------------------------------------------------- /images/icons/message-boxes/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/message-boxes/warning.png -------------------------------------------------------------------------------- /images/icons/menu/menu-email-special.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-email-special.png -------------------------------------------------------------------------------- /images/icons/menu/menu-settings-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/menu/menu-settings-over.png -------------------------------------------------------------------------------- /images/icons/message-boxes/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/message-boxes/information.png -------------------------------------------------------------------------------- /images/icons/message-boxes/confirmation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/syvolia/pos-system/HEAD/images/icons/message-boxes/confirmation.png -------------------------------------------------------------------------------- /my_data.php: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /config.php.sample: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logout.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /css/screen.css: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Use: Main Screen Import 4 | 5 | ***********************************/ 6 | 7 | @import "reset.css"; 8 | @import "core.css"; 9 | 10 | @import "cmxformTemplate.css"; 11 | @import "cmxform.css"; -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 'sasi', 5 | 'desc' => 'jibi', 6 | 'value' => 'jibi' 7 | ); 8 | $data[1] = array( 9 | 'label' => 'sasi', 10 | 'desc' => 'jibi', 11 | 'value' => 'jibi' 12 | ); 13 | echo json_encode($data); 14 | 15 | ?> 16 | -------------------------------------------------------------------------------- /stock.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM stock_avail where quantity >0 "); 6 | while ($line = $db->fetchNextObject()) { 7 | 8 | if (strpos(strtolower($line->name), $q) !== false) { 9 | echo "$line->name\n"; 10 | 11 | } 12 | } 13 | 14 | ?> -------------------------------------------------------------------------------- /stock_purchse.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM stock_details "); 6 | while ($line = $db->fetchNextObject()) { 7 | 8 | if (strpos(strtolower($line->stock_name), $q) !== false) { 9 | echo "$line->stock_name\n"; 10 | 11 | } 12 | } 13 | 14 | ?> -------------------------------------------------------------------------------- /category.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM category_details"); 6 | while ($line = $db->fetchNextObject()) { 7 | 8 | if (strpos(strtolower($line->category_name), $q) !== false) { 9 | echo "$line->category_name\n"; 10 | 11 | } 12 | } 13 | 14 | ?> -------------------------------------------------------------------------------- /customer1.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM customer_details"); 6 | while ($line = $db->fetchNextObject()) { 7 | 8 | if (strpos(strtolower($line->customer_name), $q) !== false) { 9 | echo "$line->customer_name \n"; 10 | 11 | } 12 | } 13 | 14 | ?> -------------------------------------------------------------------------------- /supplier1.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM supplier_details"); 6 | while ($line = $db->fetchNextObject()) { 7 | 8 | if (strpos(strtolower($line->supplier_name), $q) !== false) { 9 | echo "$line->supplier_name\n"; 10 | 11 | } 12 | } 13 | 14 | ?> -------------------------------------------------------------------------------- /db.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /session.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /css/cmxform.css: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Name: cmxform Styles 4 | 5 | ***********************************/ 6 | 7 | form.cmxform legend { 8 | padding-left: 0; 9 | } 10 | 11 | form.cmxform label.error, label.error { 12 | /* remove the next line when you have trouble in IE6 with labels in list */ 13 | color: red; 14 | font-style: italic 15 | } 16 | div.error { display: none; } 17 | 18 | input:focus { border: 1px dotted black; } 19 | input.error { } 20 | -------------------------------------------------------------------------------- /check_customer_details.php: -------------------------------------------------------------------------------- 1 | queryUniqueObject("SELECT * FROM customer_details WHERE customer_name='" . $_POST['stock_name1'] . "'"); 5 | $address = $line->customer_address; 6 | $contact1 = $line->customer_contact1; 7 | $contact2 = $line->customer_contact2; 8 | 9 | if ($line != NULL) { 10 | 11 | $arr = array("address" => "$address", "contact1" => "$contact1", "contact2" => "$contact2"); 12 | echo json_encode($arr); 13 | 14 | } else { 15 | $arr1 = array("no" => "no"); 16 | echo json_encode($arr1); 17 | 18 | } 19 | ?> -------------------------------------------------------------------------------- /check_supplier_details.php: -------------------------------------------------------------------------------- 1 | queryUniqueObject("SELECT * FROM supplier_details WHERE supplier_name='" . $_POST['stock_name1'] . "'"); 5 | $address = $line->supplier_address; 6 | $contact1 = $line->supplier_contact1; 7 | $contact2 = $line->supplier_contact2; 8 | 9 | if ($line != NULL) { 10 | 11 | $arr = array("address" => "$address", "contact1" => "$contact1", "contact2" => "$contact2"); 12 | echo json_encode($arr); 13 | 14 | } else { 15 | $arr1 = array("no" => "no"); 16 | echo json_encode($arr1); 17 | 18 | } 19 | ?> -------------------------------------------------------------------------------- /tpl/auto.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /check_item_details.php: -------------------------------------------------------------------------------- 1 | queryUniqueObject("SELECT * FROM stock_details WHERE stock_name ='" . $_POST['stock_name1'] . "'"); 5 | $cost = $line->company_price; 6 | $sell = $line->selling_price; 7 | $stock_id = $line->stock_id; 8 | $line = $db->queryUniqueObject("SELECT * FROM stock_avail WHERE name ='" . $_POST['stock_name1'] . "'"); 9 | $stock = $line->quantity; 10 | 11 | if ($line != NULL) { 12 | 13 | $arr = array("cost" => "$cost", "sell" => "$sell", "stock" => "$stock", "guid" => $stock_id); 14 | echo json_encode($arr); 15 | 16 | } else { 17 | $arr1 = array("no" => "no"); 18 | echo json_encode($arr1); 19 | 20 | } 21 | ?> -------------------------------------------------------------------------------- /js/script.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | 3 | Project Name: SimpleAdmin CMS Theme 4 | Project Description: A clean admin theme 5 | File Name: script.js 6 | Author: Adi Purdila 7 | Author URI: http://www.adipurdila.com 8 | Version: 1.0.0 9 | 10 | **********************************************************************************/ 11 | 12 | $(document).ready(function() { 13 | 14 | //Content boxes expand/collapse 15 | $(".initial-expand").hide(); 16 | 17 | $("div.content-module-heading").click(function(){ 18 | $(this).next("div.content-module-main").slideToggle(); 19 | 20 | $(this).children(".expand-collapse-text").toggle(); 21 | }); 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # POSNIC 2 | ## Intro 3 | * A really simple Point of Sale application based on PHP/MySQL 4 | 5 | ## Security notes 6 | * Stores passwords in plain text by default 7 | * No cleaning of any POST / GET variables 8 | * PHP 5.3.x and MySQL 5.1 tested 9 | 10 | ## Installation 11 | * Extract the zip file 12 | * Copy file to localhost 13 | * Run the project in localhost 14 | * Configure the localhost name, username and password 15 | * Click install button 16 | * Create a database or select your existing database and click next button 17 | * Upload your store logo 18 | * Enter your store details (with your logo) 19 | * Press Finish 20 | * Enjoy 21 | 22 | ## If you find any difficulties in installation please modify config.php.sample file and save as config.php. -------------------------------------------------------------------------------- /Readme.txt: -------------------------------------------------------------------------------- 1 | # POSNIC 2 | ## Intro 3 | * A really simple Point of Sale application based on PHP/MySQL 4 | 5 | ## Security notes 6 | * Stores passwords in plain text by default 7 | * No cleaning of any POST / GET variables 8 | * PHP 5.3.x and MySQL 5.1 tested 9 | 10 | ## Installation 11 | * Extract the zip file 12 | * Copy file to localhost 13 | * Run the project in localhost 14 | * Configure the localhost name, username and password 15 | * Click install button 16 | * Create a database or select your existing database and click next button 17 | * Upload your store logo 18 | * Enter your store details (with your logo) 19 | * Press Finish 20 | * Enjoy 21 | 22 | ## If you find any difficulties in installation please modify config.php.sample file and save as config.php. -------------------------------------------------------------------------------- /css/core.css: -------------------------------------------------------------------------------- 1 | body, div { font-family: 'lucida grande', helvetica, verdana, arial, sans-serif } 2 | body { margin: 0; padding: 0; font-size: small; color: #333 } 3 | h1, h2 { font-family: 'trebuchet ms', verdana, arial; padding: 10px; margin: 0 } 4 | h1 { font-size: large } 5 | #main { padding: 1em; } 6 | #banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc; 7 | background: url(../images/bg.gif) repeat-x; text-align: center } 8 | #banner a { color: white; } 9 | 10 | p { margin: 10px 0; } 11 | 12 | li { margin-left: 10px; } 13 | 14 | h3 { margin: 1em 0 0; } 15 | 16 | h1 { font-size: 2em; } 17 | h2 { font-size: 1.8em; } 18 | h3 { font-size: 1.6em; } 19 | h4 { font-size: 1.4em; } 20 | h5 { font-size: 1.2em; } 21 | 22 | -------------------------------------------------------------------------------- /deleteall.php: -------------------------------------------------------------------------------- 1 | execute("INSERT INTO stock_sales(transactionid)VALUES('$tablename')"); 30 | //$data=$_POST['data']; 31 | 32 | 33 | //$db->execute("INSERT INTO stock_sales( transactionid)VALUES('$d')"); 34 | //$db->execute("DELETE FROM stock_sales WHERE id='$d'"); 35 | 36 | $db->execute("TRUNCATE TABLE ".$tablename); 37 | 38 | 39 | 40 | //$db->execute("DELETE FROM stock_details WHERE id='$id'"); 41 | 42 | 43 | 44 | 45 | ?> 46 | -------------------------------------------------------------------------------- /deleterecords.php: -------------------------------------------------------------------------------- 1 | execute("INSERT INTO stock_sales(id)VALUES('hhh')"); 29 | $data=$_POST['data']; 30 | 31 | foreach($data as $d){ 32 | $d=substr($d,1); 33 | // $db->execute("INSERT INTO stock_sales( transactionid)VALUES('$d')"); 34 | //$db->execute("DELETE FROM stock_sales WHERE id='$d'"); 35 | 36 | $db->execute("DELETE FROM ".$tablename." WHERE id='$d'"); 37 | } 38 | 39 | 40 | 41 | //$db->execute("DELETE FROM stock_details WHERE id='$id'"); 42 | 43 | } 44 | exit; 45 | 46 | 47 | ?> 48 | -------------------------------------------------------------------------------- /lib/auto/css/jquery.autocomplete.css: -------------------------------------------------------------------------------- 1 | .ac_results { 2 | padding: 0px; 3 | border: 1px solid black; 4 | background-color: white; 5 | overflow: hidden; 6 | z-index: 99999; 7 | } 8 | 9 | .ac_results ul { 10 | width: 100%; 11 | list-style-position: outside; 12 | list-style: none; 13 | padding: 0; 14 | margin: 0; 15 | } 16 | 17 | .ac_results li { 18 | margin: 0px; 19 | padding: 2px 5px; 20 | cursor: default; 21 | display: block; 22 | /* 23 | if width will be 100% horizontal scrollbar will apear 24 | when scroll mode will be used 25 | */ 26 | /*width: 100%;*/ 27 | font: menu; 28 | font-size: 12px; 29 | /* 30 | it is very important, if line-height not setted or setted 31 | in relative units scroll will be broken in firefox 32 | */ 33 | line-height: 16px; 34 | overflow: hidden; 35 | } 36 | 37 | .ac_loading { 38 | background: white url('indicator.gif') right center no-repeat; 39 | } 40 | 41 | .ac_odd { 42 | background-color: #eee; 43 | } 44 | 45 | .ac_over { 46 | background-color: #0A246A; 47 | color: white; 48 | } 49 | -------------------------------------------------------------------------------- /css/reset.css: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Use: Reset Styles for all browsers 4 | 5 | ***********************************/ 6 | 7 | body, p, blockquote { 8 | margin: 0; 9 | padding: 0; 10 | } 11 | 12 | a img, iframe { border: none; } 13 | 14 | /* Headers 15 | ------------------------------*/ 16 | 17 | h1, h2, h3, h4, h5, h6 { 18 | margin: 0; 19 | padding: 0; 20 | font-size: 100%; 21 | } 22 | 23 | /* Lists 24 | ------------------------------*/ 25 | 26 | ul, ol, dl, li, dt, dd { 27 | margin: 0; 28 | padding: 0; 29 | } 30 | 31 | /* Links 32 | ------------------------------*/ 33 | 34 | a, a:link {} 35 | a:visited {} 36 | a:hover {} 37 | a:active {} 38 | 39 | /* Forms 40 | ------------------------------*/ 41 | 42 | form, fieldset { 43 | margin: 0; 44 | padding: 0; 45 | } 46 | 47 | fieldset { border: 1px solid #000; } 48 | 49 | legend { 50 | padding: 0; 51 | color: #000; 52 | } 53 | 54 | input, textarea, select { 55 | margin: 0; 56 | padding: 1px; 57 | font-size: 100%; 58 | font-family: inherit; 59 | } 60 | 61 | select { padding: 0; } -------------------------------------------------------------------------------- /css/b.css: -------------------------------------------------------------------------------- 1 | .button { 2 | border-top: 1px solid #084063; 3 | background: #012d4a; 4 | background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#012d4a)); 5 | background: -webkit-linear-gradient(top, #3e779d, #012d4a); 6 | background: -moz-linear-gradient(top, #3e779d, #012d4a); 7 | background: -ms-linear-gradient(top, #3e779d, #012d4a); 8 | background: -o-linear-gradient(top, #3e779d, #012d4a); 9 | padding: 5px 10px; 10 | -webkit-border-radius: 8px; 11 | -moz-border-radius: 8px; 12 | border-radius: 8px; 13 | -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0; 14 | -moz-box-shadow: rgba(0,0,0,1) 0 1px 0; 15 | box-shadow: rgba(0,0,0,1) 0 1px 0; 16 | text-shadow: rgba(0,0,0,.4) 0 1px 0; 17 | color: white; 18 | font-size: 14px; 19 | font-family: Georgia, serif; 20 | text-decoration: none; 21 | vertical-align: middle; 22 | } 23 | .button:hover { 24 | border-top-color: #28597a; 25 | background: #28597a; 26 | color: #ccc; 27 | } 28 | .button:active { 29 | border-top-color: #01395e; 30 | background: #01395e; 31 | } -------------------------------------------------------------------------------- /tpl/header.php: -------------------------------------------------------------------------------- 1 | 3 |
4 | 5 |
6 | 7 | 17 | 18 | 19 | 20 | 21 |
22 | 23 |
-------------------------------------------------------------------------------- /js/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*$.validator.setDefaults({ 4 | submitHandler: function() { alert("submitted!"); } 5 | });*/ 6 | 7 | $(document).ready(function () { 8 | 9 | // validate signup form on keyup and submit 10 | $("#login-form").validate({ 11 | rules: { 12 | username: { 13 | required: true, 14 | minlength: 3 15 | }, 16 | password: { 17 | required: true, 18 | minlength: 3 19 | } 20 | }, 21 | messages: { 22 | username: { 23 | required: "Please enter a username", 24 | minlength: "Your username must consist of at least 3 characters" 25 | }, 26 | password: { 27 | required: "Please provide a password", 28 | minlength: "Your password must be at least 3 characters long" 29 | } 30 | } 31 | }); 32 | 33 | }); 34 | 35 | -------------------------------------------------------------------------------- /js/install_step1.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*$.validator.setDefaults({ 4 | submitHandler: function() { alert("submitted!"); } 5 | });*/ 6 | 7 | $(document).ready(function () { 8 | 9 | // validate signup form on keyup and submit 10 | $("#login-form").validate({ 11 | rules: { 12 | host: { 13 | required: true, 14 | minlength: 3 15 | }, 16 | username: { 17 | required: true, 18 | minlength: 3 19 | } 20 | }, 21 | messages: { 22 | host: { 23 | required: "Please Enter The Host", 24 | minlength: "Your Host must consist of at least 3 characters" 25 | }, 26 | username: { 27 | required: "Please Enter The User Name", 28 | minlength: "Your User Name must be at least 3 characters long" 29 | } 30 | } 31 | }); 32 | 33 | }); 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /css/cmxformTemplate.css: -------------------------------------------------------------------------------- 1 | /********************************** 2 | 3 | Use: cmxform template 4 | 5 | ***********************************/ 6 | form.cmxform fieldset { 7 | margin-bottom: 10px; 8 | } 9 | 10 | form.cmxform legend { 11 | padding: 0 2px; 12 | font-weight: bold; 13 | _margin: 0 -7px; /* IE Win */ 14 | } 15 | 16 | form.cmxform label { 17 | display: inline-block; 18 | line-height: 1.8; 19 | vertical-align: top; 20 | cursor: hand; 21 | } 22 | 23 | form.cmxform fieldset p { 24 | list-style: none; 25 | padding: 5px; 26 | margin: 0; 27 | } 28 | 29 | form.cmxform fieldset fieldset { 30 | border: none; 31 | margin: 3px 0 0; 32 | } 33 | 34 | form.cmxform fieldset fieldset legend { 35 | padding: 0 0 5px; 36 | font-weight: normal; 37 | } 38 | 39 | form.cmxform fieldset fieldset label { 40 | display: block; 41 | width: auto; 42 | } 43 | 44 | form.cmxform label { width: 100px; } /* Width of labels */ 45 | form.cmxform fieldset fieldset label { margin-left: 103px; } /* Width plus 3 (html space) */ 46 | form.cmxform label.error { 47 | margin-left: 103px; 48 | width: 220px; 49 | } 50 | 51 | form.cmxform input.submit { 52 | margin-left: 103px; 53 | } 54 | 55 | /*\*//*/ form.cmxform legend { display: inline-block; } /* IE Mac legend fix */ -------------------------------------------------------------------------------- /js/update_category.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | $(document).ready(function () { 6 | 7 | // validate signup form on keyup and submit 8 | $("#form1").validate({ 9 | rules: { 10 | name: { 11 | required: true, 12 | minlength: 3, 13 | maxlength: 200 14 | }, 15 | address: { 16 | minlength: 3, 17 | maxlength: 500 18 | } 19 | }, 20 | messages: { 21 | name: { 22 | required: "Please enter a Category Name", 23 | minlength: "Category Name must consist of at least 3 characters" 24 | }, 25 | address: { 26 | minlength: "Category Discription must be at least 3 characters long", 27 | maxlength: "Category Discription must be at least 3 characters long" 28 | } 29 | } 30 | }); 31 | 32 | }); 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /js/install_step2.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | 6 | $(document).ready(function () { 7 | document.getElementById('create').checked = true; 8 | document.getElementById('select_box').disabled = true; 9 | 10 | // validate signup form on keyup and submit 11 | $("#login-form").validate({ 12 | rules: { 13 | name: { 14 | required: true, 15 | minlength: 3 16 | } 17 | 18 | }, 19 | messages: { 20 | name: { 21 | required: "Please Enter The Database Name", 22 | minlength: "Your Database must consist of at least 3 characters" 23 | } 24 | } 25 | }); 26 | 27 | }); 28 | function create_data() { 29 | document.getElementById("select_box").disabled = true; 30 | document.getElementById("name").disabled = false; 31 | 32 | } 33 | function select_data() { 34 | document.getElementById("select_box").disabled = false; 35 | document.getElementById("name").disabled = true; 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /tpl/top_bar.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 | 21 | 22 | 23 |
24 |
25 | 26 | 27 |
28 |
29 | 30 |
31 | 32 |
-------------------------------------------------------------------------------- /js/add_category.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | 8 | /*$.validator.setDefaults({ 9 | submitHandler: function() { alert("submitted!"); } 10 | });*/ 11 | $(document).ready(function () { 12 | 13 | // validate signup form on keyup and submit 14 | $("#form1").validate({ 15 | rules: { 16 | name: { 17 | required: true, 18 | minlength: 3, 19 | maxlength: 200 20 | }, 21 | address: { 22 | minlength: 3, 23 | maxlength: 500 24 | } 25 | }, 26 | messages: { 27 | name: { 28 | required: "Please enter a Category Name", 29 | minlength: "Category Name must consist of at least 3 characters" 30 | }, 31 | address: { 32 | minlength: "Category Discription must be at least 3 characters long", 33 | maxlength: "Category Discription must be at least 3 characters long" 34 | } 35 | } 36 | }); 37 | 38 | }); 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /checklogin.php: -------------------------------------------------------------------------------- 1 | connection, $myusername); 17 | $mypassword = mysqli_real_escape_string($db->connection, $mypassword); 18 | 19 | $sql = "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; 20 | $result = mysqli_query($db->connection, $sql); 21 | // mysqli_num_row is counting table row 22 | $count = mysqli_num_rows($result); 23 | // If result matched $myusername and $mypassword, table row must be 1 row 24 | 25 | if ($count == 1) { 26 | // Register $myusername, $mypassword and redirect to file "dashboard.php" 27 | $row = mysqli_fetch_row($result); 28 | 29 | $_SESSION['id'] = $row[0]; 30 | $_SESSION['username'] = $row[1]; 31 | $_SESSION['usertype'] = $row[3]; 32 | 33 | if ($row[3] == "admin") 34 | header("location: dashboard.php"); 35 | else 36 | die("Not Valid User Type. Check with your application administartor"); 37 | 38 | } else { 39 | header("location: index.php?msg=Wrong%20Username%20or%20Password&type=error"); 40 | } 41 | ?> -------------------------------------------------------------------------------- /js/install_step3.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | 6 | $(document).ready(function () { 7 | 8 | // validate signup form on keyup and submit 9 | $("#login-form").validate({ 10 | rules: { 11 | uname: { 12 | required: true, 13 | minlength: 5 14 | }, 15 | password: { 16 | required: true, 17 | minlength: 5 18 | }, 19 | answer: { 20 | required: true, 21 | minlength: 5 22 | } 23 | }, 24 | messages: { 25 | uname: { 26 | required: "Please Enter The User Name", 27 | minlength: "Your User Name must consist of at least 5 characters" 28 | }, 29 | password: { 30 | required: "Please Enter The Password", 31 | minlength: "Your Password must be at least 5 characters long" 32 | }, 33 | answer: { 34 | required: "Please Enter Security Question Answer", 35 | minlength: "Your Security Question Answer must be at least 5 characters long" 36 | } 37 | } 38 | }); 39 | 40 | }); 41 | 42 | 43 | -------------------------------------------------------------------------------- /shortcuts.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Shortcuts 7 | 8 | 9 | 10 | 11 | 12 | 13 | 39 | 40 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
Home (Ctrl+0)Add Purchase(Ctrl+1)Add Stock (Ctrl+2)
Add Sale (Ctrl+3)Add Category (Ctrl+4 )Add Supplier (Ctrl+5 )
Add Customer (Ctrl+6)View Stocks (Ctrl+7)View Sales (Ctrl+8)
View Payments (Ctrl+9)Add New (Ctrl+a)Save( Ctrl+s )
37 | 38 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /init.php: -------------------------------------------------------------------------------- 1 | " . $_REQUEST['msg'] . ""; 31 | else if ($_REQUEST['type'] == "warning") 32 | $POSNIC['msg'] = "
" . $_REQUEST['msg'] . "
"; 33 | else if ($_REQUEST['type'] == "confirmation") 34 | $POSNIC['msg'] = "
" . $_REQUEST['msg'] . "
"; 35 | else if ($_REQUEST['type'] == "infomation") 36 | $POSNIC['msg'] = "
" . $_REQUEST['msg'] . "
"; 37 | } 38 | ?> -------------------------------------------------------------------------------- /js/update_stock.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | $(document).ready(function () { 6 | 7 | // validate signup form on keyup and submit 8 | $("#form1").validate({ 9 | rules: { 10 | name: { 11 | required: true, 12 | minlength: 3, 13 | maxlength: 200 14 | }, 15 | 16 | cost: { 17 | required: true 18 | 19 | }, 20 | sell: { 21 | required: true 22 | 23 | } 24 | }, 25 | messages: { 26 | name: { 27 | required: "Please enter a Stock Name", 28 | minlength: "Stock must consist of at least 3 characters" 29 | }, 30 | cost: { 31 | required: "Please enter a cost Price" 32 | }, 33 | sell: { 34 | required: "Please enter a Sell Price" 35 | } 36 | } 37 | }); 38 | 39 | }); 40 | function numbersonly(e) { 41 | var unicode = e.charCode ? e.charCode : e.keyCode 42 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 38 && unicode != 39 && unicode != 40) { //if the key isn't the backspace key (which we should allow) 43 | if (unicode < 48 || unicode > 57) 44 | return false 45 | } 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /js/update_out_standing.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | $(document).ready(function () { 6 | $('#test1').jdPicker(); 7 | // validate signup form on keyup and submit 8 | $("#form1").validate({ 9 | rules: { 10 | name: { 11 | required: true, 12 | minlength: 3, 13 | maxlength: 200 14 | }, 15 | 16 | cost: { 17 | required: true 18 | 19 | }, 20 | sell: { 21 | required: true 22 | 23 | } 24 | }, 25 | messages: { 26 | name: { 27 | required: "Please enter a Stock Name", 28 | minlength: "Stock must consist of at least 3 characters" 29 | }, 30 | cost: { 31 | required: "Please enter a cost Price" 32 | }, 33 | sell: { 34 | required: "Please enter a Sell Price" 35 | } 36 | } 37 | }); 38 | 39 | }); 40 | function numbersonly(e) { 41 | var unicode = e.charCode ? e.charCode : e.keyCode 42 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 38 && unicode != 39 && unicode != 40) { //if the key isn't the backspace key (which we should allow) 43 | if (unicode < 48 || unicode > 57) 44 | return false 45 | } 46 | } 47 | function change_balance() { 48 | if (parseFloat(document.getElementById('new_payment').value) > parseFloat(document.getElementById('balance').value)) { 49 | document.getElementById('new_payment').value = parseFloat(document.getElementById('balance').value); 50 | } 51 | } 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /js/update_supplier.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | $(document).ready(function () { 6 | 7 | // validate signup form on keyup and submit 8 | $("#form1").validate({ 9 | rules: { 10 | name: { 11 | required: true, 12 | minlength: 3, 13 | maxlength: 200 14 | }, 15 | address: { 16 | minlength: 3, 17 | maxlength: 500 18 | }, 19 | contact1: { 20 | minlength: 3, 21 | maxlength: 20 22 | }, 23 | contact2: { 24 | minlength: 3, 25 | maxlength: 20 26 | } 27 | }, 28 | messages: { 29 | name: { 30 | required: "Please enter a Supplier Name", 31 | minlength: "Supplier must consist of at least 3 characters", 32 | maxlength: "Supplier name is too long !" 33 | }, 34 | address: { 35 | minlength: "Address must be at least 3 characters long", 36 | maxlength: "Address is too long !" 37 | } 38 | } 39 | }); 40 | 41 | }); 42 | 43 | //validation for name and contact field 44 | function numbersonly(e) { 45 | var unicode = e.charCode ? e.charCode : e.keyCode 46 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 27 && unicode != 38 && unicode != 39 && unicode != 40 && unicode != 9) { //if the key isn't the backspace key (which we should allow) 47 | if (unicode < 48 || unicode > 57) 48 | return false 49 | } 50 | } 51 | 52 | function ValidateAlpha(evt) { 53 | evt = (evt) ? evt : event; 54 | var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 55 | ((evt.which) ? evt.which : 0)); 56 | if (charCode > 31 && (charCode < 65 || charCode > 90) && 57 | (charCode < 97 || charCode > 122)) { 58 | return false; 59 | } 60 | return true; 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /js/update_payment.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | $(document).ready(function () { 6 | $('#test1').jdPicker(); 7 | // validate signup form on keyup and submit 8 | $("#form1").validate({ 9 | rules: { 10 | name: { 11 | required: true, 12 | minlength: 3, 13 | maxlength: 200 14 | }, 15 | 16 | cost: { 17 | required: true 18 | 19 | }, 20 | new_payment: { 21 | required: true 22 | }, 23 | 24 | paid: { 25 | required: true 26 | 27 | }, 28 | sell: { 29 | required: true 30 | 31 | } 32 | }, 33 | messages: { 34 | name: { 35 | required: "Please enter a Stock Name", 36 | minlength: "Stock must consist of at least 3 characters" 37 | }, 38 | cost: { 39 | required: "Please enter a cost Price" 40 | }, 41 | 42 | new_payment: { 43 | required: "Please enter a New Payment" 44 | }, 45 | paid: { 46 | required: "Please enter a Paid Amount" 47 | }, 48 | sell: { 49 | required: "Please enter a Sell Price" 50 | } 51 | } 52 | }); 53 | 54 | }); 55 | function numbersonly(e) { 56 | var unicode = e.charCode ? e.charCode : e.keyCode 57 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 38 && unicode != 39 && unicode != 40) { //if the key isn't the backspace key (which we should allow) 58 | if (unicode < 48 || unicode > 57) 59 | return false 60 | } 61 | } 62 | function change_balance() { 63 | if (parseFloat(document.getElementById('new_payment').value) > parseFloat(document.getElementById('balance').value)) { 64 | document.getElementById('new_payment').value = parseFloat(document.getElementById('balance').value); 65 | } 66 | } 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /js/add_stock.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /*$.validator.setDefaults({ 8 | submitHandler: function() { alert("submitted!"); } 9 | });*/ 10 | $(document).ready(function () { 11 | $("#supplier").autocomplete("supplier1.php", { 12 | width: 160, 13 | autoFill: true, 14 | selectFirst: true 15 | }); 16 | $("#category").autocomplete("category.php", { 17 | width: 160, 18 | autoFill: true, 19 | selectFirst: true 20 | }); 21 | // validate signup form on keyup and submit 22 | $("#form1").validate({ 23 | rules: { 24 | name: { 25 | required: true, 26 | minlength: 3, 27 | maxlength: 200 28 | }, 29 | stockid: { 30 | required: true, 31 | minlength: 3, 32 | maxlength: 200 33 | }, 34 | cost: { 35 | required: true, 36 | 37 | }, 38 | sell: { 39 | required: true, 40 | 41 | } 42 | }, 43 | messages: { 44 | name: { 45 | required: "Please Enter Stock Name", 46 | minlength: "Stock Name must consist of at least 3 characters" 47 | }, 48 | stockid: { 49 | required: "Please Enter Stock ID", 50 | // minlength: "Category Name must consist of at least 3 characters" 51 | }, 52 | sell: { 53 | required: "Please Enter Selling Price", 54 | }, 55 | cost: { 56 | required: "Please Enter Cost Price", 57 | } 58 | } 59 | }); 60 | 61 | }); 62 | function numbersonly(e) { 63 | var unicode = e.charCode ? e.charCode : e.keyCode 64 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 38 && unicode != 39 && unicode != 40 && unicode != 9) { //if the key isn't the backspace key (which we should allow) 65 | if (unicode < 48 || unicode > 57) 66 | return false 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /js/update_customer_details.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | $(document).ready(function () { 6 | 7 | // validate signup form on keyup and submit 8 | $("#form1").validate({ 9 | rules: { 10 | name: { 11 | required: true, 12 | minlength: 3, 13 | maxlength: 200 14 | }, 15 | address: { 16 | minlength: 3, 17 | maxlength: 500 18 | }, 19 | contact1: { 20 | required: true, 21 | minlength: 10, 22 | maxlength: 13 23 | }, 24 | contact2: { 25 | minlength: 3, 26 | maxlength: 20 27 | } 28 | }, 29 | messages: { 30 | name: { 31 | required: "Please enter supplier name", 32 | minlength: "Customer must consist of at least 3 characters", 33 | maxlength: "Customer name is too long !" 34 | }, 35 | contact1: { 36 | required: "Please enter a contact number", 37 | minlength: "Contact No must consist of at least 10 characters" 38 | maxlength: "Contact No should not be more than 13 digits" 39 | }, 40 | address: { 41 | minlength: "Customer Address must be at least 3 characters long", 42 | maxlength: "Customer Address is too long !" 43 | } 44 | } 45 | }); 46 | 47 | }); 48 | 49 | function numbersonly(e) { 50 | var unicode = e.charCode ? e.charCode : e.keyCode 51 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 27 && unicode != 38 && unicode != 39 && unicode != 40 && unicode != 9) { //if the key isn't the backspace key (which we should allow) 52 | if (unicode < 48 || unicode > 57) 53 | return false 54 | } 55 | } 56 | 57 | function lettersOnly(evt) { 58 | evt = (evt) ? evt : event; 59 | var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 60 | ((evt.which) ? evt.which : 0)); 61 | if (charCode > 31 && (charCode < 65 || charCode > 90) && 62 | (charCode < 97 || charCode > 122)) { 63 | return false; 64 | } 65 | return true; 66 | } 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /tpl/common_js.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 70 | -------------------------------------------------------------------------------- /js/add_customer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | /*$.validator.setDefaults({ 7 | submitHandler: function() { alert("submitted!"); } 8 | });*/ 9 | 10 | $(document).ready(function () { 11 | 12 | // validate signup form on keyup and submit 13 | $("#form1").validate({ 14 | rules: { 15 | name: { 16 | required: true, 17 | minlength: 3, 18 | maxlength: 200 19 | }, 20 | address: { 21 | minlength: 3, 22 | maxlength: 500 23 | }, 24 | contact1: { 25 | required: true, 26 | minlength: 10, 27 | maxlength: 13 28 | }, 29 | contact2: { 30 | minlength: 3, 31 | maxlength: 20 32 | } 33 | }, 34 | messages: { 35 | name: { 36 | required: "Please enter a supplier name", 37 | minlength: "Customer name must be at least 3 characters" 38 | }, 39 | contact1: { 40 | required: "Please enter a contact number", 41 | minlength: "Contact must consist of at least 10 digits", 42 | maxlength: "Contact No should not be more than 13 digits" 43 | }, 44 | address: { 45 | minlength: "Customer Address must be at least 3 characters long", 46 | maxlength: "Address is too long !" 47 | } 48 | } 49 | }); 50 | 51 | }); 52 | 53 | function numbersonly(e) { 54 | var unicode = e.charCode ? e.charCode : e.keyCode 55 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 27 && unicode != 38 && unicode != 39 && unicode != 40 && unicode != 9) { //if the key isn't the backspace key (which we should allow) 56 | if (unicode < 48 || unicode > 57) 57 | return false 58 | } 59 | } 60 | 61 | function lettersOnly(evt) { 62 | evt = (evt) ? evt : event; 63 | var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 64 | ((evt.which) ? evt.which : 0)); 65 | if (charCode > 31 && (charCode < 65 || charCode > 90) && 66 | (charCode < 97 || charCode > 122)) { 67 | return false; 68 | } 69 | return true; 70 | } -------------------------------------------------------------------------------- /js/add_supplier.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /*$.validator.setDefaults({ 8 | submitHandler: function() { alert("submitted!"); } 9 | });*/ 10 | $(document).ready(function () { 11 | 12 | // validate signup form on keyup and submit 13 | $("#form1").validate({ 14 | rules: { 15 | name: { 16 | required: true, 17 | minlength: 3, 18 | maxlength: 200 19 | }, 20 | address: { 21 | minlength: 3, 22 | maxlength: 500 23 | }, 24 | contact1: { 25 | required: true, 26 | minlength: 3, 27 | maxlength: 13 28 | }, 29 | contact2: { 30 | minlength: 3, 31 | maxlength: 13 32 | } 33 | }, 34 | messages: { 35 | name: { 36 | required: "Please enter a supplier Name", 37 | minlength: "Supplier Name must consist of at least 3 characters", 38 | maxlength: "Supplier Name is too long " 39 | }, 40 | contact1: { 41 | required: "Please enter a contact number", 42 | minlength: "Customer must consist of at least 10 characters", 43 | maxlength: "Contact No should not be more than 13 digits" 44 | }, 45 | address: { 46 | minlength: "Address must be at least 3 characters long", 47 | maxlength: "Address is too long !" 48 | } 49 | } 50 | }); 51 | 52 | }); 53 | 54 | function numbersonly(e) { 55 | var unicode = e.charCode ? e.charCode : e.keyCode 56 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 27 && unicode != 38 && unicode != 39 && unicode != 40 && unicode != 9) { //if the key isn't the backspace key (which we should allow) 57 | if (unicode < 48 || unicode > 57) 58 | return false 59 | } 60 | } 61 | 62 | function ValidateAlpha(evt) { 63 | evt = (evt) ? evt : event; 64 | var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : 65 | ((evt.which) ? evt.which : 0)); 66 | if (charCode > 31 && (charCode < 65 || charCode > 90) && 67 | (charCode < 97 || charCode > 122)) { 68 | return false; 69 | } 70 | return true; 71 | } -------------------------------------------------------------------------------- /setup_page.php: -------------------------------------------------------------------------------- 1 | '; 71 | fwrite($ourFileHandle, $data); 72 | fclose($ourFileHandle); 73 | header("location: install_step3.php"); 74 | 75 | 76 | } else { 77 | header("location: install_step1.php"); 78 | } 79 | // 80 | 81 | ?> -------------------------------------------------------------------------------- /js/update_details.js: -------------------------------------------------------------------------------- 1 | 2 | /*$.validator.setDefaults({ 3 | submitHandler: function() { alert("submitted!"); } 4 | });*/ 5 | 6 | $(document).ready(function () { 7 | 8 | // validate signup form on keyup and submit 9 | $("#login-form").validate({ 10 | rules: { 11 | sname: { 12 | required: true, 13 | minlength: 3 14 | }, 15 | address: { 16 | required: true, 17 | minlength: 3 18 | }, 19 | place: { 20 | required: true, 21 | minlength: 3 22 | }, 23 | website: { 24 | required: true, 25 | minlength: 3 26 | }, 27 | email: { 28 | required: true, 29 | minlength: 3 30 | }, 31 | phone: { 32 | required: true, 33 | minlength: 10, 34 | maxlength: 12 35 | }, 36 | city: { 37 | required: true, 38 | minlength: 3 39 | } 40 | }, 41 | messages: { 42 | sname: { 43 | required: "Please Enter The Store Name", 44 | minlength: "Your Store Name must consist of at least 3 characters" 45 | }, 46 | address: { 47 | required: "Please Enter The Address", 48 | minlength: "Your Address must be at least 3 characters long" 49 | }, 50 | place: { 51 | required: "Please Enter The Place", 52 | minlength: "Your place must be at least 3 characters long" 53 | }, 54 | website: { 55 | required: "Please Enter The Website", 56 | minlength: "Your Website must be at least 3 characters long" 57 | }, 58 | email: { 59 | required: "Please Enter The email", 60 | minlength: "Your Email must be at least 3 characters long" 61 | }, 62 | phone: { 63 | required: "Please Enter The Phone", 64 | minlength: "Your Phone must be at least 10 characters long", 65 | maxlength: "Your Phone must be at Less than 13 characters long" 66 | }, 67 | city: { 68 | required: "Please Enter The city", 69 | minlength: "Your city must be at least 3 characters long" 70 | } 71 | } 72 | }); 73 | 74 | }); 75 | -------------------------------------------------------------------------------- /js/install_step4.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*$.validator.setDefaults({ 4 | submitHandler: function() { alert("submitted!"); } 5 | });*/ 6 | 7 | $(document).ready(function () { 8 | 9 | // validate signup form on keyup and submit 10 | $("#login-form").validate({ 11 | rules: { 12 | sname: { 13 | required: true, 14 | minlength: 3 15 | }, 16 | address: { 17 | required: true, 18 | minlength: 3 19 | }, 20 | place: { 21 | required: true, 22 | minlength: 3 23 | }, 24 | website: { 25 | required: true, 26 | minlength: 3 27 | }, 28 | email: { 29 | required: true, 30 | minlength: 3 31 | }, 32 | phone: { 33 | required: true, 34 | minlength: 10, 35 | maxlength: 12 36 | }, 37 | city: { 38 | required: true, 39 | minlength: 3 40 | } 41 | }, 42 | messages: { 43 | sname: { 44 | required: "Please Enter The Store Name", 45 | minlength: "Store Name must be at least 3 characters" 46 | }, 47 | address: { 48 | required: "Please Enter The Address", 49 | minlength: "Your Address must be at least 3 characters long" 50 | }, 51 | place: { 52 | required: "Please Enter The Place", 53 | minlength: "Place must be at least 3 characters long" 54 | }, 55 | website: { 56 | required: "Please Enter The Website", 57 | minlength: "Website must be at least 3 characters long" 58 | }, 59 | email: { 60 | required: "Please Enter The email", 61 | minlength: "Email must be at least 3 characters long" 62 | }, 63 | phone: { 64 | required: "Please Enter The Phone", 65 | minlength: "Your Phone must be at least 10 characters long", 66 | maxlength: "Your Phone must be at Less than 13 characters long" 67 | }, 68 | city: { 69 | required: "Please Enter The city", 70 | minlength: "Your city must be at least 3 characters long" 71 | } 72 | } 73 | }); 74 | 75 | }); 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /js/logo_set.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*$.validator.setDefaults({ 4 | submitHandler: function() { alert("submitted!"); } 5 | });*/ 6 | 7 | $(document).ready(function () { 8 | 9 | // validate signup form on keyup and submit 10 | $("#login-form").validate({ 11 | rules: { 12 | sname: { 13 | required: true, 14 | minlength: 3 15 | }, 16 | address: { 17 | required: true, 18 | minlength: 3 19 | }, 20 | place: { 21 | required: true, 22 | minlength: 3 23 | }, 24 | website: { 25 | required: true, 26 | minlength: 3 27 | }, 28 | email: { 29 | required: true, 30 | minlength: 3 31 | }, 32 | phone: { 33 | required: true, 34 | minlength: 10, 35 | maxlength: 12 36 | }, 37 | city: { 38 | required: true, 39 | minlength: 3 40 | } 41 | }, 42 | messages: { 43 | sname: { 44 | required: "Please Enter The Store Name", 45 | minlength: "Your Store Name must consist of at least 3 characters" 46 | }, 47 | address: { 48 | required: "Please Enter The Address", 49 | minlength: "Your Address must be at least 3 characters long" 50 | }, 51 | place: { 52 | required: "Please Enter The Place", 53 | minlength: "Your place must be at least 3 characters long" 54 | }, 55 | website: { 56 | required: "Please Enter The Website", 57 | minlength: "Your Address must be at least 3 characters long" 58 | }, 59 | email: { 60 | required: "Please Enter The email", 61 | minlength: "Your Address must be at least 3 characters long" 62 | }, 63 | phone: { 64 | required: "Please Enter The Phone", 65 | minlength: "Your Address must be at least 10 characters long", 66 | maxlength: "Your Address must be at Less than 13 characters long" 67 | }, 68 | city: { 69 | required: "Please Enter The city", 70 | minlength: "Your city must be at least 3 characters long" 71 | } 72 | } 73 | }); 74 | 75 | }); 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /css/add_customer.css: -------------------------------------------------------------------------------- 1 | /* 2 | To change this license header, choose License Headers in Project Properties. 3 | To change this template file, choose Tools | Templates 4 | and open the template in the editor. 5 | */ 6 | /* 7 | Created on : 14 Oct, 2016, 11:14:31 AM 8 | Author : Posnic-3 9 | */ 10 | 11 | body { 12 | margin-left: 0px; 13 | margin-top: 0px; 14 | margin-right: 0px; 15 | margin-bottom: 0px; 16 | background-color: #FFFFFF; 17 | } 18 | 19 | * { 20 | padding: 0px; 21 | margin: 0px; 22 | } 23 | 24 | #vertmenu { 25 | font-family: Verdana, Arial, Helvetica, sans-serif; 26 | font-size: 100%; 27 | width: 160px; 28 | padding: 0px; 29 | margin: 0px; 30 | } 31 | 32 | #vertmenu h1 { 33 | display: block; 34 | background-color: #FF9900; 35 | font-size: 90%; 36 | padding: 3px 0 5px 3px; 37 | border: 1px solid #000000; 38 | color: #333333; 39 | margin: 0px; 40 | width: 159px; 41 | } 42 | 43 | #vertmenu ul { 44 | list-style: none; 45 | margin: 0px; 46 | padding: 0px; 47 | border: none; 48 | } 49 | 50 | #vertmenu ul li { 51 | margin: 0px; 52 | padding: 0px; 53 | } 54 | 55 | #vertmenu ul li a { 56 | font-size: 80%; 57 | display: block; 58 | border-bottom: 1px dashed #C39C4E; 59 | padding: 5px 0px 2px 4px; 60 | text-decoration: none; 61 | color: #666666; 62 | width: 160px; 63 | } 64 | 65 | #vertmenu ul li a:hover, #vertmenu ul li a:focus { 66 | color: #000000; 67 | background-color: #eeeeee; 68 | } 69 | 70 | .style1 { 71 | color: #000000 72 | } 73 | 74 | div.pagination { 75 | 76 | padding: 3px; 77 | 78 | margin: 3px; 79 | 80 | } 81 | 82 | div.pagination a { 83 | 84 | padding: 2px 5px 2px 5px; 85 | 86 | margin: 2px; 87 | 88 | border: 1px solid #AAAADD; 89 | 90 | text-decoration: none; /* no underline */ 91 | 92 | color: #000099; 93 | 94 | } 95 | 96 | div.pagination a:hover, div.pagination a:active { 97 | 98 | border: 1px solid #000099; 99 | 100 | color: #000; 101 | 102 | } 103 | 104 | div.pagination span.current { 105 | 106 | padding: 2px 5px 2px 5px; 107 | 108 | margin: 2px; 109 | 110 | border: 1px solid #000099; 111 | 112 | font-weight: bold; 113 | 114 | background-color: #000099; 115 | 116 | color: #FFF; 117 | 118 | } 119 | 120 | div.pagination span.disabled { 121 | 122 | padding: 2px 5px 2px 5px; 123 | 124 | margin: 2px; 125 | 126 | border: 1px solid #EEE; 127 | 128 | color: #DDD; 129 | 130 | } 131 | 132 | 133 | -------------------------------------------------------------------------------- /deleteselected.php: -------------------------------------------------------------------------------- 1 | connection, $SQL) or die(mysqli_error()); 16 | $checkuser = mysqli_num_rows($result); 17 | if ($checkuser > 0) { 18 | 19 | if ($tablename == "stock_entries") { 20 | 21 | $id = $singleVar; 22 | $difference = $db->queryUniqueValue("SELECT quantity FROM stock_entries WHERE id='$id'"); 23 | $name = $db->queryUniqueValue("SELECT stock_name FROM stock_entries WHERE id='$id'"); 24 | $result = $db->query("SELECT * FROM stock_entries where id > '$id'"); 25 | while ($line2 = $db->fetchNextObject($result)) { 26 | $osd = $line2->opening_stock - $difference; 27 | $csd = $line2->closing_stock - $difference; 28 | $cid = $line2->id; 29 | $db->execute("UPDATE stock_entries SET opening_stock='" . $osd . "',closing_stock='" . $csd . "' WHERE id='$cid'"); 30 | 31 | } 32 | $total = $db->queryUniqueValue("SELECT quantity FROM stock_avail WHERE name='$name'"); 33 | $total = $total - $difference; 34 | $db->execute("UPDATE stock_avail SET quantity='$total' WHERE name='$name'"); 35 | } 36 | if ($tablename == "stock_sales") { 37 | $id = $singleVar; 38 | $difference = $db->queryUniqueValue("SELECT quantity FROM stock_sales WHERE id='$id'"); 39 | $sid = $db->queryUniqueValue("SELECT transactionid FROM stock_sales WHERE id='$id'"); 40 | $id = $db->queryUniqueValue("SELECT id FROM stock_entries WHERE salesid='$sid'"); 41 | $name = $db->queryUniqueValue("SELECT stock_name FROM stock_entries WHERE id='$id'"); 42 | $result = $db->query("SELECT * FROM stock_entries where id > '$id'"); 43 | while ($line2 = $db->fetchNextObject($result)) { 44 | $osd = $line2->opening_stock + $difference; 45 | $csd = $line2->closing_stock + $difference; 46 | $cid = $line2->id; 47 | $db->execute("UPDATE stock_entries SET opening_stock='" . $osd . "',closing_stock='" . $csd . "' WHERE id=$cid"); 48 | 49 | } 50 | // echo "sale $name"; 51 | $total = $db->queryUniqueValue("SELECT quantity FROM stock_avail WHERE name='$name'"); 52 | $total = $total + $difference; 53 | $db->execute("UPDATE stock_avail SET quantity='$total' WHERE name='$name'"); 54 | } 55 | 56 | 57 | mysqli_query($db->connection, "DELETE FROM $tablename WHERE id='$singleVar'") or die(mysqli_error()); 58 | 59 | $i++; 60 | } 61 | 62 | } 63 | header("location: $return?cmsg=$i Records Deleted Successfully!"); 64 | 65 | } 66 | 67 | 68 | ?> -------------------------------------------------------------------------------- /delete.php: -------------------------------------------------------------------------------- 1 | queryUniqueValue("SELECT quantity FROM stock_entries WHERE id='$id'"); 16 | 17 | $name = $db->queryUniqueValue("SELECT stock_name FROM stock_entries WHERE id='$id'"); 18 | $result = $db->query("SELECT * FROM stock_entries where id > '$id'"); 19 | while ($line2 = $db->fetchNextObject($result)) { 20 | $osd = $line2->opening_stock - $difference; 21 | $csd = $line2->closing_stock - $difference; 22 | $cid = $line2->id; 23 | $db->execute("UPDATE stock_entries SET opening_stock='" . $osd . "',closing_stock='" . $csd . "' WHERE id='$cid'"); 24 | 25 | } 26 | $total = $db->queryUniqueValue("SELECT quantity FROM stock_avail WHERE name='$name'"); 27 | $total = $total - $difference; 28 | $db->execute("UPDATE stock_avail SET quantity='$total' WHERE name='$name'"); 29 | } 30 | if ($tablename == "stock_sales") { 31 | $difference = $db->queryUniqueValue("SELECT quantity FROM stock_sales WHERE id='$id'"); 32 | $sid = $db->queryUniqueValue("SELECT transactionid FROM stock_sales WHERE id='$id'"); 33 | $id = $db->queryUniqueValue("SELECT id FROM stock_entries WHERE salesid='$sid'"); 34 | $name = $db->queryUniqueValue("SELECT stock_name FROM stock_entries WHERE id='$id'"); 35 | $result = $db->query("SELECT * FROM stock_entries where id > '$id'"); 36 | while ($line2 = $db->fetchNextObject($result)) { 37 | $osd = $line2->opening_stock + $difference; 38 | $csd = $line2->closing_stock + $difference; 39 | $cid = $line2->id; 40 | $db->execute("UPDATE stock_entries SET opening_stock='" . $osd . "',closing_stock='" . $csd . "' WHERE id='$cid'"); 41 | 42 | } 43 | echo "sale $name"; 44 | $total = $db->queryUniqueValue("SELECT quantity FROM stock_avail WHERE name='$name'"); 45 | $total = $total + $difference; 46 | $db->execute("UPDATE stock_avail SET quantity='$total' WHERE name='$name'"); 47 | $db->execute("DELETE FROM $tablename WHERE id='$id'"); 48 | } 49 | $id = $_GET['id']; 50 | 51 | $db->execute("DELETE FROM $tablename WHERE id='$id'"); 52 | 53 | header("location: $return?msg=Record Deleted Successfully!&id=$id"); 54 | } 55 | if (isset($_POST['table']) && isset($_POST['checklist'])) { 56 | $data = $_REQUEST['checklist']; 57 | $tablename = $_POST['table']; 58 | $return = $_REQUEST['return']; 59 | for ($i = 0; $i < count($data); $i++) { 60 | $db->execute("DELETE FROM $tablename WHERE id='$data[$i]'"); 61 | } 62 | header("location: $return?msg=Record Deleted Successfully!"); 63 | } 64 | if (isset($_POST['return'])) { 65 | header("location: $return"); 66 | } 67 | } 68 | ?> -------------------------------------------------------------------------------- /js/view_payments.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | // Nannette Thacker http://www.shiningstar.net 8 | function confirmSubmit() { 9 | var agree = confirm("Are you sure you wish to Delete this Entry?"); 10 | if (agree) 11 | return true; 12 | else 13 | return false; 14 | } 15 | 16 | function confirmDeleteSubmit() { 17 | var flag = 0; 18 | var field = document.forms.deletefiles; 19 | for (i = 0; i < field.length; i++) { 20 | if (field[i].checked == true) { 21 | flag = flag + 1; 22 | 23 | } 24 | 25 | } 26 | if (flag < 1) { 27 | alert("You must check one and only one checkbox!"); 28 | return false; 29 | } else { 30 | var agree = confirm("Are you sure you wish to Delete Selected Record?"); 31 | if (agree) 32 | 33 | document.deletefiles.submit(); 34 | else 35 | return false; 36 | 37 | } 38 | } 39 | function confirmLimitSubmit() { 40 | if (document.getElementById('search_limit').value != "") { 41 | 42 | document.limit_go.submit(); 43 | 44 | } else { 45 | return false; 46 | } 47 | } 48 | 49 | 50 | function checkAll() { 51 | 52 | var field = document.forms.deletefiles; 53 | for (i = 0; i < field.length; i++) 54 | field[i].checked = true; 55 | } 56 | 57 | function uncheckAll() { 58 | var field = document.forms.deletefiles; 59 | for (i = 0; i < field.length; i++) 60 | field[i].checked = false; 61 | } 62 | 63 | 64 | /*$.validator.setDefaults({ 65 | submitHandler: function() { alert("submitted!"); } 66 | });*/ 67 | $(document).ready(function () { 68 | 69 | // validate signup form on keyup and submit 70 | $("#form1").validate({ 71 | rules: { 72 | name: { 73 | required: true, 74 | minlength: 3, 75 | maxlength: 200 76 | }, 77 | address: { 78 | minlength: 3, 79 | maxlength: 500 80 | }, 81 | contact1: { 82 | minlength: 3, 83 | maxlength: 20 84 | }, 85 | contact2: { 86 | minlength: 3, 87 | maxlength: 20 88 | } 89 | }, 90 | messages: { 91 | name: { 92 | required: "Please enter a supplier Name", 93 | minlength: "supplier must consist of at least 3 characters" 94 | }, 95 | address: { 96 | minlength: "supplier Address must be at least 3 characters long", 97 | maxlength: "supplier Address must be at least 3 characters long" 98 | } 99 | } 100 | }); 101 | 102 | }); 103 | 104 | 105 | -------------------------------------------------------------------------------- /js/view_out_standing.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | 8 | // Nannette Thacker http://www.shiningstar.net 9 | function confirmSubmit() { 10 | var agree = confirm("Are you sure you wish to Delete this Entry?"); 11 | if (agree) 12 | return true; 13 | else 14 | return false; 15 | } 16 | 17 | function confirmDeleteSubmit() { 18 | var flag = 0; 19 | var field = document.forms.deletefiles; 20 | for (i = 0; i < field.length; i++) { 21 | if (field[i].checked == true) { 22 | flag = flag + 1; 23 | 24 | } 25 | 26 | } 27 | if (flag < 1) { 28 | alert("You must check one and only one checkbox!"); 29 | return false; 30 | } else { 31 | var agree = confirm("Are you sure you wish to Delete Selected Record?"); 32 | if (agree) 33 | 34 | document.deletefiles.submit(); 35 | else 36 | return false; 37 | 38 | } 39 | } 40 | function confirmLimitSubmit() { 41 | if (document.getElementById('search_limit').value != "") { 42 | 43 | document.limit_go.submit(); 44 | 45 | } else { 46 | return false; 47 | } 48 | } 49 | 50 | 51 | function checkAll() { 52 | 53 | var field = document.forms.deletefiles; 54 | for (i = 0; i < field.length; i++) 55 | field[i].checked = true; 56 | } 57 | 58 | function uncheckAll() { 59 | var field = document.forms.deletefiles; 60 | for (i = 0; i < field.length; i++) 61 | field[i].checked = false; 62 | } 63 | 64 | 65 | 66 | /*$.validator.setDefaults({ 67 | submitHandler: function() { alert("submitted!"); } 68 | });*/ 69 | $(document).ready(function () { 70 | 71 | // validate signup form on keyup and submit 72 | $("#form1").validate({ 73 | rules: { 74 | name: { 75 | required: true, 76 | minlength: 3, 77 | maxlength: 200 78 | }, 79 | address: { 80 | minlength: 3, 81 | maxlength: 500 82 | }, 83 | contact1: { 84 | minlength: 3, 85 | maxlength: 20 86 | }, 87 | contact2: { 88 | minlength: 3, 89 | maxlength: 20 90 | } 91 | }, 92 | messages: { 93 | name: { 94 | required: "Please enter a supplier Name", 95 | minlength: "supplier must consist of at least 3 characters" 96 | }, 97 | address: { 98 | minlength: "supplier Address must be at least 3 characters long", 99 | maxlength: "supplier Address must be at least 3 characters long" 100 | } 101 | } 102 | }); 103 | 104 | }); 105 | 106 | -------------------------------------------------------------------------------- /js/view_stock_availability.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | 8 | 9 | // Nannette Thacker http://www.shiningstar.net 10 | function confirmSubmit() { 11 | var agree = confirm("Are you sure you wish to Delete this Entry?"); 12 | if (agree) 13 | return true; 14 | else 15 | return false; 16 | } 17 | 18 | function confirmDeleteSubmit() { 19 | var flag = 0; 20 | var field = document.forms.deletefiles; 21 | for (i = 0; i < field.length; i++) { 22 | if (field[i].checked == true) { 23 | flag = flag + 1; 24 | 25 | } 26 | 27 | } 28 | if (flag < 1) { 29 | alert("You must check one and only one checkbox!"); 30 | return false; 31 | } else { 32 | var agree = confirm("Are you sure you wish to Delete Selected Record?"); 33 | if (agree) 34 | 35 | document.deletefiles.submit(); 36 | else 37 | return false; 38 | 39 | } 40 | } 41 | function confirmLimitSubmit() { 42 | if (document.getElementById('search_limit').value != "") { 43 | 44 | document.limit_go.submit(); 45 | 46 | } else { 47 | return false; 48 | } 49 | } 50 | 51 | 52 | function checkAll() { 53 | 54 | var field = document.forms.deletefiles; 55 | for (i = 0; i < field.length; i++) 56 | field[i].checked = true; 57 | } 58 | 59 | function uncheckAll() { 60 | var field = document.forms.deletefiles; 61 | for (i = 0; i < field.length; i++) 62 | field[i].checked = false; 63 | } 64 | 65 | 66 | /*$.validator.setDefaults({ 67 | submitHandler: function() { alert("submitted!"); } 68 | });*/ 69 | $(document).ready(function () { 70 | 71 | // validate signup form on keyup and submit 72 | $("#form1").validate({ 73 | rules: { 74 | name: { 75 | required: true, 76 | minlength: 3, 77 | maxlength: 200 78 | }, 79 | address: { 80 | minlength: 3, 81 | maxlength: 500 82 | }, 83 | contact1: { 84 | minlength: 3, 85 | maxlength: 20 86 | }, 87 | contact2: { 88 | minlength: 3, 89 | maxlength: 20 90 | } 91 | }, 92 | messages: { 93 | name: { 94 | required: "Please enter a supplier Name", 95 | minlength: "supplier must consist of at least 3 characters" 96 | }, 97 | address: { 98 | minlength: "supplier Address must be at least 3 characters long", 99 | maxlength: "supplier Address must be at least 3 characters long" 100 | } 101 | } 102 | }); 103 | 104 | }); 105 | 106 | 107 | -------------------------------------------------------------------------------- /js/view_category.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | 8 | // Nannette Thacker http://www.shiningstar.net 9 | function confirmSubmit() { 10 | var agree = confirm("Are you sure you wish to Delete this Entry?"); 11 | if (agree) 12 | return true; 13 | else 14 | return false; 15 | } 16 | 17 | function confirmDeleteSubmit() { 18 | var flag = 0; 19 | var field = document.forms.deletefiles; 20 | for (i = 0; i < field.length; i++) { 21 | if (field[i].checked == true) { 22 | flag = flag + 1; 23 | 24 | } 25 | 26 | } 27 | if (flag < 1) { 28 | alert("You must check one and only one checkbox!"); 29 | return false; 30 | } else { 31 | var agree = confirm("Are you sure you wish to Delete Selected Record?"); 32 | if (agree) 33 | 34 | document.deletefiles.submit(); 35 | else 36 | return false; 37 | 38 | } 39 | } 40 | function confirmLimitSubmit() { 41 | if (document.getElementById('search_limit').value != "") { 42 | 43 | document.limit_go.submit(); 44 | 45 | } else { 46 | return false; 47 | } 48 | } 49 | 50 | 51 | function checkAll() { 52 | 53 | var field = document.forms.deletefiles; 54 | for (i = 0; i < field.length; i++) 55 | field[i].checked = true; 56 | } 57 | 58 | function uncheckAll() { 59 | var field = document.forms.deletefiles; 60 | for (i = 0; i < field.length; i++) 61 | field[i].checked = false; 62 | } 63 | // --> 64 | 65 | 66 | /*$.validator.setDefaults({ 67 | submitHandler: function() { alert("submitted!"); } 68 | });*/ 69 | $(document).ready(function () { 70 | 71 | // validate signup form on keyup and submit 72 | $("#form1").validate({ 73 | rules: { 74 | name: { 75 | required: true, 76 | minlength: 3, 77 | maxlength: 200 78 | }, 79 | address: { 80 | minlength: 3, 81 | maxlength: 500 82 | }, 83 | contact1: { 84 | minlength: 3, 85 | maxlength: 20 86 | }, 87 | contact2: { 88 | minlength: 3, 89 | maxlength: 20 90 | } 91 | }, 92 | messages: { 93 | name: { 94 | required: "Please enter a supplier Name", 95 | minlength: "supplier must consist of at least 3 characters" 96 | }, 97 | address: { 98 | minlength: "supplier Address must be at least 3 characters long", 99 | maxlength: "supplier Address must be at least 3 characters long" 100 | } 101 | } 102 | }); 103 | 104 | }); 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /lib/db.help.txt: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM People"); 18 | $result = $db->query("SELECT * FROM People", true); // With DEBUG 19 | 20 | // Browse results of a query (return a line as an object): 21 | while ($line = $db->fetchNextObject($result)) {} 22 | while ($line = $db->fetchNextObject()) {} // From the LAST query 23 | 24 | // Commonly, you can copy/paste this code for one query at a time: 25 | $db->query("SELECT * FROM People"); 26 | while ($line = $db->fetchNextObject()) { 27 | use($line->aField); 28 | } 29 | 30 | // But for sub-queries you should store the result of the first queries: 31 | $result = $db->query("SELECT * FROM Towns"); 32 | while ($line = $db->fetchNextObject($result)) { 33 | $db->query("SELECT * FROM People WHERE town='{$line->name}'"); 34 | while ($line2 = $db->fetchNextObject()) { 35 | use($line->aField, $line2->anotherField); 36 | } 37 | } 38 | 39 | // If you have a query that doesn't return any result such as INSERT, UPDATE, DELETE... use this: 40 | $db->execute("UPDATE People SET name=name"); 41 | 42 | /************************** Convenient Query Functions: *********************/ 43 | 44 | // Do a query and return the unique resulting object from it (or NULL if there is no result): 45 | // Equivalent to a call to query() and then to fetchNextObject(). 46 | $line = $db->queryUniqueObject("SELECT * FROM People WHERE id=2"); 47 | $line = $db->queryUniqueObject("SELECT * FROM People WHERE id=2", true); // With DEBUG 48 | 49 | // Do a query and return the unique resulting cell from it (or NULL if there is no result): 50 | // Equivalent to a call to query() and then to fetchNextObject() and then a fetching of the first cell. 51 | $age = $db->queryUniqueValue("SELECT age FROM People WHERE id=2"); 52 | 53 | // Return the maximum of a column in a table, with a condition WHERE: 54 | // Example: "SELECT MAX(age) FROM People WHERE town='Paris'" is simply: 55 | $max = $db->maxOf("age", "People", "town='Paris'"); 56 | 57 | // If there is no condition, it's simply: 58 | $max = $db->maxOfAll("age", "People"); 59 | 60 | // Return the number of lines in a table, with a condition WHERE: 61 | // Example: "SELECT COUNT(*) FROM People WHERE town='Paris'" is just: 62 | $count = $db->countOf("People", "town='Paris'"); 63 | 64 | // If there is no condition, it's just: 65 | $count = $db->countOfAll("People"); 66 | 67 | // All query...() methods can take a second boolean parameter to debug it or not. 68 | // All those convenient methods can be imbriqued: the query is not saved. 69 | 70 | /************************** Other Functions: ********************************/ 71 | 72 | // Get the id of the last inserted line: 73 | $lastId = $db->lastInsertedId(); 74 | 75 | // The execution time of the script (from "new DB();"): 76 | $time = $db->getExecTime(); 77 | 78 | // The number of executed queries (from "new DB();"): 79 | $queriesCount = $db->getQueriesCount(); 80 | 81 | /************************** Useless Functions: ******************************/ 82 | 83 | // Number of lines of a result (return an integer): 84 | $numLines = $db->numRows($result); 85 | $numLines = $db->numRows(); // From the LAST query 86 | 87 | // Go back to the first line in a fetch: 88 | $db->resetFetch($result); 89 | 90 | // Close the connexion to the base: 91 | $db->close(); 92 | 93 | ?> 94 | -------------------------------------------------------------------------------- /js/view_report.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | /*$.validator.setDefaults({ 8 | submitHandler: function() { alert("submitted!"); } 9 | });*/ 10 | $(document).ready(function () { 11 | $('#from_sales_date').jdPicker(); 12 | $('#to_sales_date').jdPicker(); 13 | $('#from_purchase_date').jdPicker(); 14 | $('#to_purchase_date').jdPicker(); 15 | $('#from_sales_purchase_date').jdPicker(); 16 | $('#to_sales_purchase_date').jdPicker(); 17 | // validate signup form on keyup and submit 18 | $("#form1").validate({ 19 | rules: { 20 | name: { 21 | required: true, 22 | minlength: 3, 23 | maxlength: 200 24 | }, 25 | 26 | cost: { 27 | required: true 28 | 29 | }, 30 | sell: { 31 | required: true 32 | 33 | } 34 | }, 35 | messages: { 36 | name: { 37 | required: "Please enter a Stock Name", 38 | minlength: "Stock must consist of at least 3 characters" 39 | }, 40 | cost: { 41 | required: "Please enter a cost Price" 42 | }, 43 | sell: { 44 | required: "Please enter a Sell Price" 45 | } 46 | } 47 | }); 48 | 49 | }); 50 | function numbersonly(e) { 51 | var unicode = e.charCode ? e.charCode : e.keyCode 52 | if (unicode != 8 && unicode != 46 && unicode != 37 && unicode != 38 && unicode != 39 && unicode != 40) { //if the key isn't the backspace key (which we should allow) 53 | if (unicode < 48 || unicode > 57) 54 | return false 55 | } 56 | } 57 | function change_balance() { 58 | if (parseFloat(document.getElementById('new_payment').value) > parseFloat(document.getElementById('balance').value)) { 59 | document.getElementById('new_payment').value = parseFloat(document.getElementById('balance').value); 60 | } 61 | } 62 | 63 | function sales_report_fn() { 64 | window.open("sales_report.php?from_sales_date=" + $('#from_sales_date').val() + "&to_sales_date=" + $('#to_sales_date').val(), "myNewWinsr", "width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no,scrollbars=yes"); 65 | 66 | } 67 | function purchase_report_fn() { 68 | window.open("purchase_report.php?from_purchase_date=" + $('#from_purchase_date').val() + "&to_purchase_date=" + $('#to_purchase_date').val(), "myNewWinsr", "width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no,scrollbars=yes"); 69 | 70 | } 71 | 72 | function sales_purchase_report_fn() { 73 | window.open("all_report.php?from_sales_purchase_date=" + $('#from_sales_purchase_date').val() + "&to_sales_purchase_date=" + $('#to_sales_purchase_date').val(), "myNewWinsr", "width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no,scrollbars=yes"); 74 | 75 | } 76 | 77 | function stock_sales_report_fn() { 78 | window.open("sales_stock_report.php?from_stock_sales_date=" + $('#from_stock_sales_date').val() + "&to_stock_sales_date=" + $('#to_stock_sales_date').val(), "myNewWinsr", "width=620,height=800,toolbar=0,menubar=no,status=no,resizable=yes,location=no,directories=no,scrollbars=yes"); 79 | 80 | } 81 | 82 | -------------------------------------------------------------------------------- /install_step1.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | POSNIC - Login to Control Panel 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 | 38 |
39 | 40 | 41 | 42 | 43 | 67 | 68 | 69 | 70 | 71 |
72 | 73 |
74 | 75 |
76 |

$msg

"; 82 | } 83 | ?> 84 | 85 |

86 | 87 |

88 | 89 | 91 |

92 | 93 |

94 | 95 | 97 |

98 | 99 |

100 | 101 | 103 |

104 | 105 |

(Ex:Database password empty in localhost)

106 | 107 | 108 | 109 | 110 |
111 | 112 |
113 | 114 |
115 | 116 | 117 | 118 | 119 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /js/date_pic/date_input.css: -------------------------------------------------------------------------------- 1 | .jdpicker_w .date_selector * { 2 | width: auto; 3 | height: auto; 4 | border: none; 5 | background: none; 6 | margin: 0; 7 | padding: 0; 8 | text-align: left; 9 | text-decoration: none; 10 | font-size:12px; 11 | } 12 | .jdpicker_w .date_selector { 13 | background: #FFF; 14 | border: 1px solid #bbb; 15 | padding: 5px; 16 | margin: -1px 0 0 0; 17 | position: absolute; 18 | z-index: 100000; 19 | display: none; 20 | width:210px 21 | } 22 | 23 | .jdpicker_w .date_selector table{ 24 | width:210px; 25 | margin-left:3px; 26 | } 27 | 28 | 29 | 30 | .jdpicker_w .date_selector_ieframe { 31 | position: absolute; 32 | z-index: 99999; 33 | display: none; 34 | } 35 | 36 | .jdpicker_w .error_msg{ 37 | display:none; 38 | text-align:center; 39 | font-size:0.8em; 40 | color:#666 41 | } 42 | 43 | .jdpicker_w .date_selector .nav { 44 | width: 17.5em; /* 7 * 2.5em */ 45 | } 46 | .jdpicker_w .date_selector .month_nav, .jdpicker_w .date_selector .year_nav { 47 | margin: 0 0 3px 0; 48 | padding: 0; 49 | display: block; 50 | position: relative; 51 | text-align: center; 52 | } 53 | .jdpicker_w .date_selector .month_nav { 54 | float: left; 55 | width: 56%; 56 | } 57 | .jdpicker_w .date_selector .year_nav { 58 | float: right; 59 | width: 37%; 60 | position:relative; 61 | } 62 | 63 | .jdpicker_w .date_selector .month_nav select { 64 | width:75px; 65 | margin: 0 auto; 66 | border:1px solid #ccc; 67 | position:relative; 68 | top:1px 69 | } 70 | 71 | .jdpicker_w .date_selector .year_nav .year_input { 72 | text-align:center; 73 | width:36px; 74 | border:1px solid #ccc; 75 | position:relative; 76 | top:2px 77 | } 78 | 79 | .jdpicker_w .date_selector .month_name, .jdpicker_w .date_selector .year_name { 80 | font-weight: bold; 81 | line-height: 20px; 82 | } 83 | .jdpicker_w .date_selector .button { 84 | display: block; 85 | position: absolute; 86 | top: 0; 87 | width: 18px; 88 | height: 18px; 89 | line-height: 17px; 90 | font-weight: bold; 91 | color: #333; 92 | text-align: center; 93 | font-size: 120%; 94 | overflow: hidden; 95 | border: 1px solid #F2F2F2; 96 | cursor:pointer; 97 | } 98 | 99 | .jdpicker_w .date_selector .button:hover, .jdpicker_w .date_selector .button.hover { 100 | background: none; 101 | color: #333; 102 | cursor: pointer; 103 | border-color: #ccc; 104 | } 105 | 106 | .jdpicker_w .date_selector .prev { 107 | left: 0; 108 | } 109 | .jdpicker_w .date_selector .next { 110 | right: 0; 111 | } 112 | 113 | .jdpicker_w .date_selector table { 114 | margin:0 auto; 115 | border-spacing: 1px; 116 | 117 | clear: both; 118 | } 119 | .jdpicker_w .date_selector th{ 120 | padding-top:5px 121 | } 122 | 123 | .jdpicker_w .date_selector th, .jdpicker_w .date_selector td { 124 | text-align: center; 125 | color: black; 126 | } 127 | 128 | .jdpicker_w .date_selector th.week_label{ 129 | font-weight:normal; 130 | font-style:italic; 131 | font-size:80%; 132 | width:25px 133 | } 134 | 135 | .jdpicker_w .date_selector .week_num, .jdpicker_w .date_selector .hover .week_num, .jdpicker_w .date_selector .selected .week_num{ 136 | font-style:italic; 137 | color:#333 ; 138 | vertical-align:bottom ; 139 | text-align:right; 140 | border:none ; 141 | font-size:70%; 142 | background:#FCFCFC ; 143 | padding-right:4px; 144 | } 145 | 146 | .jdpicker_w .date_selector td { 147 | border: 1px solid #ccc; 148 | line-height: 2em; 149 | text-align: center; 150 | white-space: nowrap; 151 | color: #003C78; 152 | background: white; 153 | } 154 | .jdpicker_w .date_selector td.today { 155 | background: #FFFEB3; 156 | } 157 | .jdpicker_w .date_selector td.unselected_month { 158 | color: #ccc; 159 | } 160 | .jdpicker_w .date_selector td.selectable_day, .jdpicker_w .date_selector tr.selectable_week td { 161 | cursor: pointer; 162 | background:url('bg_selectable.png'); 163 | border:1px solid #aaa; 164 | color:#333; 165 | width: 80px; 166 | } 167 | .jdpicker_w .date_selector td.selected, .jdpicker_w .date_selector tr.selected td{ 168 | background: url('bg_selected.png'); 169 | font-weight: bold; 170 | } 171 | .jdpicker_w .date_selector tr.selectable_week.hover td, .jdpicker_w .date_selector td.selectable_day.hover { 172 | background: url('bg_hover.png'); 173 | color: white; 174 | } 175 | -------------------------------------------------------------------------------- /js/lib/jquery.hotkeys-0.7.9.min.js: -------------------------------------------------------------------------------- 1 | (function(jQuery){jQuery.fn.__bind__=jQuery.fn.bind;jQuery.fn.__unbind__=jQuery.fn.unbind;jQuery.fn.__find__=jQuery.fn.find;var hotkeys={version:'0.7.9',override:/keypress|keydown|keyup/g,triggersMap:{},specialKeys:{27:'esc',9:'tab',32:'space',13:'return',8:'backspace',145:'scroll',20:'capslock',144:'numlock',19:'pause',45:'insert',36:'home',46:'del',35:'end',33:'pageup',34:'pagedown',37:'left',38:'up',39:'right',40:'down',109:'-',112:'f1',113:'f2',114:'f3',115:'f4',116:'f5',117:'f6',118:'f7',119:'f8',120:'f9',121:'f10',122:'f11',123:'f12',191:'/'},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"},newTrigger:function(type,combi,callback){var result={};result[type]={};result[type][combi]={cb:callback,disableInInput:false};return result;}};hotkeys.specialKeys=jQuery.extend(hotkeys.specialKeys,{96:'0',97:'1',98:'2',99:'3',100:'4',101:'5',102:'6',103:'7',104:'8',105:'9',106:'*',107:'+',109:'-',110:'.',111:'/'});jQuery.fn.find=function(selector){this.query=selector;return jQuery.fn.__find__.apply(this,arguments);};jQuery.fn.unbind=function(type,combi,fn){if(jQuery.isFunction(combi)){fn=combi;combi=null;} 2 | if(combi&&typeof combi==='string'){var selectorId=((this.prevObject&&this.prevObject.query)||(this[0].id&&this[0].id)||this[0]).toString();var hkTypes=type.split(' ');for(var x=0;x 2 | 3 | 4 | 5 | POSNIC - User 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 |
34 | 35 | 36 |
37 | 38 | 39 | 40 | 41 | 61 | 62 | 63 | query("UPDATE stock_user SET username ='" . $uname . "',password='" . $password . "',answer='" . $answer . "'"); 87 | echo ""; 88 | // exit; 89 | } 90 | ?> 91 | 92 | 93 |
94 | 95 |
96 | 97 |
98 | 99 |

100 | 101 | 103 |

104 | 105 |

106 | 107 | 109 |

110 | 111 |

112 | 113 | What's your favorite movie? 114 | 116 |

117 | 118 | 119 | 120 |  
121 |
122 | 123 |
124 | 125 | 126 | 127 | 128 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 19 | POSNIC - Login to Control Panel 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 | 49 |
50 | 51 | 52 | 53 | 54 | 78 | 79 | 80 | 81 | 82 |
83 | 84 |
85 | 86 |
87 |

" . $_REQUEST['msg'] . "

"; 93 | else if ($_REQUEST['type'] == "warning") 94 | $msg = "
" . $_REQUEST['msg'] . "
"; 95 | else if ($_REQUEST['type'] == "confirmation") 96 | $msg = "
" . $_REQUEST['msg'] . "
"; 97 | else if ($_REQUEST['type'] == "information") 98 | $msg = "
" . $_REQUEST['msg'] . "
"; 99 | 100 | echo $msg; 101 | } 102 | ?> 103 | 104 |

105 | 106 |

107 | 108 | 110 |

111 | 112 |

113 | 114 | 116 |

117 | 118 | Forgot your password? 119 | 120 | 121 | 122 | 123 | 124 |
125 | 126 |
Just click on the "LOG IN" button to continue, no login information 127 | required. 128 |
129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /logo_set.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | POS- Store Logo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | 33 | 34 |
35 | 36 | 37 |
38 | 39 | 40 | 41 | 42 | 66 | 67 | 68 | 0) { 79 | echo "Return Code: " . $_FILES["file"]["error"] . "
"; 80 | } else { 81 | $upload = $_FILES["file"]["name"]; 82 | $type = $_FILES["file"]["type"]; 83 | 84 | 85 | if (isset($_SESSION['logo'])) { 86 | echo "upload/" . $_SESSION['logo']; 87 | } else { 88 | echo "upload/posnic.png"; 89 | } 90 | if (file_exists("upload/" . $_FILES["file"]["name"])) { 91 | 92 | //echo $_FILES["file"]["name"] . " already exists. "; 93 | } else { 94 | 95 | $name = 'posnic.png'; 96 | move_uploaded_file($_FILES["file"]["tmp_name"], 97 | "images/" . $name); 98 | //echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; 99 | $upload; 100 | include("lib/db.class.php"); 101 | 102 | $host = $_SESSION['host']; 103 | $user = $_SESSION['user']; 104 | $pass = $_SESSION['pass']; 105 | $name = $_SESSION['db_name']; 106 | // Open the base (construct the object): 107 | $db = new DB($name, $host, $user, $pass); 108 | 109 | # Note that filters and validators are separate rule sets and method calls. There is a good reason for this. 110 | 111 | require "lib/gump.class.php"; 112 | $db->query("UPDATE store_details SET log ='" . $upload . "',type='" . $type . "'"); 113 | echo ""; 114 | } 115 | } 116 | } else { 117 | echo "

Invalid file

"; 118 | } 119 | } 120 | 121 | ?> 122 | 123 | 124 | 125 |
126 | 127 |
128 | 129 |
130 | 131 |
132 | 133 |
134 | 135 | 136 | 137 | 138 | 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /install_step2.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | POSNIC - Login to Control Panel 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 | 38 |
39 | 40 | 41 | 42 | 43 | 63 | 64 | 65 | 66 | 67 |
68 | 90 |
91 | 92 |
93 |

$msg

"; 99 | } 100 | ?> 101 | 102 |

103 | 104 |

105 | 114 | Create New DataBase 116 | 117 | 120 | 121 | Create New DataBase 122 | 124 | 127 | 128 | 129 |

130 | 131 |

132 | Select Created DataBase
133 | 146 | 147 |

148 | 149 | 150 | 151 | 152 | 153 |
154 | Add Demo Data 155 |
156 |
157 | 158 | 159 | 160 | 161 |
162 | 163 |
164 | 165 |
166 | 167 | 168 | 169 | 170 | 171 | 177 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /forget_pass.php: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | POSNIC - Store Logo 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 | 74 |
75 | 76 | 77 | 78 | 79 | 103 | 104 | 105 | 106 | 107 |
108 | 109 | 110 |

queryUniqueValue("select sum(id) FROM stock_user where answer ='" . $name . "'"); 113 | 114 | if ($count > 0){ 115 | $line = $db->queryUniqueObject("SELECT * FROM stock_user where answer ='" . $name . "'"); 116 | 117 | echo " User Name: $line->username

"; 118 | echo " Password: $line->password "; 119 | ?> 120 |


Dashboard 121 | window.location = 'forget_pass.php?msg=$data';"; 125 | } 126 | echo "

"; 127 | } else { 128 | 129 | ?> 130 |
131 |

139 | 140 |

141 | 142 |
143 | What's your favorite movie? 144 |

145 | 146 | Dashboard 147 |
148 |
149 | 150 | 151 |
152 | 153 | 154 | 155 | 156 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /payment_receipt_print.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | Sales Print 18 | 24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 137 | 138 |
38 | 39 | 40 | 41 | 69 | 70 | 71 | 95 | 96 | 97 | 131 | 132 | 133 | 134 | 135 |
Payment Receipt
42 |
43 | 44 | 45 | 61 | 66 | 67 |
   Date: queryUniqueObject("SELECT * FROM transactions WHERE id='$sid' "); 48 | 49 | $mysqldate = $line->date; 50 | 51 | $phpdate = strtotime($mysqldate); 52 | 53 | $phpdate = date("d/m/Y", $phpdate); 54 | echo $phpdate; 55 | ?>
56 |
57 |
58 |    Receipt No: receiptid; 59 | 60 | ?>

Murugan Company
62 | address
63 | chennai
64 | Phone 65 |
68 |

72 | 73 | 74 | 75 | 92 | 93 |
  TO:
76 | customer; 78 | echo '
'; 79 | $cname = $line->customer; 80 | 81 | $line2 = $db->queryUniqueObject("SELECT * FROM customer_details WHERE customer_name='$cname' "); 82 | 83 | echo $line2->customer_address; 84 | ?> 85 |
86 | customer_contact1 . "
"; 88 | echo "Contact2: " . $line2->customer_contact2 . "
"; 89 | 90 | 91 | ?>
94 |
98 | 99 | 100 | 101 | 124 | 125 | 126 | 127 | 128 | 129 |

102 |
103 |   Paid Amount :  payment; ?>
104 |   Balance        105 |  :  balance; ?>
106 | 107 | 108 | balance; 110 | if ($bal != 0) { 111 | 112 | $mysqldate = $line->due; 113 | 114 | $phpdate = strtotime($mysqldate); 115 | 116 | $phpdate = date("d/m/Y", $phpdate); 117 | echo $phpdate; 118 | } else 119 | echo ""; 120 | ?>
121 |
122 |
123 |
    
 Signature 
130 |
Thank you for Business with Us
136 |
139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /update_category.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | POSNIC - Update Category 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 35 |
36 | 37 | 47 | 48 | 49 | 50 | 51 | " alt="Point of Sale"/> 56 | 57 |
58 | 59 | 60 |
61 | 62 | 63 | 64 | 65 |
66 | 67 |
68 | 69 |
70 | 71 |

Stock Category Management

72 | 78 | 79 |
80 | 81 | 82 |
83 | 84 |
85 | 86 |
87 | 88 |

Update Supplier

89 | Click to collapse 90 | Click to expand 91 | 92 |
93 | 94 | 95 |
96 |
97 |

Add Stock - Add New ( Control + 3)

98 | 99 | connection, $_POST['id']); 103 | $name = trim(mysqli_real_escape_string($db->connection, $_POST['name'])); 104 | $address = trim(mysqli_real_escape_string($db->connection, $_POST['address'])); 105 | 106 | 107 | if ($db->query("UPDATE category_details SET category_name='$name',category_description='$address' where id='$id'")) 108 | echo "
[ $name ] Supplier Details Updated!"; 109 | else 110 | echo "
Problem in Updation !"; 111 | 112 | 113 | } 114 | 115 | ?> 116 | queryUniqueObject("SELECT * FROM category_details WHERE id=$id"); 121 | ?> 122 | 123 | 124 | 125 | 126 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 140 | 141 | 142 | 143 | 144 | 145 | 148 | 153 | 155 | 156 | 157 |
Name
  
Address 139 |
146 |   147 | 149 | 151 | (Control + S) 152 |
158 |
159 | 160 | 161 |
162 | 163 | 164 | 165 |
166 | 167 | 168 | 169 |
170 | 171 | 172 |
173 | 174 | 175 | 176 | 177 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /view_report.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | POSNIC - Report 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
37 | 38 |
39 | 40 | 50 | 51 | 52 | 53 | 54 | " alt="Point of Sale"/> 59 | 60 |
61 | 62 | 63 |
64 | 65 | 66 | 67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 |

Report

75 |
    76 |
      77 |
    • 78 | 79 |
    80 |
81 | 82 | 83 |
84 | 85 | 86 |
87 | 88 |
89 | 90 |
91 | 92 |

Report

93 | Click to collapse 94 | Click to expand 95 | 96 |
97 | 98 | 99 |
100 |
101 | 102 | 103 | 105 | 106 | 107 | 108 | 109 | 111 | 112 | 114 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 134 | 135 | 137 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 153 | 154 | 155 | 156 | 158 | 159 | 161 | 162 | 164 | 165 | 166 | 167 |
Sales Report FromTo 113 |
115 |
      
Purchase Report FromTo
138 |
      
Purchase Stocks FromTo
168 | 169 | 170 |
171 | 172 | 173 | 174 |
175 | 176 | 177 | 178 |
179 | 180 | 181 |
182 | 183 | 184 | 185 | 186 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /add_category.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | POSNIC - Add Stock Category 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 35 |
36 | 37 | 47 | 48 | 49 | 50 | 51 | " alt="Point of Sale"/> 56 | 57 |
58 | 59 | 60 |
61 | 62 | 63 | 64 | 65 |
66 | 67 |
68 | 69 |
70 | 71 |

supplier Management

72 | 78 | 79 |
80 | 81 | 82 |
83 | 84 |
85 | 86 |
87 | 88 |

Add Stock Category

89 | Click to collapse 90 | Click to expand 91 | 92 |
93 | 94 | 95 |
96 | 97 | 98 | sanitize($_POST); 103 | $gump->validation_rules(array( 104 | 'name' => 'required|max_len,100|min_len,3', 105 | 'address' => 'max_len,200', 106 | 107 | )); 108 | 109 | $gump->filter_rules(array( 110 | 'name' => 'trim|sanitize_string|mysqli_escape', 111 | 'address' => 'trim|sanitize_string|mysqli_escape', 112 | 113 | )); 114 | 115 | $validated_data = $gump->run($_POST); 116 | $name = ""; 117 | $address = ""; 118 | 119 | 120 | if ($validated_data === false) { 121 | echo $gump->get_readable_errors(true); 122 | } else { 123 | 124 | 125 | $name = mysqli_real_escape_string($db->connection, $_POST['name']); 126 | $address = mysqli_real_escape_string($db->connection, $_POST['address']); 127 | 128 | 129 | $count = $db->countOf("category_details", "category_name='$name'"); 130 | if ($count == 1) { 131 | echo " Dublicat Entry. Please Verify"; 132 | } else { 133 | 134 | if ($db->query("insert into category_details values(NULL,'$name','$address')")) 135 | echo "
[ $name ] Category Details Added !"; 136 | else 137 | echo "
Problem in Adding !"; 138 | 139 | } 140 | 141 | 142 | } 143 | 144 | } 145 | 146 | 147 | ?> 148 | 149 |
150 | 151 |

Add New Category - Add New ( Control +A)

152 | 153 | 154 | 155 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 181 | 188 | 189 |
*Name:
  
Address 168 |
  
179 |   180 | 182 | 184 | (Control + S) 185 | 186 |
190 |
191 | 192 | 193 |
194 | 195 | 196 | 197 |
198 | 199 | 200 | 201 |
202 | 203 | 204 |
205 | 206 | 207 | 208 | 209 | 214 | 215 | 216 | 217 | -------------------------------------------------------------------------------- /update_supplier.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | POSNIC - Update Supplier 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 35 |
36 | 37 | 47 | 48 | 49 | 50 | 51 | " alt="Point of Sale"/> 56 | 57 |
58 | 59 | 60 |
61 | 62 | 63 | 64 | 65 |
66 | 67 |
68 | 69 |
70 | 71 |

Supplier Management

72 | 76 | 77 |
78 | 79 | 80 |
81 | 82 |
83 | 84 |
85 | 86 |

Update Supplier

87 | Click to collapse 88 | Click to expand 89 | 90 |
91 | 92 | 93 |
94 |
95 |

Add Stock - Add New ( Control + 3)

96 | 97 | connection, $_POST['id']); 101 | $name = trim(mysqli_real_escape_string($db->connection, $_POST['name'])); 102 | $address = trim(mysqli_real_escape_string($db->connection, $_POST['address'])); 103 | $contact1 = trim(mysqli_real_escape_string($db->connection, $_POST['contact1'])); 104 | $contact2 = trim(mysqli_real_escape_string($db->connection, $_POST['contact2'])); 105 | 106 | 107 | if ($db->query("UPDATE supplier_details SET supplier_name ='$name',supplier_address='$address',supplier_contact1='$contact1',supplier_contact2='$contact2' where id='$id'")) 108 | echo "
[ $name ] Supplier Details Updated!"; 109 | else 110 | echo "
Problem in Updation !"; 111 | 112 | 113 | } 114 | 115 | ?> 116 | queryUniqueObject("SELECT * FROM supplier_details WHERE id=$id"); 121 | ?> 122 | 123 | 124 | 125 | 126 | 129 | 130 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 143 | 144 | 147 | 148 | 149 | 150 | 151 | 154 | 159 | 161 | 162 | 163 |
Name:Contact-1
  
Address: 142 | Contact-2
152 |   153 | 155 | 157 | (Control + S) 158 |
164 |
165 | 166 | 167 |
168 | 169 | 170 | 171 |
172 | 173 | 174 | 175 |
176 | 177 | 178 |
179 | 180 | 181 | 182 | 183 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /update_customer_details.php: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | POSNIC - Add Customer 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 35 |
36 | 37 | 47 | 48 | 49 | 50 | 51 | " alt="Point of Sale"/> 56 | 57 |
58 | 59 | 60 |
61 | 62 | 63 | 64 | 65 |
66 | 67 |
68 | 69 |
70 | 71 |

Customers Management

72 | 76 | 77 |
78 | 79 | 80 |
81 | 82 |
83 | 84 |
85 | 86 |

Add Customer

87 | Click to collapse 88 | Click to expand 89 | 90 |
91 | 92 | 93 |
94 |
95 |

Add Customer Details - Add New ( Control +A)

96 | 97 | connection, $_POST['id']); 101 | $name = trim(mysqli_real_escape_string($db->connection, $_POST['name'])); 102 | $address = trim(mysqli_real_escape_string($db->connection, $_POST['address'])); 103 | $contact1 = trim(mysqli_real_escape_string($db->connection, $_POST['contact1'])); 104 | $contact2 = trim(mysqli_real_escape_string($db->connection, $_POST['contact2'])); 105 | 106 | 107 | if ($db->query("UPDATE customer_details SET customer_name='$name',customer_address='$address',customer_contact1='$contact1',customer_contact2='$contact2' where id='$id'")) 108 | echo "
[ $name ] Supplier Details Updated!"; 109 | else 110 | echo "
Problem in Updation !"; 111 | 112 | 113 | } 114 | 115 | ?> 116 | queryUniqueObject("SELECT * FROM customer_details WHERE id=$id"); 121 | ?> 122 | 123 | 124 | 125 | 126 | 129 | 130 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 143 | 144 | 145 | 148 | 149 | 150 | 151 | 152 | 155 | 160 | 162 | 163 |
Name*Contact-1
  
Address:Contact-2
153 |   154 | 156 | 158 | (Control + S) 159 |
164 |
165 | 166 | 167 |
168 | 169 | 170 | 171 |
172 | 173 | 174 | 175 |
176 | 177 | 178 |
179 | 180 | 181 | 182 | 183 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /js/view_purchase.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | // Nannette Thacker http://www.shiningstar.net 8 | function deleteall() 9 | { 10 | var file1 = "viewpurchase"; 11 | if (confirm("Are you sure you want to delete all records...?")) 12 | { 13 | $.ajax({ 14 | type: "POST", 15 | url: "deleteall.php", 16 | data: {data: file1}, 17 | cache: false, 18 | success: function () { 19 | sessionStorage.removeItem('checked-checkboxesviewpurchase'); 20 | //sessionStorage.removeItem('checked-checkboxesviewsales'); 21 | window.location.href = "view_purchase.php"; 22 | } 23 | }); 24 | $(this).parents(".show").animate({backgroundColor: "#003"}, "slow") 25 | .animate({opacity: "hide"}, "slow"); 26 | } 27 | return false; 28 | 29 | } 30 | 31 | var arrCheckedCheckboxes1viewpurchase = []; 32 | var arrCheckedCheckboxes1viewpurchaseselected = [];//For ROw Selection in view_purchase 33 | 34 | 35 | 36 | function rowselection() { 37 | 38 | if (sessionStorage.getItem('checked-checkboxesviewpurchase') && $.parseJSON(sessionStorage.getItem('checked-checkboxesviewpurchase')).length !== 0) 39 | { 40 | arrCheckedCheckboxes1viewpurchase = $.parseJSON(sessionStorage.getItem('checked-checkboxesviewpurchase')); 41 | //Convert checked checkboxes array to comma seprated id 42 | $(arrCheckedCheckboxes1viewpurchase.toString()).prop('checked', true); 43 | 44 | } 45 | if (sessionStorage.getItem('checked-checkboxesviewpurchase_selected') && $.parseJSON(sessionStorage.getItem('checked-checkboxesviewpurchase_selected')).length !== 0) 46 | { 47 | arrCheckedCheckboxes1viewpurchaseselected = $.parseJSON(sessionStorage.getItem('checked-checkboxesviewpurchase_selected')); 48 | //Convert checked checkboxes array to comma seprated id 49 | //alert(arrCheckedCheckboxes1viewpurchaseselected); 50 | $(arrCheckedCheckboxes1viewpurchaseselected.toString()).css('background-color', '#DCDCDC'); 51 | 52 | } 53 | 54 | 55 | } 56 | 57 | $(document).ready(function () { 58 | 59 | rowselection(); 60 | 61 | $("input:checkbox").change(function () { 62 | 63 | var currentId = $(this).attr('id'); 64 | if ($(this).is(':checked')) { 65 | arrCheckedCheckboxes1viewpurchase.push("#" + currentId); 66 | arrCheckedCheckboxes1viewpurchaseselected.push("#tr" + currentId); 67 | } else { 68 | console.log('came to else condition'); 69 | arrCheckedCheckboxes1viewpurchase = jQuery.grep(arrCheckedCheckboxes1viewpurchase, function (value) { 70 | return value != "#" + currentId; 71 | }); 72 | arrCheckedCheckboxes1viewpurchaseselected = jQuery.grep(arrCheckedCheckboxes1viewpurchaseselected, function (value) { 73 | return value != "#tr" + currentId; 74 | }); 75 | 76 | } 77 | sessionStorage.setItem('checked-checkboxesviewpurchase', JSON.stringify(arrCheckedCheckboxes1viewpurchase)); 78 | sessionStorage.setItem('checked-checkboxesviewpurchase_selected', JSON.stringify(arrCheckedCheckboxes1viewpurchaseselected)); 79 | 80 | // Convert checked checkboxes array to JSON ans store it in session storage 81 | 82 | 83 | 84 | 85 | }); 86 | 87 | }); 88 | 89 | function confirmSubmit() { 90 | var agree = confirm("Are you sure you wish to Delete this Entry?"); 91 | if (agree) 92 | return true; 93 | else 94 | return false; 95 | } 96 | 97 | function confirmDeleteSubmit() { 98 | var retrievedData = sessionStorage.getItem("checked-checkboxesviewpurchase"); 99 | var movies2 = JSON.parse(retrievedData); 100 | 101 | var flag = movies2.length; 102 | 103 | // alert(flag); 104 | /*var field = document.forms.deletefiles; 105 | for (i = 0; i < field.length; i++) { 106 | if (field[i].checked == true) { 107 | flag = flag + 1; 108 | 109 | } 110 | 111 | }*/ 112 | if (flag == 0) { 113 | alert("You must check one and only one checkbox!"); 114 | return false; 115 | } else { 116 | 117 | var agree = confirm("Are you sure you wish to Delete Selected Record.?"); 118 | if (agree) 119 | 120 | 121 | { 122 | var file1 = "viewpurchase"; 123 | $.ajax({ 124 | type: "POST", 125 | url: "deleterecords.php", 126 | data: {data: movies2, file: file1}, 127 | cache: false, 128 | success: function () { 129 | sessionStorage.removeItem('checked-checkboxesviewpurchase'); 130 | window.location.href = "view_purchase.php"; 131 | } 132 | }); 133 | $(this).parents(".show").animate({backgroundColor: "#003"}, "slow") 134 | .animate({opacity: "hide"}, "slow"); 135 | } 136 | return false; 137 | 138 | 139 | } 140 | } 141 | 142 | function confirmLimitSubmit() { 143 | if (document.getElementById('search_limit').value != "") { 144 | 145 | document.limit_go.submit(); 146 | 147 | } else { 148 | return false; 149 | } 150 | } 151 | 152 | 153 | function checkAll() { 154 | 155 | var field = document.forms.deletefiles; 156 | for (i = 0; i < field.length; i++) 157 | field[i].checked = true; 158 | } 159 | 160 | function uncheckAll() { 161 | var field = document.forms.deletefiles; 162 | for (i = 0; i < field.length; i++) 163 | field[i].checked = false; 164 | } 165 | 166 | /*$.validator.setDefaults({ 167 | submitHandler: function() { alert("submitted!"); } 168 | });*/ 169 | $(document).ready(function () { 170 | 171 | // validate signup form on keyup and submit 172 | $("#form1").validate({ 173 | rules: { 174 | name: { 175 | required: true, 176 | minlength: 3, 177 | maxlength: 200 178 | }, 179 | address: { 180 | minlength: 3, 181 | maxlength: 500 182 | }, 183 | contact1: { 184 | minlength: 3, 185 | maxlength: 20 186 | }, 187 | contact2: { 188 | minlength: 3, 189 | maxlength: 20 190 | } 191 | }, 192 | messages: { 193 | name: { 194 | required: "Please enter a supplier Name", 195 | minlength: "supplier must consist of at least 3 characters" 196 | }, 197 | address: { 198 | minlength: "supplier Address must be at least 3 characters long", 199 | maxlength: "supplier Address must be at least 3 characters long" 200 | } 201 | } 202 | }); 203 | 204 | }); 205 | 206 | $(document).ready(function () 207 | { 208 | $("#checkall").live('click', function (event) { 209 | $('input:checkbox:not(#checkall)').attr('checked', this.checked); 210 | //To Highlight 211 | if ($(this).attr("checked") == true) 212 | { 213 | //$(this).parents('table:eq(0)').find('tr:not(#chkrow)').css("background-color","#FF3700"); 214 | $("#tblDisplay").find('tr:not(#chkrow)').css("background-color", "#DCDCDC"); 215 | } else 216 | { 217 | //$(this).parents('table:eq(0)').find('tr:not(#chkrow)').css("background-color","#fff"); 218 | $("#tblDisplay").find('tr:not(#chkrow)').css("background-color", "#DCDCDC"); 219 | } 220 | }); 221 | $('input:checkbox:not(#checkall)').live('click', function (event) 222 | { 223 | if ($("#checkall").attr('checked') == true && this.checked == false) 224 | { 225 | $("#checkall").attr('checked', false); 226 | $(this).closest('tr').css("background-color", "#ffffff"); 227 | } 228 | if (this.checked == true) 229 | { 230 | $(this).closest('tr').css("background-color", "#DCDCDC"); 231 | CheckSelectAll(); 232 | } 233 | if (this.checked == false) 234 | { 235 | $(this).closest('tr').css("background-color", "#ffffff"); 236 | } 237 | }); 238 | 239 | function CheckSelectAll() 240 | { 241 | var flag = true; 242 | $('input:button:not(#checkall)').each(function () { 243 | if (this.checked == false) 244 | flag = false; 245 | }); 246 | $("#checkall").attr('checked', flag); 247 | } 248 | }); 249 | 250 | -------------------------------------------------------------------------------- /js/view_product.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | // Nannette Thacker http://www.shiningstar.net 7 | 8 | 9 | 10 | function deleteall() 11 | { 12 | 13 | //var info = 'id=' + checkedvaues; 14 | //var jsonString = JSON.stringify(checkedvaues); 15 | //alert(checkedvaues[0]); 16 | var file1 = "viewproduct"; 17 | if (confirm("Are you sure you want to delete all records...?")) 18 | { 19 | $.ajax({ 20 | type: "POST", 21 | url: "deleteall.php", 22 | data: {data: file1}, 23 | cache: false, 24 | success: function () { 25 | sessionStorage.removeItem('checked-checkboxesviewproduct'); 26 | //sessionStorage.removeItem('checked-checkboxesviewsales'); 27 | window.location.href = "view_product.php"; 28 | } 29 | }); 30 | $(this).parents(".show").animate({backgroundColor: "#003"}, "slow") 31 | .animate({opacity: "hide"}, "slow"); 32 | } 33 | return false; 34 | 35 | } 36 | 37 | 38 | 39 | 40 | 41 | var arrCheckedCheckboxes1viewproduct = []; 42 | 43 | var arrCheckedCheckboxes1viewcustomerselected = [];//For ROw Selection in view_product 44 | 45 | function rowselection() { 46 | 47 | if (sessionStorage.getItem('checked-checkboxesviewproduct') && $.parseJSON(sessionStorage.getItem('checked-checkboxesviewproduct')).length !== 0) 48 | { 49 | arrCheckedCheckboxes1viewproduct = $.parseJSON(sessionStorage.getItem('checked-checkboxesviewproduct')); 50 | //Convert checked checkboxes array to comma seprated id 51 | $(arrCheckedCheckboxes1viewproduct.toString()).prop('checked', true); 52 | 53 | } 54 | if (sessionStorage.getItem('checked-checkboxesviewcustomer_selected') && $.parseJSON(sessionStorage.getItem('checked-checkboxesviewcustomer_selected')).length !== 0) 55 | { 56 | arrCheckedCheckboxes1viewcustomerselected = $.parseJSON(sessionStorage.getItem('checked-checkboxesviewcustomer_selected')); 57 | //Convert checked checkboxes array to comma seprated id 58 | //alert(arrCheckedCheckboxes1viewcustomerselected); 59 | $(arrCheckedCheckboxes1viewcustomerselected.toString()).css('background-color', '#DCDCDC'); 60 | 61 | } 62 | 63 | } 64 | 65 | $(document).ready(function () { 66 | 67 | rowselection(); 68 | 69 | $("input:checkbox").change(function () { 70 | // i++; 71 | // var arrCheckedCheckboxes1viewproduct = []; 72 | //alert(arrCheckedCheckboxes); 73 | // Get all checked checkboxes 74 | var currentId = $(this).attr('id'); 75 | if ($(this).is(':checked')) { 76 | arrCheckedCheckboxes1viewproduct.push("#" + currentId); 77 | arrCheckedCheckboxes1viewcustomerselected.push("#tr" + currentId); 78 | } else { 79 | console.log('came to else condition'); 80 | arrCheckedCheckboxes1viewproduct = jQuery.grep(arrCheckedCheckboxes1viewproduct, function (value) { 81 | return value != "#" + currentId; 82 | }); 83 | arrCheckedCheckboxes1viewcustomerselected = jQuery.grep(arrCheckedCheckboxes1viewcustomerselected, function (value) { 84 | return value != "#tr" + currentId; 85 | }); 86 | 87 | } 88 | sessionStorage.setItem('checked-checkboxesviewproduct', JSON.stringify(arrCheckedCheckboxes1viewproduct)); 89 | sessionStorage.setItem('checked-checkboxesviewcustomer_selected', JSON.stringify(arrCheckedCheckboxes1viewcustomerselected)); 90 | 91 | // Convert checked checkboxes array to JSON ans store it in session storage 92 | 93 | 94 | 95 | 96 | }); 97 | 98 | }); 99 | 100 | function confirmSubmit() { 101 | var agree = confirm("Are you sure you wish to Delete this Entry?"); 102 | if (agree) 103 | return true; 104 | else 105 | return false; 106 | } 107 | 108 | function confirmDeleteSubmit() { 109 | var retrievedData = sessionStorage.getItem("checked-checkboxesviewproduct"); 110 | var checkedvaues = JSON.parse(retrievedData); 111 | 112 | var flag = checkedvaues.length; 113 | 114 | // alert(flag); 115 | /*var field = document.forms.deletefiles; 116 | for (i = 0; i < field.length; i++) { 117 | if (field[i].checked == true) { 118 | flag = flag + 1; 119 | 120 | } 121 | 122 | }*/ 123 | if (flag == 0) { 124 | alert("You must check one and only one checkbox!"); 125 | return false; 126 | } else { 127 | 128 | var agree = confirm("Are you sure you wish to Delete Selected Record.?"); 129 | if (agree) 130 | 131 | 132 | { 133 | var file1 = "viewproduct"; 134 | $.ajax({ 135 | type: "POST", 136 | url: "deleterecords.php", 137 | data: {data: checkedvaues, file: file1}, 138 | cache: false, 139 | success: function () { 140 | sessionStorage.removeItem('checked-checkboxesviewproduct'); 141 | window.location.href = "view_product.php"; 142 | } 143 | }); 144 | $(this).parents(".show").animate({backgroundColor: "#003"}, "slow") 145 | .animate({opacity: "hide"}, "slow"); 146 | } 147 | return false; 148 | 149 | 150 | } 151 | } 152 | function confirmLimitSubmit() { 153 | if (document.getElementById('search_limit').value != "") { 154 | 155 | document.limit_go.submit(); 156 | 157 | } else { 158 | return false; 159 | } 160 | } 161 | 162 | 163 | function checkAll() { 164 | 165 | var field = document.forms.deletefiles; 166 | for (i = 0; i < field.length; i++) 167 | field[i].checked = true; 168 | } 169 | 170 | function uncheckAll() { 171 | var field = document.forms.deletefiles; 172 | for (i = 0; i < field.length; i++) 173 | field[i].checked = false; 174 | } 175 | 176 | /*$.validator.setDefaults({ 177 | submitHandler: function() { alert("submitted!"); } 178 | });*/ 179 | $(document).ready(function () { 180 | 181 | // validate signup form on keyup and submit 182 | $("#form1").validate({ 183 | rules: { 184 | name: { 185 | required: true, 186 | minlength: 3, 187 | maxlength: 200 188 | }, 189 | address: { 190 | minlength: 3, 191 | maxlength: 500 192 | }, 193 | contact1: { 194 | minlength: 3, 195 | maxlength: 20 196 | }, 197 | contact2: { 198 | minlength: 3, 199 | maxlength: 20 200 | } 201 | }, 202 | messages: { 203 | name: { 204 | required: "Please enter a supplier Name", 205 | minlength: "supplier must consist of at least 3 characters" 206 | }, 207 | address: { 208 | minlength: "supplier Address must be at least 3 characters long", 209 | maxlength: "supplier Address must be at least 3 characters long" 210 | } 211 | } 212 | }); 213 | 214 | }); 215 | $(document).ready(function () 216 | { 217 | $("#checkall").live('click', function (event) { 218 | $('input:checkbox:not(#checkall)').attr('checked', this.checked); 219 | //To Highlight 220 | if ($(this).attr("checked") == true) 221 | { 222 | //$(this).parents('table:eq(0)').find('tr:not(#chkrow)').css("background-color","#FF3700"); 223 | $("#tblDisplay").find('tr:not(#chkrow)').css("background-color", "#DCDCDC"); 224 | } else 225 | { 226 | //$(this).parents('table:eq(0)').find('tr:not(#chkrow)').css("background-color","#fff"); 227 | $("#tblDisplay").find('tr:not(#chkrow)').css("background-color", "#DCDCDC"); 228 | } 229 | }); 230 | $('input:checkbox:not(#checkall)').live('click', function (event) 231 | { 232 | if ($("#checkall").attr('checked') == true && this.checked == false) 233 | { 234 | $("#checkall").attr('checked', false); 235 | $(this).closest('tr').css("background-color", "#ffffff"); 236 | } 237 | if (this.checked == true) 238 | { 239 | $(this).closest('tr').css("background-color", "#DCDCDC"); 240 | CheckSelectAll(); 241 | } 242 | if (this.checked == false) 243 | { 244 | $(this).closest('tr').css("background-color", "#ffffff"); 245 | } 246 | }); 247 | 248 | function CheckSelectAll() 249 | { 250 | var flag = true; 251 | $('input:button:not(#checkall)').each(function () { 252 | if (this.checked == false) 253 | flag = false; 254 | }); 255 | $("#checkall").attr('checked', flag); 256 | } 257 | }); 258 | --------------------------------------------------------------------------------