How to have an iOS Phonegap app send data to Google Spreadsheet? - php

After having spent several hours looking into the matter and searched for a solution, I'm hoping someone out here can help me out and give me some hints.
My project, in a nutshell, is this:
Using Phonegap/Cordova, I want to create a one page iPad "form" app from which the submitted data should eventually get to a Google Spreadsheet.
The idea is for a hair dresser who would like to log his employees transactions: [Employee name], [Male/Female/Child haircut], [multiple choice "options": Shampoo, etc], [Amount charged], [Visa/Mastercard / Check / Cash]
I've looked into several "solutions":
Email the form, then use a Google Script + RegEx to grab the data and populate the sheet. (This sounds ugly, no?)
Submit the data to a .php webservice (forgive me if I'm using the wrong terminology!) to populate a database stored on my VPS (MySQL?), then use a Google Script to fetch the data a regular intervals to populate the sheet.
Submit the data to Parse and, again, use Google Script or a parse.com API if they have any.
Here's a very rough draft of what the app would look like (it doesn't need to be fancy)
Sketch of the concept
Any hint would be much appreciated!
Thanks in advance...

Related

Display data in android listpopupwindow on edittext click using mysql php

After doing lots of brain storming i endedup doing it hard coding ,Actually what my program does is on clicking on the edit text a listpopupwindows shows with hard coded array list such as friends name.Now what i want is i want to retrieve the my friends name from mysql database table and show the same in listpopupwindow.Actually i m getting the data from rest client api(php) using volley as network library and String request but the problem is cannot able to display it on listpopupwindow once i clicked on edittext..Dont know how to do it,tried a lots searching.Any sample code?
Yes, First you need a JSON/REST API ( may be any kind of API your choice ). There after using any Http client to get the list and populate to the list this tutorial is help to you much enter link description here

PHP get Google spreadsheet data with authentication (additional: send row data to google doc)

I'm currently developing a php page that will get spreadsheet data and display it in a datatable. I have done so by publishing my spreadsheet and getting the JSON object through spreadsheet url/key.
I have been successful in doing so :
Now, I have been requested an enhancement, I need to change the functionality of the 'print pdf' button to actually get the row data and create and populate a google doc. I'm thinking that I would need authentication for that and the implementation of accessing the google spreadsheet would change. Could anyone give me a nice example cause I am fairly new with google api and php in general.
I tried to read samples from developer.google but I'm having trouble understanding them.
Thanks a lot!

IOS app to upload data to database using php

Im creating an app where the user inputs match events in a rugby game and the player who done it. e.g. pass,wing or try,scrumhalf. This information needs to be uploaded to an external database for the website to have access to it.
I don't want every time the user clicks an event for it to upload it to the database. I want them to do a whole match with it somehow storing it on the ipad. The user then clicks an upload button and all the events get uploaded to php which then inserts them into the database.
How is the best way to go about this?
I've tried everything and not sure.
Suggestions and example code would really be appreciated.
Thanks
Sounds like your app should /may do a 'simple' call to a REST-API.
You should find a lot of examples for that. For networking you should find a more comfortable lib at cocoapods.

Using Google Plus API to store stream data in MYSQL database

I've been playing with the Google+ API PHP starterkit. My ultimate goal is to run a cron job on my server that uses the Google+ API to grab the activity data, then store it in a MYSQL database-- where I can then dynamically update a twitter-like feed on a website.
Is this a possible/practical way of mining a Google+ profile's public stream? If not, what do you suggest as a good alternative?
Sounds like a good way to me.
One thing you have to keep in mind though is that there is no easy way to check if an activity has been deleted after you have added it to your database. You would have to check with $plus->activities->get($activityId) for each of the activities you want to display to see if it still exists (unless of course you don't mind them appearing on your website).
Apart from that your solution will work fine.

Gears and Mysql sync

I am making an offline website that needs to sync every night with a server. Our employees work outside and sometimes underground and need to access the site for its database. But once home they must send us their findings.
The first time they connect, I check with google gears if they have the sqlite database and if not I run a script to insert it. Once they have it, I sync their next appointments to their local database.
When they are done, the next day, they connect to send us every thing and to download their new appointments.
For now i was able to create the sqllite database and insert new values inside thanks to google gears. But i haven t found a way to read the database with php to sync it with our online database.
To go from online to off, with PHP I can write an array in a hidden field and then read that field with JavaScript. But in the other way i was wondering if there was on other way then creating a form with DOM and submitting it in JavaScript to read the values with PHP?
I need to sync a Lot of values, do you know if there is an easier way?
Thanks for your help
I have found vortex, a powerfull script for gear that helps sync everything from files to data. It will definitely help me.
Here is the link to the developer's blog. The download link is in there.
I will come back when the website works to help the interested.
You should use Ajax for posting your new data to the PHP server.
You could use jquery (or any other framework), their lootle of resources how to post data to php on the web.
Your webpage could have a button hidden when offline, this button would enable user to start a synchronization.
Here a tutorial from PHP and jquery!

Categories