Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
73 changes: 73 additions & 0 deletions Shopping Cart/Shopping Cart in Java/Project/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Project" default="default" basedir=".">
<description>Builds, tests, and runs the project Project.</description>
<import file="nbproject/build-impl.xml"/>
<!--

There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:

-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products

(Targets beginning with '-' are not intended to be called on their own.)

Example of inserting an obfuscator after compilation could look like this:

<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>

For list of available properties check the imported
nbproject/build-impl.xml file.


Another way to customize the build is by overriding existing main targets.
The targets of interest are:

-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation

An example of overriding the target for project execution could look like this:

<target name="run" depends="Project-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>

Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.

-->
</project>
3 changes: 3 additions & 0 deletions Shopping Cart/Shopping Cart in Java/Project/manifest.mf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,096 changes: 1,096 additions & 0 deletions Shopping Cart/Shopping Cart in Java/Project/src/project/AdminPanel.form

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

package project;


public class BillObject {
private int id;
private String uname;
private int bill;
private String date;

public BillObject(int id, String uname, int bill, String date) {
this.id = id;
this.uname = uname;
this.bill = bill;
this.date = date;
}



public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getUname() {
return uname;
}

public void setUname(String uname) {
this.uname = uname;
}

public int getBill() {
return bill;
}

public void setBill(int bill) {
this.bill = bill;
}

public String getDate() {
return date;
}

public void setDate(String date) {
this.date = date;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

package project;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;


public class BillingDB {

public static void insertIntoBillingDB(String username, int price, String date){
try {
Connection con = DriverManager.getConnection("jdbc:sqlite:DBs/billingDB.db");

PreparedStatement ps = con.prepareStatement("INSERT INTO billing(uname, bill, date) VALUES(?,?,?)");

ps.setString(1, username);
ps.setInt(2, price);
ps.setString(3, date);
ps.executeUpdate();

} catch (SQLException ex) {
Logger.getLogger(MobileDB.class.getName()).log(Level.SEVERE, null, ex);
}

}

public static ArrayList<BillObject> billlings(){
ArrayList<BillObject> customers = new ArrayList<>();

try {
Connection con = DriverManager.getConnection("jdbc:sqlite:DBs/billingDB.db");
Statement ps = con.createStatement();
ResultSet rs = ps.executeQuery("SELECT id, uname, bill, date FROM billing");

BillObject pl;

while(rs.next()){
pl = new BillObject(rs.getInt("id"),rs.getString("uname"),
rs.getInt("bill"),rs.getString("date"));
customers.add(pl);

}
} catch (SQLException ex) {
Logger.getLogger(MobileDB.class.getName()).log(Level.SEVERE, null, ex);
}
return customers;
}

public static void deleteBillings(){
try {
Connection con = DriverManager.getConnection("jdbc:sqlite:DBs/billingDB.db");
PreparedStatement ps = con.prepareStatement("DELETE FROM billing");
ps.executeUpdate();
JOptionPane.showMessageDialog(null, "All entries have been deleted!");

} catch (SQLException ex) {
Logger.getLogger(ElectronicsDB.class.getName()).log(Level.SEVERE, null, ex);
}
}



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@

package project;

import java.sql.PreparedStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.MessagingException;
import javax.swing.JFrame;


public class DbConnector {

public static int insertToUser(String username, String name, String email, String password, String card) {
try {
Connection con = DriverManager.getConnection("jdbc:sqlite:DBs/bbs.db");
String sql = "INSERT INTO userinfo"
+"(username, name, email, password, card)"
+"VALUES(?,?,?,?,?)";

PreparedStatement ps = con.prepareStatement(sql);

ps.setString(1, username);
ps.setString(2, name);
ps.setString(3, email);
ps.setString(4, password);
ps.setString(5, card);
ps.executeUpdate();

JFrame notification = new NotificationForm();


} catch (SQLException e) {
if(e.getErrorCode()==19) //Duplicate username
return 19;

JFrame errorOc = new ErrorOccured();
}

return 0;

}

public static boolean signer(String username, String pass){
try {
Connection con = DriverManager.getConnection("jdbc:sqlite:DBs/bbs.db");
String check = "SELECT username, password FROM userinfo WHERE username=? AND password=?";
PreparedStatement ps = con.prepareStatement(check);

ps.setString(1, username);
ps.setString(2, pass);
ResultSet rs = ps.executeQuery();

return rs.next();

} catch (SQLException ex) {
Logger.getLogger(DbConnector.class.getName()).log(Level.SEVERE, null, ex);
}

return false;
}

public static void passRecovery(String username) throws MessagingException{
String[] query= new String[2];

try {
Connection con = DriverManager.getConnection("jdbc:sqlite:DBs/bbs.db");
String check = "SELECT username, email, password FROM userinfo WHERE username=?";
PreparedStatement ps = con.prepareStatement(check);

ps.setString(1, username);
ResultSet rs = ps.executeQuery();

if(rs.next()){
query[0]=rs.getString("email");
query[1]=rs.getString("password");

ForgotPassword.Send("blackbengalshopping","projectinjava",query[0],"Password Recovery","Your password: "+query[1]);

NotificationForm nf = new NotificationForm();
nf.jLabel7.setText("An email has been sent to "+query[0]);

}
else{
ErrorOccured foo = new ErrorOccured();
foo.errorMessage.setText("Username not found");
}

} catch (SQLException ex) {
Logger.getLogger(DbConnector.class.getName()).log(Level.SEVERE, null, ex);
}
}


}
Loading