Skip to content

Instantly share code, notes, and snippets.

View manoj-singh-developer's full-sized avatar
🎯
Focusing

Manoj Singh manoj-singh-developer

🎯
Focusing
View GitHub Profile
public function clinicimages() {
$this->loadModel('Clinicimages');
$notesimage = $this->Clinicimages->newEntity();
if (!empty($this->request->data['clinic_image'])) {
$this->request->data['user_id'] = $this->userInfo['id'];
$files = $this->request->data['clinic_image'];
$res = array();
$imagek = array();
foreach ($files as $img => $imags) {
$name = rand(0, 999);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 Local Storage Example</title>
<!-- include Bootstrap CSS for layout -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
https://developer.mozilla.org/en-US/docs/Web/API/Storage
====================================================
var aLength = storage.length;
function populateStorage() {
localStorage.setItem('bgcolor', 'yellow');
localStorage.setItem('font', 'Helvetica');
localStorage.setItem('image', 'cats.png');
localStorage.length; // should return 3
<script>
function onSubmit()
{
var fields = $("input[name='anid[]']").serializeArray();
if (fields.length === 0)
{
alert('please select animities nothing selected');
// cancel submit
return false;
}
<?php
$items = array();
foreach($cass as $key=>$val){
$items[] = $val['cspec_id'];
}
foreach($specilities as $specilitie) {?>
<label class="checkbox-inline">
<input type="checkbox" <?php
if(in_array($specilitie['id'],$items)) { ?> checked="checked" <?php } ?> name="spid[]" id="inlineCheckbox1" value="<?php echo $specilitie['id']; ?>"> <?php echo $specilitie['spec_name']; ?>
$('#demo').pagination({
dataSource: 'https://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?',
locator: 'items',
totalNumber: 120,
pageSize: 20,
ajax: {
beforeSend: function() {
dataContainer.html('Loading data from flickr.com ...');
}
},
*public scope to make that variable/function available from anywhere, other classes and instances of the object.
*private scope when you want your variable/function to be visible in its own class only.
*protected scope when you want to make your variable/function visible in all classes that extend current class including the parent class.
Differences between abstract class and interface in PHP
Following are some main difference between abstract classes and interface in php
In abstract classes this is not necessary that every method should be abstract. But in interface every method is abstract.
Multiple and multilevel both type of inheritance is possible in interface. But single and multilevel inheritance is possible in abstract classes.
Method of php interface must be public only. Method in abstract class in php could be public or protected both.
In abstract class you can define as well as declare methods. But in interface you can only defined your methods.
==========================================================================================================================
1) Abstract class can have abstract and non-abstractmethods.Interface can have only abstract methods.
final keyword:
The final keyword in java is used to restrict the user. The java final keyword can be used in many context. Final can be:
variable
method
class
The final keyword can be applied with the variables, a final variable that have no value it is called blank final variable or uninitialized final variable. It can be initialized in the constructor only. The blank final variable can be static also which will be initialized in the static block only. We will have detailed learning of these. Let's first learn the basics of final keyword.
*If you make any variable as final, you cannot change the value of final variable(It will be constant).
*If you make any method as final, you cannot override it,final method is inherited but you cannot override it.
*If you make any class as final, you cannot extend it.
<input type="color" data-bind="value: color" />
Selected: <span data-bind="text: color"></span>
ko.applyBindings({
color: ko.observable()
})