This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `users` ( | |
`user_id` int(5) NOT NULL AUTO_INCREMENT, | |
`gcm_id` text NOT NULL, | |
`email` varchar(40) NOT NULL, | |
`phone` varchar(15) NOT NULL, | |
`password` varchar(40) NOT NULL, | |
`fname` varchar(20) NOT NULL, | |
`lname` varchar(20) NOT NULL, | |
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`user_id`), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/* implements signup and login of users */ | |
class Users_model extends CI_Model { | |
//To implement user signup | |
public function signup_user($data){ | |
$signup['email'] = trim(mysql_real_escape_string($data['email'])); | |
$signup['fname'] = trim(mysql_real_escape_string($data['fname'])); | |
$signup['lname'] = trim(mysql_real_escape_string($data['lname'])); | |
$signup['phone'] = trim(mysql_real_escape_string($data['phone'])); | |
$signup['password'] = md5($data['password']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/***************************************************************************************************************** | |
* Signup details are recieved and sent to users_model from here. | |
* Signup results are recieved and actions are triggered from this controller. | |
* Validation status codes: when success = 1, Signup succeeds | |
*****************************************************************************************************************/ | |
class Signup extends CI_Controller { | |
public function auth() | |
{ | |
$data = $this->input->post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.components; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.text.Html; | |
import android.view.View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void takePhoto() { | |
mCameraSource.takePicture(null, new CameraSource.PictureCallback() { | |
@Override | |
public void onPictureTaken(byte[] bytes) { | |
try { | |
File basePath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "vstyle"); | |
if (!basePath.exists()) { | |
Log.d("CAPTURE_BASE_PATH", basePath.mkdirs() ? "Success": "Failed"); | |
} | |
File captureFile = new File(basePath + "photo_" + (new Date().getTime()) + ".jpg"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FileUtils | |
{ | |
/// <summary> | |
/// Saves file into a local directory and returns the path + file name as string | |
/// </summary> | |
/// <param name="file">File</param> | |
/// <param name="filePath"></param> | |
/// <param name="fileName"></param> | |
/// <param name="saveLocal"></param> | |
/// <returns></returns> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mCameraSource.takePicture(null, new CameraSource.PictureCallback() { | |
@Override | |
public void onPictureTaken(byte[] bytes) { | |
try { | |
File basePath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath()); | |
if (!basePath.exists()) { | |
Log.d("CAPTURE_BASE_PATH", basePath.mkdirs() ? "Success" : "Failed"); | |
} | |
File captureFile = new File(basePath + File.separator + "vstyle_photo_" + (new Date().getTime()) + ".jpg"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetchBill = () => { | |
const api = "https://randomapi.com/api/006b08a801d82d0c9824dcfdfdfa3b3c" | |
fetch(api).then((response) => { | |
if (reponse.status !== 200) { | |
console.log("Error" + response.status) | |
return; | |
} | |
return response.json() | |
}).then((data) => { |