<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programming Ideas, Logics, Tips and Tricks &#187; php source code</title>
	<atom:link href="http://www.sajithmr.me/category/php-source-code/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me</link>
	<description></description>
	<lastBuildDate>Mon, 23 Jan 2012 15:44:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Pass parameter to an iframe embedded Fan Page in Facebook</title>
		<link>http://www.sajithmr.me/pass-parameter-to-an-iframe-embedded-fan-page-in-facebook</link>
		<comments>http://www.sajithmr.me/pass-parameter-to-an-iframe-embedded-fan-page-in-facebook#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:28:33 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[webworld]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1076</guid>
		<description><![CDATA[Those who use their on hosting inside an iframe  for Facebook Fan page, there is a mechanism to pass additional parameters to your iframe page if you need to create a deep URL. A normal Fan page of Facebook would like this: https://www.facebook.com/apps/application.php?id=xxxxxxxxxx&#038;sk=app_XXXXXX This Url will call your domain, say example.com inside the iframe to [...]]]></description>
			<content:encoded><![CDATA[<p>Those who use their on hosting inside an iframe  for Facebook Fan page, there is a mechanism to pass additional parameters to your iframe page if you need to create a deep URL.</p>
<p>A normal Fan page of Facebook would like this:</p>
<p>https://www.facebook.com/apps/application.php?id=xxxxxxxxxx&#038;sk=app_XXXXXX</p>
<p>This Url will call your domain, say example.com inside the iframe to load the page.</p>
<p>Each time the iframe is loaded, Facebook do a POST to this iframe URL with some data which we can use to identify the status of the user, eg, whether the user already liked this page, or any other parameter is passed through the fan page url.</p>
<p>Facebook keep app_data variable for developers to pass additional parameters to your iframe page.</p>
<p>eg: https://www.facebook.com/apps/application.php?id=xxxxxxxxxx&amp;sk=app_XXXXXX&amp;app_data=mydata</p>
<p>To retrieve this information, in PHP, use can use the following code:</p>
<p>&lt;?php</p>
<p>if(isset($_REQUEST["signed_request"]))<br />
{</p>
<p>$signed_request = $_REQUEST["signed_request"];<br />
// $_POST also work, but better with $_REQUEST</p>
<p>list($encoded_sig, $payload) = explode(&#8216;.&#8217;, $signed_request, 2);</p>
<p>$data = json_decode(base64_decode(strtr($payload, &#8216;-_&#8217;, &#8216;+/&#8217;)), true);</p>
<p>if(isset($data['app_data']))<br />
{<br />
$mydata = $data['app_data']; //here you can get the value you passed<br />
}<br />
}</p>
<p>?&gt;</p>
<p>Check my article <a title="Like to see content" href="http://www.sajithmr.me/facebook-like-to-see-the-content">here</a>  to see how you can get the &#8216;like&#8217; status using PHP</p>
<p>Courtesy: From various online sources</p>
<p>Thanks<br />
Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/pass-parameter-to-an-iframe-embedded-fan-page-in-facebook/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jRecorder 1.1 with Preview option is released</title>
		<link>http://www.sajithmr.me/jrecorder1-1-with-preview-option-is-released</link>
		<comments>http://www.sajithmr.me/jrecorder1-1-with-preview-option-is-released#comments</comments>
		<pubDate>Wed, 14 Dec 2011 17:39:44 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[webworld]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1071</guid>
		<description><![CDATA[Two months ago, I published a jQuery plugin to record audio from browser (without any Media server) called jRecorder I got many responses and requests to maintain the code with new enhancements and some bug fixes. Based on that, a new version (1.1) is released which has the capability to preview the recorded audio before [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" src="http://www.sajithmr.me/wp-content/uploads/2011/10/recorder.png" alt="" width="326" height="124" /></p>
<p>Two months ago, I published a jQuery plugin to record audio from browser (without any Media server) called <a title="jRecorder - jQuery Plugin" href="http://www.sajithmr.me/jrecorder-jquery" target="_blank">jRecorder</a></p>
<p>I got many responses and requests to maintain the code with new enhancements and some bug fixes.</p>
<p>Based on that, a new version (<a title="jRecorder with Preview" href="http://www.sajithmr.me/jrecorder/index.html" target="_blank">1.1</a>) is released which has the capability to preview the recorded audio before sending to the server.</p>
<p>See the example implementation and documentation <a title="jRecorder - jQuery Plugin" href="http://www.sajithmr.me/jrecorder/index.html" target="_blank">here</a>.</p>
<p>Also I made this source open and available for anybody to develop at: https://github.com/sythoos/jRecorder/</p>
<p>Thanks</p>
<p>Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/jrecorder1-1-with-preview-option-is-released/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Facebook &#8211; Like to see the content</title>
		<link>http://www.sajithmr.me/facebook-like-to-see-the-content</link>
		<comments>http://www.sajithmr.me/facebook-like-to-see-the-content#comments</comments>
		<pubDate>Wed, 09 Nov 2011 21:29:20 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[php source code]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1059</guid>
		<description><![CDATA[Sometime in Facebook Pages, you can see the message / banner, we have offers for you, like us to see. Or Like us to unlock the content etc. These all are for getting more likes in their Facebook page and indeed, it is a very nice idea to spread your updates among many of your [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime in Facebook Pages, you can see the message / banner, we have offers for you, like us to see. Or Like us to unlock the content etc. These all are for getting more likes in their Facebook page and indeed, it is a very nice idea to spread your updates among many of your Facebook Fans. Usually people won&#8217;t do the dislike option to revert it back!</p>
<p>The question is how can we do this ?</p>
<p>The trick here is, you need to create a page using iframe as you usually create FB app. In that iframe, you have your custom page fragment hosted somewhere else showing some copies/contents/offer etc.</p>
<p>Each time when Facebook load your url inside the iframe, Facebook do a POST to your domain signed_request as the parameter. The rest of the part you have to handle with your server side scripting.</p>
<p>Here mine is PHP:</p>
<p>&lt;?php</p>
<p>$signed_request = $_REQUEST["signed_request"];<br />
// $_POST also work, but better with $_REQUEST</p>
<p>list($encoded_sig, $payload) = explode(&#8216;.&#8217;, $signed_request, 2);</p>
<p>$data = json_decode(base64_decode(strtr($payload, &#8216;-_&#8217;, &#8216;+/&#8217;)), true);</p>
<p>if (empty($data["page"]["liked"])) {</p>
<p>//write code here to show a non-liked situational contents<br />
echo &#8220;You haven&#8217;t liked us yet&#8221;;</p>
<p>}<br />
else {</p>
<p>//write code here to show contents for already liked people<br />
echo &#8220;Hello Fan, here are your offers.&#8221;;</p>
<p>}<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/facebook-like-to-see-the-content/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jRecorder &#8211; jQuery plugin for audio recording</title>
		<link>http://www.sajithmr.me/jrecorder-jquery</link>
		<comments>http://www.sajithmr.me/jrecorder-jquery#comments</comments>
		<pubDate>Wed, 26 Oct 2011 15:50:03 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php source code]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=1034</guid>
		<description><![CDATA[Recently I made a jQuery plugin named jRecorder to record voice in html pages. This plugin is very easy to integrate with your web page and you DON&#8217;T need a flash server or RED5 server to do the recording What all you need is a Web Server (PHP or any server scripting language). You can [...]]]></description>
			<content:encoded><![CDATA[<p><a title="jRecorder" href="http://www.sajithmr.me/jrecorder/index.html" target="_blank"><img class="alignnone size-full wp-image-1035" title="recorder" src="http://www.sajithmr.me/wp-content/uploads/2011/10/recorder.png" alt="" width="326" height="124" /></a></p>
<p>Recently I made a jQuery plugin named jRecorder to record voice in html pages.</p>
<p>This plugin is very easy to integrate with your web page and you DON&#8217;T need a flash server or RED5 server to do the recording</p>
<p>What all you need is a Web Server (PHP or any server scripting language).</p>
<p>You can find the documentation and <a title="jRecorder - jQuery Plugin" href="http://www.sajithmr.me/jrecorder/index.html" target="_blank">Download</a> the plugin <a title="jRecorder - jQuery Plugin" href="http://www.sajithmr.me/jrecorder/index.html" target="_blank">HERE</a>.</p>
<p>eg: $.jRecorder( settings );</p>
<p>Another advantage is your can decide your recorder design, buttons , mic activity level , recording progress etc in HTML+CSS and this plugin gives you many recording callback events to manage. It is like jPlayer plugin for audio playback.</p>
<pre>$.jRecorder ({

   'rec_width': '300',
   'rec_height': '200',
   'rec_top': '0px',
   'rec_left': '0px',
   'recorderlayout_id' : 'flashrecarea',
   'recorder_id' : 'audiorecorder',
   'recorder_name': 'audiorecorder',
   'wmode' : 'transparent',
   'bgcolor': '#ff0000',
   'swf_path': 'jRecorder.swf',
   'host': 'acceptfile.php?filename=hello.wav',
   'callback_started_recording' : function(){},
   'callback_finished_recording' : function(){},
   'callback_stopped_recording': function(){},
   'callback_error_recording' : function(){},
   'callback_activityTime': function(time){},
   'callback_activityLevel' : function(level){}
});</pre>
<p>This plugin sends recorded WAV file to your webserver, where you can save this file where ever you wish. You can use FFMPEG tool to convert this WAV to MP3 or any other format for further use</p>
<p>The technology used here is, the plugin uses hidden swf file to record the voice and save the binary data in browser&#8217;s cache and when the recording finishes, it sends the data to webserver. Thats why you don&#8217;t need any Flash media server to capture the recording on time.</p>
<p>The plugin is good for recording voice less than 180 seconds (3 min), else the time to upload the final data to server takes longer.</p>
<p>Feel free to add comments here if the plugin causes any problem or error.</p>
<p>Those who wish to continue the development, the GIT version is available at: <a title="jRecorder - jQuery Plugin" href="https://github.com/sythoos/jRecorder/" target="_blank">https://github.com/sythoos/jRecorder/</a></p>
<p>Thanks</p>
<p>Sajith</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/jrecorder-jquery/feed</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>VARDUMP.IT &#8211; PHP remote debugging console</title>
		<link>http://www.sajithmr.me/vardump-it-php-remote-debugging-console</link>
		<comments>http://www.sajithmr.me/vardump-it-php-remote-debugging-console#comments</comments>
		<pubDate>Thu, 10 Jun 2010 23:42:43 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[webworld]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[vardump]]></category>
		<category><![CDATA[var_dump]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=833</guid>
		<description><![CDATA[In PHP coding, we spend most of the time for debugging. Either we use echo, print_r or var_dump to check variable values or check whether a particular function is executing or not. These all things are outputting something to browser. This is not applicable in case of redirection, or image processing (GD) or sometimes with [...]]]></description>
			<content:encoded><![CDATA[<p><a href=" http://vardump.it" target="_blank"><img class="alignnone" src="http://vardump.it/images/logo.jpg" alt="" width="206" height="58" /></a></p>
<p>In PHP coding, we spend most of the time for debugging. Either we use echo, print_r or var_dump to check variable values or check whether a particular function is executing or not.</p>
<p>These all things are outputting something to browser. This is not applicable in case of redirection, or image processing (GD) or sometimes with callback url for Payment integrations.</p>
<p>header(Location: etc);may cause Warning : header is already sent , if you put an echo or debug and you cannot  see the output, since it redirects into some other page.</p>
<p>Here is your <strong><span style="color: #993300;">remote debugging console</span></strong> to solve these problems.<a href=" http://vardump.it" target="_blank"> http://vardump.it</a></p>
<p><img class="alignnone size-full wp-image-834" title="remote-console" src="http://www.sajithmr.me/wp-content/uploads/2010/06/remote-console.png" alt="remote-console" width="400" height="320" /></p>
<p>Copy the url from the site and use that url for your debugging purpose and <strong><span style="color: #ff6600;">keep the console open in another tab.</span></strong></p>
<p>eg:</p>
<p>&lt;?php</p>
<p>file_get_contents(&#8216;http://vardump.it/253522/inserted-into-database&#8217;);  // last part of this url is your debugging message</p>
<p>?&gt;</p>
<p>You can see these messages from your remote console http://vardump.it/253522 (last numbers are your unique key)</p>
<p>The debug url is formatted in this way: <span style="text-decoration: underline;"><strong>http://vardump.it/debug-id/your message here</strong></span></p>
<p>Email me for more details.</p>
<p>More features like watch, break etc are under development</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/vardump-it-php-remote-debugging-console/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Algorithm for range of dates</title>
		<link>http://www.sajithmr.me/algorithm-for-range-of-dates</link>
		<comments>http://www.sajithmr.me/algorithm-for-range-of-dates#comments</comments>
		<pubDate>Wed, 12 May 2010 12:22:08 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[from date]]></category>
		<category><![CDATA[last 7 days]]></category>
		<category><![CDATA[last month]]></category>
		<category><![CDATA[last quarter]]></category>
		<category><![CDATA[last week]]></category>
		<category><![CDATA[php code]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[this month]]></category>
		<category><![CDATA[this quarter]]></category>
		<category><![CDATA[this week]]></category>
		<category><![CDATA[this year]]></category>
		<category><![CDATA[to date]]></category>
		<category><![CDATA[today]]></category>
		<category><![CDATA[yesterday]]></category>

		<guid isPermaLink="false">http://www.sajithmr.me/?p=691</guid>
		<description><![CDATA[Here is a php function which returns from and to date as an array for a range: &#60;?php function get_rangeof_dates($time_frame = &#8216;all_time&#8217;) { $from_date = &#8221;; $to_date = &#8221;; switch($time_frame) { case &#8216;all_time&#8217;:        $from_date = &#8217;1170-01-01 00:00:00&#8242;; $to_date = &#8217;2250-12-31 23:59:59&#8242;; break; case &#8216;today&#8217;: $from_date = date(&#8216;Y-m-d 00:00:00&#8242;); $to_date = date(&#8216;Y-m-d 23:59:59&#8242;); [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-709" title="calendar-icon" src="http://www.sajithmr.me/wp-content/uploads/2010/05/calendar-icon.png" alt="calendar-icon" width="256" height="256" /></p>
<p>Here is a php function which returns from and to date as an array for a range:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #bf2e9d;">&lt;?php</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #bf2e9d;"><span style="color: #000000;"><span style="color: #bf2e9d;">function</span> get_rangeof_dates($time_frame = <span style="font: 11.0px Menlo; color: #2832cf;">&#8216;all_time&#8217;</span>)</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = <span style="font: 11.0px Menlo; color: #2832cf;">&#8221;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = <span style="font: 11.0px Menlo; color: #2832cf;">&#8221;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"><span style="white-space: normal;"><span style="color: #bf2e9d;">switch</span>($time_frame)</span></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #2832cf;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #bf2e9d;">case</span><span style="color: #000000;"> </span><span style="font: 11.0px Menlo;">&#8216;all_time&#8217;</span><span style="color: #000000;">:        $from_date = </span><span style="font: 11.0px Menlo;">&#8217;1170-01-01 00:00:00&#8242;</span><span style="color: #000000;">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span>$to_date = </span>&#8217;2250-12-31 23:59:59&#8242;<span style="font: 12.0px Menlo; color: #000000;">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #2832cf;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span><span style="color: #bf2e9d;">case</span><span style="color: #000000;"> </span><span style="font: 11.0px Menlo;">&#8216;today&#8217;</span><span style="color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 00:00:00&#8242;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 23:59:59&#8242;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;yesterday&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 00:00:00&#8242;</span>, time()- <span style="font: 11.0px Menlo; color: #2832cf;">24</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 23:59:59&#8242;</span>, time()- <span style="font: 11.0px Menlo; color: #2832cf;">24</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;this_week&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 00:00:00&#8242;</span>, time() &#8211; (date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;w&#8217;</span>, time()) * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span>));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 23:59:59&#8242;</span>, time() + ((<span style="font: 11.0px Menlo; color: #2832cf;">6</span> &#8211; date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;w&#8217;</span>, time())) * <span style="font: 11.0px Menlo; color: #2832cf;">60</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span> ));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;last_week&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 00:00:00&#8242;</span>, time() &#8211; (date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;w&#8217;</span>, time()) * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span>) &#8211; <span style="font: 11.0px Menlo; color: #2832cf;">7</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 23:59:59&#8242;</span>, time() + (( <span style="font: 11.0px Menlo; color: #2832cf;">6</span> &#8211; date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;w&#8217;</span>, time()) ) * <span style="font: 11.0px Menlo; color: #2832cf;">60</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span> ) &#8211; <span style="font: 11.0px Menlo; color: #2832cf;">7</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">case</span> <span style="font: 11.0px Menlo; color: #2832cf;">&#8216;last_7_days&#8217;</span>:     $additonal_query = <span style="font: 11.0px Menlo; color: #d62b24;">&#8220;created_at &gt; &#8216;&#8221;</span>.date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d&#8217;</span>, time()- <span style="font: 11.0px Menlo; color: #2832cf;">7</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> )<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #d62b24;">&#8220;&#8216;&#8221;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 00:00:00&#8242;</span>, time()- <span style="font: 11.0px Menlo; color: #2832cf;">7</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 23:59:59&#8242;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;this_month&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 00:00:00&#8242;</span>, mktime( <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;m&#8221;</span>)  , <span style="font: 11.0px Menlo; color: #2832cf;">1</span> , date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;Y&#8221;</span>) ) );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 23:59:59&#8242;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;last_month&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;Y-m-01 00:00:00&#8243;</span>, strtotime(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;-1 month&#8221;</span>, strtotime(date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;Y-m-d&#8221;</span>))));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;Y-m-d 23:59:59&#8243;</span>, strtotime(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;-1 day&#8221;</span>, strtotime(date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;Y-m-01&#8243;</span>))));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;last_30_days&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 00:00:00&#8242;</span>, time()- <span style="font: 11.0px Menlo; color: #2832cf;">30</span> * <span style="font: 11.0px Menlo; color: #2832cf;">24</span>* <span style="font: 11.0px Menlo; color: #2832cf;">60</span> * <span style="font: 11.0px Menlo; color: #2832cf;">60</span> );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-m-d 23:59:59&#8242;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;this_quarter&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$month = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;m&#8217;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$year = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y&#8217;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">if</span>($month == <span style="font: 11.0px Menlo; color: #2832cf;">1</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">2</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">3</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-01-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-03-31&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">elseif</span>($month == <span style="font: 11.0px Menlo; color: #2832cf;">4</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">5</span>|| $month == <span style="font: 11.0px Menlo; color: #2832cf;">6</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-04-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-06-30&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">elseif</span>($month == <span style="font: 11.0px Menlo; color: #2832cf;">7</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">8</span>|| $month == <span style="font: 11.0px Menlo; color: #2832cf;">9</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-07-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-09-30&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">else</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-10-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-12-31&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;last_quarter&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$month = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;m&#8217;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$year = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y&#8217;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">if</span>($month == <span style="font: 11.0px Menlo; color: #2832cf;">1</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">2</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">3</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = ($year -<span style="font: 11.0px Menlo; color: #2832cf;">1</span>)<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-10-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = ($year-<span style="font: 11.0px Menlo; color: #2832cf;">1</span>)<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-12-31&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">elseif</span>($month == <span style="font: 11.0px Menlo; color: #2832cf;">4</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">5</span>|| $month == <span style="font: 11.0px Menlo; color: #2832cf;">6</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-01-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-03-31&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">elseif</span>($month == <span style="font: 11.0px Menlo; color: #2832cf;">7</span> || $month == <span style="font: 11.0px Menlo; color: #2832cf;">8</span>|| $month == <span style="font: 11.0px Menlo; color: #2832cf;">9</span> )</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-04-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-06-30&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">else</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>{</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-07-01&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = $year<span style="color: #bf2e9d;">.</span><span style="font: 11.0px Menlo; color: #2832cf;">&#8216;-09-30&#8242;</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;this_year&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-01-01 00:00:00&#8242;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-12-31 23:59:59&#8242;</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #2832cf;"><span style="font: 12.0px Menlo; color: #000000;"><span style="white-space: pre;"> </span></span><span style="font: 12.0px Menlo; color: #bf2e9d;">case</span><span style="font: 12.0px Menlo; color: #000000;"> </span>&#8216;last_year&#8217;<span style="font: 12.0px Menlo; color: #000000;">:</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$from_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-01-01 00:00:00&#8242;</span>, mktime( <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">01</span> , <span style="font: 11.0px Menlo; color: #2832cf;">01</span> , date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;Y&#8221;</span>) &#8211; <span style="font: 11.0px Menlo; color: #2832cf;">1</span> ));</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>$to_date = date(<span style="font: 11.0px Menlo; color: #2832cf;">&#8216;Y-12-31 23:59:59&#8242;</span>, mktime( <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">0</span>, <span style="font: 11.0px Menlo; color: #2832cf;">12</span> , <span style="font: 11.0px Menlo; color: #2832cf;">31</span> , date(<span style="font: 11.0px Menlo; color: #d62b24;">&#8220;Y&#8221;</span>) &#8211; <span style="font: 11.0px Menlo; color: #2832cf;">1</span> ) );</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">break</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span><span style="color: #bf2e9d;">return</span> <span style="color: #bf2e9d;">array</span>($from_date, $to_date);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo;"><span style="white-space: pre;"> </span>}</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; min-height: 14.0px;"><span style="white-space: pre;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #bf2e9d;"><span style="color: #000000;"><span style="white-space: pre;"> </span></span>?&gt;</p>
<div><span style="font-family: Menlo, 'Times New Roman', 'Bitstream Charter', Times, serif; color: #bf2e9d; font-size: small;"><span style="line-height: normal;"><br />
</span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/algorithm-for-range-of-dates/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Table Editor</title>
		<link>http://www.sajithmr.me/mysql-table-editor</link>
		<comments>http://www.sajithmr.me/mysql-table-editor#comments</comments>
		<pubDate>Thu, 04 Jun 2009 04:31:56 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[msql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/?p=439</guid>
		<description><![CDATA[In a php project, if we get the requirement , we usually start design and database. But the data entry procedure is very hard. In this case PhpMyadmin is a good comfort.  Here is another tool from phpguru.org , MySQL Table Editor. Using this library you can make your database table editable from your php [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sajithmr.com/wp-content/uploads/2009/06/mysql-table-editor.png"><img class="alignnone size-full wp-image-442" title="mysql-table-editor" src="http://www.sajithmr.com/wp-content/uploads/2009/06/mysql-table-editor.png" alt="" width="291" height="59" /></a></p>
<p>In a php project, if we get the requirement , we usually start design and database. But the data entry procedure is very hard. In this case PhpMyadmin is a good comfort. </p>
<p>Here is another tool from phpguru.org , MySQL Table Editor. Using this library you can make your database table editable from your php code. </p>
<p>You can  :</p>
<ol>
<li>Select the table to be displayed</li>
<li>decide which column should be hidden</li>
<li>Whether a column should be editable or not</li>
<li>Add advanced searching option</li>
<li>Download the table as csv format</li>
<li>Add pagination</li>
<li>Set alias display name for your column</li>
</ol>
<div>Download Library from: </div>
<div><a href="http://www.phpguru.org/downloads/TableEditor/TableEditor.zip">http://www.phpguru.org/downloads/TableEditor/TableEditor.zip</a></div>
<div></div>
<div>Documentation:</div>
<div><a href="http://www.phpguru.org/static/TableEditor.html">http://www.phpguru.org/static/TableEditor.html</a></div>
<div></div>
<div>Sample Code Below:</div>
<pre lang="php">

<?php
require_once('TableEditor.php');
//database connection object
$db_conn = mysql_connect('localhost','root','');
mysql_select_db('mydbname'); 

//select the table to be edited, here it is accounts
$editor = new TableEditor($db_conn, 'accounts');
//I dont want to display id and password column
$editor->noDisplay('id');
$editor->noDisplay('password');
//the email column should not be editable
$editor->noEdit('email');
//set display name for column email and login
$editor->setDisplayNames(array('email'       => 'Email',
                              'login'     => 'Username'
                              ));
//sort order of first name
$editor->setDefaultOrderby('namefirst', 0);
//set which are the filed to be searchable
$editor->setConfig('searchableFields', array('namefirst', 'namelast', 'email'));
//can set the type of input field
$editor->setInputType('available', 'select');
//finally display the editor window
$editor->display();
?>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/mysql-table-editor/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>XAJAX</title>
		<link>http://www.sajithmr.me/xajax</link>
		<comments>http://www.sajithmr.me/xajax#comments</comments>
		<pubDate>Wed, 03 Jun 2009 16:00:24 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[capitalize]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[xajax]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/?p=432</guid>
		<description><![CDATA[Basically using xajax &#8220;You can directly call php functions from your javascript code&#8221; Xajax will do the rest.  For example, if you are going to write a javascript function Capitalize which captilaze your textbox content when you press a button. Here is the pure html/javascript code for that: ============================================= &#60;script&#62; function Capitalize() {      [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://xajaxproject.org/" target="_blank"><img class="alignnone size-medium wp-image-433" title="xajax_logo" src="http://www.sajithmr.com/wp-content/uploads/2009/06/xajax_logo-300x179.png" alt="" width="300" height="179" /></a></p>
<p>Basically using xajax &#8220;You can directly call php functions from your javascript code&#8221;</p>
<p>Xajax will do the rest. </p>
<p>For example, if you are going to write a javascript function Capitalize which captilaze your textbox content when you press a button.</p>
<p>Here is the pure html/javascript code for that:</p>
<p>=============================================</p>
<p><strong><span style="color: #99cc00;">&lt;script&gt;</span></strong></p>
<p><span> </span><strong>function</strong> Capitalize()</p>
<p><span> </span>{</p>
<p>      var t = document.getElementById(&#8216;cap&#8217;).value;</p>
<p>      document.getElementById(&#8216;update&#8217;).innerHTML = t.toUpperCase() ;</p>
<p><span> </span>}</p>
<p><span style="color: #99cc00;"><strong>&lt;/script&gt;</strong></span></p>
<p> </p>
<p><span style="color: #0000ff;">&lt;input type=&#8221;text&#8221; id=&#8221;cap&#8221; name=&#8221;cap&#8221; /&gt;</span></p>
<p><span style="color: #0000ff;">&lt;input type=&#8221;button&#8221; id=&#8221;capbutton&#8221; value=&#8221;Capitalize&#8221; onclick=&#8221;Capitalize()&#8221; /&gt;</span></p>
<p><span style="color: #0000ff;">&lt;div id=&#8221;update&#8221;&gt;&lt;/div&gt;</span></p>
<p>==============================================</p>
<p>Now see the difference when we use xajax, we can write this Capitalize function in php code and can call from javascript.</p>
<p><strong>function</strong> Capitalize($value)</p>
<p>{</p>
<p>    $objResponse = new xajaxResponse();</p>
<p>    $objResponse-&gt;assign(&#8220;update&#8221;,&#8221;innerHTML&#8221;,strtoupper($value));</p>
<p>    return $objResponse;</p>
<p><span> </span></p>
<p>}</p>
<p>and you can call from your button&#8217;s onclick function:</p>
<p><span style="color: #ff6600;"> onclick=&#8221;xajax_Capitalize(document.getElementById(&#8216;cap&#8217;).value)&#8221; </span></p>
<p>Here the same functionality we moved from client to server. Thus the point is you can simply call all the functions you written in php (Server Side) from javascript code via onClick, onMouseOver or window.onLoad etc.</p>
<p>You can get the full source code of Capitalize example here:</p>
<p><a href="http://www.sajithmr.com/downloads/capitalize.zip">http://www.sajithmr.com/downloads/capitalize.zip</a></p>
<p>To download and for documentation go: </p>
<p><a href="http://xajaxproject.org/">http://xajaxproject.org/</a></p>
<p>Thanks</p>
<p>Sajith</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/xajax/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contact Grabber</title>
		<link>http://www.sajithmr.me/contact-grabber</link>
		<comments>http://www.sajithmr.me/contact-grabber#comments</comments>
		<pubDate>Thu, 06 Nov 2008 10:55:51 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[AOL]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[fetch]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[grab]]></category>
		<category><![CDATA[grabber]]></category>
		<category><![CDATA[Hotmail]]></category>
		<category><![CDATA[Indiatimes]]></category>
		<category><![CDATA[Linkedin]]></category>
		<category><![CDATA[lycos]]></category>
		<category><![CDATA[MySpace]]></category>
		<category><![CDATA[orkut]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[Rediff]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/?p=353</guid>
		<description><![CDATA[If you are a social media website developer , sometimes you might search for grabbing contacts from a particular email account if the password is given. I also did the same.  In most of the cases it did not work properly. But recently i got a contact grabber from phpclasses.org which works perfectly on Gmail, [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a social media website developer , sometimes you might search for grabbing contacts from a particular email account if the password is given. I also did the same.  In most of the cases it did not work properly. But recently i got a contact grabber from <a href="http://www.phpclasses.org" target="_blank">phpclasses.org</a> which works perfectly on <strong>Gmail</strong>, <strong>Hotmail</strong>, <strong>Rediff</strong>, <strong>Yahoo</strong>, <strong>Orkut</strong>, <strong>MySpace</strong>, <strong>Indiatimes</strong>, <strong>Linkedin</strong> , <strong>AOL</strong> and <strong>lycos</strong></p>
<div id="attachment_355" class="wp-caption alignnone" style="width: 371px"><a href="http://www.sajithmr.com/wp-content/uploads/2008/11/grabber.jpg"><img class="size-full wp-image-355" title="Contact Grabber " src="http://www.sajithmr.com/wp-content/uploads/2008/11/grabber.jpg" alt="screen shot" width="361" height="225" /></a><p class="wp-caption-text">screen shot</p></div>
<p>But the zip file i got is not well arranged, so it shows some errors . I arranged it in proper way and uploaded here:</p>
<p><span style="text-decoration: underline;">Download:</span></p>
<p><a href="http://sajithmr.com/downloads/grabber.zip" target="_self"><img class="alignnone size-thumbnail wp-image-354" title="winzip_180x180" src="http://www.sajithmr.com/wp-content/uploads/2008/11/winzip_180x180-150x150.gif" alt="" width="98" height="98" /></a></p>
<p><a title="Contact Grabber" href="http://sajithmr.com/downloads/grabber.zip" target="_self">http://sajithmr.com/downloads/grabber.zip</a></p>
<p><span style="color: #808080;"><em>(Under GNU Public License)</em></span></p>
<p>Using this <strong>php code</strong> , you can <strong>export the email contacts</strong> as csv file.</p>
<p>Here is the actual source website : <a href="http://www.phpclasses.org/browse/package/3895.html" target="_blank">http://www.phpclasses.org/browse/package/3895.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/contact-grabber/feed</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Intelligent Watermark (php + gd)</title>
		<link>http://www.sajithmr.me/intelligent-watermark-php-gd</link>
		<comments>http://www.sajithmr.me/intelligent-watermark-php-gd#comments</comments>
		<pubDate>Sat, 09 Aug 2008 04:51:45 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/intelligent-watermark-php-gd/</guid>
		<description><![CDATA[Online Photoshop in PHP Part (5) &#62;&#62; (image after watermarked with gmail logo) Those who haven&#8217;t seen  the online photoshop tool created by me, just click here: http://www.sajithmr.com/photoshop Today we will implement the watermarking on images using php gd library. Intelligent watermarking means, apply a logo or a watermark image on another image by measuring [...]]]></description>
			<content:encoded><![CDATA[<p><font color="#339966"><strong>Online Photoshop in PHP Part (5)</strong></font> &gt;&gt;</p>
<p><img src="http://www.sajithmr.com/wp-content/uploads/2008/08/watermark.jpg" /></p>
<p><em><font color="#999999">(image after watermarked with gmail logo) </font></em></p>
<p>Those who haven&#8217;t seen  the online photoshop tool created by me, just click here: <a href="http://www.sajithmr.com/photoshop/" title="Online Photoshop" target="_blank">http://www.sajithmr.com/photoshop</a></p>
<p>Today we will implement the watermarking on images using php gd library. Intelligent watermarking means, apply a logo or a watermark image on another image by measuring the color depth of the applied image. For this water marking, use png images as logo or watermark  for better results.</p>
<p>Live example for watermark implementation:<a href="http://sajithmr.com/photoshop-tuts/watermark/addwatermark.php" title="Watermark implementation " target="_blank"> http://sajithmr.com/photoshop-tuts/watermark/addwatermark.php </a></p>
<p>You can see different watermark location by changing the x1,y1 and x2,y2 parameters of the following url:</p>
<p><a href="http://sajithmr.com/photoshop-tuts/watermark/showresult.php?x1=405&amp;y1=285&amp;x2=520&amp;y2=392&amp;width=115&amp;height=107" target="_blank">http://sajithmr.com/photoshop-tuts/watermark/showresult.php?x1=405&amp;y1=285&amp;x2=520&amp;y2=392&amp;width=115&amp;height=107 </a></p>
<p>See the watermark php source code here: <a href="http://sajithmr.com/photoshop-tuts/watermark/watermark.class.txt" title="Source code for watermark" target="_blank">http://sajithmr.com/photoshop-tuts/watermark/watermark.class.txt </a></p>
<p>Download the full-source code of watermarking implementation using php+gd from here: <a href="http://sajithmr.com/photoshop-tuts/watermark.rar" title="Full Source Code" target="_blank">http://sajithmr.com/photoshop-tuts/watermark.rar </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/intelligent-watermark-php-gd/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

