Sunday, 6 August 2017

CakePHP Date Picker

Folder Structure:


Controller:

 File location - cakephp/src/controller/HomepageController.php

namespace App\Controller;
use Cake\Controller\Controller;
class HomepageController extends Controller{    public function index()    {       // $this->render('index');    }}


Index:

 File location - cakephp/src/Template/Homepage/index.ctp



Layout:

  File location - cakephp/src/Template/Layout/default.ctp
    Html->charset() ?>
   
    </blockquote> <blockquote class="tr_bq">         <?= $this->fetch('title') ?></blockquote> <blockquote class="tr_bq">    
    Html->meta('icon') ?>

    Html->css('base.css') ?>
    Html->css('cake.css') ?>
    Html->css('datepicker.css') ?>
    Html->script('jquery-3.2.1.min.js') ?>
    Html->script('bootstrap-datepicker.js') ?>

    fetch('meta') ?>
    fetch('css') ?>
    fetch('script') ?>
    fetch('content') ?>     

Webroot Files:

  JS - include the .js files in the following path.


  CSS - include the .css files in the following path.

Brower View:

  Initial View
Datepicker
  After clicking the month

  After clicking the month

Friday, 24 June 2016

C++ Program - Swapping Two Integers

#include
using namespace std;
int main() {
    int number1,number2;
cout<<"Enter 1st No. ";
    cin>>number1;
cout<<"Enter 2nd NO ";
    cin>>number2;
    cout<<"Before Swapping ";
cout< number1 = number1 + number2;
number2 = number1 - number2;
number1 = number1 - number2;
cout<<"After Swapping ";
cout<    return 0;
}

C++ Program - To find Prime Number or Not

#include
using namespace std;
int main() {
    int number,count=0;
cout<<"Enter a NO. to check Prime or Not ";
    cin>>number;
    for(int a=2;a<=number/2;a++) {
        if(number%a==0) {
            count++;
            break;
        }
    }
    if(count==0) {
        cout<    } else {
        cout<    }
    return 0;
}

C++ Program - To find Leap Year or Not

#include
using namespace std;
int main() {
    int year;
    cout << "Enter a year: ";
    cin >> year;
    if (year%4 == 0) {
        if (year%100 == 0) {
            if (year%400 == 0) {
                cout << year << " is a leap year.";
            } else {
                cout << year << " is not a leap year.";
            }
        } else {
            cout << year << " is a leap year.";
        }
    } else {
        cout << year << " is not a leap year.";
    }
    return 0;
}




C++ Program - Largest Number in an Array

#include
#include
#include
using namespace std;
int main() {
int i,j,temp,arrSize;
cout<<"Enter Array Size.:";
cin>>arrSize;
int a[arrSize];
cout<<"Enter Any"< for(i=0;i cin>>a[i];
}
for(i=0;i for(j=i+1;j if(a[j] < a[i]) {
temp = a[j];
a[j] = a[i];
a[i] = temp;
}
}
}
cout<<"Largest No. is "< return 0;
}

CakePHP Date Picker

Folder Structure: Controller:   File location - cakephp/src/controller/HomepageController.php namespace App\Controller; use...