Go Back   SPBAS Business Automation Software - Community Forums > Discussion > Programming Discussion

Reply
 
Thread Tools
Old 09-18-2009, 02:30 PM   #11
shketuljko
Junior Member
 
Join Date: Jun 2009
Posts: 10
Default


Also I need to finish bridge for Vivvo (between Vivvo CMS and SPBAS) so I think I will need your help again
shketuljko is offline   Reply With Quote
Old 09-18-2009, 02:34 PM   #12
Rockwell
Owner / Founder
 
Rockwell's Avatar
 
Join Date: Mar 2004
Location: Wilmington, NC
Posts: 1,485
Send a message via AIM to Rockwell
Default

I'm will document the local api too so it's easier to tap into SPBAS from via the rest api. So let me know what you need and if at all possible I'll be glad to help.
__________________
Thanks,
Andy Rockwell
SolidPHP, Inc.
Rockwell is offline   Reply With Quote
Old 09-18-2009, 02:41 PM   #13
shketuljko
Junior Member
 
Join Date: Jun 2009
Posts: 10
Default

I need to review old plug-in so after that I will tell you In a few days I will write on this thread again.
shketuljko is offline   Reply With Quote
Old 11-20-2009, 06:47 AM   #14
shketuljko
Junior Member
 
Join Date: Jun 2009
Posts: 10
Default

A few days ... A few weeks ..

I have a question for you @Rockwell

In older system I had information about upgrades and supports
Now i have this:

Code:
Array
(
    [licenses] => Array
        (
            [0] => Array
                (
                    [id] => 6085
                    [license_key] => Professional-xxxxxxxxxx
                    [method_id] => 2
                    [licensing_type_id] => 4
                    [customer_id] => 3716
                    [package_id] => 5842
                    [product_id] => 3
                    [sku_id] => 3
                    [reissue_count] => 0
                    [license_type_revision] => 1253173719
                    [notes] => 
                    [status] => Active
                    [expires] => Never
                    [local_expires] => 0
                    [activated] => 1248337515
                    [created] => 1248337515
                    [license_logs] => Array
                        (
                            [0] => 
                        )

                )

        )

    [errors] => Array
        (
        )

)
How can I see those information?
Or ... How can I have information if license has support or upgrade or not? maybe it's better ...
shketuljko is offline   Reply With Quote
Old 11-20-2009, 09:01 AM   #15
shketuljko
Junior Member
 
Join Date: Jun 2009
Posts: 10
Default

I just wrote some piece of code. Andy what do you think about this:

Code:
# <?PHP @api::ran_directly();  
#   
# // NOTE: $errors has already been set to an empty array().  
#   
# // validate the incoming API key  
# if (!mod::validate_api_key(x('api_key'))) { $errors[]='Invalid API Key'; }  
#   
# if (empty($errors))  
#     {  
#     // do we have a value posted on the key email?  
#     if (!x('email'))   
#         {   
#         $errors[]='Missing the target e-mail address.';   
#         }  
#     }  
#   
# if (empty($errors))  
#     {  
#     // $buffer is a stream, attach things to it that are to  
#     // be returned by the API, like licenses in this case.  
#     $buffer['licenses']=array();  
#   
#     // get all licenses for a customer based on the e-mail address sent in  
#     $query=mysql_query("SELECT `m3_licenses` . *  
#     FROM `m3_licenses` , `m3_users` , `m3_customers` , `m3_customers_jusers`  
#     WHERE `m3_users`.`email` = '".a(x('email'))."'  
#     AND `m3_users`.`id` = `m3_customers_jusers`.`user_id`  
#     AND `m3_customers_jusers`.`customer_id` = `m3_customers`.`id`  
#     AND `m3_licenses`.`customer_id` = `m3_customers_jusers`.`customer_id`  
#     ORDER BY `m3_users`.`email` ASC");  
#     while ($rs=mysql_fetch_assoc($query))  
#         {  
#         // were the logs requested too?  
#         if (x('include_logs'))  
#             {  
#             $rs['license_logs']=array();  
#             $query2=mysql_query("SELECT *  
#             FROM `m3_license_log`  
#             WHERE `license_key` = '".a(x('email'))."'  
#             ORDER BY created ASC");  
#             while ($rs2=mysql_fetch_assoc($query2))  
#                 {  
#                 $rs['license_logs'][]=$rs2;  
#                 }  
#             }

             $query3=mysql_query("SELECT *  
				FROM `m3_customer_support_packages`
				WHERE `customer_id` = '".$rs['customer_id']."'
				AND	 `package_id`  = '".$rs['package_id']."'
				AND `product_id`  = '".$rs['product_id']."'"); 
             while ($rs3=mysql_fetch_assoc($query3))  
             {  
                          $rs['support'][]=$rs3;  
             }

#   
#         $buffer['licenses'][]=$rs;  
#         }  
#     }  
# ?>
shketuljko is offline   Reply With Quote
Old 11-20-2009, 09:04 AM   #16
Rockwell
Owner / Founder
 
Rockwell's Avatar
 
Join Date: Mar 2004
Location: Wilmington, NC
Posts: 1,485
Send a message via AIM to Rockwell
Default

PHP Code:
             $query3=mysql_query("SELECT *  
                FROM `m3_customer_support_packages`
                WHERE `customer_id` = '"
.$rs['customer_id']."'
                AND     `package_id`  = '"
.$rs['package_id']."'
                AND `product_id`  = '"
.$rs['product_id']."'"); 
             while (
$rs3=mysql_fetch_assoc($query3))  
             {  
                          
$rs['support'][]=$rs3;  
             } 
Looks great! That should bring back the info you need. Nice work
__________________
Thanks,
Andy Rockwell
SolidPHP, Inc.
Rockwell is offline   Reply With Quote
Old 11-20-2009, 09:05 AM   #17
shketuljko
Junior Member
 
Join Date: Jun 2009
Posts: 10
Default

Heheheh

I can't find upgrade section ... or it's the same?
shketuljko is offline   Reply With Quote
Old 11-20-2009, 09:22 AM   #18
Rockwell
Owner / Founder
 
Rockwell's Avatar
 
Join Date: Mar 2004
Location: Wilmington, NC
Posts: 1,485
Send a message via AIM to Rockwell
Default

It's in the table `m3_customer_download_control`.
__________________
Thanks,
Andy Rockwell
SolidPHP, Inc.
Rockwell is offline   Reply With Quote
Old 11-20-2009, 09:41 AM   #19
shketuljko
Junior Member
 
Join Date: Jun 2009
Posts: 10
Default

Nice

You can add this in your API:
http://solidphp.com/docs/index.php?t...category_id=10


Code:
 $query3=mysql_query("SELECT *  
                FROM `m3_customer_download_control`
                WHERE `customer_id` = '".$rs['customer_id']."'
                AND     `package_id`  = '".$rs['package_id']."'
                AND `product_id`  = '".$rs['product_id']."'"); 
             while ($rs3=mysql_fetch_assoc($query3))  
             {  
                          $rs['upgrade'][]=$rs3;  
             }
I think it will be helpful for other customers.
Anyhow, thanks and have a nice day or night or whatever
shketuljko is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
vBulletin Style by: vbskinpixel.com
© Copyright 2008 SolidPHP, Inc.