Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Exceptions has a deprecated constructor in /var/www/html/ipps/system/libraries/Exceptions.php on line 27
Notice: Only variables should be passed by reference in /var/www/html/ipps/system/codeigniter/Common.php on line 148
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Hooks has a deprecated constructor
Filename: libraries/Hooks.php
Line Number: 30
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Config has a deprecated constructor
Filename: libraries/Config.php
Line Number: 29
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_URI has a deprecated constructor
Filename: libraries/URI.php
Line Number: 29
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Router has a deprecated constructor
Filename: libraries/Router.php
Line Number: 29
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Output has a deprecated constructor
Filename: libraries/Output.php
Line Number: 29
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Input has a deprecated constructor
Filename: libraries/Input.php
Line Number: 29
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Language has a deprecated constructor
Filename: libraries/Language.php
Line Number: 27
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Base has a deprecated constructor
Filename: codeigniter/Base5.php
Line Number: 33
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; Controller has a deprecated constructor
Filename: libraries/Controller.php
Line Number: 30
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; Access has a deprecated constructor
Filename: controllers/access.php
Line Number: 7
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; Supercontroller has a deprecated constructor
Filename: controllers/supercontroller.php
Line Number: 4
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Loader has a deprecated constructor
Filename: libraries/Loader.php
Line Number: 29
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: codeigniter/Common.php
Line Number: 148
function is_date($value, $format = 'dd/mm/yyyy'){
if(strlen($value) == 10 && strlen($format) == 10){
// find separator. Remove all other characters from $format
$separator_only = str_replace(array('m','d','y'),'', $format);
$separator = $separator_only[0]; // separator is first character
if($separator && strlen($separator_only) == 2){
// make regex
$regexp = str_replace('mm', '[0-1][0-9]', $value);
$regexp = str_replace('dd', '[0-3][0-9]', $value);
$regexp = str_replace('yyyy', '[0-9]{4}', $value);
$regexp = str_replace($separator, "\\" . $separator, $value);
if($regexp != $value && preg_match('/'.$regexp.'/', $value)){
// check date
$day = substr($value,strpos($format, 'd'),2);
$month = substr($value,strpos($format, 'm'),2);
$year = substr($value,strpos($format, 'y'),4);
if(@checkdate($month, $day, $year))
return true;
}
}
}
return false;
}
function calculateAge($birthday,$division_cal_date){
list($day,$month,$year) = explode("/",$birthday);
$year_diff = date("Y") - $year;
$month_diff = date("m") - $month;
$day_diff = date("d") - $day;
if ($day_diff < 0 || $month_diff < 0)
$year_diff--;
$age = $year_diff+1;
$birthday = $year.'-'.$month.'-'.$day;
if($division_cal_date != '')
{
$date = date( "Y-m-d", strtotime( $birthday."+".$age." years" ) );
if($date > $division_cal_date)
$age = $age - 1;
}
return $age;
}
function explode_string($str) {
$str = nl2br($str);
$str = str_replace("\n",'',$str);
$str = str_replace('\r','',$str);
$str = str_replace("\r\n",'',$str);
$str = explode('
',$str);
return $str;
}
function unzip($zipfile,$dest_folder)
{
include_once('pclzip.lib.php');
$archive = new PclZip($zipfile);
if ($archive->extract(PCLZIP_OPT_PATH, $dest_folder) == 0) {
die("Error : ".$archive->errorInfo(true));
}
}
function check_index_in_zip($zipfile) {
include_once('pclzip.lib.php');
$archive = new PclZip($zipfile);
$list = $archive->listContent();
foreach($list as $l) {
if($l['stored_filename'] == 'template/index.html')
{
return 1;
}
}
}
function genRanString($length=15)
{
# first character is capitalize
$pass = chr(mt_rand(65,90)); // A-Z
# rest are either 0-9 or a-z
for($k=0; $k < $length - 1; $k++)
{
$probab = mt_rand(1,10);
if($probab <= 8) // a-z probability is 80%
$pass .= chr(mt_rand(97,122));
else // 0-9 probability is 20%
$pass .= chr(mt_rand(48, 57));
}
return $pass;
}
function send_email($email_to,$from,$from_name,$reply_to,$return_path,$subject,$html,$text)
{
include_once('Mail.php');
include_once('Mail/mime.php');
$crlf = "\n";
$hdrs = array(
'From' => $from_name.'<'.$from.'>',
'Reply-To' => $from_name.'<'.$reply_to.'>',
'Return-Path' => $return_path,
'Subject' => $subject,
'To' => $email_to
);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$params['sendmail_path'] = '/usr/lib/sendmail';
$mail =& Mail::factory('sendmail',$params);
$result = $mail->send($email_to, $hdrs, $body);
return $result;
}
function export($headers,$list,$exclude_field=array(),$teams,$members,$without_team = 1,$mandatory_field=array())
{
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$format_bold =& $workbook->addFormat();
$format_bold->setBold();
$format_bold->setAlign('left');
$format_red =& $workbook->addFormat();
$format_red->setBold();
$format_red->setColor('red');
$format_red->setBold();
$format_bold->setAlign('left');
$worksheet =& $workbook->addWorksheet('');
$format_notmaltext =& $workbook->addFormat();
$workbook->setVersion(8);
$worksheet->setInputEncoding('UTF-8');
$format_notmaltext->setAlign('left');
$radius = 17;
$col_size = 20;
$worksheet->setColumn(0,$radius,$col_size);
$radius = 30;
$col_size = 50;
$worksheet->setColumn(18,$radius*2,$col_size);
$row = 0;
$col = 0;
foreach($headers as $key=>$value)
{
if(!in_array($value,$exclude_field))
{
if(!in_array($value,$mandatory_field))
{
$worksheet->write($row, $col, $value, $format_bold);
} else {
$worksheet->write($row, $col, $value, $format_red);
}
$col++;
}
}
$row = 1;
$col = 0;
if(!empty($list))
{
foreach($list as $l)
{
foreach($l as $key=>$value)
{
if($key == 'profile10')
{
$field_array = array('1-3 times a week','1-3 times a month','1-3 times a year');
$value = $field_array[$value-1];
}
if(!in_array($key,$exclude_field))
{
if($value != "")
{
$worksheet->write($row, $col, stripslashes(html_entity_decode($value)),$format_notmaltext);
}
else
{
$worksheet->write($row, $col, "-",$format_notmaltext);
}
$col++;
}
unset($value);
}
$row++;
$col = 0;
}
}
if($without_team == 1)
{
$worksheet_2 =& $workbook->addWorksheet('Teams Entry');
$radius = 17;
$col_size = 20;
$worksheet_2->setColumn(0,$radius,$col_size);
$radius = 30;
$col_size = 50;
$worksheet_2->setColumn(18,$radius*2,$col_size);
$row = 0;
if(!empty($teams))
{
foreach($teams as $t)
{
$col = 0;
$worksheet_2->write($row, $col, 'Team Name', $format_bold);
$col ++;
$worksheet_2->write($row, $col, $t['team_name'],$format_bold);
$row++;
$col = 0;
$worksheet_2->write($row, $col, 'Category Name', $format_bold);
$col ++;
$worksheet_2->write($row, $col, $t['category_name'],$format_bold);
$row++;
$col = 0;
foreach($headers as $key=>$value)
{
if(!in_array($key,$exclude_field))
{
$worksheet_2->write($row, $col, $value, $format_bold);
$col++;
}
}
$row++;
if(!empty($members[$t['team_id']]))
{
foreach($members[$t['team_id']] as $l)
{
$col = 0;
foreach($l as $key=>$value)
{
if($key == 'profile10')
{
$field_array = array('1-3 times a week','1-3 times a month','1-3 times a year');
$value = $field_array[$value-1];
}
if(!in_array($key,$exclude_field))
{
if($value != "")
{
$worksheet_2->write($row, $col, stripslashes(html_entity_decode($value)),$format_notmaltext);
}
else
{
$worksheet_2->write($row, $col, "-",$format_notmaltext);
}
$col++;
}
unset($value);
}
$row++;
$col = 0;
}
}
$row++;
$row++;
}
$row++;
$row++;
}
else
{
$col = 0;
$worksheet_2->write($row, $col, "No teams has available.",$format_notmaltext);
}
}
$workbook->send('export.xls');
$workbook->close();
}
function export_uploading($headers,$list,$exclude_field=array(),$teams,$members,$without_team = 1,$mandatory_field=array(),$categories=array())
{
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$format_bold =& $workbook->addFormat();
$format_bold->setBold();
$format_bold->setAlign('left');
$format_red =& $workbook->addFormat();
$format_red->setBold();
$format_red->setColor('red');
$format_red->setBold();
$format_bold->setAlign('left');
$worksheet =& $workbook->addWorksheet('');
$format_notmaltext =& $workbook->addFormat();
$workbook->setVersion(8);
$worksheet->setInputEncoding('UTF-8');
$format_notmaltext->setAlign('left');
$radius = 17;
$col_size = 20;
$worksheet->setColumn(0,$radius,$col_size);
$radius = 30;
$col_size = 50;
$worksheet->setColumn(18,$radius*2,$col_size);
$row = 0;
$col = 0;
foreach($headers as $key=>$value)
{
if(!in_array($value,$exclude_field))
{
if(!in_array($value,$mandatory_field))
{
$worksheet->write($row, $col, $value, $format_bold);
} else {
$worksheet->write($row, $col, $value, $format_red);
}
$col++;
}
}
$row = 1;
$col = 0;
if(!empty($list))
{
foreach($list as $l)
{
foreach($l as $key=>$value)
{
if($key == 'profile10')
{
$field_array = array('1-3 times a week','1-3 times a month','1-3 times a year');
$value = $field_array[$value-1];
}
if(!in_array($key,$exclude_field))
{
if($value != "")
{
$worksheet->write($row, $col, stripslashes(html_entity_decode($value)),$format_notmaltext);
}
else
{
$worksheet->write($row, $col, "-",$format_notmaltext);
}
$col++;
}
unset($value);
}
$row++;
$col = 0;
}
}
$worksheet_2 =& $workbook->addWorksheet('Legend');
$radius = 17;
$col_size = 20;
$worksheet_2->setColumn(0,$radius,$col_size);
$radius = 30;
$col_size = 50;
$worksheet_2->setColumn(18,$radius*2,$col_size);
$row = 0;
$col = 0;
$worksheet_2->write($row, $col, 'Group Name', $format_bold);
$col++;
$worksheet_2->write($row, $col, 'Category Name', $format_bold);
foreach ($categories as $group_name=>$c) {
foreach($c as $ca) {
$row ++;
$col = 0;
$worksheet_2->write($row, $col, $group_name);
$col++;
$worksheet_2->write($row, $col, $ca['category_name']);
}
}
$workbook->send('bulk_upload_entries.xls');
$workbook->close();
}
function isValidEmail($email){
return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);
}
function send_email_server($email_to,$from,$from_name,$reply_to,$return_path,$subject,$html,$text){
send_email($email_to,$from,$from_name,$reply_to,$return_path,$subject,$html,$text);
}
function send_email_2($email_to,$from,$from_name,$reply_to,$return_path,$subject,$html,$text)
{
include_once('Mail.php');
include_once('Mail/mime.php');
$crlf = "\n";
$hdrs = array(
'From' => $from_name.'<'.$from.'>',
'Reply-To' => '<'.$reply_to.'>',
'Return-Path' => $return_path,
'Subject' => $subject
);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$result = $mail->send($email_to, $hdrs, $body);
return $result;
}
?>
A PHP Error was encountered
Severity: 8192
Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_DB_driver has a deprecated constructor
Filename: database/DB_driver.php
Line Number: 31
A PHP Error was encountered
Severity: Notice
Message: Only variables should be passed by reference
Filename: database/DB.php
Line Number: 133
Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in /var/www/html/ipps/system/database/drivers/mysql/mysql_driver.php:88
Stack trace:
#0 /var/www/html/ipps/system/database/DB_driver.php(115): CI_DB_mysql_driver->db_pconnect()
#1 /var/www/html/ipps/system/database/DB.php(137): CI_DB_driver->initialize()
#2 /var/www/html/ipps/system/libraries/Loader.php(224): DB(Array, false)
#3 /var/www/html/ipps/system/libraries/Loader.php(985): CI_Loader->database()
#4 /var/www/html/ipps/system/libraries/Controller.php(83): CI_Loader->_ci_autoloader()
#5 /var/www/html/ipps/system/libraries/Controller.php(43): Controller->_ci_initialize()
#6 /var/www/html/ipps/system/application/controllers/supercontroller.php(8): Controller->Controller()
#7 /var/www/html/ipps/system/application/controllers/access.php(13): Supercontroller->Supercontroller()
#8 /var/www/html/ipps/system/codeigniter/CodeIgniter.php(201): Access->Access()
#9 /var/www/html/ipps/index.php(120): require_once('/var/www/html/i...')
#10 {main}
thrown in /var/www/html/ipps/system/database/drivers/mysql/mysql_driver.php on line 88