To count total by current year and current month you need to execute the following MySQL statement:
Select * from tablename where year(columnname)=year(now()) and month(columnname)=month(now())
Example: Suppose we have a database product ...
screen.availHeight:
This denotes the available height in the screen, i.e., the height of the users screen. Thus, if the screen resolution of the
users screen is 1366 768 pixels and the height of the taskbar is 25 pixels, this
property will ...
Hi All,
I need to do the below requirement in my app.
When app is in background, call a webservice. This service will have an XML response containing new features of the app.
If there is some response, show it as a notification to the ...
The functioning part both the syntax will work the same but by inditing session_unset will clears the $_SESSION variable but will not ravage the variables and it will initialize to this stage:
session_unset(); effaces only the variables from s...
If you are looking to make search based on day and month and wants to neglect year like you want to search all records between 2 March to 10 September under any year.
$schFrm = '2015-03-02'; //You can specify any year like 2015, 1980, 2005 etc...
If define Payment Transaction in sale order in sale module then first override the function and inherit to the view from sale and add fields acquirer_name in sale order model and set default draft method and use this function in your own module....
In order to set cron in zend framework please follow the below steps.
Step 1: Please do not execute or access the bootstrap's run function directly in the file index.php
Location of file : public_html/index.php
Now Upgrade below code:...
What is an API ? :- Generally API means Application Programming Interface, which specializes that how one element must collaborate with the another element. This comprises of a group of procedures, protocols and equipment for building or construc...
CakePHP database configuration details are in a file that is located at app/Config/database.php.
the database file. You can edit the file in the notepad or sublime and can edit the feilds by which it will be connected to the database.
Here w...
I have a situation where we have to make query for searching on the basis of multiple fields with Laravel 4.x. So for this we have many method either we will concatenate or we will use OR query in Laravel
Example:
$searchqueryResult =User:...
Arrays are the sequential memory storage which holds the different elements of same type under a common name.
The arrays have key/value pair in which the key points to the value.
There are two types of arrays:
Indexed array and
Asso...
CDN is a Content Delivery System which are deployed in multiple data centers across the internet. It's goal is to serve end users. There are 3 popular jquery CDNs:
1. Google
2. Microsoft
3. jQuery.
Load jQuery from CDN:
Code to load jQue...
Mobile Responsive Email Template Using HTML
The tutorial explains how to build an Advanced email template that works in every email client, including outlook and smartphone apps. To acquire maximum compatibility it goes with minimal media querie...
User Name Validation Code: Use below code, to check if the name field only contains alphabet and white space.
$name = test_input($_POST["name"]);
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only alphabet and white space allowed"...
Hello Readers!
We can use YouTube Data API to retrieve video thumbnails, caption, description, rating, statistics and more. API version 3 requires a key*. Obtain the key and create a videos: list request.
Example PHP Code
$data = file_ge...
Assertion Based Testing:- Assertion based testing is a boolean expression testing. An assertion is a boolean style at a general details in any program how will be correct or true although there is a issue or bug in the program. A test assertion ...
The array_unique() function removes duplicate values from an array. If two or more array values are the same, the first appearance will be kept and the other will be removed.
Example :
<?php
$a=array("a"=>"red","b"=>"green","c"=&...
Hello Readers !
== compares the values of variables for equality, type casting as necessary. === checks if the two variables are of the same type AND have the same value.
Examples:
1 === 1: true
1 == 1: true
1 === "1": false // 1 is an...
What is use of ucfirst() in php ?
The ucfirst() function is used for converting the first character of a string to uppercase.
Syntax of ucfirst() function:
ucfirst(string)
string is a parameter that is compulsory to given for convert...
Function in SQL
There are two type of function in sql
SQL aggregate function
1) AVG() - Returns the average value
SELECT AVG(column_name) FROM table_name
2) COUNT() - Returns the number of rows
SELECT COUNT(column_name...
Option 1 :
You need to set the value of upload_max_filesize and post_max_size in your php.ini :
; Maximum allowed size for uploaded files.
upload_max_filesize = 40M
; Must be greater than or equal to upload_max_filesize
post_max_size ...
There are many predefined variables in PHP which are "superglobals", that denotes they are always accessible, regardless of scope.
and you can access them according to your need from any function.
So, there are 5 main superglobal variables i...
Errors are the unwanted conditions which interrupts the normal flow of the program.
Errors can be categorized in two :
Syntax Error : If there is any symbol missing or mistake in the statements of the program those are syntax errors.
Log...
JSON stands for JavaScript Object Notation which is a format for storing data.
JSON is used when we have to send data from server to webpage.
JSON Example
{
"employees":[
{"firstName":"Pranav", "lastName":"Chhabra"},
{"firstNam...
The code below will help you in declaration of completion handler and how to call the completion handler in swift.
To declare a completion handler in swift use the line :
typealias completionHander = (sucess: Bool)->Void
//decalrat...
Hello everyone,
I am facing a problem in uploading a image to server.
I am able to successfully capture a image from the camera or select a image from the gallery,
but i have to provide a crop option before uploading the image just like in Wha...
Paper formats are records of report.paperformat and can contain the following attributes:
1. name (mandatory) : only useful as a mnemonic/description of the report when looking for one in a list of some sort.
2. description : a small descript...
In odoo useful remarks have three useful step-
1- Twitter Bootstrap and FontAwesome classes can be used in your report template
2- Local CSS can be put directly in the template
3- Global CSS can be inserted in the mai...
Hi fellows here I created many2many field in view it widget is many2many_tags here I select products as tags
now what I really want is that I want to show only that products in project.task field product_id which I have selected in the many2man...
Hello everyone,
I was working with navigation bar and found a way so that you could make the status as well as navigation bar transparent, your views could be shown bellow to the navigation bar, by default activity is shown above the navigatio...
Hello Everyone,
Want to get the height of on screen navigation bar ??
Here is a solution
private int getNavigation_bar_Height(){
Resources resources = getResources();
int resourceId = resources.getIdentifier("navigat...
Hello everyone ,
I was working on status bar and found that we could get the height of the navigation bar at runtime.
following is the code to get the height of the status bar.
private int getStatusBarHeight() {
int result = 0;
...
Create and remove remote branch on GIT : As we know that the git is used to collaborate between team. Developers can share the code using git by sitting anywhere on this word, for this the code should be exist in a central repository which is acc...
Making NGINX Server HTTPS Certified
For making a server HTTPS compatible, these steps can be followed if you are purchasing the SSL certificate from Godaddy:
Purchase an SSL certificate from Godaddy.
Now login to your server using SSH
...
Barcodes are images returned by a controller and can easily be embedded in reports thanks to the QWeb syntax:
<img t-att-src="'/report/barcode/QR/%s' % 'My text in qr code'">
If you want more parameters can be passed as a query stri...
HttpServletRequestWrapper Class : In JavaEE everything is in the form of request and response. User sends the request and server do the response. Now the question is what if we want to change the request data or wanna override the default request...
To display a table structure in MySQL first of all you need to go inside the database using following MySQL statement:
use databasename;
To display the table structure you need to execute the following MySQL statement:
describe tablena...
In minimal template you can call the translatable document from your main template with the attribute t-lang set to a language code or to a record field.
You also need to re-browse the related records with the proper context if you use fields t...
To find out the current user you need to execute the following MySQL statement:
SELECT USER();
To find out the current date you need to execute the following MySQL statement:
SELECT CURDATE();
To find out the version of MySQL you ...
In Odoo-9 by default, tests are run once right after the corresponding module has been installed. Test cases can also be configured to run after all modules have been installed, and not run right after the module installation.For example code is ...
There are some specific variables accessible to make template reports.
1. docs : records for the current report
2. doc_ids : list of ids for the docs records
3. doc_model : model for the docs records
4. time : a reference to time from the Pyt...
In Odoo-9 reports are written in HTML/QWeb, like all regular views in Odoo. You can use the usual QWeb control flow tools. The PDF rendering itself is performed by pdf.For example code is below.
report
id="account_invoices"
model="ac...
This post describes the major differences between CTE, temp table and table variables.
1) CTE
CTE stands for Common Table expressions. These are simple select queries and they do not create physical space in tempDB. Unlike temporary tabl...
The following article captures the difference between truncate and delete.
1) Rollback Possibility:
It is possible rollback a DELETE operation but not a TRUNCATE operation.
2) Impact on Identity
TRUNCATE resets identity of a t...
Yo can login to MySQL using following command:
mysql -h hostname -u <UserName> -p <password>
Suppose you are login with hostname as 'localhost ', Username as 'root' and password as 'root'. Then the command will be as follows:
...
Drivers enables the developers to build database applications in their language of choice. Drivers available in Mysql:
PHP Driver:The MySQL native driver for PHP is a replacement for the MySQL Client Library for the PHP script language.
JD...
To compare two dates we can use the following code :
NSComparisonResult result = [mydate1 compare:mydate2];
//where mydate1 and mydate2 are two dates we want to compare.
if (result == NSOrderedDescending) {
//mydate1 is later than myda...
The quantity from specific source location with Consumed product and param product_qty means that Consumed product quantity and param location_id is Source location and returns Consumed lines in this function. Use the below function in .py file
...
Use the following codes to count the character dynamically enter by user in the input tag.
HTML Code:-insert the following code in the form tag.
<input type="text" maxlength="12" />
<span>0</span>/12
jQuery Code:inse...
Functional Testing- Functional testing ensures that the application is working as per the requirements. Most of the test conducted for this is driven by the user interface and call flows.
Laboratory Testing- It is done by simulating the comp...