<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://3.19.219.109/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Steven.Mueller</id>
		<title>WHMCS Documentation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://3.19.219.109/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Steven.Mueller"/>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/Special:Contributions/Steven.Mueller"/>
		<updated>2026-04-03T22:01:11Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>http://3.19.219.109/index.php?title=Further_Security_Steps&amp;diff=19182</id>
		<title>Further Security Steps</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Further_Security_Steps&amp;diff=19182"/>
				<updated>2016-06-21T20:03:22Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WHMCS has many features built-in to help keep your data safe, but here are several simple extra steps you can take to secure your WHMCS installation even further.&lt;br /&gt;
&lt;br /&gt;
==Secure the Writeable Directories==&lt;br /&gt;
&lt;br /&gt;
We recommend moving all writeable directories to a non-public directory above your web root to prevent web based access.  There are three writeable directories required for WHMCS to function, they are: &amp;quot;attachments&amp;quot;, &amp;quot;downloads&amp;quot; and &amp;quot;templates_c&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;We recommend moving all writeable directories to a non-public location above your web root to prevent web based access.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you move the directories, you need to provide WHMCS with the new paths to use them.  You do this by adding (or updating if they already exist) the following lines in the ''configuration.php'' file within the root WHMCS directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$attachments_dir = &amp;quot;/home/username/attachments/&amp;quot;;&lt;br /&gt;
$downloads_dir = &amp;quot;/home/username/downloads/&amp;quot;;&lt;br /&gt;
$templates_compiledir = &amp;quot;/home/username/templates_c/&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;quot;username&amp;quot; is the cPanel username and so the 3 folders are located in the home directory, above public_html.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;Note that if you are running suPHP or phpSuExec chmod 755 should be sufficient permissions to make the directories writeable as this is the highest permission available for both folders and files when running in that condition.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Secure the `configuration.php` File==&lt;br /&gt;
&lt;br /&gt;
We recommend adjusting the permissions set for the &amp;quot;configuration.php&amp;quot; file located in your WHMCS root directory.  This file contains sensitive data that cannot be recovered without a backup of the file.  To avoid accidentally overwriting, editing or deleting the file, change the permission setting of this file to `400`.  This provides read only access to the file by the system and prevents anyone else from reading, editing or executing the file.&lt;br /&gt;
&lt;br /&gt;
To change the permissions on this file, you can run the following command from shell while in your WHMCS root directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 400 configuration.php&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;title&amp;quot;&amp;gt;Attention!&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Some systems may require you to set the permission to 440 or 444 depending on how the server is configured.  For most, 400 should suffice, but if you encounter an error loading the application after setting the permission to 400, try 440 and then 444.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;title&amp;quot;&amp;gt;License Key Updates&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Should you need to ever update your license key, you must set the permissions on this file to 755 to allow the system to edit the file.  Once the key is updated, you can revert the permissions to 400.&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Move the Crons Directory==&lt;br /&gt;
&lt;br /&gt;
{{:Custom Crons Directory}}&lt;br /&gt;
&lt;br /&gt;
==Restrict Access by IP==&lt;br /&gt;
&lt;br /&gt;
For increased protection, if your staff use fixed IP addresses, you can add even more protection to your admin area by restricting access to a specific set of IPs.  This is done by creating a file with the name .htaccess within your WHMCS admin directory, with the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
order deny,allow&lt;br /&gt;
allow from 12.34.5.67&lt;br /&gt;
allow from 98.76.54.32&lt;br /&gt;
deny from all&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can specify as many different '''allow from''' lines as you require.  Or you can even allow entire IP subnet's by specifying just the first part of an IP, for example: &amp;quot;12.34.&amp;quot;.  This is called Htaccess IP Restriction.&lt;br /&gt;
&lt;br /&gt;
==Change your WHMCS Admin Folder Name==&lt;br /&gt;
&lt;br /&gt;
Customising the url of your WHMCS admin area makes it harder for boths and malicious users to find it.  It is not required, but if you wish to do so, find out how here: [[Customising the Admin Directory]]&lt;br /&gt;
&lt;br /&gt;
==Restrict Database Privileges==&lt;br /&gt;
For day to day use, only the following database privileges are required. All others may be disabled.&lt;br /&gt;
&lt;br /&gt;
*DELETE&lt;br /&gt;
*INSERT&lt;br /&gt;
*SELECT&lt;br /&gt;
*UPDATE&lt;br /&gt;
*LOCK TABLES&lt;br /&gt;
&lt;br /&gt;
Please note that installation, upgrading, activating, and deactivating modules require the following additional privileges.&lt;br /&gt;
&lt;br /&gt;
*ALTER&lt;br /&gt;
*CREATE&lt;br /&gt;
*DROP&lt;br /&gt;
*INDEX&lt;br /&gt;
&lt;br /&gt;
[[Installation|&amp;lt;&amp;lt; Back to Installation Overview]]&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=CentovaCast&amp;diff=19018</id>
		<title>CentovaCast</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=CentovaCast&amp;diff=19018"/>
				<updated>2016-05-24T16:35:36Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* Common Error Codes */ DOCS-6466: Broken Link on CentovaCast server&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Provisioning_Module&lt;br /&gt;
| changepw = Yes&lt;br /&gt;
| clientarealink = Yes&lt;br /&gt;
| additional = Start, Stop and Restart Stream}}&lt;br /&gt;
Centova Cast is an internet radio stream hosting control panel. To find out more about it, please refer to http://www.centova.com/pages/cast/&lt;br /&gt;
&lt;br /&gt;
The guides below explain how to setup and utilise the Centova Cast integration with WHMCS.&lt;br /&gt;
&lt;br /&gt;
==Setting Up a CentovaCast Product==&lt;br /&gt;
&lt;br /&gt;
#Login to WHMCS, go to Setup, and then click Manage Servers. Then, click Add New Server.&lt;br /&gt;
#On the Add New Server page, fill out the following fields:&lt;br /&gt;
&lt;br /&gt;
 Name - Set this to the hostname of the machine on which Centova Cast is running.&lt;br /&gt;
 &lt;br /&gt;
 IP Address: Set this to the IP address of the machine on which Centova Cast is running.&lt;br /&gt;
 &lt;br /&gt;
 Hostname: Enter the complete URL to your Centova Cast installation, for example:&lt;br /&gt;
      http://centovacast.yourdomain.com/cast/&lt;br /&gt;
 &lt;br /&gt;
 Type: Select Centovacast from the list.&lt;br /&gt;
 &lt;br /&gt;
 Username: Set this to: admin&lt;br /&gt;
 &lt;br /&gt;
 Password: Enter your Centova Cast administrator password.&lt;br /&gt;
 &lt;br /&gt;
 All other fields can be ignored. When finished, click Create Server.&lt;br /&gt;
&lt;br /&gt;
#Next, go to Setup, and then click Products/Services. Then, click Create a New Product.&lt;br /&gt;
#Select Shared Hosting Account and select a suitable product group and name. Then, click Continue.&lt;br /&gt;
#On the Module Settings tab, fill out the following fields:&lt;br /&gt;
&lt;br /&gt;
 Module Name - Select &amp;quot;Centovacast&amp;quot; from the list.&lt;br /&gt;
 &lt;br /&gt;
 Account template name - Enter the name of the Centova Cast account template to use for this&lt;br /&gt;
 package. You can create your account templates in Centova Cast by clicking “Account Templates”&lt;br /&gt;
 This feature allows you to predefine completely custom configurations for each package.&lt;br /&gt;
 &lt;br /&gt;
 Max listeners - Specify the maximum number simultaneous listeners for this stream. You may&lt;br /&gt;
 optionally leave this blank to use the value specified in the account template.&lt;br /&gt;
 &lt;br /&gt;
 Max bit rate - Specify the maximum bit rate (in kbps) for this stream. You may optionally&lt;br /&gt;
 leave this blank to use the value specified in the account template.&lt;br /&gt;
 *Data transfer limit - Specify the monthly data transfer limit for this stream. You may&lt;br /&gt;
 optionally leave this blank to use the value specified in the account template.&lt;br /&gt;
 &lt;br /&gt;
 Disk quota - Specify the disk quota for this stream (which must be large enough to&lt;br /&gt;
 accommodate all of this server's configuration files, log files, and any media uploaded for&lt;br /&gt;
 the autoDJ). You may optionally leave this blank to use the value specified in the account&lt;br /&gt;
 template.&lt;br /&gt;
 &lt;br /&gt;
 Start server - Set this to “yes” to automatically start the server after provisioning, or&lt;br /&gt;
 “no” if you want the user to start it manually before using it. Note that this only applies&lt;br /&gt;
 to non-autoDJ streams; if an autoDJ is enabled, it cannot be started until media is uploaded.&lt;br /&gt;
&lt;br /&gt;
#This step is optional. If you would like to allow your users to “build their own” packages, and have WHMCS to prompt the user for various stream limit options (bit rate, data transfer limit, etc.) and be able to set custom pricing for each option, click the Configurable Options tab.&lt;br /&gt;
#Next, click the the Add New Configurable Option link, and follow the directions to create one of the following options. Note that in all cases, the “Option Name” field is case-sensitive and must precisely match what is shown below or the option will not be recognized by Centova Cast.&lt;br /&gt;
&lt;br /&gt;
 Max listeners - This allows the user to specify a custom listener limit. Enter Max listeners&lt;br /&gt;
 in the Option Name field to begin. Next, in the Add Option field, enter the number of&lt;br /&gt;
 listeners, then enter the extra fee for this number of listeners, and click Save Changes.&lt;br /&gt;
 Repeat this process for each listener limit you wish to offer.&lt;br /&gt;
 &lt;br /&gt;
 Max bit rate - This allows the user to specify a custom maximum bit rate (in kbps). Enter Max&lt;br /&gt;
 bit rate in the Option Name field to begin. Next, in the Add Option field, enter the bit rate,&lt;br /&gt;
 then enter the extra fee for this bit rate, and click Save Changes. Repeat this process for&lt;br /&gt;
 each bit rate you wish to offer. Note that Centova Cast treats this as a numeric value in&lt;br /&gt;
 kbps, and will strip any non-numeric characters out of this value before attempting to use it.&lt;br /&gt;
 &lt;br /&gt;
 Data transfer limit - This allows the user to specify a custom data transfer limit (in MB per&lt;br /&gt;
 month). Enter Data transfer limit in the Option Name field to begin. Next, in the Add Option&lt;br /&gt;
 field, enter the limit (in MB), then enter the extra fee for this limit, and click Save&lt;br /&gt;
 Changes. Repeat this process for each limit you wish to offer. Note that Centova Cast treats&lt;br /&gt;
 this as a numeric value in megabytes, and will strip any non-numeric characters out of this&lt;br /&gt;
 value before attempting to use it.&lt;br /&gt;
 &lt;br /&gt;
 Disk quota - This allows the user to specify a custom disk quota (in MB). Enter Disk quota&lt;br /&gt;
 in the Option Name field to begin. Next, in the Add Option field, enter the quota (in MB),&lt;br /&gt;
 then enter the extra fee for this quota, and click Save Changes. Repeat this process for each&lt;br /&gt;
 quota you wish to offer. Note that Centova Cast treats this as a numeric value in megabytes,&lt;br /&gt;
 and will strip any non-numeric characters out of this value before attempting to use it.&lt;br /&gt;
