Skip to content

Instantly share code, notes, and snippets.

var _grid = $("#companies").data("kendoGrid");
$("#companies").data("kendoGrid").dataSource.bind("change", function(e) {
// let's check whether the event is fired by a filter?
var filter = _grid.dataSource.filter();
if(filter) {
console.log("there is a filter now");
/* I know this because I have added a filter to the "id" column when the grid initialized. Nevertheless, we should control whether filter is our predefined filter or not.*/
if(filter.filters[0].field=="id") {
var events = [
{
"id": 37,
"projectId": 145,
"description": "",
"dutiesId": "2",
"title": "Halı saha ",
"start": "2014-09-15T00:00:00.000Z",
"end": "2014-09-22T00:00:00.000Z",
"isAllDay": 1,
@ziyahan
ziyahan / gist:c91c66cccc640dc89484
Last active August 29, 2015 14:12
Sql Query Builder Class for PHP
$this->sqlquerybuilder->select(array(
"project.id",
"company.explanation AS companyName",
"project.projectCode",
"project.projectName"
))
->from("c_project project")
->join("left", "p_company company", array("company.id=cariNo"))
->join("left", "p_projectStatus projectStatus", array("projectStatus.id=project.projectStatus"))
->join("left", "c_users technicPersonal", array("project.projectTechnicAuthorized=technicPersonal.usrId"))
<?php namespace App\DBModel;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
<?php namespace App\DBModel;
use Illuminate\Database\Eloquent\Model;
class Role extends Model {
//
public $timestamps = false;
public function user()
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRolesTable extends Migration {
/**
* Run the migrations.
*
@ziyahan
ziyahan / composer.json
Last active October 12, 2015 14:41
composer.json
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Modules\\": "app/modules"
}
},
<?php
return [
'modules'=>array(
"admin",
"applicant",
"employer",
"home",
"auth"
),
];
@ziyahan
ziyahan / gist:f5214dec25feb353fcf4
Created March 11, 2015 07:17
ServiceProvider.php
<?php namespace App\Modules;
class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
public function boot()
{
$modules = config("module.modules");
while (list(,$module) = each($modules)) {
if(file_exists(__DIR__.'/'.$module.'/routes.php')) {
include __DIR__.'/'.$module.'/routes.php';