This file contains 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 | |
function exportCSV($id, $data) { | |
header("Content-Type: application/vnd.ms-excel; charset=utf-8"); | |
header("Content-Disposition: attachment; filename=report_$id.csv"); | |
if ($data && count($data[0]) > 0) { | |
$rc = 0; | |
foreach ($data[0] as $key => $value) { | |
if ($rc > 0) { | |
echo ','; | |
} $rc++; |
This file contains 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 Captcha extends CI_Controller { | |
public function __construct() { | |
parent::__construct(); | |
} | |
//Settings: You can customize the captcha here | |
public function index($rand = 100) { |
This file contains 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
diff --git a/system/libraries/Email.php b/system/libraries/Email.php | |
index c70144f..8968a84 100644 | |
--- a/system/libraries/Email.php | |
+++ b/system/libraries/Email.php | |
@@ -704,11 +704,37 @@ class CI_Email { | |
* Email Validation | |
* | |
* @param string | |
+ * @param mixed types of records to check | |
* @return bool |
This file contains 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_once './API.class.php'; | |
class MyAPI extends API | |
{ | |
protected $User; | |
public function __construct($request, $origin) { | |
parent::__construct($request); | |
// Abstracted out for example |
This file contains 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 | |
// header('Content-Type: application/xml; charset=utf-8'); | |
// header('Content-Type: application/json'); | |
// Page Name : index.php | |
$params = array( | |
"apiKey" => "30aNowar50Hossain42", | |
"User" => "anowar", | |
"token" => "1001", | |
"student" => "anowar", | |
"roll" => "305042", |
This file contains 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 exportReport($report_id,$type){ | |
$reportData = $this->getReportById($report_id); | |
$filename=preg_replace("/[^a-zA-Z]+/", "", $reportData['REPORT_TITLE']); | |
include_once "report_helper.php"; | |
if($type =='word'){ | |
header('Content-Type: application/msword'); | |
header("Content-Disposition: attachment; filename=$filename.doc"); | |
}else{ | |
header("Content-Type: application/vnd.ms-excel; charset=utf-8"); | |
header("Content-Disposition: attachment; filename=$filename.xls"); |
This file contains 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 | |
class Db { | |
public $url = 'http://localhost/DashboardObject/'; | |
protected $host = '192.--.--.54'; | |
protected $SID = 'qpro'; | |
protected $userName = 'brac_central_db'; | |
protected $password = '123456'; | |
protected $port = '1521'; | |
protected $db; | |
public function __construct(){ |
This file contains 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 | |
class Encryption{ | |
var $defskey = "NibidAlo"; // Encryption Key | |
public function safe_b64encode($string) { | |
$data = base64_encode($string); | |
$data = str_replace(array('+','/','='),array('-','_',''),$data); | |
return urlencode($data); | |
} |
This file contains 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
// Magic square Algorithm | |
/* | |
* Logic: | |
1. set 1 in first row centre | |
2. then upper->left = key [key=2,3,4....] | |
3. if not empty (upper->left) then find the buttom of last node = key | |
*/ | |
#include <iostream> | |
#include <string> | |
using namespace std; |
This file contains 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 | |
function ConvertSqlPara($sql, $data) { | |
$start = strpos($sql, '{$'); | |
$i=0; | |
while ($start>-1) { | |
$end = strpos($sql, '}', $start); | |
if($i++>20) {return $sql ;} | |
if ($end > $start) { | |
$filed = substr($sql, $start + 2, $end - $start - 2); | |
$var=array('',''); |
NewerOlder