How to make pure html graphs in cakephp

2009-08-24 Thread mona

I want functions that create pure html graphs.


The functions should take an array as a parameter. The array will look
like
array('data' =>
  array(
array('label' => 'Nokia N95', 'number' => 95, 'axislabel' => ''),
array('label' => 'Apple iPhone', 'number' => 120, 'axislabel' =>
'iPhone'),
  ),
  'heading' => 'Graph Heading',
  'xaxis' => 'Phones this month',
  'yaxis' => 'Hits',
  'graphtype' => 'horizontal',
  'pixelswide' => 700,
  'pixelshigh' => 120);

Mousing over the bars in the bar graphs will produce the label &
number.

graphs should be horiantal or vertical bar graphs

can anybody tell me how to make these type of graphs in cakephp


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to use cdata tag in attribute in xml in cakephp

2009-07-23 Thread mona

can anybody tell me how to cdata tag for attribute value in cakephp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to use cakephp session class for wordpress

2009-07-22 Thread mona

Hello friends

 I have integrate wordpress in cakephp now i want to cake php session
in wordpress and i want to write that value in database by using
cakephp session class how to do that

please help me its urgent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to write one single query for fetching data from two tables

2009-07-22 Thread mona

How to write the folowing query in cakephp

 $sql = "select
devices.uid,devices.agent,devices.capabilities,devices.localcaps from
devices,agents where devices.uid = agents.uid and agents.verified=1
limit 100";

Followin is my controller file

class AgentsController extends AppController {
var $name = 'Agents';
var $helpers = array('Html','Form','Xml','Text','Javascript','Ajax');
var $uses = array( 'Agent','Device');
var $components = array('RequestHandler');


function admin_exportDevice(){
$this->_adminOnly();
$export = trim($this->data['deviceExport']['export']);
if($export=='Full'){
   $sql = "select
devices.uid,devices.agent,devices.capabilities,devices.localcaps from
devices,agents where devices.uid =   agents.uid and agents.verified=1
limit 100";
  $qry = mysql_query($sql);
$this->set('qry', $qry);
$this->set('filename', 'Full'.date("Ymd").'.xml');
$this->layout='ajax';

$sql1 = "Update devices set export=1 where export=0";
$query = mysql_query($sql1);
}
 else{
   $sql = "select
devices.uid,devices.agent,devices.capabilities,devices.localcaps from
devices,agents where devices.uid = agents.uid and agents.verified=1
and devices.export=0 limit 2";
$qry = mysql_query($sql);
$this->set('qry', $qry);
$this->set('filename', 'Incremental'.date("Ymd").'.xml');
$this->layout='ajax';
$sql1 = "Update devices set export=1 where export=0";
$query = mysql_query($sql1);

  }
}
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to write single query for fetching records from two table

2009-07-22 Thread mona

How to write followin query in cakephp

   $sql = "select
devices.uid,devices.agent,devices.capabilities,devices.localcaps from
devices,agents where devices.uid =   agents.uid and agents.verified=1
limit 100";


Following is my controller file


class AgentsController extends AppController {
var $name = 'Agents';
var $helpers = array('Html','Form','Xml','Text','Javascript','Ajax');
var $uses = array( 'Agent','Device');
var $components = array('RequestHandler');


function admin_exportDevice(){
$this->_adminOnly();
$export = trim($this->data['deviceExport']['export']);
if($export=='Full'){
   $sql = "select
devices.uid,devices.agent,devices.capabilities,devices.localcaps from
devices,agents where devices.uid =   agents.uid and agents.verified=1
limit 100";
  $qry = mysql_query($sql);
$this->set('qry', $qry);
$this->set('filename', 'Full'.date("Ymd").'.xml');
$this->layout='ajax';
//$this->Device->updateAll(array('Device.export' =>1),array
('Device.export'=>0));
$sql1 = "Update devices set export=1 where export=0";
$query = mysql_query($sql1);
}
 else{
   $sql = "select
devices.uid,devices.agent,devices.capabilities,devices.localcaps from
devices,agents where devices.uid = agents.uid and agents.verified=1
and devices.export=0 limit 2";
$qry = mysql_query($sql);
$this->set('qry', $qry);
$this->set('filename', 'Incremental'.date("Ymd").'.xml');
$this->layout='ajax';
$sql1 = "Update devices set export=1 where export=0";
$query = mysql_query($sql1);
//$this->Device->updateAll(array('Device.export' =>1),array
('Device.export'=>0));
  }
}
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to integrate wordpress blog in cakephp

2009-07-17 Thread mona

hello friends i have ask this question already but no one reply i need
urgent response for that i want to integrate wordpress blog in cakephp
but i want to place outside the app folder so can anybody tell me how
to do that.I try to place that in webroot folder but when i access
this blog it is displaying error message file not found so please help
me to sort out this issue .One more thing i don't want to make
separate MVC for that
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to generate xml in cakephp

2009-07-13 Thread mona

can anybody tell me how to generate xml in cakephp and export data
from database in xml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



can anybody use wurfl with cakephp

2009-07-13 Thread mona

I want to export device data to wurfl can anybody help me for this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to export data to WURFL into patch files in cakephp

2009-07-09 Thread mona

Ya i have device info in database but i don't know how to export data
in patch files

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to export data to WURFL into patch files in cakephp

2009-07-09 Thread mona

How to write a function to export data through patch files  in WURFL
can anybody help me to solve this problem

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to make scrolling tabs using jquery in cakephp

2009-07-07 Thread mona

How to make suct type of scrolling tabs given in following link using
jquery in cakephp please give me some example


http://www.handsetdetection.com/devices/properties/Access/netfront_ver3
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to use wordpress blog without making controller in cakephp

2009-07-02 Thread mona

Hi every body i wan't to include wordpress blogs in my cakephp site
but i don't wan't to make MVC for that is it possible to make this way
and along with that i wan't to place my blog outside app folder but it
is not working and it is displaying error message controller not found
so please tell me how to do this task my index.php file is


