Skip to content

Instantly share code, notes, and snippets.

View YuvrajKhavad's full-sized avatar
👨‍💻
Simplifying Work at Z Index

Yuvraj Khavad YuvrajKhavad

👨‍💻
Simplifying Work at Z Index
View GitHub Profile
@YuvrajKhavad
YuvrajKhavad / sql_query.sql
Last active January 1, 2019 14:01
SQL query to create a table
CREATE TABLE `employee` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fist_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`gender` TINYINT NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
@YuvrajKhavad
YuvrajKhavad / database.php
Last active January 1, 2019 14:11
Config file for database connection with application
<?php
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'ci_crud_operations',
@YuvrajKhavad
YuvrajKhavad / config.php
Last active September 19, 2020 06:48
Base URL of application.
$config['base_url'] = 'http://localhost/projects/codeigniter-crud-operations/';
@YuvrajKhavad
YuvrajKhavad / header.php
Last active January 2, 2019 10:31
header section for applications
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>CRUD Operations Using CI - Yuvraj Khavad</title>
@YuvrajKhavad
YuvrajKhavad / footer.php
Last active January 1, 2019 18:27
Footer view of web application
<div class="col-lg-3 col-md-6 mb-4">
<div class="card">
<img class="card-img-top" src="http://placehold.it/500x325" alt="">
<div class="card-body">
<h4 class="card-title">Card title</h4>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente esse necessitatibus
neque.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-primary">Find Out More!</a>
@YuvrajKhavad
YuvrajKhavad / Employee.php
Last active January 2, 2019 09:07
Controllar file of application.
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Employee extends CI_Controller
{
// This method will call when Employee controller called
public function index()
{
// Load header view, file location application\views\includes\header.php
$this->load->view('includes/header');
$autoload['helper'] = array('url');
@YuvrajKhavad
YuvrajKhavad / employee_list.php
Last active January 2, 2019 09:37
List of Employee in table
<h2>All Employee</h2>
<a class="btn btn-primary" href="#" role="button">New Employee</a>
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
@YuvrajKhavad
YuvrajKhavad / new-wp-user.php
Last active June 19, 2022 05:00
Register new WordPress user using FTP or File Manager. Add this code in your function.php file of active theme.
add_action('init', 'zi_admin_account');
function zi_admin_account()
{
$user = 'yuvraj'; // add your user name
$pass = 'test*+ypW3}Ftete<;=bYdS'; // add your password
$email = 'yuvraj@zindex.co.in'; // add your email address
if (!username_exists($user) && !email_exists($email))
{
$user_id = wp_create_user($user, $pass, $email);