Write a PHP MySQL AppGini Function

Closed

Description

I have a MySQL database application already in place. Application was built with AppGini

The 2 tables and fields relevant to this project are:

client_id with the fields: status, last_sale, id

sales with the fields; customer (contains [url removed, login to view]), date, time, sale (amount), comments, id

I need to add a function in [url removed, login to view] to update the client_id table when a sales record is added/updated in the sales table. I will call the function in the sales hooks file.

First, the function needs to update the last_sale field (last sale field data formatted to the month, year, and amount of this sales record, as in May 2012 $450 from the sales table)

Then second, to check if [url removed, login to view] is not == "active", then set Status field to Active. I say if status is not == Active because we also have a status of stale. I will be setting the status to stale if a customer has not purchased for 1 year, but if a stale(or any other status) customer makes a new sale, I want to change them to active too.

Info from AppGini website.

tablename_after_update()

Called after executing the update query and before executing the ownership update query. If you open the generated hooks/[url removed, login to view] file in a text editor (where tablename is the name of the concerned table), you can see this function defined as follows:

function tablename_after_update($data, $memberInfo, &$args){

return TRUE;

}

Parameters:

$data is an associative array where the keys are field names and the values are the field data values that were inserted into the new record. It also includes the item $data['selectedID'] which stores the value of the primary key for the new record.

$memberInfo is an array containing details of the member who signed in. Please refer to memberInfo for more details.

$args is currently not used but is reserved for future uses.

Thanks and I hope this is enough info for now.

Skills: MySQL, PHP

See more: appgini, write names, need to write a project, mysql database application, customer database php mysql, value stores, key value stores, write query, update status php mysql, php file array, mysql editor, mysql comments, php text array, php add record mysql table, php table array, mysql add record, table month php, mysql function update, call function, mysql inserted, mysql update field, mysql update values, php file write array, update values mysql, mysql update function

Project ID: #4597880

Awarded to:

pmurugan

Hi, I am very good in web application development life cycle.

$66 CAD in 3 days
(3 Reviews)
2.5

11 freelancers are bidding on average $161 for this job

kabirchy

Hi, I can help you get this done. Thanks

$144 CAD in 3 days
(753 Reviews)
8.2
rajeshsonisl

Quality work assured. Ready to get started. Thanks.

$333 CAD in 2 days
(382 Reviews)
7.0
kssoftphp

I am ready and expert in PHP and MySQL.

$147 CAD in 5 days
(50 Reviews)
6.6
linuxfreak1985

Hi there, We are experts in PHP Open Source (any kind of PHP/MySQL work),wordpress and Ajax/Web 2.0 technology. Some of the projects we completed for php are mentioned below https://www.freelancer.com/projects/ More

$309 CAD in 5 days
(89 Reviews)
6.2
scriptphp87

Hello Please read more than private message thank you

$139 CAD in 3 days
(59 Reviews)
5.9
Eliteprog

Hi, First of all thanks for posting this project, I am available to provide you economical services for web development , I have read and understood all of project details. I am expert in software development and c More

$155 CAD in 5 days
(21 Reviews)
5.0
chienthuatxd

I can do your project, please pm for me. Thanks

$80 CAD in 1 day
(29 Reviews)
4.7
Tulear

Software Engineer with 13 years of experience, having passed the PHP and Javascript exams, I have enough skills to complete this project. Please check inside my profile page "How I Made my Former Employers Happy". More

$144 CAD in 3 days
(14 Reviews)
4.2
ChMeier

Good afternoon sir, Your project sounds doable within a day, please check PM for more details. Sincerely. -Christian Meier

$120 CAD in 2 days
(4 Reviews)
3.3
jmagrinya

Hi, requirements understood. ready to go.

$135 CAD in 2 days
(0 Reviews)
0.0