78 lines
1.7 KiB
PHP
78 lines
1.7 KiB
PHP
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
|
|
/**
|
|
* This function is used to print the content of any data
|
|
*/
|
|
function pre($data)
|
|
{
|
|
echo "<pre>";
|
|
print_r($data);
|
|
echo "</pre>";
|
|
}
|
|
|
|
/**
|
|
* This function used to get the CI instance
|
|
*/
|
|
if(!function_exists('get_instance'))
|
|
{
|
|
function get_instance()
|
|
{
|
|
$CI = &get_instance();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This function used to generate the hashed password
|
|
* @param {string} $plainPassword : This is plain text password
|
|
*/
|
|
if(!function_exists('getHashedPassword'))
|
|
{
|
|
function getHashedPassword($plainPassword)
|
|
{
|
|
return password_hash($plainPassword, PASSWORD_DEFAULT);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This function used to generate the hashed password
|
|
* @param {string} $plainPassword : This is plain text password
|
|
* @param {string} $hashedPassword : This is hashed password
|
|
*/
|
|
if(!function_exists('verifyHashedPassword'))
|
|
{
|
|
function verifyHashedPassword($plainPassword, $hashedPassword)
|
|
{
|
|
return password_verify($plainPassword, $hashedPassword) ? true : false;
|
|
}
|
|
}
|
|
|
|
|
|
function get_fav($user)
|
|
{
|
|
$CI = &get_instance();
|
|
$CI->load->database();
|
|
$user = (int)$user;
|
|
$CI->db->reconnect();
|
|
$CI->db->where('Created_BY',$user);
|
|
$CI->db->where('Status',1);
|
|
return $CI->db->get('t_fav_add')->result();
|
|
|
|
}
|
|
|
|
function reOrderListing()
|
|
{
|
|
$CI = &get_instance();
|
|
$CI->load->database();
|
|
|
|
$CI->db->reconnect();
|
|
$subQuery='SELECT * from t_materialmaster where Current_stock < reorder?';
|
|
|
|
$query=$CI->db->query($subQuery,array());
|
|
//print_r($this->db->last_query());
|
|
|
|
return $query->result();
|
|
}
|
|
|
|
|
|
?>
|