http://www.cakephp.org)
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://
www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
(http://www.cakefoundation.org)
 * @link  http://www.cakefoundation.org/projects/info/cakephp
CakePHP(tm) Project
 * @package   cake
 * @since CakePHP(tm) v 0.2.9
 * @version   $Revision: 7945 $
 * @modifiedby$LastChangedBy: gwoo $
 * @lastmodified  $Date: 2008-12-18 18:16:01 -0800 (Thu, 18 Dec 2008)
$
 * @license   http://www.opensource.org/licenses/mit-license.php
The MIT License
 */
/**
 *  Get Cake's root directory
 */
define('APP_DIR', 'app');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__FILE__));
define('WEBROOT_DIR', 'webroot');
define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
/**
 * This only needs to be changed if the cake installed libs are
located
 * outside of the distributed directory structure.
 */
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
//define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE
CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
if (function_exists('ini_set')) {
ini_set('include_path', ini_get('include_path') . 
PATH_SEPARATOR .
CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
define('APP_PATH', null);
define('CORE_PATH', null);
} else {
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
require CORE_PATH . 'cake' . DS . 'basics.php';
$TIME_START = getMicrotime();
require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
require LIBS . 'object.php';
require LIBS . 'inflector.php';
require LIBS . 'configure.php';

$bootstrap = true;
$url = null;
require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
?>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to send some value through response.redirect

2009-07-02 Thread mona

Dear Friends,

 Can anybody tell me how to send some value through
response.redirect
I am making search funtion and that is called admin_search() from
there when user enters some value then form will redirected to
admin_index function where my search query is working.

function admin_search() {
$this->_adminOnly();

}

function admin_index() {
$this->_adminOnly();
$_SESSION['lastsort'] = $_SERVER['REQUEST_URI'];
if (! empty ($this->data)) {
$Querystring= trim($this->data['Agent']['search']);
$this->paginate['fields'] = array
('id','uid','agent','vendor','model','totalhits');
$this->paginate['limit'] = 50;
$this->Agent->recursive = 0;
$this->set('agents', $this->paginate(array(array('verified' =>
0,'or'=>'Agent.agent' like "%$Querystring%";
}
}


In this case my form is posted on admin_index
But what i wan't is that i want to post my form to admin_search and
then from there i wan' t to send search string value to admin index
page so cananybody tell me how to perfor this task this is very
urgent.

and also can anybody tell me whether this is the write way to send
value to other function

$this->redirect(array('action'=>'admin_index'),$Querystring);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to make payment module in cakephp

2009-06-08 Thread mona

 I want to make payment module for my site i wan't connectivity with
paypal and in my site i want to make different plans so cananybody
tell me how to begin with paypal
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to use wordpress forum in cakephp

2009-06-08 Thread mona

Hello friends
can anybody tell me how to use wordpress forum in cakephp i
wan't to place wordpress forum outside the app folder now it is
showing error message missing controller so please how to solve this
problem.my .htaccess file is as follows


   RewriteEngine on
   RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



cake php is not installed correctly

2009-05-26 Thread mona

can anybody tell me how to install cakephp i read the manual and
follow that procedure for installatiion but when i view cakephp
default page using localhost it is not correctly displaying and also
cake console is not working so please help me out because it's very
urgent
I am attaching you the screenshot of default page
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to change image on onover event

2009-02-25 Thread mona

I am displayin a image on my index page when user mouseover on that
image it should display anoter image and remove first image cananybody
tell me how to this in cakephp how to call javascript function in cake
php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to set css for internet explorer

2009-02-13 Thread mona

hi viewers

i have one serious problem i have to set the page layout in such a way
that my website should perfectly viewed in internet explorer . It is
working fine in firefox but in IE it is not so can anybody tell me how
to call two different css for two different browsers or any other
solution for that so that is should be correctly displayed in internet
explorer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



css problem

2009-02-13 Thread mona

hi viewers

i have one serious problem i have to set the page layout in such a way
that my website should perfectly viewed in internet explorer . It is
working fine in firefox but in IE it is not so can anybody tell me how
to call two different css for two different browsers or any other
solution for that so that is should be correctly displayed in internet
explorer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: nice new API layout

2009-02-02 Thread Mona


> http://cakeforge.org/frs/?group_id=53&release_id=76

Thanks for the link.  However I noticed that this documentation is
incomplete...for instance AppModel.findAllBy is
missing...


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: nice new API layout

2009-01-29 Thread Mona


API 1.1 is missing!  Please put it back ASAP.  I'm still using that
version.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to use cake console for baking

2009-01-16 Thread mona

Can anybody tell me how to use bake.php for baking in cakephp1.2 i
know how to use this in cakephp1.1 but i don't know in 1.2 i read the
manual and tried but it was not working
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



edit function is not working

2009-01-16 Thread mona

Here is my edit function code i don't know where i mistaken if i edit
my record it added automatically one new record and i didn't get
validation messages also below is my edit function code
function edit($id = null){
$this->set('sections', $this->Entry->Section->find
('list',array
('fields'=>'Section.section','Section.id','recursive' => 1,'page' =>
1,)));
if (empty($this->data)){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
}
else{
$query=mysql_query("select max(counter) from entries");
   $row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
if ($this->Entry->save($this->data)){
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
}
}
}

can anybody tell me where i m mistaken this function doesn't edit my
record instead of that it will added one new record in my table
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



validation message are not coming

2009-01-13 Thread mona

In my add view when i kept all the fields blank and click on submit
button it will display a message record added successfully instead of
that i wan't to display my validation message and page should not be
redirect to other page
how to do this here is my add function code
add function in
controller---
function add(){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (!empty($this->data)){
$this->Entry->save($this->data);
$id=mysql_insert_id();
if($id){
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
if(is_uploaded_file($this->data['Entry']['File']['tmp_name'])){
$fileData = fread(fopen($this->data['Entry']['File']['tmp_name'],
"r"),
$this->data['Entry']['File']['size']);
$fname = $this->data['Entry']['File']['name'];
$ftype = $this->data['Entry']['File']['type'];
$fsize = $this->data['Entry']['File']['size'];
$fdata = addslashes($fileData);
$q1=mysql_query("update entries set name='$fname',size=
$fsize,type='$ftype',data='$fdata' where id=$id");
}
}
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
}
-my model code is
-
array(
'className'=>'Section'
),
'Submenu'=>array('className'=>'Submenu')
);
var $validate = array(
'username' => array('/^[a-zA-Z._0-9]+$/'),
'Please enter username' => array('rule'=>'notEmpty'),
'Listitem'=>array(
  'Please enter listitem' => array
('rule'=>'notEmpty')),
 'section_id'=>array(
  'Please select listitem' => array
('rule'=>'notEmpty')),
'Telephone'=>array(
  'Please enter phone number' => array
('rule'=>'notEmpty'),
  'Must be at least 10 chars' => array('rule'=>array
('minLength', 10))),


  );
}
?>

please tell me the answer it is very urgent


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to upload files in edit view

2009-01-12 Thread mona

I tried alot i wan't to chand my attachment in edit view but when i m
doing that it is displaying error
how to edit uploaded files in database from edit view i tried as add
action but it doesn't work


thsi is my controller code please tell me in edit function where to
write file uploading code and how
Entry->find('all', array('fields' => array('(max
(Entry.counter)) as max_counter')));
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$count=$row[0];
$this->set('count',$count);
$name=$this->Session->read('User');
$query1=mysql_query("select id from users where username='$name'");
$row1=mysql_fetch_array($query1);
$user_id=$row1[0];
$this->set('user_id',$user_id);
$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll(null, null, array
('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
}

 function view($id = null){
 if (!$id){
 $this->Session->setFlash('Invalid id for Entry.');
 $this->redirect('/entries/index');
 }
 $this->set('entry', $this->Entry->read(null, $id));
 }

function add(){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (!empty($this->data) &&
 is_uploaded_file($this->data['Entry']['File']
['tmp_name']))
{
$fileData = fread(fopen($this->data['Entry']['File']
['tmp_name'], "r"),
 $this->data['Entry']['File']
['size']);
$this->data['Entry']['name'] = $this->data['Entry']['File']
['name'];
$this->data['Entry']['type'] = $this->data['Entry']['File']
['type'];
$this->data['Entry']['size'] = $this->data['Entry']['File']
['size'];
$this->data['Entry']['data'] = $fileData;
if ($this->Entry->save($this->data)){
$id=mysql_insert_id();
$query=mysql_query("select max(counter) from 
entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co 
where id=$id");
$this->Session->setFlash('The Entry has been 
saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
$this->redirect('/entries/add');
}
}
}
---edit
function
function edit($id = null){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id','recursive' => 1,'page' =>
1,)));
if (empty($this->data)){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
}
else{
$query=mysql_query("select max(counter) from entries");
   $row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
if ($this->Entry->save($this->data)){
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
}
}
}
--
function delete($id = null){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)){
$this->Session->setFlash('Record deleted successfully');
$this->redirect('/entries/index');
}
}

function update_select(){
if(!empty($this->data['Entry']['section_id'])){
$section_id = (int)$this->data['Entry']['section_id'];
$options = $this->Entry->Submenu->find('list',array('section_id'=>
$section_id,'recursive' => 1,'conditions'=>array('section_id'=>
$section_id),'page' => 1,'fields'=>'Submenu.submenu'));
$this->set('options',$options);
}
}
}?>



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to display image in your view from database

2009-01-12 Thread mona

i m storing images in database and i wan't to display images in my
view how to do this in cake php


my controller code is
Entry->find('all', array('fields' => array('(max
(Entry.counter)) as max_counter')));
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$count=$row[0];
$this->set('count',$count);
$name=$this->Session->read('User');
$query1=mysql_query("select id from users where username='$name'");
$row1=mysql_fetch_array($query1);
$user_id=$row1[0];
$this->set('user_id',$user_id);
$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll(null, null, array
('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
}

 function view($id = null){
 if (!$id){
 $this->Session->setFlash('Invalid id for Entry.');
 $this->redirect('/entries/index');
 }
 $this->set('entry', $this->Entry->read(null, $id));
 }

function add(){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (!empty($this->data) &&
 is_uploaded_file($this->data['Entry']['File']
['tmp_name']))
{
$fileData = fread(fopen($this->data['Entry']['File']
['tmp_name'], "r"),
 $this->data['Entry']['File']
['size']);
$this->data['Entry']['name'] = $this->data['Entry']['File']
['name'];
$this->data['Entry']['type'] = $this->data['Entry']['File']
['type'];
$this->data['Entry']['size'] = $this->data['Entry']['File']
['size'];
$this->data['Entry']['data'] = $fileData;
if ($this->Entry->save($this->data)){
$id=mysql_insert_id();
$query=mysql_query("select max(counter) from 
entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co 
where id=$id");
$this->Session->setFlash('The Entry has been 
saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
$this->redirect('/entries/add');
}
}
}

}?>
images are storing in database but how to display it i don't know
my view code

Welcome read
('User')?>


View Entry
 css('style');
?>

Id


Name
0)
{
echo $entry['Entry']['username'];
}
else{
echo "";
}
?>

Address
0)
{
echo $entry['Entry']['Address'];
}
else{
echo "";
}
?>

Phone
0)
{
echo $entry['Entry']['Telephone'];
}
else{
echo "";
}
?>

Website
0)
{
echo $entry['Entry']['Website'];
}
else{
echo "";
}
?>


Section


Submenu


Listitem
0)
{
echo $entry['Entry']['Listitem'];
}
else{
echo "";
}
?>

Detail
0)
{
echo $entry['Entry']['Detail'];
}
else{
echo "";
}
?>

Attachment
0)
{
echo $entry['Entry']['name'];
}
else{
echo "";
}
?>


here i m displaying image
--
Image
image(array('controller'=>'entries','action'=>'show',$entry
['Entry']['data']));
?>




link('Edit entry',   '/entries/edit/' . $entry
['Entry']['id'],array('class'=>'ppstyle'))?>
link('Delete entry', '/
entries/delete/' . $entry['Entry']['id'], array
('class'=>'ppstyle',null, 'Are you sure you want to delete: id ' .
$entry['Entry']['id'] . '?')) ?>
link('Home',   '/entries/
index',array('class'=>'ppstyle')) ?>
link('Add new',  '/entries/
add',array('class'=>'ppstyle')) ?>






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to do this in cakephp

2009-01-11 Thread mona

I have two dropdown boxes if value of one dropdown changes then
according to that value of second dropdown changes i doing that using
ajax my problem is that in my edit view only one dropdown box is
displaying value from database not second one it is displaying blank
my controller code is as follows:


set('co',$co);
$name=$this->Session->read('User');
$query1=mysql_query("select id from users where username='$name'");
$row1=mysql_fetch_array($query1);
$user_id=$row1[0];
$this->set('user_id',$user_id);
$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll(null, null, array
('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
}
function view($id = null){
if (!$id){
$this->Session->setFlash('Invalid id for Entry.');
$this->redirect('/entries/index');
}
$this->set('entry', $this->Entry->read(null, $id));
}
function add()
{
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (empty($this->data))
{
$this->render();
}
else
{
$this->data['Entry']['name'] = $this->data['Entry']['File']['name'];
$this->data['Entry']['type'] = $this->data['Entry']['File']['type'];
$this->data['Entry']['size'] = $this->data['Entry']['File']['size'];
if ($this->Entry->save($this->data))
{
$id=mysql_insert_id();
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
if (move_uploaded_file($this->data['Entry']['File']['tmp_name'],
WWW_ROOT.'/files/' .$this->data['Entry']['File']['name']))
{
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else
{
echo "There was an error uploading the file, please try again!";
}
//{
//echo "File uploaded successfully";

//}
}
else
{
$this->Session->setFlash('Please correct errors below.');
$this->redirect('/entries/add');
}
}
}
--this is my edit
function---
function edit($id = null){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id','recursive' => 1,'page' =>
1,)));
if (empty($this->data)){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
}
else{
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
if ($this->Entry->save($this->data)){
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
}
}
}
--i m using ajax
here-
function update_select(){
if(!empty($this->data['Entry']['section_id'])){
$section_id = (int)$this->data['Entry']['section_id'];
$options = $this->Entry->Submenu->find('list',array('section_id'=>
$section_id,'recursive' => 1,'conditions'=>array('section_id'=>
$section_id),'page' => 1,'fields'=>'Submenu.submenu'));
$this->set('options',$options);
}
}
}?>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Why i get this warning

2009-01-10 Thread mona

I m getting this warning when i m adding a
record
Cannot modify header information - headers already sent by (output
started at /home/maheep/domains/phraseout.com/public_html/cakephp/
styleguide/controllers/entries_controller.php:50) [CORE/cake/libs/
controller/controller.php, line 615]

I remove all white spaces then also i m getting this warning my
controller code is as follows set('co',$co);
$name=$this->Session->read('User');
$query1=mysql_query("select id from users where username='$name'");
$row1=mysql_fetch_array($query1);
$user_id=$row1[0];
$this->set('user_id',$user_id);
$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll(null, null, array
('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
}
function view($id = null){
if (!$id){
$this->Session->setFlash('Invalid id for Entry.');
$this->redirect('/entries/index');
}
$this->set('entry', $this->Entry->read(null, $id));
}
function add(){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (empty($this->data)){
$this->render();
}
else{
$this->data['Entry']['name'] = $this->data['Entry']['File']['name'];
$this->data['Entry']['type'] = $this->data['Entry']['File']['type'];
$this->data['Entry']['size'] = $this->data['Entry']['File']['size'];
if ($this->Entry->save($this->data)){
$id=mysql_insert_id();
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
$this->Session->setFlash('The Entry has been saved');
}
else{
$this->Session->setFlash('Please correct errors below.');
$this->redirect('/entries/add');
}
if (move_uploaded_file($this->data['Entry']['File']['tmp_name'],
WWW_ROOT.'/files/' .$this->data['Entry']['File']['name'])){
echo "File uploaded successfully";
}
else{
echo "There was an error uploading the file, please try again!";
}
$this->redirect('/entries/index');
}
}
function edit($id = null){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id','recursive' => 1,'page' =>
1,)));
if (empty($this->data)){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
}
else{
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
if ($this->Entry->save($this->data)){
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
}
}
}
function delete($id = null){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)){
$this->Session->setFlash('Record deleted successfully');
$this->redirect('/entries/index');
}
}
function update_select(){
if(!empty($this->data['Entry']['section_id'])){
$section_id = (int)$this->data['Entry']['section_id'];
$options = $this->Entry->Submenu->find('list',array('section_id'=>
$section_id,'recursive' => 1,'conditions'=>array('section_id'=>
$section_id),'page' => 1,'fields'=>'Submenu.submenu'));
$this->set('options',$options);
}
}
}?>