&lt;br /&gt;
#All other fields should be filled out in the usual manner, as when creating any other WHMCS product. When finished, click Save Changes to create your product.&lt;br /&gt;
&lt;br /&gt;
The Centova Cast module is now ready to use, and will function like any other built-in WHMCS module (CPanel, Plesk, etc.)&lt;br /&gt;
&lt;br /&gt;
==Common Error Codes==&lt;br /&gt;
&lt;br /&gt;
* '''Unsupported protocol:''' - this indicates you have an incorrect value for hostname field in the server setup. Double check to ensure you have entered the full URL to Centova Cast as instructed in the steps above.&lt;br /&gt;
&lt;br /&gt;
* '''Invalid source/server type:''' - this indicates you haven't entered an account template name in the products module settings, or that the name entered is invalid and not found within the Centova Cast system.&lt;br /&gt;
&lt;br /&gt;
For further assistance, Centova's documentation is available @ http://www.centova.com/docs/cast/centovacast_install.pdf&lt;br /&gt;
{{modules}}&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Products_and_Services&amp;diff=19014</id>
		<title>Products and Services</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Products_and_Services&amp;diff=19014"/>
				<updated>2016-05-24T15:45:53Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* Pricing Tab */ DOCS-6455: Clarify how to populate the Termination Email field in the Pricing Tab&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Products are configured via the '''Setup &amp;gt; Products/Services &amp;gt; Products/Services''' page&lt;br /&gt;
