CakePHP cake bake command

step 1: set path to environment variable. like: C:\xampp\php;C:\xampp\htdocs\yourproject\lib\cake\console\; step 2: open command prompt and type cd C:\xampp\htdocs\yourproject\app  and press enter. step 3: now type cake bake now you can see the options there. you can continue accordingly.

Manipulating datastore data after loading

[php]var restaurantsStore = this.getStore(); var avg_rating; restaurantsStore.clearFilter(); if ( restaurantsStore !== undefined ) { restaurantsStore.load({ callback: function(records, operation, success) { var proxy = restaurantsStore.getProxy(), message = proxy.getReader().rawData.message; if( success === false ){ Ext.Msg.alert(‘Operation Failed’, message); } else{ var vendor = records[0].get(‘vendor’); Ext.getCmp(‘poweredByContainer’).setVendor( vendor ); if( vendor === ‘O’ ){ for ( var index = 0; … Read more

jQuery UI Datepicker Add Days (check-in,check-out,no. of nights)

<div class=”cus-select” style=”width:90px;”> <input type=”text” name=”check_in[<?=$_GET[‘i’]?>]” class=”custom-sel-box check_in checkin_out” style=”width:90px;” onchange=”getDetail(‘<?=$_GET[‘i’]?>’)” > </div> <div class=”cus-select” style=”width:90px; margin-left: 14px;”> <input type=”text” name=”check_out[<?=$_GET[‘i’]?>]” class=”custom-sel-box check_out checkin_out” style=”width:90px;” onchange=”getDetail(‘<?=$_GET[‘i’]?>’)” > </div> <div class=”cus-select” style=”width:90px; margin-left: 14px;”> <select name=”nights[<?=$_GET[‘i’]?>]” class=”custom-sel-box nights” style=”width:90px;” onchange=”getDetail(‘<?=$_GET[‘i’]?>’)” > <option value=”2″>2</option> <option value=”3″>3</option> <option value=”4″>4</option> <option value=”5″>5</option> <option value=”6″>6</option> <option value=”7″>7</option> <option value=”8″>8</option> <option … Read more

Sending multiple files in email using PHP

<?php // array with filenames to be sent as attachment $files = array(“emi_pdf/Self_Employee_1330438553.pdf”, “emi_pdf/Self_Employee_1330439327.pdf”,”emi_pdf/Self_Employee_1330438611.pdf”); // email fields: to, from, subject, and so on $to = “abc.kumar@gmail.com”; $from = “me@domain.com”; $subject = “send email with pdf attachment”; $message = “<p>Please see the attachment.</p>”; $headers = “From: $from”; // boundary $semi_rand = md5(time()); $mime_boundary = “==Multipart_Boundary_x{$semi_rand}x”; // … Read more

Generate a PDF and send as attachment in Email

One way: In PHP // download fpdf class (http://fpdf.org) require(“/fpd/fpdf.php”); // fpdf object $pdf = new FPDF(); // generate a simple PDF (for more info, see http://fpdf.org/en/tutorial/) $pdf->AddPage(); $pdf->SetFont(“Arial”,”B”,14); $pdf->Cell(40,10, “this is a pdf example”); // email stuff (change data below) $to = “target@domain.com”; $from = “me@domain.com”; $subject = “send email with pdf attachment”; $message … Read more