I tried all the things but i m getting this warning please help me it
is very urgent i m getting this  warning only at add action
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to do this in cakephp

2009-01-09 Thread mona

this will help me but it is not returning value it is returning only
Array as value please help me how to solve this porblem
---see this --
Counter : Array

function index(){
$count = $this->Entry->find('all', array('fields' => array('(max
(Entry.counter)) as max_counter')));


$this->set('count',$count);
$name=$this->Session->read('User');
$query1=mysql_query("select id from users where username='$name'");
$row1=mysql_fetch_array($query1);
$user_id=$row1[0];
$this->set('user_id',$user_id);
$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll(null, null, array
('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
}

It is returning value as counter
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Why i get this warning

2009-01-09 Thread mona

Warning (2): Cannot modify header information - headers already sent
by (output started at /home/maheep/domains/phraseout.com/public_html/
cakephp/styleguide/controllers/users_controller.php:71) [CORE/cake/
libs/controller/controller.php, line 615]

when i upload my cakephp project on the server i m getting this
problem
i remove all blank spaces then also  i  m getting this problem please
help me it's very urgent
my controller code is as follows:
User->recursive = 1;
$this->set('users', $this->User->findAll());
}
function login(){
$this->pageTitle ='CMS Home';
$this->layout ='newlayout';
if(!empty($this->data)){
$dbuser = $this->User->findByUsername($this->data['User']
['username']);
if(!empty($dbuser) && ($dbuser['User']['password']==($this->data
['User']['password']))){
$this->Session->write('User', $this->data['User']['username']);
$this->redirect('/entries/index');
}
else{
$this->set('error', 'Either your username or password is incorrect.');
}
}
}
function logout(){
$this->Session->destroy('User');
$this->flash( 'You have been logged out.', '/users/login');
}
function edit($user_id = null){
if (empty($this->data)){
if (!$user_id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->User->read(null, $user_id);
}
else{
if ($this->User->save($this->data)){
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
}
}
}
function add(){
if (empty($this->data)){
$this->render();
}
else{
if ($this->User->save($this->data)){
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
}
}
}
function delete($id = null){
if (!$id){
$this->Session->setFlash('Invalid id for User');
$this->redirect('/users/index');
}
if ($this->User->del($id)){
$this->Session->setFlash('Record deleted successfully');
$this->redirect('/users/index');
}
}
}
?>

---Now my view code


" . $error . "";
 }
?>
create('User',array('action' => 'login'));?>


input('username',array('label' =>'Username
','size'=>'25'));?>


input('password',array('label' =>' Password
','size'=>'25'));?>

hidden('user/id')?>

submit('Login');?>




document.getElementById('UserUsername').focus();

---now my model
code
" . $error . "";
 }
?>
create('User',array('action' => 'login'));?>


input('username',array('label' =>'Username
','size'=>'25'));?>


input('password',array('label' =>' Password
','size'=>'25'));?>

hidden('user/id')?>

submit('Login');?>




document.getElementById('UserUsername').focus();


--Now my entries controller code
to which i m redirecting page 
set('co',$co);
$name=$this->Session->read('User');
$query1=mysql_query("select id from users where username='$name'");
$row1=mysql_fetch_array($query1);
$user_id=$row1[0];
$this->set('user_id',$user_id);
$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll(null, null, array
('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
}

 function view($id = null){
 if (!$id){
 $this->Session->setFlash('Invalid id for Entry.');
 $this->redirect('/entries/index');
 }
 $this->set('entry', $this->Entry->read(null, $id));
 }

function add(){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (empty($this->data)){
$this->render();
}
else{
$this->data['Entry']['name'] = $this->data['Entry']['File']['name'];
$this->data['Entry']['type'] = $this->data['Entry']['File']
['type'];
$this->data['Entry']['size'] = $this->data['Entry']['File']
['size'];
if ($this->Entry->save($this->data)){
$id=mysql_insert_id();
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
$this->Session->setFlash('The Entry has been saved');
}
else{
$this->Session->setFlash('Please correct errors below.');
$this->redirect('/entries/add');
}
if (move_uploaded_file($this->data['Entry']['File']['tmp_name'],
WWW_ROOT.'/files/' .$this->data['Entry']['File']['name']))
{
echo "File uploaded successfully";
}
else{
echo "There was an error uploading the file, please try again!";
}
$this->redirect('/entries/index');
}
}

function edit($id = null){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id','recursive' =>

How to upload cakephp project on to the server

2009-01-08 Thread mona

what settings i have to do to upload my cakephp project on to server
because it is showing some warning like
header already sent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to do this in cakephp

2009-01-08 Thread mona


I know how to handle queries but i don't know how to fetch values of
variables for example
i wan't to fetch max(counter) so i know how to write query but how to
store value of this in some variable and print them in my index view
for eg
$query=mysql_query("select max(counter) from entries");
how to fetch max value from database of some field in cakephp how to
write this query in cakephp
$row=mysql_fetch_array($query);
$co=$row[0]+1; '
what to use instead of mysql_fetch_array in cakephp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to do this in cakephp

2009-01-08 Thread mona

I have code of my controller in which i use normal php codes to fetch
data from a database and update counter how to do this in cakephp


set('co',$co);
$name=$this->Session->read('User');
$query1=mysql_query("select id from users where username='$name'");
$row1=mysql_fetch_array($query1);
$user_id=$row1[0];
$this->set('user_id',$user_id);



$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll(null, null, array
('Section.id' => 'ASC','Submenu.submenu' => 'ASC')));
}

 function view($id = null){
 if (!$id){
 $this->Session->setFlash('Invalid id for Entry.');
 $this->redirect('/entries/index');
 }
 $this->set('entry', $this->Entry->read(null, $id));
 }

function add(){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (empty($this->data)){
$this->render();
}
else{
$this->data['Entry']['name'] = $this->data['Entry']['File']['name'];
$this->data['Entry']['type'] = $this->data['Entry']['File']
['type'];
$this->data['Entry']['size'] = $this->data['Entry']['File']
['size'];
if ($this->Entry->save($this->data)){
-please check it from
here---
$id=mysql_insert_id();
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");
--
$this->Session->setFlash('The Entry has been saved');
}
else{
$this->Session->setFlash('Please correct errors below.');
$this->redirect('/entries/add');
}
if (move_uploaded_file($this->data['Entry']['File']['tmp_name'],
WWW_ROOT.'/files/' .$this->data['Entry']['File']['name']))
{
echo "File uploaded successfully";
}
else{
echo "There was an error uploading the file, please try again!";
}
$this->redirect('/entries/index');
}
}

function edit($id = null){
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id','recursive' => 1,'page' =>
1,)));
if (empty($this->data)){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
}
else{
---please
check--
$query=mysql_query("select max(counter) from entries");
$row=mysql_fetch_array($query);
$co=$row[0]+1;
$q=mysql_query("update entries set counter=$co where id=$id");

if ($this->Entry->save($this->data)){
$this->Session->setFlash('The Entry has been saved');
$this->redirect('/entries/index');
}
else{
$this->Session->setFlash('Please correct errors below.');
}
}
}

function delete($id = null){
if (!$id){
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)){
$this->Session->setFlash('Record deleted successfully');
$this->redirect('/entries/index');
}
}

function update_select(){
if(!empty($this->data['Entry']['section_id'])){
$section_id = (int)$this->data['Entry']['section_id'];
$options = $this->Entry->Submenu->find('list',array('section_id'=>
$section_id,'recursive' => 1,'conditions'=>array('section_id'=>
$section_id),'page' => 1,'fields'=>'Submenu.submenu'));
$this->set('options',$options);
}
}

}
?>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How can we edit uploaded file

2009-01-03 Thread mona

hi all
On my edit view i have one option to update uploaded file but when i
do this they are taking first character of file and in size also it
will take character value so how can i edit uploaded file value in
cake php
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How can use ajax

2009-01-02 Thread mona

hi all
i wan't to make a filter on my site if user select particular section
then in  the submenu selectbox value automatically updates and when
user select submenu the listitem of that menu automatically updates
and result will display in table
means data of table changes when we use filter using ajax

how can we use reset button in cakephp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to update counter

2009-01-01 Thread mona

I have one button update counter when user click on update counter
button it will update the counter but my problem is that how to use
this on my link i have separate table for that name as updates
evertime user click on this link it will update the value in database
but this link is present on my entries/index page means view of other
model how to do this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to access one model from other model

2009-01-01 Thread mona

I want to manage my user account from my entries index view i have
link on my entries/index  page when i click on this link it will take
user to users/edit view how to do this  my entries controller look
like
set('id',$this->Entry->User->find('all',array
('fields'=>'User.id','recursive'=>'0','conditions'=>array
('username'=>'pooja';
$this->Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll());

}
function view($id = null)
{
if (!$id)
 {
$this->Session->setFlash('Invalid id for Entry.');
$this->redirect('/entries/index');
  }
$this->set('entry', $this->Entry->read(null, $id));

}

function add()
{
$this->set('sections', $this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id')));
if (empty($this->data))
 {
$this->render();
 }

 else
 {
$this->data['Entry']['name'] = 
$this->data['Entry']['File']
['name'];
$this->data['Entry']['type'] = $this->data['Entry']['File']
['type'];
$this->data['Entry']['size'] = $this->data['Entry']['File']
['size'];
if ($this->Entry->save($this->data))
{

$this->Session->setFlash('The Entry has 
been saved');
}
   else
   {
$this->Session->setFlash('Please 
correct errors below.');
}
if (move_uploaded_file($this->data['Entry']['File']
['tmp_name'], WWW_ROOT.'/files/' .$this->data['Entry']['File']
['name']))
   {
echo "File uploaded successfully";
}
else
{
echo "There was an error uploading the file,
please try again!";
}
$this->redirect('/entries/index');
}

}
function edit($id = null)
 {
if (empty($this->data))
 {
if (!$id)
 {
$this->Session->setFlash('Invalid id for 
Entry');
$this->redirect('/entries/index');
}

$this->set('sections', 
$this->Entry->Section->find('list',array
('fields'=>'Section.section','Section.id','recursive' => 1,'page' =>
1,)));
$this->data = $this->Entry->read(null, $id);
}
else
{

if ($this->Entry->save($this->data))
 {
$this->Session->setFlash('The Entry has 
been saved');
$this->redirect('/entries/index');
 }
else
{
$this->Session->setFlash('Please 
correct errors below.');
}


}
}

function delete($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)) {
$this->Session->setFlash('Record deleted successfully');
$this->redirect('/entries/index');
}
}
function update_select()
{
if(!empty($this->data['Entry']['section_id']))
 {
 $section_id = (int)$this->data['Entry']['section_id'];
$options = $this->Entry->Submenu->find('list',array('section_id'=>
$section_id,'recursive' => 1,'conditions'=>array('section_id'=>
$section_id),'page' => 1,'fields'=>'Submenu.submenu'));
$this->set('options',$options);
}


}

}
?>
i don't have user_id in entries table
my index view as follows


Welcome read('User')?>
Count :
 
 css('default');
?>

tableHeaders(
array(

  'Section',
  'Submenu',
  'Listitem',
  'Detail',
  'Actions'
)
);?>

>


0)
{
echo $entry['Entry']['Listitem'];
}
else{
echo "";
}
?>
0)
{
echo $entry['Entry']['Detail'];
}
else{
echo "";
}
?>

link('View','/entries/view/' . $entry['Entry']
['id'])?>
link('Edit','/entries/edit/' . $entry['Entry']
['id'])?>
   

How to display total no of entries from database

2008-12-31 Thread mona

I wan't to display total no of records in database on my welcome page
how to do this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



About session variable

2008-12-31 Thread mona

I username in session and read this on my welcome page
but after some time name stored in session disappears can anybody tell
me why this happen and what is the solution for that
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to set title for cakephp pages

2008-12-31 Thread mona

I tried alot using
I used this in my login function
$this->pageTitle = 'My search engine optimized title';
but when i wan't to display in my layout it can't display
but when i display this
in body section it is displaying a title
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to give label when we take input type is file and how to give titles to your pages in cakephp

2008-12-30 Thread mona

How to give titles to your pages in your layout where to give that
title
and i m taking input type file and i want to give name as attachment
on my view how to give this in label
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



buttons in cakephp

2008-12-30 Thread mona

can we make buttons in cakephp1.2 and call javascript functions on
them how to call functions on buttons in cakephp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to change data of dropdown box when value of other dropdown box changes

2008-12-30 Thread mona

I have two dropdown box if i change the value of one dropdown box it
will update the value of other dropdown box how to do this in
cakephp1.2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to find total enteries from database

2008-12-30 Thread mona

I wan't to display total enteries from database and i have one link on
database when user enter new entry it will update the count how to do
this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Where to save uploaded files

2008-12-29 Thread mona

where to make temp folder in file uploading i want to know where to
save folder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to make buttons in cakephp

2008-12-29 Thread mona

can anybody tell me how to make buttons in cakephp and call javascript
functions on it in my index page instead of making links i want
buttons so how to do this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: css is not caling

2008-12-29 Thread mona

How to load a firebug in cakephp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to edit user record in database

2008-12-29 Thread mona

I want to edit user data through index view of other model how to send
id of user
i have only username in session variable

Welcome read('User')?>
 
 css('default');
?>

tableHeaders(
array(

  'Section',
  'Submenu',
  'Listitem',
  'Detail',
  'Actions'
)
);?>

>





link('View','/entries/view/' . $entry['Entry']
['id'])?>
link('Edit','/entries/edit/' . $entry['Entry']
['id'])?>
link('Delete','/entries/delete/' . 
$entry['Entry']
['id'], null, 'Are you sure you want to delete record' )?>





link('New Content entry', '/entries/add'); ?>
link('Logout','/users/logout');?>

link('Manage Account','/users/edit'.$form->value
('User'.$id));?>


please consider above line Manage account how can i do that

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



css is not caling

2008-12-29 Thread mona

I wan't to alternate colors to rows in the index view but when i call
css it is not calling
my code is as follows:
code of index view


Welcome read('User')?>
 
 css('default');
?>

tableHeaders(
array(

  'Section',
  'Submenu',
  'Listitem',
  'Detail',
  'Actions'
)
);?>

>





link('View','/entries/view/' . $entry['Entry']
['id'])?>
link('Edit','/entries/edit/' . $entry['Entry']
['id'])?>
link('Delete','/entries/delete/' . 
$entry['Entry']
['id'], null, 'Are you sure you want to delete record' )?>





link('New Content entry', '/entries/add'); ?>
link('Logout','/users/logout');?>
link('Manage Account','/users/edit'.$form->value
('User'.$id));?>



my css is follows
table {
background: #fff;
border:1px solid #ccc;
border-right:0;
clear: both;
color: #333;
margin-bottom: 10px;
width: 100%;
}
th
{
  background: #f2f2f2;
border:1px solid #bbb;
border-top: 1px solid #fff;
border-left: 1px solid #fff;
text-align: center;
}

.altrow
{
  background-color: #D4FFA8;
  border-top: 1px solid #00;
  border-bottom: 1px solid #00;
}

can anybody tell me what is the problem

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem related to dropdown box

2008-12-28 Thread mona

I tired this thing but it was not workin i already send you my code
plz check it and correct it if it is possible for you
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: file uploading in cake php

2008-12-28 Thread mona


I tried alot but it is not working any other options
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Where to place new layout page

2008-12-28 Thread mona



thanks for replying can u tell me how to use bake.php in cakephp 1.2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to upload files and where to save in temp folder

2008-12-28 Thread mona

This is my code of add vies i want to upload file from this code and
send file name and type in database when i click on add button if i
click on add button it is displaying error array to string conversion
and file data doesn't save data in database can anybody tell me how to
do this


New Entry
create('Entry',array('action' => 'add','type' =>
'file'));?>

input('Section', array('options' => array
('Announcements','The Venue','About Melbourne')),array('error' =>
'false','value' => array(1,2,3) )); ?>


input('Submenu', array('options' => array
(1,2,3,4,5)),array('error' => false,'label' => 'Submenu')); ?>


input('Listitem',array('label' => 'Listitem'),array
('error' => false));?>


input('Detail',array('label' => 'Detail'),array
('error' => false));?>


file('File'); ?>


submit('Add');?>



link('Home', '/entries/index')?>


from this form i wan't to upload file when I click on submit button
where to write file upload code please correct my code
this is my controller  code
Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll());

}
function view($id = null)
{
if (!$id)
 {
$this->Session->setFlash('Invalid id for
Entry.');
$this->redirect('/entries/index');
  }
$this->set('entry', $this->Entry->read(null, $id));

}

function add()
{
if (empty($this->data))
 {
$this->render();
 }
 else
 {
//$this->cleanUpFields();

if ($this->Entry->save($this->data))
{

$this->Session->setFlash('The
Entry has been saved');
$this->redirect('/entries/
index');
}
else
 {
$this->Session->setFlash
('Please correct errors below.');
}
 }
}
function edit($id = null)
 {
if (empty($this->data))
 {
if (!$id)
 {
$this->Session->setFlash('Invalid id
for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
} else
{
//$this->cleanUpFields();
if ($this->Entry->save($this->data))
 {
$this->Session->setFlash('The
Entry has been saved');
$this->redirect('/entries/
index');
 }
   else
{
$this->Session->setFlash
('Please correct errors below.');
}
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid id for
Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)) {
$this->Session->setFlash('Record deleted
successfully');
$this->redirect('/entries/index');
}
}

}

?>
how to upload files from this code

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to fetch data in a dropdown box in add action

2008-12-28 Thread mona

This is my code can anybody tell me how to fetch data in a drop down
box in add action i want to display data in dropdown box and when i
click on add button is save values in a database
code is follows my controller is

Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll());

}
function view($id = null)
{
if (!$id)
 {
$this->Session->setFlash('Invalid id for
Entry.');
$this->redirect('/entries/index');
  }
$this->set('entry', $this->Entry->read(null, $id));

}

function add()
{
if (empty($this->data))
 {
$this->render();
 }
 else
 {
//$this->cleanUpFields();

if ($this->Entry->save($this->data))
{

$this->Session->setFlash('The
Entry has been saved');
$this->redirect('/entries/
index');
}
else
 {
$this->Session->setFlash
('Please correct errors below.');
}
 }
}
function edit($id = null)
 {
if (empty($this->data))
 {
if (!$id)
 {
$this->Session->setFlash('Invalid id
for Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
} else
{
//$this->cleanUpFields();
if ($this->Entry->save($this->data))
 {
$this->Session->setFlash('The
Entry has been saved');
$this->redirect('/entries/
index');
 }
   else
{
$this->Session->setFlash
('Please correct errors below.');
}
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid id for
Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)) {
$this->Session->setFlash('Record deleted
successfully');
$this->redirect('/entries/index');
}
}

}

?>

my model of entries is

array(
'className'=>'Section'
),
'Submenu'=>array('className'=>'Submenu')
);

}

?>
and my add view is here i want drop down box and fetch data from
section table in Section field i m using cake php 1.2

New Entry
create('Entry',array('action' => 'add','type' =>
'file'));?>

input('Section', array('options' => array
('Announcements','The Venue','About Melbourne')),array('error' =>
'false','value' => array(1,2,3) )); ?>


input('Submenu', array('options' => array
(1,2,3,4,5)),array('error' => false)); ?>


input('Listitem',array('label' => 'Listitem'),array
('error' => false));?>


input('Detail',array('label' => 'Detail'),array
('error' => false));?>



submit('Add');?>



link('Home', '/entries/index')?>


and my edit view is
Edit Entry
create('Entry',array('action' => 'edit'));?>

/* here instead of text box i wan't data in dropdown box */
input('Section.section',array('label'
=>'Section','size'=>'30'
,'type'=>'text'));?>


input('Submenu.submenu',array('label'
=>'Submenu','size'=>'30'
,'type'=>'text'));?>


input('Entry.Listitem',array('label'
=>'Listitem','size'=>'30'
,'type'=>'text'));?>


input('Entry.Detail',array('label'
=>'Detail','size'=>'30'
));?>


hidden('entry/id')?>

submit('Save');?>



link('Delete','/entries/delete/' . $form->value
('Entry/id'), null, 'Are you sure you want to delete: id ' . $form-
>value('Entry/id'));?>

link('Back', '/entries/index')?>


please help me it is very urgent
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Where to place new layout page

2008-12-28 Thread mona

Can anybody tell me where to place my new layout page in cakephp so
that i call in my login function to use that layout
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to use bake.php in cakephp1.2

2008-12-27 Thread mona

It is not properly working in cakephp 1.2 how to use this in cakephp
1.2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



login script

2008-12-27 Thread mona

Can anyone tell me how to set the layout of this page i m having
fields username and password
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How can i change the layout of cakephp pages

2008-12-27 Thread mona

When i edit default.ctp file in cake php it doesn't work can i use
table as normal php and set my layout i m using fieldset so how can i
adjust the size of that fieldset i tried alot but doesn't success can
we design page in cakephp as simple php and how i can disable the sql
log table from my pages it is displayin in php 1.2 .If i delete all
the contents of default.ctp does it cause any problem.One thing in the
index i m displaying a table and i wan't to give alternate rows
different colors how it is possibe i m using foreach loop to display
the contents of table
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: file uploading in cake php

2008-12-27 Thread mona

Hello mike
sorry for distutbing you once again. I am sending you my file
uploading problem please i need your help if you help me it will be
great help for me
this is my add view code please consider it
New Entry
create('Entry',array('action' => 'add','type' =>
'file'));?>

input('Section', array('options' => array
('Announcements','The Venue','About Melbourne')),array('error' =>
'false','value' => array(1,2,3) )); ?>


input('Submenu', array('options' => array
(1,2,3,4,5)),array('error' => false,'label' => 'Submenu')); ?>


input('Listitem',array('label' => 'Listitem'),array
('error' => false));?>


input('Detail',array('label' => 'Detail'),array
('error' => false));?>


file('File'); ?>


submit('Add');?>



link('Home', '/entries/index')?>


from this form i wan't to upload file when I click on submit button
where to write file upload code please correct my code
this is my controller  code
Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll());

}
function view($id = null)
{
if (!$id)
 {
$this->Session->setFlash('Invalid id for Entry.');
$this->redirect('/entries/index');
  }
$this->set('entry', $this->Entry->read(null, $id));

}

function add()
{
if (empty($this->data))
 {
$this->render();
 }
 else
 {
//$this->cleanUpFields();

if ($this->Entry->save($this->data))
{

$this->Session->setFlash('The Entry has 
been saved');
$this->redirect('/entries/index');
}
else
 {
$this->Session->setFlash('Please 
correct errors below.');
}
 }
}
function edit($id = null)
 {
if (empty($this->data))
 {
if (!$id)
 {
$this->Session->setFlash('Invalid id for 
Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
} else
{
//$this->cleanUpFields();
if ($this->Entry->save($this->data))
 {
$this->Session->setFlash('The Entry has 
been saved');
$this->redirect('/entries/index');
 }
   else
{
$this->Session->setFlash('Please 
correct errors below.');
}
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)) {
$this->Session->setFlash('Record deleted successfully');
$this->redirect('/entries/index');
}
}


}
?>
how to upload files from this code

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem related to dropdown box

2008-12-27 Thread mona


It can't solve my problem i m sending you my code can you tell me
where i m making mistake plz correct it if it is possible
this i my entries controller  and i want data in drop down box in add
and edit pages from table name section
Entry->recursive = 1;
$this->set('entries', $this->Entry->findAll());

}
function view($id = null)
{
if (!$id)
 {
$this->Session->setFlash('Invalid id for Entry.');
$this->redirect('/entries/index');
  }
$this->set('entry', $this->Entry->read(null, $id));

}

function add()
{
if (empty($this->data))
 {
$this->render();
 }
 else
 {
//$this->cleanUpFields();

if ($this->Entry->save($this->data))
{

$this->Session->setFlash('The Entry has 
been saved');
$this->redirect('/entries/index');
}
else
 {
$this->Session->setFlash('Please 
correct errors below.');
}
 }
}
function edit($id = null)
 {
if (empty($this->data))
 {
if (!$id)
 {
$this->Session->setFlash('Invalid id for 
Entry');
$this->redirect('/entries/index');
}
$this->data = $this->Entry->read(null, $id);
} else
{
//$this->cleanUpFields();
if ($this->Entry->save($this->data))
 {
$this->Session->setFlash('The Entry has 
been saved');
$this->redirect('/entries/index');
 }
   else
{
$this->Session->setFlash('Please 
correct errors below.');
}
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid id for Entry');
$this->redirect('/entries/index');
}
if ($this->Entry->del($id)) {
$this->Session->setFlash('Record deleted successfully');
$this->redirect('/entries/index');
}
}


}
?>
my model of entries is
array(
'className'=>'Section'
),
'Submenu'=>array('className'=>'Submenu')
);

}
?>
and my add view is here i want drop down box and fetch data from
section table in Section field i m using cake php 1.2
New Entry
create('Entry',array('action' => 'add','type' =>
'file'));?>

input('Section', array('options' => array
('Announcements','The Venue','About Melbourne')),array('error' =>
'false','value' => array(1,2,3) )); ?>


input('Submenu', array('options' => array
(1,2,3,4,5)),array('error' => false)); ?>


input('Listitem',array('label' => 'Listitem'),array
('error' => false));?>


input('Detail',array('label' => 'Detail'),array
('error' => false));?>



submit('Add');?>



link('Home', '/entries/index')?>


and my edit view is
Edit Entry
create('Entry',array('action' => 'edit'));?>

/* here instead of text box i wan't data in dropdown box */
input('Section.section',array('label'
=>'Section','size'=>'30'
,'type'=>'text'));?>


input('Submenu.submenu',array('label'
=>'Submenu','size'=>'30'
,'type'=>'text'));?>


input('Entry.Listitem',array('label'
=>'Listitem','size'=>'30'
,'type'=>'text'));?>


input('Entry.Detail',array('label'
=>'Detail','size'=>'30'
));?>


hidden('entry/id')?>

submit('Save');?>



link('Delete','/entries/delete/' . $form->value
('Entry/id'), null, 'Are you sure you want to delete: id ' . $form-
>value('Entry/id'));?>
link('Back', '/entries/index')?>


Please if you help me it will be great help for me can you tell me how
i can remove sql log table from my pages in cakephp 1.2

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: file uploading in cake php

2008-12-26 Thread mona



thanks for the reply but when i click on add button to submit the form
value in the database it is displaying the error like array to string
conversion something like that how to print the value of array you me
the above link but in all that page file uploading having different
table different controller so can i make new table for file uploading
and but i want to store file data in my main table enteries how can i
do that
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to change the layout of your pages in cake php

2008-12-26 Thread mona

I am making login page but due to default settings of cakephp my
layout is not looking good i m using table on my login page but if i
customize cakephp default page and delete the cakephp logo and all
that things on display the contents then my layout is not looking good
how to make my login page properly aligned in cakephp so that its look
good i need fast answers please can anybody help me
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Model association

2008-12-26 Thread mona

How to make association between three of four tables because i m
fetching data on my table from three different tables
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



file uploading in cake php

2008-12-26 Thread mona

In my add view i have one form which contain file upload option i want
to send all the values of form in one table but file upload option is
displaying error like array to string conversion because the query is
like that ("insert into enteries(section,list,submenu,file) values
('shopping','list','sub',array)") why file field is having array as a
value how to do file uploading from a form in cakephp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem related to dropdown box

2008-12-26 Thread mona

How to fetch data from a database and display in dropdown box.
For e.g i have one table enteries and another table name as section
when i add new entry then at my add view all the section should
display in dropdown box and i have section_id field in entry table
because i m saving only id of the section in the entry table so how to
do this and i have one more field submenu it should also display its
content in dropdown box and when i change value in section dropdown
menu the content of sub menu dropdown box also change
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



installation of cakephp

2008-12-24 Thread mona

when we install cakephp then in httpd.conf of apache where we find
Addmodule mod_rewrite.c. this is for unix os because i m using windows
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



cms in cake php

2008-12-24 Thread mona

I have to make cms using cakephp and in that cms i have to increment a
count every time when new content add in cms for that first i have to
make login script can anybody tell me how to make login script in php
and i want that when i type address it should open my login page not
index page and also i want to remove cakephp framework tag from my
pages everytime i create new pages i will display a logo of cakephp
can anybody tell me how to remove this logo and do all that things
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to make forms in cakephp

2008-12-23 Thread mona

I m new to cake php i want to make form in cakephp and i make the
following things
class User extends AppModel {

var $name = 'User';

 var $validate = array(
 'name'=>array('rule'=>'notEmpty'),
 'email'=>array('rule'=>'email'),
 'password'=>array(
  'Cannot be empty' => array('rule'=>'notEmpty'),
'Must be at least 4 chars' => array('rule'=>array
('minLength', 4))
 )
   );
 }
This is my model and i saved as a user.php
and my controller is
  class UsersController extends AppController {

var $name = 'Users';
var $components = array('Security');

function add() {
 if(!empty($this->data)) {
$this->User->save($this->data);
}
  }
 }

and then i create a view for add action
echo $form->create();
echo $form->inputs(array('name', 'email', 'password'));
echo $form->end('Register');
but it is creating error can anybody tell me why it is creating a
error please correct it

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to install cake php

2008-12-21 Thread mona

I m new to cake php and i don't know how to install it on windows i m
using apache server and mysql can anybody step by step procedure of
installtion so that i can easily install it because i can't understand
the manual

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: sorting table by colum for cake 1.1.19

2008-11-25 Thread Mona


Anyone?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error about non-existing field!

2008-11-21 Thread Mona

I finally figure out what is wrong.  CakePHP makes a select statement
to the entire table without qualifying the schema and so it is picking
up tables with same name in a different schema!  I hope this is fixed
in the new version!

For example, the query it makes is:

SELECT DISTINCT column_name AS name, data_type AS type, is_nullable AS
null,
column_default AS default, ordinal_position AS position,
character_maximum_length AS char_length, character_octet_length AS
oct_length
FROM information_schema.columns WHERE table_name ='institutions' ORDER
BY position

When it should qualfiy the table_schema like this:

SELECT DISTINCT column_name AS name, data_type AS type, is_nullable AS
null,
column_default AS default, ordinal_position AS position,
character_maximum_length AS char_length, character_octet_length AS
oct_length
FROM information_schema.columns WHERE table_schema = 'publications'
AND
table_name ='institutions' ORDER BY position

Hope this helps someone else.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error about non-existing field!

2008-10-24 Thread Mona


Ok, I fixed the missing default_teragrid_list file problem but my
original problem of a non-existent field error message is back...

Any other suggestions?

thanks,
Mona


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Error about non-existing field!

2008-10-24 Thread Mona


I just tried to empty my cache by deleting tmp/cache/mode/*  and now
I'm getting a different error:

Warning: file_put_contents(/misc/www/projects/test/mona/app/tmp/cache/
models/default_teragrid_list) [function.file-put-contents]: failed to
open stream: No such file or directory in /misc/www/projects/test/mona/
cake/basics.php on line 936

Warning: file_put_contents(/misc/www/projects/test/mona/app/tmp/cache/
models/default_authors) [function.file-put-contents]: failed to open
stream: No such file or directory in /misc/www/projects/test/mona/cake/
basics.php on line 936

Warning: file_put_contents(/misc/www/projects/test/mona/app/tmp/cache/
models/default_organizations) [function.file-put-contents]: failed to
open stream: No such file or directory in /misc/www/projects/test/mona/
cake/basics.php on line 936

Warning: file_put_contents(/misc/www/projects/test/mona/app/tmp/cache/
models/default_publications) [function.file-put-contents]: failed to
open stream: No such file or directory in /misc/www/projects/test/mona/
cake/basics.php on line 936


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Error about non-existing field!

2008-10-23 Thread Mona

Hi:

I'm using version 1.1.19 and I keep getting a runtime error message
about a non-existing field:


Warning: pg_query() [function.pg-query]: Query failed: ERROR: column
Organization.organization does not exist in /misc/www/projects/test/
mona/cake/libs/model/dbo/dbo_postgres.php on line 123

Query: SELECT "Organization"."id" AS "Organization__id",
"Organization"."organization" AS "Organization__organization",
"Organization"."organization_id" AS "Organization__organization_id",
"Organization"."name" AS "Organization__name",
"Organization"."org_type_id" AS "Organization__org_type_id",
"Organization"."organization_abbrev" AS
"Organization__organization_abbrev",
"Organization"."organization_name" AS
"Organization__organization_name", "Organization"."state" AS
"Organization__state", "Organization"."country" AS
"Organization__country", "Organization"."organization_url" AS
"Organization__organization_url", "Organization"."city" AS
"Organization__city", "Organization"."organization_phone" AS
"Organization__organization_phone", "Organization"."nsf_org_code" AS
"Organization__nsf_org_code", "Organization"."is_reconciled" AS
"Organization__is_reconciled", "Organization"."amie_name" AS
"Organization__amie_name", "Organization"."country_id" AS
"Organization__country_id", "Organization"."state_id" AS
"Organization__state_id" FROM "organizations" AS "Organization" WHERE
1 = 1
Warning: SQL Error: ERROR: column Organization.organization does not
exist in /misc/www/projects/test/mona/cake/libs/model/datasources/
dbo_source.php on line 440


The field "organization" has been removed from the table and all the
MVC code, but I am still getting this error message and I don't know
why.  Is something cached somewhere?  I've checked my code over and
over and over again and I don't make any references to that field
anywhere.

I just don't know what the problem is.  All help is appreciated!

Here is my organization.php:

 VALID_NOT_EMPTY,
'state' => VALID_NOT_EMPTY,
'country' => VALID_NOT_EMPTY,
'city' => VALID_NOT_EMPTY );
}

?>

Here is my index.html:

layout = 'list'; ?>


Organizations


IDx
Name
City
State
Country














Here is my organizations_controller.php:

set ( 'organizations', $this->Organization-
>findAll() );
}

}

?>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



sorting table by colum for cake 1.1.19

2008-10-15 Thread Mona

Without writing my own javascript library, is there a way to sort a
table by clicking on a column?  I see paginator for CakePHP 1.2 but
not for 1.1.19.

The closest thing I found was the ajax h elper sortable() but that
sorts by dragging and dropping, not by clicking on a column,,,

All help is appreciated.

thanks,
Mona

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: pass info from controller methodA to methodB

2008-09-05 Thread Mona


Yes true, I do not expect CakePHP to add any data to session for
me...I guess I thought that if I do a $this->set() or $this->data, it
will be automatically saved for me and accessible in other
requests...now I know it is a wrong assumption (:

Thanks for the $this->Sessison->write() tip.

Thanks to everyone for their help!  I appreciate it very much...good
way to end the work week (:  Have a great weekend everyone!

cheers,
Mona

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: pass info from controller methodA to methodB

2008-09-05 Thread Mona

Hi everyone:

I guess I thought CakePHP will have an easy way to store data between
client requests for the same controller class, but it sounds like
there isn't a built-in way (via $this->set or $this->data) and I have
to store the info into the session myself...

Is this conclusion correct?

thanks,
Mona

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: pass info from controller methodA to methodB

2008-09-05 Thread Mona

Hi Mark:

I tried to store it in various ways, this $this->set, via a class
variable, via a static variable...but nothing worked...

Mona

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: pass info from controller methodA to methodB

2008-09-04 Thread Mona

Hi Jaime:

I tried your suggestion but it didn't work, probably because the calls
to these 2 methods are from 2 separate client requests.

To answer your last question:

methodA shows a form and handles the form by calling a web services to
retrieve information.  methodB is intended to display the information
in a table which allows the user to choose which information to
actually store into the database.  I'm new to CakePHP, perhaps there
is a better way to accomplish this?

thanks,
Mona

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



pass info from controller methodA to methodB

2008-09-03 Thread Mona

Hi:  I'm using 1.1.19* and have a simple question that I cannot find
answer to from either manual or search here...

I have 2 methods in a controller, let's call them methodA and
methodB.  In methodA, I do some work and I want to store the result of
that work so that methodB can access and display it.  How do I
accomplish this?

I've tried many things but nothing seems to be working.  All help or
suggestions are welcome!

FYI, each method has its own respective view (eg methodA.thtml,
methodB.thtml)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



pass info from controller methodA to methodB

2008-09-03 Thread Mona

Hi:  I'm using 1.1.19* and have a simple question that I cannot find
answer to from either manual or search here...

I have 2 methods in a controller, let's call them methodA and
methodB.  In methodA, I do some work and I want to store the result of
that work so that methodB can access and display it.  How do I
accomplish this?

I've tried many things but nothing seems to be working.  All help or
suggestions are welcome!

FYI, each method has its own respective view (eg methodA.thtml,
methodB.thtml)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---