This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('Pdf.php'); | |
class PDF_Rotate extends Pdf | |
{ | |
var $angle=0; | |
function Header() | |
{ | |
//Put the watermark | |
$this->SetFont('','B',40); | |
$this->SetTextColor( 165, 203, 73 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chown -R $USER /var/www; ln -s /var/www /home/username/htdocs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') OR exit('No direct script access allowed'); | |
class XML extends CI_Controller { | |
protected $xml; | |
public function __construct() { | |
parent::__construct(); | |
$this->xml = new DOMDocument('1.0', 'utf8'); | |
$this->xml->formatOutput = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors', 'on'); | |
$xml = new DOMDocument('1.0', 'utf8'); | |
$xml->formatOutput = true; | |
$xml->preserveWhiteSpace = false; | |
$startTag1 = $xml->createElement('startTag1'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('BASEPATH') or exit('No direct script access allowed'); | |
class Dump extends CI_Controller | |
{ | |
public function index() | |
{ | |
$this->load->dbutil(); | |
$tableList=$this->db->query("SELECT t.TABLE_NAME AS tablename FROM INFORMATION_SCHEMA.TABLES AS t WHERE t.TABLE_SCHEMA = 'database_name'")->result_array(); | |
if ($this->dbutil->database_exists('database_name')) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function callexistclass(){ | |
$CI = & get_instance(); | |
$file_name = 'Test'; | |
$file_path = APPPATH.'controllers/' . $file_name . '.php'; | |
$object_name = $file_name; | |
if (file_exists($file_path)) { | |
require $file_path; | |
$CI->$object_name = new $object_name(); | |
var_dump($CI->$object_name); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `country` (`id`,`country_name`,`code`,`currency_name`, `currency_symbol`, `currency_code`) VALUES | |
(1, 'Afghanistan', 'AF', '+93', 'Afghan afghani', 'Af', 'AFN'), | |
(2, 'ÅLAND ISLANDS', 'AX', '+358', 'Euro', '€', 'EUR'), | |
(3, 'Albania', 'AL', '+355', 'Albanian lek', 'Lek', 'ALL'), | |
(4, 'Algeria', 'DZ', '+213', 'Algerian dinar', 'دج', 'DZD'), | |
(5, 'American Samoa', 'AS', '+1684', 'US Dollar', '$', 'USD'), | |
(6, 'Andorra', 'AD', '+376', 'Euro', '€', 'EUR'), | |
(7, 'Angola', 'AO', '+244', 'Angolan kwanza', 'Kz', 'AOA'), | |
(8, 'Anguilla', 'AI', '+1264', 'East Caribbean dolla', '$', 'XCD'), | |
(9, 'Antarctica', 'AQ', '+672', 'No universal currency', '', ''), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<link src="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"> | |
<!-- Latest compiled and minified JavaScript --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> | |
<table id="example-datatables"> | |
<thead> | |
<tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For Ubuntu 18.04 and mysql version 14.14 Distrib 5.7.22 follow the below step to reset the mysql password. | |
Step 1 | |
sudo systemctl stop mysql | |
Step 2 | |
sudo systemctl edit mysql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE table_name SET column_name = concat('', substring(column_name, 7)) WHERE `column_name` like '%string/%' |