Skip to content

Instantly share code, notes, and snippets.

View taleeb35's full-sized avatar

taleeb35

  • United Arab Emirates
View GitHub Profile
public function find() {
$this->Country->recursive = -1;
if ($this->request->is('ajax')) {
$this->autoRender = false;
$country_name = $this->request->data['Country']['name'];
$results = $this->Country->find('all', array(
'conditions' => array('Country.name LIKE ' => '%' . $country_name . '%')
));
foreach($results as $result) {
<?php
App::uses('AppController', 'Controller');
class CountriesController extends AppController {
public $helpers = array('Js');
public function select() {
$countries = $this->Country->find('list');
$states = array();
$(function() {
$('#countries').change(function() {
var selectedValue = $(this).val();
var targeturl = $(this).attr('rel') + '?id=' + selectedValue;
$.ajax({
type: 'get',
url: targeturl,
beforeSend: function(xhr) {
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50173
Source Host : localhost:3306
Source Database : smart2
Target Server Type : MYSQL
Target Server Version : 50173
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50173
Source Host : localhost:3306
Source Database : smart2
Target Server Type : MYSQL
Target Server Version : 50173
<?php
App::uses('AppModel', 'Model');
/**
* Department Model
*
* @property Project $Project
*/
class Country extends AppModel {
public $hasMany = array(
<?php
App::uses('AppController', 'Controller');
/**
* Helps Controller
*
* @property Help $Help
* @property PaginatorComponent $Paginator
*/
class StatesController extends AppController {
var $helpers = array('Html','Js');
<table width="800px" cellspacing="0" cellpadding="5" border="1" style="border-collapse:collapse"><tbody><tr><th>ID</th> <th>Task Name</th> <th>Assigned Date</th> <th>Action</th> </tr><tr><td>1347 </td><td><a href="http://controls.localhost.com/issues/view/1347" target="_blank">Inventory of Authorized and Unauthorized Devices </a></td><td><span class="aBn" data-term="goog_281741611" tabindex="0"><span class="aQJ">2014-09-12</span></span></td><td><a href="http://controls.localhost.com/issues/email_close_issue/1347/5413256b-12a0-4f00-895d-10ad7f000001" target="_blank">Close Task</a></td></tr><tr><td>1348 </td><td><a href="http://controls.localhost.com/issues/view/1348" target="_blank">Test monthly control</a></td><td><span class="aBn" data-term="goog_281741612" tabindex="0"><span class="aQJ">2014-09-12</span></span></td><td><a href="http://controls.localhost.com/issues/email_close_issue/1348/5413256c-1c08-42ec-9cb0-10ad7f000001" target="_blank">Close Task</a></td></tr><tr><td>1349 </td><td><a href="http://contro
$email_body = '<table width="800px" cellspacing="0" cellpadding="5" border="1" style="border-collapse: collapse;">'
. '<tr><th>ID</th> <th>Task Name</th> <th>Assigned Date</th> <th>Action</th> </tr>';
$task_view_link = '<a href="' . APP_URL . '/issues/view/' . $issue_id . '">' . $task_name . '</a>';
$close_issue = '<a href="' . APP_URL . '/issues/email_close_issue/' . $issue_id . '/' . $issue_close_string . '">Close Task</a>';
$email_body .= '<tr><td>' . $issue_id . ' </td><td>' . $task_view_link . '</td><td>' . $target_email_date . '</td><td>' . $close_issue . '</td></tr>';
$email_body .='</table>';
$email_body = "<table width='800px' cellspacing='0' cellpadding='5' border='1' style='border-collapse: collapse;'>"
. "<tr><th>ID</th> <th>Task Name</th> <th>Assigned Date</th> <th>Action</th> </tr>";
$task_view_link = "<a href=" . APP_URL . "/issues/view/" . $issue_id . ">" . $task_name . "</a>";
$close_issue = "<a href=" . APP_URL . "/issues/email_close_issue/" . $issue_id . "/" . $issue_close_string . ">Close Task</a>";
$email_body .= "<tr><td>" . $issue_id . " </td><td>" . $task_view_link . "</td><td>" . $target_email_date . "</td><td>" . $close_issue . "</td></tr>";
$email_body .="</table>";