add gitignore
No files matched your search
@@ -0,0 +1,51 @@
|
||||
DROP TABLE test_customers;
|
||||
|
||||
CREATE TABLE test_customers (
|
||||
CustomerID NUMBER(8),
|
||||
CustName VARCHAR2(35) NOT NULL,
|
||||
CustAge NUMBER(2),
|
||||
CONSTRAINT pk_test_customers_CustomerID PRIMARY KEY(CustomerID),
|
||||
CONSTRAINT uk_test_customers_CustName UNIQUE(CustName),
|
||||
CONSTRAINT ck_test_customers_CustAge CHECK(CustAge>=16 AND CustAge<=70)
|
||||
);
|
||||
|
||||
INSERT INTO test_customers VALUES(100, 'John Smith', null);
|
||||
INSERT INTO test_customers VALUES(350, 'Mark Smith', 20);
|
||||
|
||||
SELECT * FROM test_customers;
|
||||
|
||||
CREATE TABLE test_orders (
|
||||
OrderID NUMBER(8),
|
||||
CustomerID NUMBER(8),
|
||||
OrderDate Date,
|
||||
OrderAmount NUMBER(8,2),
|
||||
CONSTRAINT pk_test_orders_OrderID PRIMARY KEY(OrderID),
|
||||
CONSTRAINT fk_test_orders_test_customers FOREIGN KEY(CustomerID) REFERENCES test_customers(CustomerID)
|
||||
);
|
||||
|
||||
INSERT INTO test_orders VALUES(1, 100, '2023-01-15', 125.3);
|
||||
INSERT INTO test_orders VALUES(2, 100, '2023-01-18', 300.3);
|
||||
|
||||
SELECT * FROM test_orders;
|
||||
SELECT * FROM test_customers c JOIN test_orders o ON c.CustomerID = o.CustomerID;
|
||||
|
||||
|
||||
|
||||
|
||||
SELECT constraint_name, constraint_type, search_condition, table_name, 'Levi McLean' AS "Created By"
|
||||
FROM user_constraints
|
||||
WHERE table_name IN('CATEGORIES','EMPLOYEES','CUSTOMERS', 'ORDERS','ORDER_DETAILS','PRODUCTS','VENDORS','PRODUCT_VENDORS')
|
||||
AND constraint_name NOT LIKE 'SYS%'
|
||||
ORDER BY 1;
|
||||
|
||||
|
||||
|
||||
SELECT 'Customers' AS "Levi McLean's Tables", COUNT(*) AS "Row Count" FROM CUSTOMERS
|
||||
UNION
|
||||
SELECT 'Employees', COUNT(*) FROM Employees UNION
|
||||
SELECT 'Orders', COUNT(*) FROM Orders UNION
|
||||
SELECT 'Orders Details', COUNT(*) FROM OrderDetails UNION
|
||||
SELECT 'Products', COUNT(*) FROM Products UNION
|
||||
SELECT 'Categories', COUNT(*) FROM Categories UNION
|
||||
SELECT 'Shippers', COUNT(*) FROM Shippers UNION
|
||||
SELECT 'Suppliers', COUNT(*) FROM Suppliers;
|
||||
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 144 KiB |
@@ -0,0 +1,41 @@
|
||||
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
|
||||
# Expo
|
||||
.expo/
|
||||
dist/
|
||||
web-build/
|
||||
expo-env.d.ts
|
||||
|
||||
# Native
|
||||
.kotlin/
|
||||
*.orig.*
|
||||
*.jks
|
||||
*.p8
|
||||
*.p12
|
||||
*.key
|
||||
*.mobileprovision
|
||||
|
||||
# Metro
|
||||
.metro-health-check*
|
||||
|
||||
# debug
|
||||
npm-debug.*
|
||||
yarn-debug.*
|
||||
yarn-error.*
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
|
||||
# generated native folders
|
||||
/ios
|
||||
/android
|
||||
@@ -0,0 +1,21 @@
|
||||
import React from 'react';
|
||||
import { NavigationContainer } from '@react-navigation/native';
|
||||
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
||||
import MainScreen from './screens/MainScreen';
|
||||
import SendEmail from './screens/SendEmail';
|
||||
import SendSMS from './screens/SendSMS';
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<NavigationContainer>
|
||||
<Stack.Navigator initialRouteName="MainScreen">
|
||||
<Stack.Screen name="MainScreen" component={MainScreen} options={{ title: 'Lab 4 - Send My Info App' }} />
|
||||
<Stack.Screen name="SendEmail" component={SendEmail} />
|
||||
<Stack.Screen name="SendSMS" component={SendSMS} />
|
||||
</Stack.Navigator>
|
||||
</NavigationContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Sample Snack app
|
||||
|
||||
Open the `App.js` file to start writing some code. You can preview the changes directly on your phone or tablet by scanning the **QR code** or use the iOS or Android emulators. When you're done, click **Save** and share the link!
|
||||
|
||||
When you're ready to see everything that Expo provides (or if you want to use your own editor) you can **Download** your project and use it with [expo cli](https://docs.expo.dev/get-started/installation/#expo-cli)).
|
||||
|
||||
All projects created in Snack are publicly available, so you can easily share the link to this project via link, or embed it on a web page with the `<>` button.
|
||||
|
||||
If you're having problems, you can tweet to us [@expo](https://twitter.com/expo) or ask in our [forums](https://forums.expo.dev/c/expo-dev-tools/61) or [Discord](https://chat.expo.dev/).
|
||||
|
||||
Snack is Open Source. You can find the code on the [GitHub repo](https://github.com/expo/snack).
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"expo": {
|
||||
"name": "lab-4-info-app",
|
||||
"slug": "snack-afcff946-e184-4514-b19c-dfa890a17f09",
|
||||
"version": "1.0.0",
|
||||
"orientation": "portrait",
|
||||
"icon": "./assets/icon.png",
|
||||
"userInterfaceStyle": "light",
|
||||
"newArchEnabled": true,
|
||||
"splash": {
|
||||
"image": "./assets/splash-icon.png",
|
||||
"resizeMode": "contain",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"ios": {
|
||||
"supportsTablet": true
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/adaptive-icon.png",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"edgeToEdgeEnabled": true
|
||||
},
|
||||
"web": {
|
||||
"favicon": "./assets/favicon.png"
|
||||
},
|
||||
"plugins": [
|
||||
"expo-mail-composer"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,31 @@
|
||||
import { Text, View, StyleSheet, Image } from 'react-native';
|
||||
|
||||
export default function AssetExample() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.paragraph}>
|
||||
Local files and assets can be imported by dragging and dropping them into the editor
|
||||
</Text>
|
||||
<Image style={styles.logo} source={require('../assets/snack-icon.png')} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: 24,
|
||||
},
|
||||
paragraph: {
|
||||
margin: 24,
|
||||
marginTop: 0,
|
||||
fontSize: 14,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
},
|
||||
logo: {
|
||||
height: 128,
|
||||
width: 128,
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
import { registerRootComponent } from 'expo';
|
||||
|
||||
import App from './App';
|
||||
|
||||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
||||
// It also ensures that whether you load the app in Expo Go or in a native build,
|
||||
// the environment is set up appropriately
|
||||
registerRootComponent(App);
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"license": "0BSD",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"web": "expo start --web"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^15.0.3",
|
||||
"@react-navigation/native": "^7.5.1",
|
||||
"@react-navigation/native-stack": "^7.21.0",
|
||||
"expo": "~54.0.37",
|
||||
"expo-mail-composer": "~15.0.8",
|
||||
"expo-sms": "~14.0.8",
|
||||
"expo-status-bar": "~3.0.9",
|
||||
"react": "19.1.0",
|
||||
"react-native": "0.81.5",
|
||||
"react-native-paper": "4.9.2",
|
||||
"react-native-safe-area-context": "~5.6.0",
|
||||
"react-native-screens": "~4.16.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import React from 'react';
|
||||
import { View, Text, Button, StyleSheet } from 'react-native';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
|
||||
const MainScreen = () => {
|
||||
const navigation = useNavigation();
|
||||
|
||||
const navigateToSendEmail = () => {
|
||||
navigation.navigate('SendEmail');
|
||||
}
|
||||
|
||||
const navigateToSendSMS = () => {
|
||||
navigation.navigate('SendSMS');
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>SEND MY INFO</Text>
|
||||
<Text style={styles.title}>l_mclean215318</Text>
|
||||
<View style={styles.buttonContainer}>
|
||||
<Button title="EMAIL MY INFO" color="green" onPress={navigateToSendEmail} />
|
||||
</View>
|
||||
<View style={styles.buttonContainer}>
|
||||
<Button title="SMS MY INFO" color="blue" onPress={navigateToSendSMS} />
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
marginTop: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
title: {
|
||||
fontSize: 30,
|
||||
fontWeight: 'bold',
|
||||
marginBottom: 20,
|
||||
alignItems: 'center',
|
||||
},
|
||||
buttonContainer: {
|
||||
borderRadius: 10,
|
||||
marginTop: 10,
|
||||
padding: 10,
|
||||
width: 200,
|
||||
alignItems: 'center',
|
||||
},
|
||||
});
|
||||
|
||||
export default MainScreen;
|
||||
@@ -0,0 +1,60 @@
|
||||
import React from 'react';
|
||||
import { View, Text, StyleSheet, Button, Alert } from 'react-native';
|
||||
import * as MailComposer from 'expo-mail-composer';
|
||||
|
||||
const SendEmail = () => {
|
||||
const [message, setMessage] = React.useState('Levi McLean\n123 Main St\nLondon, ON\n(555) 555-5555\naidanmclean111@gmail.com');
|
||||
|
||||
const sendMessageWithEmail = async () => {
|
||||
try {
|
||||
const isAvailable = await MailComposer.isAvailableAsync();
|
||||
if (!isAvailable) {
|
||||
Alert.alert('Email is not available on this device');
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await MailComposer.composeAsync({
|
||||
recipients: ['aidanmclean111@gmail.com'],
|
||||
subject: 'Lab 4 - Customized Email',
|
||||
body: message,
|
||||
});
|
||||
|
||||
if (result.status === 'sent') {
|
||||
Alert.alert('Email sent successfully');
|
||||
} else {
|
||||
Alert.alert('Failed to send email');
|
||||
}
|
||||
} catch (error) {
|
||||
Alert.alert('Error sending email', error.message);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={styles.form}>
|
||||
<Text style={styles.label}>You are going to send the following info:</Text>
|
||||
<Text style={styles.messageInfo}>{message}</Text>
|
||||
|
||||
<Button title="Send via Email" onPress={sendMessageWithEmail} />
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
form: {
|
||||
padding: 30,
|
||||
marginTop: 60,
|
||||
},
|
||||
label: {
|
||||
fontSize: 18,
|
||||
marginBottom: 30,
|
||||
textAlign: 'center',
|
||||
},
|
||||
messageInfo: {
|
||||
fontSize: 16,
|
||||
marginBottom: 15,
|
||||
textAlign: 'center',
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
});
|
||||
|
||||
export default SendEmail;
|
||||
@@ -0,0 +1,64 @@
|
||||
import React, { useState } from 'react';
|
||||
import { View, Text, StyleSheet, Button } from 'react-native';
|
||||
import * as SMS from 'expo-sms';
|
||||
|
||||
const SendSMS = () => {
|
||||
const [message, setMessage] = useState('Levi McLean\n123 Main St\nLondon, ON\n(555) 555-5555\naidanmclean111@gmail.com');
|
||||
|
||||
const sendMessageWithSMS = async () => {
|
||||
const isAvailable = await SMS.isAvailableAsync();
|
||||
if (isAvailable) {
|
||||
const recipients = ['+15195351398']; // Replace with the recipient's phone number
|
||||
const options = {
|
||||
recipients: recipients,
|
||||
message: message,
|
||||
};
|
||||
await SMS.sendSMSAsync(options.recipients, options.message)
|
||||
.then((result) => {
|
||||
if (result.result === 'sent') {
|
||||
Alert.alert('SMS sent successfully');
|
||||
} else {
|
||||
Alert.alert('Failed to send SMS');
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
Alert.alert('Error sending SMS');
|
||||
});
|
||||
} else {
|
||||
Alert.alert('SMS is not available on this device');
|
||||
};
|
||||
};
|
||||
|
||||
const onChangeHandler = (value) => {
|
||||
setMessage(value);
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={styles.form}>
|
||||
<Text style={styles.label}>You are going to send the following info:</Text>
|
||||
<Text style={styles.messageInfo}>{message}</Text>
|
||||
|
||||
<Button title="Send via SMS" onPress={sendMessageWithSMS} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
form: {
|
||||
padding: 30,
|
||||
marginTop: 60,
|
||||
},
|
||||
label: {
|
||||
fontSize: 18,
|
||||
marginBottom: 30,
|
||||
textAlign: 'center',
|
||||
},
|
||||
messageInfo: {
|
||||
fontSize: 16,
|
||||
marginBottom: 15,
|
||||
textAlign: 'center',
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
});
|
||||
|
||||
export default SendSMS;
|
||||