Posts

Showing posts from March, 2015

Online Currency Convertor

Online Currency Convertor In PHP <b>&lt;?php <br />$from = "USD";<br />$to = "INR";<br />$url = 'http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency='.$from.'&amp;ToCurrency='.$to;<br />$rate = simplexml_load_file($url);<br />echo 'Rate from '.$from.' to '.$to.' is: '.$rate[0];<br />?&gt; </b><br /> <br />

Only Show Current & Before Year

<select name="year" id='year' class="form-control"> <option value=""> Select </option> <?php $before = 0; // Specify number of "year" selections. $year = date('Y'); for( $i=4; $i>=$before; $i--) { $t = $year - $i; echo("<option value=\"$t\">$t</option>"); } ?> </select>

Get Data By Month and Year

<h2>Get Data By Month and Year</h2> <div dir="ltr" style="text-align: left;" trbidi="on"> <br /> function getLeave()<br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $this-&gt;db-&gt;where('MONTH(CURDATE()) = MONTH(emp_leave_start_date) and&nbsp; YEAR(CURDATE()) = YEAR(emp_leave_start_date)');<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $query = $this-&gt;db-&gt;get('employee_leave');<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $query-&gt;result();<br />&nbsp;&nbsp;&nbsp; }</div>