&lt;br /&gt;
Basic instructions for creating your first product group and product can be found under [[Setting Up Your First Product]]. This page explains all the advanced options available, including hiding products, stock control and upgrades.&lt;br /&gt;
&lt;br /&gt;
[[File:Videotutorial.png‎|center|link=http://www.youtube.com/watch?v=0lqzsTSUGw0&amp;amp;hd=1|Watch Video Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Product Groups==&lt;br /&gt;
Products are organised on the order form by group, as each group has a separate page, this means products can be split into categories or across several pages for ease of display. For example you may wish to list your shared hosting plans on a separate page to the reseller plans. Clients can switch between groups on the order form or you can link to them directly (see [[#Links Tab]]).&lt;br /&gt;
&lt;br /&gt;
*To create a product group click the '''Create a New Group''' link&lt;br /&gt;
*Enter a name for the group - this will be displayed on the order form&lt;br /&gt;
* Under normal circumstances all product groups will use the system default order form template specified in the general settings. However if you wish to use a different template for just this group, select it from the '''Order Form Template''' option here.&amp;lt;br/&amp;gt;'''N.B.''' Any order form template selected here cannot be overwritten by the carttpl variable in the link URL.&lt;br /&gt;
*Use the tick boxes to select which ''payment gateways'' will be offered on the checkout page to pay for products within this group.&lt;br /&gt;
*To hide this group from the order form tick the ''Hidden'' checkbox&lt;br /&gt;
*Click ''Create Group''. To edit the group at a later date click the corresponding Edit icon on the Products/Services page.&lt;br /&gt;
&lt;br /&gt;
==Products==&lt;br /&gt;
To create a product click the '''Create a New Product''' link and you will see these three options:&lt;br /&gt;
* '''Product Type''' -  There are 4 options to choose from and used to determine only how WHMCS should handle it. This is only for system use - you use the groups to divide products into categories for your own use.&lt;br /&gt;
**Shared Hosting - for web hosting accounts&lt;br /&gt;
**Reseller Hosting - for web hosting reseller accounts&lt;br /&gt;
**Dedicated/VPS Server - for servers and displays server hostname, ns &amp;amp; root pw fields on signup&lt;br /&gt;
**Other - for anything else&lt;br /&gt;
*'''Product Group''' - The group the product belongs to for display on the order form&lt;br /&gt;
*'''Product Name''' - The name to display to customers and throughout the admin area&lt;br /&gt;
Once created the following options will be available for configuration. To edit a product at a later date click the corresponding Edit icon on the Products/Services page.&lt;br /&gt;
&lt;br /&gt;
==Group and Product Sorting==&lt;br /&gt;
&lt;br /&gt;
Groups and Products are sortable using the crosshair icon on the appropriate row. This is on the left for Groups and the right for Products.&lt;br /&gt;
&lt;br /&gt;
[[File:Drag_and_drop_sorting.png|center|850x250px]]&lt;br /&gt;
&lt;br /&gt;
After moving, a success message will appear on the top right of the page to show the sort order has saved.&lt;br /&gt;
&lt;br /&gt;
[[File:Product_drag_and_drop_success.png]]&lt;br /&gt;
&lt;br /&gt;
It is not possible to move products between groups using the drag and drop method.&lt;br /&gt;
===Details Tab===&lt;br /&gt;
This is the first tab you see and contains general information about a product including its name and product group.&lt;br /&gt;
&lt;br /&gt;
* '''Product Type''', '''Product Group''' and '''Product Name''' - See above [[#Products]]&lt;br /&gt;
*'''Product Description''' - The detailed information displayed on the order form relating to this product&lt;br /&gt;
*'''Welcome Email''' - The email template to send when the product is activated. You can create custom email templates to use on different products - see [[Email Templates]] for more info.&lt;br /&gt;
*'''Require Domain''' - To show the domain registration options on ordering. Should always be enabled for hosting and disabled for any other products that don't require a domain name.&lt;br /&gt;
*'''Stock Control''' - Can be used if you have a specific quantity of an item available (for example servers) or a limited special offer product - tick to enable and enter a quantity remaining and WHMCS will stop orders when it reaches zero. When a stock controlled item is cancelled (either by cancellation request or clicking &amp;quot;Cancel Order&amp;quot; on an order) the stock level will automatically increase. However if a member of staff manually changes the product to cancelled or terminated status it will not re-add stock to the product.&lt;br /&gt;
*'''Sort Order''' -  Can be set to a number to overide the default product ordering of alphabetical names. A product with sort order of 0 will appear in the list first, 1 will be beneath that, 2 beneath that etc..&lt;br /&gt;
*'''Apply Tax''' - Tick if tax rules should be applied to this product. For more information refer to [[Tax/VAT Rules]].&lt;br /&gt;
*'''Hidden''' - Tick to not show the product on the order form - can still be ordered using the direct order links&lt;br /&gt;
*'''Retire''' -  When ticked the product is hidden from admin area lists, such as the Products/Services dropdown in the client's Products/Services tab.&lt;br /&gt;
&lt;br /&gt;
===Pricing Tab===&lt;br /&gt;
This second tab is where the prices and length of the product are specified.&lt;br /&gt;
[[File:Price grid.png|thumb|Price Grid]]&lt;br /&gt;
*'''Payment Types''' - consists of Free, One Time &amp;amp; Recurring options&lt;br /&gt;
*When One Time or Recurring payment types are selected, the '''pricing grid''' will appear for entry of the product price. Enable each billing cycle by ticking the corresponding '''Enable''' checkbox.&lt;br /&gt;
**For Free products the grid will not appear as one cannot specify a price for a free product.&lt;br /&gt;
**For One Time products, enable the One Time/Monthly column and enter your prices into that column.&lt;br /&gt;
**For Recurring pricing types there are several billing cycles to choose from depending on how often you want clients to be billed. You can enable as many or as few as you like.&lt;br /&gt;
**The '''setup fee''' in each column allows you to specify different setup fees depending on the cycle chosen, for example you may charge setup fees on monthly cycles and offer free setup if paid annually&lt;br /&gt;
**If you do not wish to offer a particular billing cycle, UNtick the Enable checkbox to '''disable''' it. In this screenshot the product will only be available monthly or annually with no setup fee.&lt;br /&gt;
*'''Allow Multiple Quantities''' - When enabled this option allows clients to choose the quantity of this product they wish to order, on the checkout page an option will be available. The product must require no additional configuration such as product custom fields, configurable options.&lt;br /&gt;
*'''Recurring Cycles Limit''' - For Recurring payment types the default value 0 will invoice indefinitely until cancelled. However by entering a value in this field you can limit the number of times this product will invoice the client. For example entering 5 on a monthly product would cause no invoice to be generated in the 6th month after ordering.&lt;br /&gt;
*'''Auto Terminate/Fixed Term''' - You can setup products to automatically terminate after a set number of days from the date of signup. This can be used to offer free trial products for a certain period of time, or time limited products that should only recur for a certain number of cycles before stopping.&lt;br /&gt;
**To enable enter the number of days to wait before terminating, and choose an email template to be sent to the client when the termination occurs (for example an up-selling email to promote your paid products in the case of a trial, or confirmation of payment completing for instalment payment situations). Set the Auto Terminate/Fixed Term value to 0 to disable this feature. &lt;br /&gt;
**Entering a number in this field will cause the product to be terminated when the cron runs x days after the product registration date.&lt;br /&gt;
*'''Termination Email''' - When the above feature is enabled, choose an email to be sent to the client when the product is terminated.&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;title&amp;quot;&amp;gt;Note:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The Termination Email dropdown field is only populated with custom product type email templates.  For more information on creating a custom email template, please visit [http://docs.whmcs.com/Email_Templates http://docs.whmcs.com/Email_Templates]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
*'''Prorata Billing''' - This allows you to bill products on a specific day of the month and charge a prorata'd amount at the initial time of order. If enabled all clients will be charged on one exact day each month. When disabled the product will use the default anniversary billing system (eg. Jun 15 - Jul 15).&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;title&amp;quot;&amp;gt;Note:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Prorata billing is not compatible with the free domain logic or having domain renewal invoices generated further in advance than other products.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
*'''Prorata Date''' - If you set this to 1, then all clients would be charged on the 1st of each month.&lt;br /&gt;
*'''Charge Next Month''' - After this day of the month has been reached, a client will also be charged for the next month in their initial payment when signing up on a monthly billing cycle. If you had prorata date set to 1, and a client signed up on the 30th of the month, they'd only be charged a tiny amount without this setting. So it is pro-rated amount + next month in advance.&amp;lt;br/&amp;gt;'''TIP:''' If you wish to pro-rate a product but not use the 'charge next month' feature, set &amp;quot;Prorata Date&amp;quot; to a normal value and &amp;quot;Charge Next Month&amp;quot; to 32.&lt;br /&gt;
&lt;br /&gt;
===Module Settings (aka Provisioning)===&lt;br /&gt;
&lt;br /&gt;
This tab specifies which server type the product will use and how WHMCS will behave when this product is ordered. &lt;br /&gt;
*From the Module Name dropdown menu select the type of server you're using&lt;br /&gt;
*The options you will see depend upon the module chosen, and more info specific to each module can be found in the [[Server_Modules|Provisioning Modules]] section&lt;br /&gt;
*If a product has no specific module to be linked to then you can set it to &amp;quot;[[Auto_Release|Autorelease]]&amp;quot; in order to have the activation simulated and therefore welcome email sent automatically&lt;br /&gt;
*There are 4 automation settings to choose from for product activation and they are:&lt;br /&gt;
**Automatically setup the product as soon as an order is placed - this will setup instantly usually used for free products&lt;br /&gt;
**Automatically setup the product as soon as the first payment is received - this will perform the setup as soon as the order is paid for&lt;br /&gt;
**Automatically setup the product when you manually accept a pending order - this will perform the setup only when an admin has manually reviewed and accepted the order&lt;br /&gt;
**Do not automatically setup this product - never auto setup the product - admins can still initiate manually from the product details page under a clients profile&lt;br /&gt;
&lt;br /&gt;
===Custom Fields===&lt;br /&gt;
&lt;br /&gt;
From this tab you can create custom fields for this product, allowing you to collect additional information from your clients on the order form required for supplying the product.&lt;br /&gt;
*Field types consist of text boxes, dropdown selections, yes/no checkboxes, memo text boxes and password fields (text entered here with appear as asterisks ****)&lt;br /&gt;
*Fields can be set as admin only for private data, required/optional on the order form, displayed on the order form or only in the client area, or displayed on invoices (such as VAT numbers)&lt;br /&gt;
*See [[Custom_Fields|Custom Fields]] for more info&lt;br /&gt;
&lt;br /&gt;
===Configurable Options===&lt;br /&gt;
&lt;br /&gt;
Use this tab to select which configurable options are associated with the product, they can be displayed on the order form or in the client area.&lt;br /&gt;
*Configurable Options allow you to give your clients options which alter the price of the product&lt;br /&gt;
*Refer to [[Addons_and_Configurable_Options|Addons &amp;amp; Configurable Options]] for more info&lt;br /&gt;
&lt;br /&gt;
===Upgrades===&lt;br /&gt;
&lt;br /&gt;
The sixth tab allows you to specify whether the client can upgrade or downgrade from this product to another.&lt;br /&gt;
*Upgrades/downgrades can be fully automated by WHMCS with many of the modules&lt;br /&gt;
*All you need to do on this tab is select the products that the product can be upgraded or downgraded to&lt;br /&gt;
*Use Ctrl+Click to select multiple products&lt;br /&gt;
*There is also a checkbox for enabling the upgrades of configurable options if there are any on the product&lt;br /&gt;
*From the '''Upgrade Email''' dropdown menu you can select an email template to be sent when a client upgrades to this product. A new Product email template will first need to be created under Setup &amp;gt; Email Templates.&lt;br /&gt;
*See the [[Automated_Upgrades_and_Downgrades|Automated Upgrades and Downgrades]] article for more info on how upgrades/downgrades are calculated and processed.&lt;br /&gt;
&lt;br /&gt;
===Free Domain===&lt;br /&gt;
&lt;br /&gt;
Use this tab to configure the offer of a free domain with this product is desired&lt;br /&gt;
*WHMCS lets you offer free domains with your packages when purchased with certain payment terms&lt;br /&gt;
*For example you might want to offer a free domain when a package is purchased annually as an incentive&lt;br /&gt;
*Refer to the [[Domains_Configuration#Offering_Free_Domain_Registration_with_Selected_Packages|Offering Free Domain Registration]] article for more details on how to configure it&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
&lt;br /&gt;
The penultimate tab contains miscellaneous settings such as product affiliate rates, product downloads and overage billing.&lt;br /&gt;
*'''Custom Affiliate Payout''' - These settings allow you to specify a custom payout rate for this specific product if using the built in affiliate system, this setting overrides the system default commission rate, it can even be disabled.&lt;br /&gt;
*'''Affiliate Pay Amount''' - Based on your setting above to either percentage or fixed amount, this is the percentage or amount paid for a purchase of this product&lt;br /&gt;
*'''One Time Payout''' - Tick this if you want to pay only a one off commission&lt;br /&gt;
*'''Subdomain Options''' - Enter a domain in the format &amp;quot;.yourdomain.com&amp;quot; if you want to offer a free subdomain option for the domain at signup. You can offer more than one by entering a comma separated list, eg. &amp;quot;.yourdomain.com,.yourdomain.net&amp;quot;&lt;br /&gt;
*'''Product Downloads''' - Lets you offer files to be automatically released to the customer when the product is activated. See [[Product Downloads Distribution]] for more information&lt;br /&gt;
*'''Overage Billing''' - Allows you to bill for the product based on disk and bandwidth usage for the month. Refer to [[Disk Space and Bandwidth Overage Billing]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Links tab===&lt;br /&gt;
&lt;br /&gt;
The final tab contains some ready-made URLs to add to a webpage linking to this product.&lt;br /&gt;
*Each URL will add the product to the shopping cart and jump straight to the configuration step&lt;br /&gt;
*There are many more possible variations, refer to [[Linking to WHMCS]].&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Interacting_With_The_Database&amp;diff=19010</id>
		<title>Interacting With The Database</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Interacting_With_The_Database&amp;diff=19010"/>
				<updated>2016-05-24T15:43:18Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* The Query Manager */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Database connectivity changes in WHMCS 6.0=&lt;br /&gt;
&lt;br /&gt;
The mysql PHP extension was deprecated when PHP 5.5 was released in June 2013&amp;lt;ref&amp;gt;http://php.net/ChangeLog-5.php#5.5.0&amp;lt;/ref&amp;gt; and is scheduled to be removed in PHP 7&amp;lt;ref&amp;gt;https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7&amp;lt;/ref&amp;gt;. WHMCS 6.0 introduces a new database connection and library to ensure compatibility with modern PHP environments and best practices.&lt;br /&gt;
&lt;br /&gt;
==New functionality==&lt;br /&gt;
&lt;br /&gt;
WHMCS 6.0 incorporates the Laravel framework 4.1's database component. This library includes a Database Abstraction Layer (DBAL) called &amp;quot;Capsule&amp;quot; and an Object Relational Mapping (ORM) library called &amp;quot;Eloquent&amp;quot;. The new DBAL is based on the PHP Data Objects (PDO MySQL) extension and uses WHMCS's existing &amp;lt;tt&amp;gt;configuration.php&amp;lt;/tt&amp;gt; file. No configuration file changes are required to use the new database connection.&lt;br /&gt;
&lt;br /&gt;
The Capsule DBAL component introduces two libraries to WHMCS, a query manager for running database queries and a schema manager for an abstracted API to table management. Capsule's underlying PDO connection is also available for advanced database usage. Capsule has three static methods to get to these components:&lt;br /&gt;
&lt;br /&gt;
* '''Capsule::table(string $tableName)''': Access the query manager for the given table.&lt;br /&gt;
* '''Capsule::schema()''': Access the schema manager for the WHMCS database. &lt;br /&gt;
* '''Capsule::connection()''': Access the connection manager to interact with the underlying database connection.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' WHMCS 6.0 makes two connections to the database. One connection is made through the legacy mysql extension to handle existing hooks, modules, and other customizations. The other connection is made by PDO to drive new DBAL and model based functionality in the program. &lt;br /&gt;
&lt;br /&gt;
==Deprecated functionality==&lt;br /&gt;
&lt;br /&gt;
The current [[SQL Helper Functions]] are present in WHMCS 6.0 and above, but are now deprecated and may be removed in a later version of the product:&lt;br /&gt;
* '''select_query()'''&lt;br /&gt;
* '''update_query()'''&lt;br /&gt;
* '''insert_query()'''&lt;br /&gt;
* '''full_query()'''&lt;br /&gt;
&lt;br /&gt;
The mysql extension driven database connection is now deprecated and may be discontinued in a later version of the product. WHMCS encourages all third party developers to use the Capsule DBAL and PDO connection for all new database interaction.&lt;br /&gt;
&lt;br /&gt;
=Using Capsule=&lt;br /&gt;
&lt;br /&gt;
Declare an alias to Laravel's database manager in your project file's &amp;lt;tt&amp;gt;use&amp;lt;/tt&amp;gt; block to access Capsule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Run queries or modify tables as you like.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Query Manager==&lt;br /&gt;
&lt;br /&gt;
: ''Please see [https://laravel.com/docs/4.2/queries Laravel's query documentation] for more information.''&lt;br /&gt;
&lt;br /&gt;
The '''Capsule::table(string $tableName)''' method provides access to the query manager. Declare it with the name of the table you wish to query as it's first parameter to interact with that table. The query manager has a wide range of functionality to perform advanced select, join, insert, update, and delete statements. Capsule's select calls return rows as ''stdClass'' objects.&lt;br /&gt;
&lt;br /&gt;
Capsule escapes all input, so it is not necessary to add escaping slashes to variables passed to these methods.&lt;br /&gt;
&lt;br /&gt;
All of Capsule's methods throw an exception on failure. Please place Capusle calls in &amp;lt;tt&amp;gt;try&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;catch&amp;lt;/tt&amp;gt; blocks for graceful error handling and to avoid potential fatal errors in your hook, module, or other customization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Print all client first names using a simple select.&lt;br /&gt;
&lt;br /&gt;
/** @var stdClass $client */&lt;br /&gt;
foreach (Capsule::table('tblclients')-&amp;gt;get() as $client) {&lt;br /&gt;
    echo $client-&amp;gt;firstname . PHP_EOL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Rename all clients named &amp;quot;John Deo&amp;quot; to &amp;quot;John Doe&amp;quot; using an update statement. &lt;br /&gt;
try {&lt;br /&gt;
    $updatedUserCount = Capsule::table('tblclients')&lt;br /&gt;
        -&amp;gt;where('firstname', 'John')&lt;br /&gt;
        -&amp;gt;where('lastname', 'Deo')&lt;br /&gt;
        -&amp;gt;update(&lt;br /&gt;
            [&lt;br /&gt;
                'lastname' =&amp;gt; 'Doe',&lt;br /&gt;
            ]&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Fixed {$updatedUserCount} misspelled last names.&amp;quot;;&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;I couldn't update client names. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Schema Manager==&lt;br /&gt;
&lt;br /&gt;
Use the '''Capsule::schema()''' method to access the schema manager to modify table schema if necessary. The schema manager has support for creating, dropping and truncating tables and for modifying columns, indexes, and keys. &lt;br /&gt;
&lt;br /&gt;
'''Note''': WHMCS does not recommend changing default table schema as that can affect product functionality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Create a new table.&lt;br /&gt;
try {&lt;br /&gt;
    Capsule::schema()-&amp;gt;create(&lt;br /&gt;
        'my_table',&lt;br /&gt;
        function ($table) {&lt;br /&gt;
            /** @var \Illuminate\Database\Schema\Blueprint $table */&lt;br /&gt;
            $table-&amp;gt;increments('id');&lt;br /&gt;
            $table-&amp;gt;string('name');&lt;br /&gt;
            $table-&amp;gt;integer('serial_number');&lt;br /&gt;
            $table-&amp;gt;boolean('is_required');&lt;br /&gt;
            $table-&amp;gt;timestamps();&lt;br /&gt;
        }&lt;br /&gt;
    );&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Unable to create my_table: {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Connection Manager==&lt;br /&gt;
&lt;br /&gt;
The '''Capsule::connection()''' method provides low-level access to the database connection itself. Use it to initiate transactions with automatic commit and rollback or to access the underlying PDO connection to perform manual database queries outside the DBAL. The connection manager also has methods to retrieve query and schema managers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Perform potentially risky queries in a transaction for easy rollback.&lt;br /&gt;
try {&lt;br /&gt;
    Capsule::connection()-&amp;gt;transaction(&lt;br /&gt;
        function ($connectionManager)&lt;br /&gt;
        {&lt;br /&gt;
            /** @var \Illuminate\Database\Connection $connectionManager */&lt;br /&gt;
            $connectionManager-&amp;gt;table('my_table')-&amp;gt;insert(&lt;br /&gt;
                [&lt;br /&gt;
                    'name' =&amp;gt; $_POST['name'],&lt;br /&gt;
                    'serial_number' =&amp;gt; $_POST['serialNumber'],&lt;br /&gt;
                    'is_required' =&amp;gt; (int)(bool) $_POST['isRequired'],&lt;br /&gt;
                ]&lt;br /&gt;
            );&lt;br /&gt;
        }&lt;br /&gt;
    );&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh! Inserting didn't work, but I was able to rollback. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting to PDO===&lt;br /&gt;
&lt;br /&gt;
Use the connection manager's '''getPdo()''' method to retrieve the underlying PDO connection instance. Use the PDO connection to perform manual queries and advanced database usage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Perform potentially risky queries in a transaction for easy rollback.    &lt;br /&gt;
$pdo = Capsule::connection()-&amp;gt;getPdo();&lt;br /&gt;
$pdo-&amp;gt;beginTransaction();&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
    $statement = $pdo-&amp;gt;prepare(&lt;br /&gt;
        'insert into my_table (name, serial_number, is_required) values (:name, :serialNumber, :isRequired)'&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    $statement-&amp;gt;execute(&lt;br /&gt;
        [&lt;br /&gt;
            ':name' =&amp;gt; $_POST['name'],&lt;br /&gt;
            ':serialNumber' =&amp;gt; $_POST['serialNumber'],&lt;br /&gt;
            ':isRequired' =&amp;gt; (bool) $_POST['isRequired'],&lt;br /&gt;
        ]&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    $pdo-&amp;gt;commit();&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh! {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
    $pdo-&amp;gt;rollBack();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Exceptions==&lt;br /&gt;
&lt;br /&gt;
All Capsule methods throw an exception on failure. Catch these exceptions and analyze their messages and stack traces to help determine the nature of the failure. WHMCS recommends placing all database interactivity in &amp;lt;tt&amp;gt;try&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;catch&amp;lt;/tt&amp;gt; blocks for graceful error handling.&lt;br /&gt;
&lt;br /&gt;
==The Capsule Query Log==&lt;br /&gt;
&lt;br /&gt;
The connection manager's '''getQueryLog()''' method returns an array of all queries made during the life of the page request. Queries are stored in the log as an array containing the query run, the parameter bindings passed to the query, and the time it took for the query to execute, measured in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Loop through each Capsule query made during the page request.&lt;br /&gt;
foreach (Capsule::connection()-&amp;gt;getQueryLog() as $query) {&lt;br /&gt;
    echo &amp;quot;Query: {$query['query']}&amp;quot; . PHP_EOL;&lt;br /&gt;
    echo &amp;quot;Execution Time: {$query['time']}ms&amp;quot; . PHP_EOL;&lt;br /&gt;
    echo &amp;quot;Parameters: &amp;quot; . PHP_EOL;&lt;br /&gt;
&lt;br /&gt;
    foreach ($query['bindings'] as $key =&amp;gt; $value) {&lt;br /&gt;
        echo &amp;quot;{$key} =&amp;gt; {$value}&amp;quot; . PHP_EOL;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The WHMCS Activity Log==&lt;br /&gt;
&lt;br /&gt;
All uncaught PDO-based query failures, including those made by Capsule and manual PDO queries, are written to to the WHMCS activity log. View the system activity log to view the details of these failed queries.&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
* [[SQL Helper Functions]] (functional, but deprecated in WHMCS 6.0)&lt;br /&gt;
&lt;br /&gt;
=External Links=&lt;br /&gt;
* [http://laravel.com/docs/4.2/queries Query Builder - Laravel 4.2]&lt;br /&gt;
* [http://laravel.com/docs/4.2/schema Schema Builder - Laravel 4.2]&lt;br /&gt;
* [http://php.net/manual/en/book.pdo.php PHP: PDO]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Interacting_With_The_Database&amp;diff=19006</id>
		<title>Interacting With The Database</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Interacting_With_The_Database&amp;diff=19006"/>
				<updated>2016-05-24T15:41:41Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* The Schema Manager */ Docs-6452: Fix dead links on the Interacting With The Database page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Database connectivity changes in WHMCS 6.0=&lt;br /&gt;
&lt;br /&gt;
The mysql PHP extension was deprecated when PHP 5.5 was released in June 2013&amp;lt;ref&amp;gt;http://php.net/ChangeLog-5.php#5.5.0&amp;lt;/ref&amp;gt; and is scheduled to be removed in PHP 7&amp;lt;ref&amp;gt;https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7&amp;lt;/ref&amp;gt;. WHMCS 6.0 introduces a new database connection and library to ensure compatibility with modern PHP environments and best practices.&lt;br /&gt;
&lt;br /&gt;
==New functionality==&lt;br /&gt;
&lt;br /&gt;
WHMCS 6.0 incorporates the Laravel framework 4.1's database component. This library includes a Database Abstraction Layer (DBAL) called &amp;quot;Capsule&amp;quot; and an Object Relational Mapping (ORM) library called &amp;quot;Eloquent&amp;quot;. The new DBAL is based on the PHP Data Objects (PDO MySQL) extension and uses WHMCS's existing &amp;lt;tt&amp;gt;configuration.php&amp;lt;/tt&amp;gt; file. No configuration file changes are required to use the new database connection.&lt;br /&gt;
&lt;br /&gt;
The Capsule DBAL component introduces two libraries to WHMCS, a query manager for running database queries and a schema manager for an abstracted API to table management. Capsule's underlying PDO connection is also available for advanced database usage. Capsule has three static methods to get to these components:&lt;br /&gt;
&lt;br /&gt;
* '''Capsule::table(string $tableName)''': Access the query manager for the given table.&lt;br /&gt;
* '''Capsule::schema()''': Access the schema manager for the WHMCS database. &lt;br /&gt;
* '''Capsule::connection()''': Access the connection manager to interact with the underlying database connection.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' WHMCS 6.0 makes two connections to the database. One connection is made through the legacy mysql extension to handle existing hooks, modules, and other customizations. The other connection is made by PDO to drive new DBAL and model based functionality in the program. &lt;br /&gt;
&lt;br /&gt;
==Deprecated functionality==&lt;br /&gt;
&lt;br /&gt;
The current [[SQL Helper Functions]] are present in WHMCS 6.0 and above, but are now deprecated and may be removed in a later version of the product:&lt;br /&gt;
* '''select_query()'''&lt;br /&gt;
* '''update_query()'''&lt;br /&gt;
* '''insert_query()'''&lt;br /&gt;
* '''full_query()'''&lt;br /&gt;
&lt;br /&gt;
The mysql extension driven database connection is now deprecated and may be discontinued in a later version of the product. WHMCS encourages all third party developers to use the Capsule DBAL and PDO connection for all new database interaction.&lt;br /&gt;
&lt;br /&gt;
=Using Capsule=&lt;br /&gt;
&lt;br /&gt;
Declare an alias to Laravel's database manager in your project file's &amp;lt;tt&amp;gt;use&amp;lt;/tt&amp;gt; block to access Capsule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Run queries or modify tables as you like.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Query Manager==&lt;br /&gt;
&lt;br /&gt;
: ''Please see [http://laravel.com/docs/queries Laravel's query documentation] for more information.''&lt;br /&gt;
&lt;br /&gt;
The '''Capsule::table(string $tableName)''' method provides access to the query manager. Declare it with the name of the table you wish to query as it's first parameter to interact with that table. The query manager has a wide range of functionality to perform advanced select, join, insert, update, and delete statements. Capsule's select calls return rows as ''stdClass'' objects.&lt;br /&gt;
&lt;br /&gt;
Capsule escapes all input, so it is not necessary to add escaping slashes to variables passed to these methods.&lt;br /&gt;
&lt;br /&gt;
All of Capsule's methods throw an exception on failure. Please place Capusle calls in &amp;lt;tt&amp;gt;try&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;catch&amp;lt;/tt&amp;gt; blocks for graceful error handling and to avoid potential fatal errors in your hook, module, or other customization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Print all client first names using a simple select.&lt;br /&gt;
&lt;br /&gt;
/** @var stdClass $client */&lt;br /&gt;
foreach (Capsule::table('tblclients')-&amp;gt;get() as $client) {&lt;br /&gt;
    echo $client-&amp;gt;firstname . PHP_EOL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Rename all clients named &amp;quot;John Deo&amp;quot; to &amp;quot;John Doe&amp;quot; using an update statement. &lt;br /&gt;
try {&lt;br /&gt;
    $updatedUserCount = Capsule::table('tblclients')&lt;br /&gt;
        -&amp;gt;where('firstname', 'John')&lt;br /&gt;
        -&amp;gt;where('lastname', 'Deo')&lt;br /&gt;
        -&amp;gt;update(&lt;br /&gt;
            [&lt;br /&gt;
                'lastname' =&amp;gt; 'Doe',&lt;br /&gt;
            ]&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Fixed {$updatedUserCount} misspelled last names.&amp;quot;;&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;I couldn't update client names. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Schema Manager==&lt;br /&gt;
&lt;br /&gt;
Use the '''Capsule::schema()''' method to access the schema manager to modify table schema if necessary. The schema manager has support for creating, dropping and truncating tables and for modifying columns, indexes, and keys. &lt;br /&gt;
&lt;br /&gt;
'''Note''': WHMCS does not recommend changing default table schema as that can affect product functionality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Create a new table.&lt;br /&gt;
try {&lt;br /&gt;
    Capsule::schema()-&amp;gt;create(&lt;br /&gt;
        'my_table',&lt;br /&gt;
        function ($table) {&lt;br /&gt;
            /** @var \Illuminate\Database\Schema\Blueprint $table */&lt;br /&gt;
            $table-&amp;gt;increments('id');&lt;br /&gt;
            $table-&amp;gt;string('name');&lt;br /&gt;
            $table-&amp;gt;integer('serial_number');&lt;br /&gt;
            $table-&amp;gt;boolean('is_required');&lt;br /&gt;
            $table-&amp;gt;timestamps();&lt;br /&gt;
        }&lt;br /&gt;
    );&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Unable to create my_table: {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Connection Manager==&lt;br /&gt;
&lt;br /&gt;
The '''Capsule::connection()''' method provides low-level access to the database connection itself. Use it to initiate transactions with automatic commit and rollback or to access the underlying PDO connection to perform manual database queries outside the DBAL. The connection manager also has methods to retrieve query and schema managers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Perform potentially risky queries in a transaction for easy rollback.&lt;br /&gt;
try {&lt;br /&gt;
    Capsule::connection()-&amp;gt;transaction(&lt;br /&gt;
        function ($connectionManager)&lt;br /&gt;
        {&lt;br /&gt;
            /** @var \Illuminate\Database\Connection $connectionManager */&lt;br /&gt;
            $connectionManager-&amp;gt;table('my_table')-&amp;gt;insert(&lt;br /&gt;
                [&lt;br /&gt;
                    'name' =&amp;gt; $_POST['name'],&lt;br /&gt;
                    'serial_number' =&amp;gt; $_POST['serialNumber'],&lt;br /&gt;
                    'is_required' =&amp;gt; (int)(bool) $_POST['isRequired'],&lt;br /&gt;
                ]&lt;br /&gt;
            );&lt;br /&gt;
        }&lt;br /&gt;
    );&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh! Inserting didn't work, but I was able to rollback. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting to PDO===&lt;br /&gt;
&lt;br /&gt;
Use the connection manager's '''getPdo()''' method to retrieve the underlying PDO connection instance. Use the PDO connection to perform manual queries and advanced database usage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Perform potentially risky queries in a transaction for easy rollback.    &lt;br /&gt;
$pdo = Capsule::connection()-&amp;gt;getPdo();&lt;br /&gt;
$pdo-&amp;gt;beginTransaction();&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
    $statement = $pdo-&amp;gt;prepare(&lt;br /&gt;
        'insert into my_table (name, serial_number, is_required) values (:name, :serialNumber, :isRequired)'&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    $statement-&amp;gt;execute(&lt;br /&gt;
        [&lt;br /&gt;
            ':name' =&amp;gt; $_POST['name'],&lt;br /&gt;
            ':serialNumber' =&amp;gt; $_POST['serialNumber'],&lt;br /&gt;
            ':isRequired' =&amp;gt; (bool) $_POST['isRequired'],&lt;br /&gt;
        ]&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    $pdo-&amp;gt;commit();&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh! {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
    $pdo-&amp;gt;rollBack();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Exceptions==&lt;br /&gt;
&lt;br /&gt;
All Capsule methods throw an exception on failure. Catch these exceptions and analyze their messages and stack traces to help determine the nature of the failure. WHMCS recommends placing all database interactivity in &amp;lt;tt&amp;gt;try&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;catch&amp;lt;/tt&amp;gt; blocks for graceful error handling.&lt;br /&gt;
&lt;br /&gt;
==The Capsule Query Log==&lt;br /&gt;
&lt;br /&gt;
The connection manager's '''getQueryLog()''' method returns an array of all queries made during the life of the page request. Queries are stored in the log as an array containing the query run, the parameter bindings passed to the query, and the time it took for the query to execute, measured in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Loop through each Capsule query made during the page request.&lt;br /&gt;
foreach (Capsule::connection()-&amp;gt;getQueryLog() as $query) {&lt;br /&gt;
    echo &amp;quot;Query: {$query['query']}&amp;quot; . PHP_EOL;&lt;br /&gt;
    echo &amp;quot;Execution Time: {$query['time']}ms&amp;quot; . PHP_EOL;&lt;br /&gt;
    echo &amp;quot;Parameters: &amp;quot; . PHP_EOL;&lt;br /&gt;
&lt;br /&gt;
    foreach ($query['bindings'] as $key =&amp;gt; $value) {&lt;br /&gt;
        echo &amp;quot;{$key} =&amp;gt; {$value}&amp;quot; . PHP_EOL;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The WHMCS Activity Log==&lt;br /&gt;
&lt;br /&gt;
All uncaught PDO-based query failures, including those made by Capsule and manual PDO queries, are written to to the WHMCS activity log. View the system activity log to view the details of these failed queries.&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
* [[SQL Helper Functions]] (functional, but deprecated in WHMCS 6.0)&lt;br /&gt;
&lt;br /&gt;
=External Links=&lt;br /&gt;
* [http://laravel.com/docs/4.2/queries Query Builder - Laravel 4.2]&lt;br /&gt;
* [http://laravel.com/docs/4.2/schema Schema Builder - Laravel 4.2]&lt;br /&gt;
* [http://php.net/manual/en/book.pdo.php PHP: PDO]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Interacting_With_The_Database&amp;diff=19002</id>
		<title>Interacting With The Database</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Interacting_With_The_Database&amp;diff=19002"/>
				<updated>2016-05-24T15:41:20Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* The Query Manager */ DOCS-6452: Fix dead links on the Interacting With The Database page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Database connectivity changes in WHMCS 6.0=&lt;br /&gt;
&lt;br /&gt;
The mysql PHP extension was deprecated when PHP 5.5 was released in June 2013&amp;lt;ref&amp;gt;http://php.net/ChangeLog-5.php#5.5.0&amp;lt;/ref&amp;gt; and is scheduled to be removed in PHP 7&amp;lt;ref&amp;gt;https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7&amp;lt;/ref&amp;gt;. WHMCS 6.0 introduces a new database connection and library to ensure compatibility with modern PHP environments and best practices.&lt;br /&gt;
&lt;br /&gt;
==New functionality==&lt;br /&gt;
&lt;br /&gt;
WHMCS 6.0 incorporates the Laravel framework 4.1's database component. This library includes a Database Abstraction Layer (DBAL) called &amp;quot;Capsule&amp;quot; and an Object Relational Mapping (ORM) library called &amp;quot;Eloquent&amp;quot;. The new DBAL is based on the PHP Data Objects (PDO MySQL) extension and uses WHMCS's existing &amp;lt;tt&amp;gt;configuration.php&amp;lt;/tt&amp;gt; file. No configuration file changes are required to use the new database connection.&lt;br /&gt;
&lt;br /&gt;
The Capsule DBAL component introduces two libraries to WHMCS, a query manager for running database queries and a schema manager for an abstracted API to table management. Capsule's underlying PDO connection is also available for advanced database usage. Capsule has three static methods to get to these components:&lt;br /&gt;
&lt;br /&gt;
* '''Capsule::table(string $tableName)''': Access the query manager for the given table.&lt;br /&gt;
* '''Capsule::schema()''': Access the schema manager for the WHMCS database. &lt;br /&gt;
* '''Capsule::connection()''': Access the connection manager to interact with the underlying database connection.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' WHMCS 6.0 makes two connections to the database. One connection is made through the legacy mysql extension to handle existing hooks, modules, and other customizations. The other connection is made by PDO to drive new DBAL and model based functionality in the program. &lt;br /&gt;
&lt;br /&gt;
==Deprecated functionality==&lt;br /&gt;
&lt;br /&gt;
The current [[SQL Helper Functions]] are present in WHMCS 6.0 and above, but are now deprecated and may be removed in a later version of the product:&lt;br /&gt;
* '''select_query()'''&lt;br /&gt;
* '''update_query()'''&lt;br /&gt;
* '''insert_query()'''&lt;br /&gt;
* '''full_query()'''&lt;br /&gt;
&lt;br /&gt;
The mysql extension driven database connection is now deprecated and may be discontinued in a later version of the product. WHMCS encourages all third party developers to use the Capsule DBAL and PDO connection for all new database interaction.&lt;br /&gt;
&lt;br /&gt;
=Using Capsule=&lt;br /&gt;
&lt;br /&gt;
Declare an alias to Laravel's database manager in your project file's &amp;lt;tt&amp;gt;use&amp;lt;/tt&amp;gt; block to access Capsule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Run queries or modify tables as you like.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Query Manager==&lt;br /&gt;
&lt;br /&gt;
: ''Please see [http://laravel.com/docs/queries Laravel's query documentation] for more information.''&lt;br /&gt;
&lt;br /&gt;
The '''Capsule::table(string $tableName)''' method provides access to the query manager. Declare it with the name of the table you wish to query as it's first parameter to interact with that table. The query manager has a wide range of functionality to perform advanced select, join, insert, update, and delete statements. Capsule's select calls return rows as ''stdClass'' objects.&lt;br /&gt;
&lt;br /&gt;
Capsule escapes all input, so it is not necessary to add escaping slashes to variables passed to these methods.&lt;br /&gt;
&lt;br /&gt;
All of Capsule's methods throw an exception on failure. Please place Capusle calls in &amp;lt;tt&amp;gt;try&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;catch&amp;lt;/tt&amp;gt; blocks for graceful error handling and to avoid potential fatal errors in your hook, module, or other customization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Print all client first names using a simple select.&lt;br /&gt;
&lt;br /&gt;
/** @var stdClass $client */&lt;br /&gt;
foreach (Capsule::table('tblclients')-&amp;gt;get() as $client) {&lt;br /&gt;
    echo $client-&amp;gt;firstname . PHP_EOL;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Rename all clients named &amp;quot;John Deo&amp;quot; to &amp;quot;John Doe&amp;quot; using an update statement. &lt;br /&gt;
try {&lt;br /&gt;
    $updatedUserCount = Capsule::table('tblclients')&lt;br /&gt;
        -&amp;gt;where('firstname', 'John')&lt;br /&gt;
        -&amp;gt;where('lastname', 'Deo')&lt;br /&gt;
        -&amp;gt;update(&lt;br /&gt;
            [&lt;br /&gt;
                'lastname' =&amp;gt; 'Doe',&lt;br /&gt;
            ]&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;Fixed {$updatedUserCount} misspelled last names.&amp;quot;;&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;I couldn't update client names. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Schema Manager==&lt;br /&gt;
&lt;br /&gt;
: ''Please see [http://laravel.com/docs/4.1/schema Laravel's schema builder documentation] for more information.''&lt;br /&gt;
&lt;br /&gt;
Use the '''Capsule::schema()''' method to access the schema manager to modify table schema if necessary. The schema manager has support for creating, dropping and truncating tables and for modifying columns, indexes, and keys. &lt;br /&gt;
&lt;br /&gt;
'''Note''': WHMCS does not recommend changing default table schema as that can affect product functionality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Create a new table.&lt;br /&gt;
try {&lt;br /&gt;
    Capsule::schema()-&amp;gt;create(&lt;br /&gt;
        'my_table',&lt;br /&gt;
        function ($table) {&lt;br /&gt;
            /** @var \Illuminate\Database\Schema\Blueprint $table */&lt;br /&gt;
            $table-&amp;gt;increments('id');&lt;br /&gt;
            $table-&amp;gt;string('name');&lt;br /&gt;
            $table-&amp;gt;integer('serial_number');&lt;br /&gt;
            $table-&amp;gt;boolean('is_required');&lt;br /&gt;
            $table-&amp;gt;timestamps();&lt;br /&gt;
        }&lt;br /&gt;
    );&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Unable to create my_table: {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The Connection Manager==&lt;br /&gt;
&lt;br /&gt;
The '''Capsule::connection()''' method provides low-level access to the database connection itself. Use it to initiate transactions with automatic commit and rollback or to access the underlying PDO connection to perform manual database queries outside the DBAL. The connection manager also has methods to retrieve query and schema managers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Perform potentially risky queries in a transaction for easy rollback.&lt;br /&gt;
try {&lt;br /&gt;
    Capsule::connection()-&amp;gt;transaction(&lt;br /&gt;
        function ($connectionManager)&lt;br /&gt;
        {&lt;br /&gt;
            /** @var \Illuminate\Database\Connection $connectionManager */&lt;br /&gt;
            $connectionManager-&amp;gt;table('my_table')-&amp;gt;insert(&lt;br /&gt;
                [&lt;br /&gt;
                    'name' =&amp;gt; $_POST['name'],&lt;br /&gt;
                    'serial_number' =&amp;gt; $_POST['serialNumber'],&lt;br /&gt;
                    'is_required' =&amp;gt; (int)(bool) $_POST['isRequired'],&lt;br /&gt;
                ]&lt;br /&gt;
            );&lt;br /&gt;
        }&lt;br /&gt;
    );&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh! Inserting didn't work, but I was able to rollback. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting to PDO===&lt;br /&gt;
&lt;br /&gt;
Use the connection manager's '''getPdo()''' method to retrieve the underlying PDO connection instance. Use the PDO connection to perform manual queries and advanced database usage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Perform potentially risky queries in a transaction for easy rollback.    &lt;br /&gt;
$pdo = Capsule::connection()-&amp;gt;getPdo();&lt;br /&gt;
$pdo-&amp;gt;beginTransaction();&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
    $statement = $pdo-&amp;gt;prepare(&lt;br /&gt;
        'insert into my_table (name, serial_number, is_required) values (:name, :serialNumber, :isRequired)'&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    $statement-&amp;gt;execute(&lt;br /&gt;
        [&lt;br /&gt;
            ':name' =&amp;gt; $_POST['name'],&lt;br /&gt;
            ':serialNumber' =&amp;gt; $_POST['serialNumber'],&lt;br /&gt;
            ':isRequired' =&amp;gt; (bool) $_POST['isRequired'],&lt;br /&gt;
        ]&lt;br /&gt;
    );&lt;br /&gt;
&lt;br /&gt;
    $pdo-&amp;gt;commit();&lt;br /&gt;
} catch (\Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh! {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
    $pdo-&amp;gt;rollBack();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Troubleshooting=&lt;br /&gt;
&lt;br /&gt;
==Exceptions==&lt;br /&gt;
&lt;br /&gt;
All Capsule methods throw an exception on failure. Catch these exceptions and analyze their messages and stack traces to help determine the nature of the failure. WHMCS recommends placing all database interactivity in &amp;lt;tt&amp;gt;try&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;catch&amp;lt;/tt&amp;gt; blocks for graceful error handling.&lt;br /&gt;
&lt;br /&gt;
==The Capsule Query Log==&lt;br /&gt;
&lt;br /&gt;
The connection manager's '''getQueryLog()''' method returns an array of all queries made during the life of the page request. Queries are stored in the log as an array containing the query run, the parameter bindings passed to the query, and the time it took for the query to execute, measured in milliseconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use Illuminate\Database\Capsule\Manager as Capsule;&lt;br /&gt;
&lt;br /&gt;
// Loop through each Capsule query made during the page request.&lt;br /&gt;
foreach (Capsule::connection()-&amp;gt;getQueryLog() as $query) {&lt;br /&gt;
    echo &amp;quot;Query: {$query['query']}&amp;quot; . PHP_EOL;&lt;br /&gt;
    echo &amp;quot;Execution Time: {$query['time']}ms&amp;quot; . PHP_EOL;&lt;br /&gt;
    echo &amp;quot;Parameters: &amp;quot; . PHP_EOL;&lt;br /&gt;
&lt;br /&gt;
    foreach ($query['bindings'] as $key =&amp;gt; $value) {&lt;br /&gt;
        echo &amp;quot;{$key} =&amp;gt; {$value}&amp;quot; . PHP_EOL;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The WHMCS Activity Log==&lt;br /&gt;
&lt;br /&gt;
All uncaught PDO-based query failures, including those made by Capsule and manual PDO queries, are written to to the WHMCS activity log. View the system activity log to view the details of these failed queries.&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
* [[SQL Helper Functions]] (functional, but deprecated in WHMCS 6.0)&lt;br /&gt;
&lt;br /&gt;
=External Links=&lt;br /&gt;
* [http://laravel.com/docs/4.2/queries Query Builder - Laravel 4.2]&lt;br /&gt;
* [http://laravel.com/docs/4.2/schema Schema Builder - Laravel 4.2]&lt;br /&gt;
* [http://php.net/manual/en/book.pdo.php PHP: PDO]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Support_Tab&amp;diff=18998</id>
		<title>Support Tab</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Support_Tab&amp;diff=18998"/>
				<updated>2016-05-24T15:36:39Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* Client Tickets Require Login */ DOCS-6447: Client Tickets Require Login functionality is incorrectly documented&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;{{General Settings}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For information regarding the support centre in WHMCS [[Support_Center|refer to this page]].&lt;br /&gt;
&lt;br /&gt;
===Support Module===&lt;br /&gt;
If a third party support system is installed, select it here.&lt;br /&gt;
&lt;br /&gt;
===Support Ticket Mask Format===&lt;br /&gt;
This options allows for the customisation of the support ticket number assigned to new tickets as they are opened. Entering the following codes into the mask field will change the format of the ticket number, you can even add letters and dates:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
%A - Uppercase letter | %a - Lowercase letter | %n - Number | %y - Year | %m - Month | %d - Day | %i - Ticket ID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example a mask format configuration of '''%A%A%A - %n%n%n%n - %y''' would result in a ticket number of '''AAA - 111 - 2013'''. Where %A is replaced with any random uppercase letter and %n is replaced with any random number between 0-9.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;title&amp;quot;&amp;gt;'''Note:'''&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The maximum length of the ticket mask is 15 characters.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ticket Reply List Order===&lt;br /&gt;
Choose the order support ticket messages are displayed when viewing a ticket in the admin area.&lt;br /&gt;
&lt;br /&gt;
===Ticket Reply Email Limit===&lt;br /&gt;
Specifies the maximum number of emails you wish to receive into your support system from an individual email address within a 15 minute period. This is useful if a client opens a ticket and has an auto-responder active on their email address; the auto-responder replies to your message, the support system sends an automated acknowledgement email, their auto-responder responds ad infinitum. By default WHMCS will prevent the 10th email being imported into the support system.&lt;br /&gt;
&lt;br /&gt;
===Show Client Only Departments===&lt;br /&gt;
By default support departments with the ''Clients Only'' option enabled are hidden from visitors on the ticket submission page. Ticking this option will cause such departments to be displayed to visitors and allow them to submit tickets to them.&lt;br /&gt;
&lt;br /&gt;
===Client Tickets Require Login===&lt;br /&gt;
Enabling this will prompt clients to login before they can view a support ticket. This will not prevent unregistered users from viewing their tickets.&lt;br /&gt;
&lt;br /&gt;
===Attachment Thumbnail Previews===&lt;br /&gt;
When enabled a thumbnail sized preview of any images attached to a support ticket will be displayed, allowing you quickly identify &amp;amp; see what's in the attachment you're looking for without even needing to open it. &lt;br /&gt;
&lt;br /&gt;
===Knowledgebase Suggestions===&lt;br /&gt;
Enabling will display the title and first line of articles from your knowledgebase relevant to the support ticket message a customer is typing. It is displayed between the ticket body and the submit button. You must have at-least 5 articles in your KB if 30 words each before this feature will function.&lt;br /&gt;
&lt;br /&gt;
===Support Ticket Rating===&lt;br /&gt;
A star-rating system will appear below each staff reply when enabled. Customers can rate the responses on a scale of 1-5 and the Support Ticket Ratings Reviewer report is available with the results.&lt;br /&gt;
&lt;br /&gt;
===Ticket Closure Feedback Request===&lt;br /&gt;
In addition to the above option, you can also send an email to users once a support ticket has been closed. They will be directed to a page asking the client to rate and provide comments on each member of staff's response to the ticket as well as a general comment. The message will only be sent once per ticket and only for tickets with at-least one staff reply.&lt;br /&gt;
&lt;br /&gt;
The results are collated into two reports under the Reports tab; Ticket Feedback Scores and Ticket Feedback Comments.&lt;br /&gt;
&lt;br /&gt;
If auto-close ticket notifications are also enabled the feedback email will take precedence. Ie. The feedback email will be sent instead of the ticket closure notification.&lt;br /&gt;
&lt;br /&gt;
===Prevent Email Reopening===&lt;br /&gt;
&lt;br /&gt;
Enabling this setting will prevent replies by email from re-opening a ticket once it has been closed.  Instead, when a user attempts to reply to a closed ticket via email, the user is sent an email based on the email template &amp;quot;Closed Ticket Bounce Message&amp;quot; and the reply is not added to the ticket.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;title&amp;quot;&amp;gt;'''Note:'''&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
This does not prevent users from replying to and re-opening closed tickets from the client area.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For registered clients, the email message they receive explains that if they wish to re-open the ticket they attempted to reply to, that they can login to the client area and do so from there.  For non-registered users, they need to open a new ticket and are instructed as such.&lt;br /&gt;
&lt;br /&gt;
===Update Last Reply Timestamp===&lt;br /&gt;
With the '''Every time a reply is made''' option selected, whenever a client replies to a support ticket the &amp;quot;Last Reply&amp;quot; timestamp will be reset. This can mean that a client bumping a ticket actually delays a staff response as it would move to the back of the queue. Choosing the '''Every time for staff replies, only on a change of status for clients''' option will prevent this by only resetting the &amp;quot;Last Reply&amp;quot; timestamp when a member of staff replies or when the ticket status is changed.&lt;br /&gt;
&lt;br /&gt;
===Disable Reply Email Logging===&lt;br /&gt;
When ticked, ticket responses will not be recorded in the email log. This saves some disk space in the database as it is already logged in the ticket itself.&lt;br /&gt;
&lt;br /&gt;
===KB SEO Friendly URLs===&lt;br /&gt;
Enabling this requires mod_rewrite enabled on your server, it will rewrite ''/knowledgebase.php?action=view&amp;amp;id=1'' to &amp;quot;/knowledgebase/1/How_do_I_login.html&amp;quot; for example. Making your knowledgebase, announcements and downloads more friendly to search engines. For more information [[Support_Center#Search_Engine_Friendly_URLS|refer to this page]].&lt;br /&gt;
&lt;br /&gt;
===Allowed File Attachment Types===&lt;br /&gt;
Specify the file types that customers are permitted to attach to support tickets. For example .jpg,.gif,.jpeg,.png&amp;lt;br /&amp;gt;&lt;br /&gt;
It is not possible to accept .php attachments for security reasons as this could potentially allow someone to upload a malicious script to your server.&lt;br /&gt;
&lt;br /&gt;
===Network Issues Require Login===&lt;br /&gt;
When enabled, only customers who are logged in will be able to view the network issues pages.&lt;br /&gt;
&lt;br /&gt;
===Include Product Downloads===&lt;br /&gt;
If a product has an [[Product_Downloads_Distribution|associated download]] it is usually only available on the product details page, ticking this option will also display this file on the Downloads page. Clients will still only be able to download the file if they own the relevant product.&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Using_Models&amp;diff=18934</id>
		<title>Using Models</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Using_Models&amp;diff=18934"/>
				<updated>2016-05-10T19:56:56Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: DOCS-6461 - Broken link on &amp;quot;Using Models&amp;quot; docs page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WHMCS 6.0 introduces a code-driven method for interacting with data stored in the database. Many tables in the WHMCS installation are modeled as classes available both internally to WHMCS and to third party code. These classes, based on the Eloquent 4.1 ORM library, model tables, columns, and relationships between tables in WHMCS' backend database. Use these classes to easily interact with WHMCS' backend data without the need for complex SQL statements.&lt;br /&gt;
&lt;br /&gt;
A model-based class in WHMCS corresponds to a single table in the database and has properties that map to the columns in that table. For instance, the &amp;lt;tt&amp;gt;\WHMCS\User\Client&amp;lt;/tt&amp;gt; class models data in the &amp;lt;tt&amp;gt;tblclients&amp;lt;/tt&amp;gt; table. It includes the properties &amp;lt;tt&amp;gt;$id&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;$firstName&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;$lastName&amp;lt;/tt&amp;gt;, and others that map to the &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;firstname&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;lastname&amp;lt;/tt&amp;gt;, and other columns in that table. Model-based classes also have properties that relate to other model-based classes. For example, a client can have more than one domain or contact on their account. The client's &amp;lt;tt&amp;gt;$domains&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;$contacts&amp;lt;/tt&amp;gt; properties contain collections of &amp;lt;tt&amp;gt;\WHMCS\Domain\Domain&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;\WHMCS\User\Client\Contact&amp;lt;/tt&amp;gt; instances, which in turn model data in the &amp;lt;tt&amp;gt;tbldomains&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;tblcontacts&amp;lt;/tt&amp;gt; tables, and each have their own column and relational properties. &lt;br /&gt;
&lt;br /&gt;
This page describes basic interactivity with model classes. Please see [http://laravel.com/docs/eloquent Laravel's Eloquent ORM manual] for a much more detailed reference.&lt;br /&gt;
&lt;br /&gt;
=Creating Records=&lt;br /&gt;
&lt;br /&gt;
Creating new records using model-based classes is as simple as creating a local object.&lt;br /&gt;
&lt;br /&gt;
# Declare a new instance of the class of data to insert.&lt;br /&gt;
# Populate the object's properties.&lt;br /&gt;
# Call the &amp;lt;tt&amp;gt;save()&amp;lt;/tt&amp;gt; method to insert the new record into the database.&lt;br /&gt;
&lt;br /&gt;
Models with a primary key have that key automatically populated on save. In most model-based classes the &amp;lt;tt&amp;gt;$id&amp;lt;/tt&amp;gt; property is the classes' primary key. As with all all backend interaction it's helpful to place the &amp;lt;tt&amp;gt;save()&amp;lt;/tt&amp;gt; call in a &amp;lt;tt&amp;gt;try&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;catch&amp;lt;/tt&amp;gt; block to intelligently handle any error situations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
&lt;br /&gt;
$newClient = new Client;&lt;br /&gt;
$newClient-&amp;gt;firstName = 'John';&lt;br /&gt;
$newClient-&amp;gt;lastName = 'Doe';&lt;br /&gt;
$newClient-&amp;gt;email = 'jdoe@example.org';&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
    $newClient-&amp;gt;save();&lt;br /&gt;
    echo &amp;quot;I just created John Doe's client record. His id number is {$newClient-&amp;gt;id}.&amp;quot;;&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh. I couldn't create John Doe's client record. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Retrieving Records=&lt;br /&gt;
&lt;br /&gt;
Use a model's static &amp;lt;tt&amp;gt;find()&amp;lt;/tt&amp;gt; method to locate a record by its primary key. &amp;lt;tt&amp;gt;find()&amp;lt;/tt&amp;gt; retrieves the record or returns &amp;lt;tt&amp;gt;null&amp;lt;/tt&amp;gt; if the record doesn't exist in the database. Alternatively, use the static &amp;lt;tt&amp;gt;findOrFail()&amp;lt;/tt&amp;gt; method to throw an exception instead of retuning a null value if the record isn't found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
&lt;br /&gt;
$clientId = 1234;&lt;br /&gt;
&lt;br /&gt;
// Look for John Doe by id. $johnDoe will be null if id 1234 doesn't exist.&lt;br /&gt;
$johnDoe = Client::find($clientId);&lt;br /&gt;
&lt;br /&gt;
// Look for John Doe by id, but throw an exception if id 1234 doesn't exist.&lt;br /&gt;
try {&lt;br /&gt;
    $johnDoe = Client::findOrFail($clientId);&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
    echo &amp;quot;I couldn't find John Doe. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Querying for data is also possible with chains of &amp;lt;tt&amp;gt;where()&amp;lt;/tt&amp;gt; method calls. Call it statically first with the names of the property and value to search for. End the chain with a &amp;lt;tt&amp;gt;get()&amp;lt;/tt&amp;gt; method call to query the database and retrieve a collection of the results. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
&lt;br /&gt;
// Look for all clients with the name &amp;quot;John Doe&amp;quot;.&lt;br /&gt;
$johnDoes = Client::where('firstName', 'John')-&amp;gt;where('lastName', 'Doe')-&amp;gt;get();&lt;br /&gt;
&lt;br /&gt;
foreach ($johnDoes as $john) {&lt;br /&gt;
    echo &amp;quot;I found a John Doe from {$john-&amp;gt;city}, {$john-&amp;gt;state} with the id number {$client-&amp;gt;id}.&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once models are retrieved then their related properties to other models are also immediately available. Relational model properties in turn have other relational properties that can be chained together in multiple ways.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
&lt;br /&gt;
$clientId = 1234;&lt;br /&gt;
$johnDoe = Client::find($clientId);&lt;br /&gt;
&lt;br /&gt;
echo 'John Doe has ' . $johnDoe-&amp;gt;services-&amp;gt;count() . ' service(s).';&lt;br /&gt;
echo 'John Doe also has ' . $johnDoe-&amp;gt;contacts-&amp;gt;count() . &amp;quot;contacts. The first one goes by &amp;quot; . $johnDoe-&amp;gt;contacts-&amp;gt;first()-&amp;gt;firstName . '.';&lt;br /&gt;
&lt;br /&gt;
foreach ($johnDoe-&amp;gt;services as $service) {&lt;br /&gt;
    echo 'Service ' . $service-&amp;gt;domain . ' is based from the product ' . $service-&amp;gt;product-&amp;gt;name . '.';&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Updating Records=&lt;br /&gt;
&lt;br /&gt;
A model's &amp;lt;tt&amp;gt;save()&amp;lt;/tt&amp;gt; method can also update existing records in addition to creating new records. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
&lt;br /&gt;
$clientId = 1234;&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
    $johnDoe = Client::findOrFail($clientId);&lt;br /&gt;
&lt;br /&gt;
    $johnDoe-&amp;gt;address1 = '1234 Main Street';&lt;br /&gt;
    $johnDoe-&amp;gt;city = 'Anytown';&lt;br /&gt;
    $johnDoe-&amp;gt;state = 'TX';&lt;br /&gt;
    $johnDoe-&amp;gt;postcode = '12345';&lt;br /&gt;
&lt;br /&gt;
    $johnDoe-&amp;gt;save();&lt;br /&gt;
&lt;br /&gt;
    echo &amp;quot;I've updated John Doe's address.&amp;quot;;&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh. I couldn't update John Doe's address. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Deleting Records=&lt;br /&gt;
&lt;br /&gt;
Call a model object's &amp;lt;tt&amp;gt;delete()&amp;lt;/tt&amp;gt; method to delete its associated table row. Deletions are permanent and cannot be undone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
&lt;br /&gt;
$clientId = 1234;&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
    Client::findOrFail($clientId)-&amp;gt;delete();&lt;br /&gt;
    echo &amp;quot;So long, John!&amp;quot;;&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh. I couldn't delete John Doe's client record. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to delete an object's related properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
use WHMCS\User\Client;&lt;br /&gt;
&lt;br /&gt;
$clientId = 1234;&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
    // Delete John Doe's first domain.&lt;br /&gt;
    Client::findOrFail($clientId)-&amp;gt;domains-&amp;gt;first()-&amp;gt;delete();&lt;br /&gt;
    echo &amp;quot;Take that, domain!&amp;quot;;&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
    echo &amp;quot;Uh oh. I couldn't delete John Doe's first domain. {$e-&amp;gt;getMessage()}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Current Models=&lt;br /&gt;
&lt;br /&gt;
Not every table in WHMCS has an associated model yet. These are the current model classes in WHMCS and their associated tables. This list is updated on new version releases. Please check here often for new functionality.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Table&lt;br /&gt;
! Class&lt;br /&gt;
|-&lt;br /&gt;
| tblaccounts&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Billing\Payment\Transaction&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tbladmins&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\User\Admin&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tbladminsecurityquestions&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\User\Client\SecurityQuestion&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblaffiliates&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\User\Client\Affiliate&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblannouncements&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Announcement\Announcement&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblcancelrequests&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Service\CancellationRequest&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblclients&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\User\Client&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblcontacts&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\User\Client\Contact&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tbldomains&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Domain\Domain&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tbldomainsadditionalfields&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Domain\AdditionalField&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tbldownloadcats&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Download\Category&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tbldownloads&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Download\Download&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblemailtemplates&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Mail\Template&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblhosting&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Service\Service&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblhostingaddons&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Service\Addon&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblinvoices&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Billing\Invoice&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblnetworkissues&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Network\NetworkIssue&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblproductgroups&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Product\Group&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblproducts&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Product\Product&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblquoteitems&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Billing\Quote\Item&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| tblquotes&lt;br /&gt;
| &amp;lt;tt&amp;gt;\WHMCS\Billing\Quote&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
* [[Interacting With The Database]]&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Standard_Order_Form_Templates&amp;diff=18414</id>
		<title>Standard Order Form Templates</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Standard_Order_Form_Templates&amp;diff=18414"/>
				<updated>2016-03-28T13:59:03Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* Standard Cart */ DOCS-6433: Clarify the Standard Cart Product Group Features capability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WHMCS includes a number of standard order form templates to choose from to provide the best ordering experience for your visitors. To select a template navigate to '''Setup &amp;gt; General Settings &amp;gt; Ordering tab'''. This page describes the various templates, for instructions customising them refer to [[Order Form Templates]].&lt;br /&gt;
&lt;br /&gt;
=Templates=&lt;br /&gt;
&lt;br /&gt;
==Standard Cart==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results 3, supports unlimited.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default shopping cart experience in Version 6.1 and later. Compatible with all types of products.&lt;br /&gt;
&lt;br /&gt;
==Premium Comparison==&lt;br /&gt;
[[File:Premium-Comparison.png‎|thumb|Premium Comparison]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results 3, supports unlimited.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect for comparing a number of products/services. You should utilise the product features functionality to define comparable features/values, and ensure you have the same format/order for all descriptions of products within the group for best results.&lt;br /&gt;
&lt;br /&gt;
==Pure Comparison==&lt;br /&gt;
[[File:Pure-Comparison.png‎|thumb|Pure Comparison]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results 4, supports unlimited.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect for comparing a number of products/services. You should utilise the product features functionality to define comparable features/values, and ensure you have the same format/order for all descriptions of products within the group for best results.&lt;br /&gt;
&lt;br /&gt;
==Supreme Comparison==&lt;br /&gt;
[[File:SupremeComparisonOrderForm.png‎|thumb|Supreme Comparison]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
Headline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results 6, supports unlimited.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect for comparing a number of products/services. You should utilise the product features functionality to define comparable features/values, and ensure you have the same format/order for all descriptions of products within the group for best results.&lt;br /&gt;
&lt;br /&gt;
==Universal Slider==&lt;br /&gt;
[[File:UniversalSliderOrderForm.png‎|thumb|Universal Slider]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
Headline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results between 4 and 8, supports unlimited space permitting.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Allows you to showcase your products in a slider format that can work universally for any type of product.  Includes support for comparison of product features with percentage bars as well as support for a free-form text description.  For best results we recommend utilising the product feature functionality to define 4 or 8 comparable features/values and using the same product description format for all products within the group - this avoids page shifting on sliding between products.&lt;br /&gt;
&lt;br /&gt;
==Cloud Slider==&lt;br /&gt;
[[File:Cloud-Slider.png‎|thumb|Cloud Slider]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results between 2 and 12, supports unlimited space permitting.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect for comparing a number of products/services. You should utilise the product features functionality to define comparable features/values. For best results use 4 feature/value comparisons. and ensure you have the same format/order for all descriptions of products within the group for best results.&lt;br /&gt;
&lt;br /&gt;
==Boxes==&lt;br /&gt;
[[File:Boxesthumb.gif‎|thumb|Boxes]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: Unlimited&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flexible cart that is designed to work for most types of products.&lt;br /&gt;
&lt;br /&gt;
==Modern==&lt;br /&gt;
[[File:Modernthumb.gif‎|thumb|Modern]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: Unlimited&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Six template/Bootstrap 3&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A flexible cart that is designed to work for all types of products.&lt;br /&gt;
&lt;br /&gt;
=Using Feature Highlights=&lt;br /&gt;
&lt;br /&gt;
Feature Highlights allow you to define features and their values for products in a way that WHMCS can interpret for comparison based display.&lt;br /&gt;
&lt;br /&gt;
Feature Highlights are supported by most order form templates.  See the above descriptions for exact details.&lt;br /&gt;
&lt;br /&gt;
[[File:PremiumComparisonFeatureHighlights.png|right]]&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
Feature Highlights are specified as part of the product description.  They must be entered in the following format, with one feature per line.&lt;br /&gt;
&lt;br /&gt;
 '''Feature: Value'''&lt;br /&gt;
&lt;br /&gt;
For example, the description for a shared hosting product using Feature Highlights might look like this:&lt;br /&gt;
&lt;br /&gt;
 Disk Space: 1000MB&lt;br /&gt;
 Bandwidth: 5GB&lt;br /&gt;
 Email Accounts: 5&lt;br /&gt;
 Subdomains: 3&lt;br /&gt;
 Addon Domains: 1&lt;br /&gt;
&lt;br /&gt;
The preview on the right shows how the above would be rendered in the Premium Comparison order form.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;For best results we recommend that you use the same features and in the same order for all products within the same product group.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disabling Feature Highlights==&lt;br /&gt;
&lt;br /&gt;
There may be occasions when it's required to disable feature highlights, such as when wishing to use other markup in the product description. To do this, simply edit the /templates/orderforms/*your active template*/products.tpl template file and perform these two edits:&lt;br /&gt;
&lt;br /&gt;
# Replace '''{$product.featuresdesc}''' with '''{$product.description}'''&lt;br /&gt;
# Remove/comment out:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{foreach from=$product.features key=feature item=value}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;prodfeature&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;feature&amp;quot;&amp;gt;{$feature}&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;{$value}&amp;lt;/span&amp;gt;&lt;br /&gt;
{/foreach} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save changes and upload the modified template file. Now product descriptions will be displayed as entered.&lt;br /&gt;
&lt;br /&gt;
=Using Different Templates for Different Products=&lt;br /&gt;
&lt;br /&gt;
It is possible to specify the template you want to use for a product in the URL you use to link to the order form. And therefore by doing that you can use multiple different templates concurrently and thus use the one that best suits each product or type of product you offer.&lt;br /&gt;
&lt;br /&gt;
Details on how to do this can be found in the article: [[Linking_to_WHMCS#Order_Links|Linking to WHMCS - Order Links]]&lt;br /&gt;
&lt;br /&gt;
=Discontinued Order Form Templates=&lt;br /&gt;
&lt;br /&gt;
The following shopping carts are no longer shipped with releases and are provided for legacy users only.&lt;br /&gt;
&lt;br /&gt;
==Cart==&lt;br /&gt;
[[File:Cartthumb.gif‎|thumb|Cart]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: Unlimited&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Five template/Bootstrap 2&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replaced by the Standard Cart in 6.1. This cart is now deprecated and will no longer receive updates.&lt;br /&gt;
&lt;br /&gt;
==Comparison==&lt;br /&gt;
[[File:Comparisonthumb.gif‎|thumb|Comparison]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results 4, supports unlimited.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Five template/Bootstrap 2&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replaced by Premium Comparison/Supreme Comparison in 6.1 and 6.2. This cart is now deprecated and will no longer receive updates.&lt;br /&gt;
&lt;br /&gt;
==Slider==&lt;br /&gt;
[[File:Sliderthumb.gif‎|thumb|Slider]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: Yes&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: For best results between 2 and 12, supports unlimited space permitting.&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Five template/Bootstrap 2&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replaced by the Universal Slider in 6.2. This cart is now deprecated and will no longer receive updates.&lt;br /&gt;
&lt;br /&gt;
==Verticalsteps==&lt;br /&gt;
[[File:Verticalstepsthumb.gif‎|thumb|Vertical Steps]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-warning&amp;quot;&amp;gt;&lt;br /&gt;
'''Supported Features'''&lt;br /&gt;
&lt;br /&gt;
Headline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Tagline: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Feature Highlights: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Featured Products: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Product Group Features: No&amp;lt;br /&amp;gt;&lt;br /&gt;
Number of Products: Unlimited&amp;lt;br /&amp;gt;&lt;br /&gt;
Compatible With: Five template/Bootstrap 2&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replaced by the Standard Cart in 6.1. This cart is now deprecated and will no longer receive updates.&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=File:Client_trans.png&amp;diff=18402</id>
		<title>File:Client trans.png</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=File:Client_trans.png&amp;diff=18402"/>
				<updated>2016-03-28T13:41:58Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: Steven.Mueller uploaded a new version of &amp;amp;quot;File:Client trans.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Clients:Transactions_Tab&amp;diff=18395</id>
		<title>Clients:Transactions Tab</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Clients:Transactions_Tab&amp;diff=18395"/>
				<updated>2016-03-28T13:40:33Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: DOCS-6423:  Clarify Documentation on Adding Transaction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;{{Client Management}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:client_trans.png|thumb|Client Transactions Tab]]&lt;br /&gt;
The Transactions tab is accessed via the '''Clients &amp;gt; View/Search Clients''' page, select a client, then click the tab marked &amp;quot;Transactions&amp;quot;. It contains summary statistics of the transactions made by this client along with a paginated list of all their transactions, icons to edit or delete an existing quote and a link to record a new transaction.&lt;br /&gt;
&lt;br /&gt;
The number of entries per page is determined under Setup &amp;gt; General Settings. Click the table headings to change the sorting order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Add New Transaction====&lt;br /&gt;
Clicking the '''Add New Transaction''' link will record a new transaction against this client's account.  &lt;br /&gt;
{|class=&amp;quot;table table-striped&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| '''Date'''&lt;br /&gt;
| Enter the date of the transaction&lt;br /&gt;
|-&lt;br /&gt;
| '''Description'''&lt;br /&gt;
| Enter a description for this transaction (required if no Invoice ID specified)&lt;br /&gt;
|-&lt;br /&gt;
| '''Transaction ID'''&lt;br /&gt;
| Enter a transaction ID if relevant to the transaction&lt;br /&gt;
|-&lt;br /&gt;
| '''Invoice ID'''&lt;br /&gt;
| Enter an invoice ID to apply the transaction against (required if no description entered - single Invoice ID value only)&lt;br /&gt;
|-&lt;br /&gt;
| '''Payment Method'''&lt;br /&gt;
| Select the payment method this transaction was received by&lt;br /&gt;
|-&lt;br /&gt;
| '''Amount In'''&lt;br /&gt;
| Enter the amount that was received (no currency symbols)&lt;br /&gt;
|-&lt;br /&gt;
| '''Fees'''&lt;br /&gt;
| Enter the amount that the payment gateway charged for this transaction&lt;br /&gt;
|-&lt;br /&gt;
| '''Amount Out'''&lt;br /&gt;
| Enter the amount that was sent to the customer (for refund transactions)&lt;br /&gt;
|-&lt;br /&gt;
| '''Credit'''&lt;br /&gt;
| Check this box to apply the transaction against the client's credit balance (requires a description entered)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;docs-alert-info&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;strong&amp;gt;Did You Know?&amp;lt;/strong&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;WHMCS provides an easy interface to add transactions for clients, including a way to apply a transaction across many invoices?  To find out more check out the [[Transactions#Adding_a_Manual_Transaction|Adding a Manual Transaction]] section of our [[Transactions#|Transactions]] page.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Language_Files&amp;diff=18386</id>
		<title>Language Files</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Language_Files&amp;diff=18386"/>
				<updated>2016-03-28T13:26:37Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: /* Default Languages */ Correct count of client area and admin area languages in use&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WHMCS supports numerous languages, in both in the client and admin areas. To enable this, all text used throughout the system is stored within language files.&lt;br /&gt;
&lt;br /&gt;
Language files are stored in the '''/lang/''' sub-folders of both the client and admin directories.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Default Languages==&lt;br /&gt;
&lt;br /&gt;
WHMCS includes 21 client area translations by default. These are:&lt;br /&gt;
&lt;br /&gt;
'''Arabic, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Farsi, French, German, Hungarian, Italian, Norwegian, Brazilian &amp;amp; Native Portuguese, Russian, Spanish, Swedish, Turkish &amp;amp; Ukranian'''&lt;br /&gt;
&lt;br /&gt;
And for the admin area there are 13 translations included:&lt;br /&gt;
&lt;br /&gt;
'''Arabic, Czech, Dutch, English, Farsi, French, Hebrew, Hungarian, Italian, Portuguese, Russian, Spanish &amp;amp; Turkish'''&lt;br /&gt;
&lt;br /&gt;
We rely on the dedication and generosity of our users for contributing translations, as we find real life translations are a much higher quality compared with using automated translation systems as some softwares do. So if you have any suggestions for improvements, or a new language file you are willing to contribute, please get in touch.&lt;br /&gt;
&lt;br /&gt;
==Adding a New Language==&lt;br /&gt;
&lt;br /&gt;
If a language you operate in is not available as standard, then you can create your own translation. Here's how:&lt;br /&gt;
&lt;br /&gt;
#Begin by opening an existing language file&lt;br /&gt;
#Save this file with a new name - the name you want to be shown in the language selection dropdown menu in WHMCS - the name should only consist of a-z0-9 characters and end with the extension &amp;quot;.php&amp;quot;&lt;br /&gt;
#Once the file has been created, you can then begin going through and translating the lines within it&lt;br /&gt;
#An example line is as follows - you should only change the part in bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$_LANG['accountinfo'] = &amp;quot;Account Information&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Be careful not to delete any of the quotation marks (&amp;quot;) around the text strings or the semi-colons on the ends of each line (;). Also should you want to use a quote character (&amp;quot;) within your translated text, you must escape it - for example: \&amp;quot;  The language files are written in PHP syntax so valid PHP code must be maintained.''&lt;br /&gt;
&lt;br /&gt;
===Encoding===&lt;br /&gt;
By default the language files in WHMCS use the UTF-8 encoding without a Byter Order Marker character at the start. When modifying these files it is important to  maintain the same encoding.&lt;br /&gt;
&lt;br /&gt;
If you have chosen to change the system charset setting to something other than UTF-8 (eg. iso-8859-1) then the language files will need to be re-saved with ANSI encoding without a Byte Order Marker. Most text editors have this option (including Notepad).&lt;br /&gt;
&lt;br /&gt;
==Overriding Language Strings==&lt;br /&gt;
&lt;br /&gt;
{{:Language_Overrides}}&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	<entry>
		<id>http://3.19.219.109/index.php?title=Language_Files&amp;diff=18319</id>
		<title>Language Files</title>
		<link rel="alternate" type="text/html" href="http://3.19.219.109/index.php?title=Language_Files&amp;diff=18319"/>
				<updated>2016-03-21T20:25:20Z</updated>
		
		<summary type="html">&lt;p&gt;Steven.Mueller: DOCS-6297 - Update Language Document to Include Full List of Languages Support in Admin Area in 6.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WHMCS supports numerous languages, in both in the client and admin areas. To enable this, all text used throughout the system is stored within language files.&lt;br /&gt;
&lt;br /&gt;
Language files are stored in the '''/lang/''' sub-folders of both the client and admin directories.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Default Languages==&lt;br /&gt;
&lt;br /&gt;
WHMCS includes 20 client area translations by default. These are:&lt;br /&gt;
&lt;br /&gt;
'''Arabic, Catalan, Croatian, Czech, Danish, Dutch, English, Farsi, French, German, Hungarian, Italian, Norwegian, Brazilian &amp;amp; Native Portuguese, Russian, Spanish, Swedish, Turkish &amp;amp; Ukranian'''&lt;br /&gt;
&lt;br /&gt;
And for the admin area there are 6 translations included:&lt;br /&gt;
&lt;br /&gt;
'''Arabic, Czech, Dutch, English, Farsi, French, Hebrew, Hungarian, Italian, Portuguese, Russian, Spanish &amp;amp; Turkish'''&lt;br /&gt;
&lt;br /&gt;
We rely on the dedication and generosity of our users for contributing translations, as we find real life translations are a much higher quality compared with using automated translation systems as some softwares do. So if you have any suggestions for improvements, or a new language file you are willing to contribute, please get in touch.&lt;br /&gt;
&lt;br /&gt;
==Adding a New Language==&lt;br /&gt;
&lt;br /&gt;
If a language you operate in is not available as standard, then you can create your own translation. Here's how:&lt;br /&gt;
&lt;br /&gt;
#Begin by opening an existing language file&lt;br /&gt;
#Save this file with a new name - the name you want to be shown in the language selection dropdown menu in WHMCS - the name should only consist of a-z0-9 characters and end with the extension &amp;quot;.php&amp;quot;&lt;br /&gt;
#Once the file has been created, you can then begin going through and translating the lines within it&lt;br /&gt;
#An example line is as follows - you should only change the part in bold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$_LANG['accountinfo'] = &amp;quot;Account Information&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Be careful not to delete any of the quotation marks (&amp;quot;) around the text strings or the semi-colons on the ends of each line (;). Also should you want to use a quote character (&amp;quot;) within your translated text, you must escape it - for example: \&amp;quot;  The language files are written in PHP syntax so valid PHP code must be maintained.''&lt;br /&gt;
&lt;br /&gt;
===Encoding===&lt;br /&gt;
By default the language files in WHMCS use the UTF-8 encoding without a Byter Order Marker character at the start. When modifying these files it is important to  maintain the same encoding.&lt;br /&gt;
&lt;br /&gt;
If you have chosen to change the system charset setting to something other than UTF-8 (eg. iso-8859-1) then the language files will need to be re-saved with ANSI encoding without a Byte Order Marker. Most text editors have this option (including Notepad).&lt;br /&gt;
&lt;br /&gt;
==Overriding Language Strings==&lt;br /&gt;
&lt;br /&gt;
{{:Language_Overrides}}&lt;/div&gt;</summary>
		<author><name>Steven.Mueller</name></author>	</entry>

	</feed>