Skip to content

Instantly share code, notes, and snippets.

View harendra21's full-sized avatar
🏠
Working from home

Harendra Kumar Kanojiya harendra21

🏠
Working from home
View GitHub Profile
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`address` text NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Coolpraz\PhpBlade\PhpBlade;
class MY_Controller extends CI_Controller {
protected $views = APPPATH . 'views';
protected $cache = APPPATH . 'cache';
protected $blade;
public function __construct(){
parent::__construct();
$this->blade = new PhpBlade($this->views, $this->cache);
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends MY_Controller {
public function index(){
$head = array();
$data = array();
$this->front_render('home',$data,$head);
}
}
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="./assets/style.css">
<title>Angular Firbase Crud App</title>
var app = angular.module('myApp',['ngRoute']);
app.constant('BASEURL',
'http://localhost/projects/ngTodo/bkend/'
);
app.config(function($routeProvider) {
$routeProvider
.when("/home", {
templateUrl : "views/home.html",
controller : 'HomeCtrl'
})
<div class="jumbotron text-center">
<h2><b><i class="fa fa-list text-success" aria-hidden="true"></i> <span class="text-success">TASK</span> <i>Manager</i></b></h2>
<p>Keep your work up to date.</p>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4">
<div class="card">
<div class="card-header">
Add New Task
$route['add-update-task'] = 'TaskCtrl/add_update_task';
$route['get-task'] = 'TaskCtrl/get_task';
$route['action-task'] = 'TaskCtrl/action_task';
<?php
class TaskCtrl extends CI_Controller {
public function add_update_task()
{
$json = file_get_contents('php://input');
$data = json_decode($json, TRUE);
$id = $data['id'];
$title = $data['title'];
$status = $data['status'];
$description = $data['description'];
CREATE TABLE `task` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`description` text,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);