How to resovle Cakephp Missing Database Table error
1.Customize the error message
Missing Database Table
Error: Database table pages for model Page was not found.
Notice: If you want to customize this error message, create app/views/
errors/missing_table.ctp
2. Sometime if you encounter “Missing Database Table” from CakePHP errors, it might not really be due to missing of some database tables.
What you need to do is simple. Clear the cache folders found in CakePHP. The directory should be /app/tmp/cache.
Clear (delete) all files found in these 3 folders:
- models
- persistent
- views
By right, we should only clear the files in models folder. Just to be on the safe side, I strongly recommend clearing all these 3 folders.
Ajax Form Post with Cakephp
Html Form
<form id=’ajaxPostForm’>
User Name :<input type=’text’ name=’user_name’>
Email : <input type=’text’ name=’user_email’>
Comments : <input type=’text’ name=’comments’>
<input value=”Save” type=”button” onclick=”save();”>
</form>
Javascript Code:
function save()
{
var base=$(“#ajaxPostForm”);
var params=base.serialize();
$.ajax({
type: “GET”,
url: ‘<?php echo FULL_BASE_URL.$this->webroot.’users/data_save’; ?>’,
data: params,
success: function(msg){
}
});
}
Cakephp Code:
<?php
class UsersController extends AppController
{
var $name = ‘Users’;
function data_save()
{
$userName = $this->params['url']['user_name'];
$userEmail = $this->params['url']['user_email'];
$userComments = $this->params['url']['comments'];
$this->data['User']['user_name'] = $userName;
$this->data['User']['user_email'] = $userEmail;
$this->data['User']['comments'] = $userComments;
$this->User->save($this->data, false);
}
}
?>
PayPal Pro for Joomla Virtuemart
PayPal Pro for Virtuemart
PayPal Pro is an express Direct payment system offered by PayPal for US, UK and Canada. It helps you to process direct credit cards, instead of taking you to the PayPal website for the payments. Its very handy for those who needs direct credit card payment processors on their website.
The primary difference between PayPal and PayPal Pro is that with PayPal, the user has to get redirected to the PayPal website to make the payment and they need to have a valid PayPal account, while with PayPal Pro, you dont get to the PayPal website at any step and you can directly enter your credit card info into the form and the payment gets automatically processed in the background via PayPal.
Sounds good ? Yes, because credit card payments sum up to 79 billion dollars via PayPal every year! And it also enhances the customer shopping experience on your online store, adding the reputation.
Get Form all field value at a time by JQUERY.
You can get form all data at a time by clicking any field.Only jquery serializeArray function can do this. Here is very important thing is all field class name must be same, Below example all field class name is “Target”,
JQUERY CODE:
jQuery(document).ready(function () {
jQuery(‘.target’).change(function() {
var formAllData;
var fieldName;
var fieldValue;
var grossTotal=0;
formAllData = $(‘#getAllData’).serializeArray();
var dataArray = new Object();
for( index in formAllData)
{
if(formAllData[index].value) {
//dataArray[perfTimes[index].name] = perfTimes[index].value;
fieldName =formAllData[index].name;
fieldValue = formAllData[index].value;
grossTotal += parseInt(fieldValue);
//alert(fieldName);
//alert(fieldValue);
}
}
var pre_gross_price = jQuery(“#priceGross”).val(grossTotal);
});
});
HTML CODE :
<form name=”getAllData” id=”getAllData” action=”#”>
<input type=”text” name=”priceGross” id=”priceGross” value=”1000″ />
<input type=”checkbox” name=”Attribute1″ id=”Attribute1″ value=”600″ />
<input type=”checkbox” name=”Attribute2″ id=”Attribute1″ value=”600″ />
<input type=”checkbox” name=”Attribute3″ id=”Attribute1″ value=”600″ />
<input type=”radio” name=”Size” id=”Size” value=”300″ /> XL
<input type=”radio” name=”Size” id=”Size” value=”500″ /> XXL
<select name=”color” id=”color”>
<option value=”100″>Red</option>
<option value=”200″>Blue</option>
<option value=”300″>Green</option>
</select>
</form>
Javascript string split
Javascript string split or extact
<script type=”text/javascript”>
var mySplit = ’1-56′;
var partsArray = mySplit.split(‘-’);
alert(partsArray[0]);
alert(partsArray[1]);
</script>
How To Create An Image Map Using html
An image map is a picture in which areas within the picture are links. Creating an image involves using the
<IMG ...>, <MAP ...>, and <AREA ...> tags. Suppose we want to make an image map using this image:
To make this image into an image map, we use this code:
<map name=”TopNavigaton”>
<area shape=”rect” coords=”550,45,605,60″ href=”‘.$invoice_url.’” alt=”Click Here” />
<area shape=”rect” coords=”820,10,900,33″ href=”‘.$url_path.’28″ alt=”Green” />
<area shape=”rect” coords=”730,10,800,33″ href=”‘.$url_path.’3″ alt=”Porcelain” />
<area shape=”rect” coords=”635,10,700,33″ href=”‘.$url_path.’2″ alt=”Mosaics” />
<area shape=”rect” coords=”550,10,600,33″ href=”‘.$url_path.’11″ alt=”Glass” />
<area shape=”rect” coords=”470,10,520,33″ href=”‘.$url_path.’6″ alt=”Quarry Tile” />
<area shape=”rect” coords=”390,10,445,33″ href=”‘.$url_path.’13″ alt=”Pebbles” />
<area shape=”rect” coords=”240,10,340,33″ href=”‘.$url_path.’17″ alt=”Natural Stone” />
<area shape=”rect” coords=”160,10,225,33″ href=”‘.$url_path.’5″ alt=”Metal” />
<area shape=”rect” coords=”80,10,145,33″ href=”‘.$url_path.’4″ alt=”Ceramic” />
</map>
Joomla Admin Panel Menu Control (Active-inactive)
Menu Control(Active-Inactive) From File and database
Admin panel menu List :
1.Site
2.Menu
3.Content
4.Components
5.Extensions
6.Tools
7.Help
a) Below The Menu List control (Active – Inactive) From File
- Site
- Menu
- Content
- Extension
- Tools
- Help
File location : root/administrator/modules/mod_menu/helper.php
b) Below The Menu List Control(Active-inactive) From Database
- Components
Step of database config :
- Go to database
- Choose your table (jos_components)
- Change your value from (enabled) field
- Value(1,0)
- 1= Active menu
- 0= Inactive menu
- Then save and check now..
jquery mouseover and mouseout event
Examples :Image change when mouse over and mouseout
<html>
<head>
<script type=’text/javascript>
jQuery(document).ready(function () {
jQuery(‘.yellow’).bind(‘mouseover’, yellow_mouseover)
jQuery(‘.yellow’).bind(‘mouseout’, yellow_mouseout)
function yellow_mouseover()
{
jQuery(‘.yellow’).attr(“src”,”images/yellow.gif”);
}
function yellow_mouseout()
{
jQuery(‘.yellow’).attr(“src”,”images/yellow1.gif”);
}
});
</script>
</head>
<body>
<img class=’yellow’ src=’images/yellow1.jpg’>
</body>
</html>
Zen cart new page create step by step.
At First select your file name (Examples : myprofile)
Step 1 :define your file name
root : includes/filenames.php
define(‘FILENAME_MYPROFILE’,'myprofile’);
Step 2 : create your file folder
root : includes/modules/pages/(create your folder e.g : myprofile)
e.g : includes/modules/pages/myprofile
Step 3 : Create your templates file where u will write something.
root : includes/templates/template_default/templates/tpl_myprofile_default.php
Step 4 : Run your site (http://yoursite.com/home.php?main_page=myprofile
How to file rename in php?
Examples :
<?php
rename ("oldFile.php", "NewFile.php");
?>
First parameters is existence file and second parameter is your desire file name.
