PHP Version Upgrade: 5.6 to 8.5
Code and configuration changes required to run cloud8.clouderp.com.bd on PHP 8.5.
Overview#
Code and configuration changes required to run cloud8.clouderp.com.bd on PHP 8.5.
| Part A | Terminal: bulk replacements run once from the server shell (Sections 1–6) |
| Part B | File Changes: edits to shared engine files (Sections 7–15) |
| Part C | Troubleshooting: common errors, page-level fixes by module, and open issues (Sections 16–38) |
| Application root | /home/clouderp/public_html/cloud8.clouderp.com.bd |
| Controller root | /home/clouderp/controller/clouderp8 |
| Page paths | Relative to https://cloud8.clouderp.com.bd |
Part A: Terminal#
Sections 1–6. Run each command once, in order, from the server shell.
sed -i edits files in place and cannot be undone. Take the backup first.
1 Convert 'mysql_' to 'mysqli_'#
find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/mysql_/mysqli_/g' {} \;
find /home/clouderp/controller/clouderp8 -type f -exec sed -i 's/mysql_/mysqli_/g' {} \;2 Route Queries Through db_query()#
find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/mysqli_query(/db_query(/g' {} \;
find /home/clouderp/controller/clouderp8 -type f -exec sed -i 's/mysqli_query(/db_query(/g' {} \;3 Route Insert IDs Through db_insert_id()#
find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/mysqli_insert_id()/db_insert_id()/g' {} \;
find /home/clouderp/controller/clouderp8 -type f -exec sed -i 's/mysqli_insert_id()/db_insert_id()/g' {} \;4 Replace Removed each() Loops With foreach#
find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/while (list($key, $value)=each($data))/foreach ($data as $key => $value)/g' {} \;5 Remove php From Commented PHP Tags#
find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/<?php \/\*?>/<? \/\*?>/g' {} \;find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/<?php\/\*?>/<?\/\*?>/g' {} \;6 Quote $_POST Date Keys#
find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/<?=$_POST\[fdate\]?>/<?=$_POST['\''fdate'\'']?>/g' {} \;find /home/clouderp/public_html/cloud8.clouderp.com.bd -type f -exec sed -i 's/<?=$_POST\[tdate\]?>/<?=$_POST['\''tdate'\'']?>/g' {} \;Part B: File Changes#
Sections 7–15. Edits to shared engine files. Apply once, after Part A.
7 Database Helper Functions#
File: inc.database.php
7.1 db_query() and db_insert_id()#
Add the following functions, replacing any existing versions:
function db_query($sql) {
global $link;
if (empty(trim($sql))) {
return mysqli_query($link, "SELECT NULL WHERE FALSE");
}
try {
$result = mysqli_query($link, $sql);
if (!$result) {
error_log("MySQL Error: " . mysqli_error($link) . " | Query: " . $sql);
// Return a harmless real mysqli_result by running a fake empty query
return mysqli_query($link, "SELECT NULL WHERE FALSE");
}
return $result;
} catch (mysqli_sql_exception $e) {
error_log("MySQL Error: " . $e->getMessage() . " | Query: " . $sql);
//echo "dddddddddddddddddddddddd";
return mysqli_query($link, "SELECT NULL WHERE FALSE");
}
}
function db_insert_id() {
global $link;
return mysqli_insert_id($link);
}7.2 find_a_field()#
Replace the existing function with:
function find_a_field($table, $field, $condition, $echo_sql = 0)
{
global $con; // Assuming $con is your database connection variable
try {
$sql = "SELECT $field FROM $table WHERE $condition LIMIT 1";
if ($echo_sql == 1) {
echo $sql; // echo $sql;
}
$res = db_query($sql); // Assuming db_query is your custom database query function
if (!$res) {
throw new Exception("SQL Error: Query execution failed");
}
$count = mysqli_num_rows($res);
if ($count > 0) {
$data = mysqli_fetch_row($res);
return $data[0];
} else {
return null;
}
} catch (Exception $e) {
// Handle the exception (log it, display an error message, etc.)
echo "Error: " . $e->getMessage();
return null;
}
}7.3 foreign_relation() : make the 4th parameter optional#
PHP 8 requires required parameters to come before optional ones.
function foreign_relation($table,$id,$show,$value,$condition='',$echo_sql=0)function foreign_relation($table,$id,$show,$value='',$condition='',$echo_sql=0)7.4 Replace mysql_field_name()#
Apply wherever the old call appears (also report.class.php , line 148).
$name = $coloum[$i] = mysql_field_name($res,$i);$fieldinfo = mysqli_fetch_field_direct($res,$i);
$name = $coloum[$i] =$fieldinfo -> name;8 Database Connection Files#
Replace the full contents of each file with the code below.
8.1 db_connect.php#
Location: controller/configure/db_connect.php (under the controller root). Connects to the tenant database using the credentials stored in the session at login.
<?php
session_start();
date_default_timezone_set('Asia/Dhaka');
global $link;
$host = 'localhost';
$user = $_SESSION['db_user'] ?? '';
$pass = $_SESSION['db_pass'] ?? '';
$db = $_SESSION['db_name'] ?? '';
$link = @mysqli_connect($host, $user, $pass, $db);
if (!$link) {
die('Could not connect to database.');
}
mysqli_set_charset($link, 'utf8');
?>8.2 db_connect_acc_main.php#
Location: controller/configure/db_connect_acc_main.php . Connects to the central accounts database, with a fallback to localhost.
The database password is replaced with <DB_PASSWORD> . Use the value from the live file; do not circulate it in documents.
<?php
mysqli_report(MYSQLI_REPORT_OFF);
$con = @mysqli_connect(
'203.26.151.218',
'erpengine_clouderpuser',
'<DB_PASSWORD>',
'erpengine_clouderpdb'
);
if (!$con) {
$con = @mysqli_connect(
'localhost',
'erpengine_clouderpuser',
'<DB_PASSWORD>',
'erpengine_clouderpdb'
);
if (!$con) {
die('Could not connect to either Central or Local Database.');
}
}
?>8.3 check_login.php#
Validates the company and user, then stores the tenant database credentials in the session and loads db_conn ect.php .
<?
function check_for_login($cid,$uid,$passward,$type){
require_once(SERVER_ENGINE.'configure/db_connect_acc_main.php');
require_once(SERVER_ENGINE.'tools/inc.log.php');
require_once(SERVER_ENGINE.'tools/inc.database.php');
$l_cid = strlen($cid);
$l_uid = strlen($uid);
$l_passward = strlen($passward);
if($l_cid<15&&$l_uid<15&&$l_passward<15)
$sql="SELECT b.db_user,b.db_pass,b.db_name,a.cid,a.id,a.company_name,a.address FROM
company_info a,database_info b WHERE a.cid='$cid' and a.id=b.company_id and a.status='ON' and register_date>'".date('Y-m-d')."' limit 1";
else
return false;
$sql=mysqli_query($con,$sql);
if($proj=mysqli_fetch_object($sql))
{
$_SESSION['proj_id'] = $proj->cid;
$_SESSION['db_name'] = $proj->db_name;
$_SESSION['db_user'] = $proj->db_user;
$_SESSION['db_pass'] = $proj->db_pass;
require_once(SERVER_ENGINE.'configure/db_connect.php');
$today = date('Y-m-d');
$user_sql="select * from user_activity_management where username='".$uid."' and expire_date>='".$today."'";
$info = find_all_field_sql($user_sql);
if($info->password==$passward)
{
$_SESSION['user']['level'] = $info->level;
$_SESSION['user']['id'] = $info->user_id;
$_SESSION['user']['fname'] = $info->fname;
$_SESSION['user']['designation']= $info->designation;
$_SESSION['user']['depot'] = $info->warehouse_id;
$_SESSION['user']['group'] = $info->group_for;
$_SESSION['user']['username'] = $uid;
$_SESSION['mhafuz'] ='Active';
// $_SESSION['mhafuz'] ='Inactive';
// $_SESSION['authorize'] ='No';$_SESSION['company_name']=$_SESSION['proj_name']=find_a_field('user_group','group_name','id='.$info->group_for);
$_SESSION['company_address']=$proj->address;
// ['user']['access_id'] =activity_log($module_id,$page_id,$page_name,$tr_from,$tr_no,$tr_id,$tr_type,$execution_time);
return true;
}
}else return false;
}
?>9 crud.php : Replace __construct()#
Line 19
function __construct($table_name)
{
$this->table_name = $table_name;
$sql = "SHOW COLUMNS FROM " . $this->table_name;
$query = db_query($sql);
if($query){
while ($res = @mysqli_fetch_row($query)) {
$name = $res[0];
$type = $res[1];
$this->fields_empty = array_merge($this->fields_empty, array($name => ''));
$this->fields = array_merge($this->fields, array($name));
$this->fields_type = array_merge($this->fields_type, array($name => $type));
}
}
}10 gl_config.php : crud __construct#
Line 97
while (list($key, $value)=each($data))foreach ($data as $key => $value)11 report.class.php#
File: /home/clouderp/controller/clouderp8/controller/tools/report.class.php
11.1 Replace link_report_add_del_auto()#
function link_report_add_del_auto($sql,$link='',$sum_of1='',$sum_of2='',$sl=''){
if($sql==NULL) return NULL;
$str.='
<table class="table table-striped table-bordered table-sm">';
$str .='<tr>';
$res=db_query($sql);
$cols = mysqli_num_fields($res);
$str .='<th>S/L</th>';
for($i=1;$i<$cols;$i++)
{
// $name = mysql_field_name($res,$i);
$fieldinfo = mysqli_fetch_field_direct($res,$i);
$name = $coloum[$i] =$fieldinfo -> name;
$str .='<th>'.ucwords(str_replace('_', ' ',$name)).'</th>';
}
$str .='</tr>';
$c=0;
while($row=mysqli_fetch_array($res))
{
$total_qty=$total_qty+$row[$sum_of1-1];
$total=$total+$row[$sum_of2-1];
if($link!='') $link= ' onclick="custom('.$row[0].');"';
$c++;
$str .='<tr'.$class.$link.'>';
$str .='<td>'.$c.'</td>';
for($i=1;$i<($cols-1);$i++) {$str .='<td> '.$row[$i]."</td>"; }
$str .='<td><a href="?del='.$row[0].'"><i class="fa fa-trash" style="color:red"></i></a></td>';
$str .='</tr>';
}
$str .='<tfoot><tr'.$class.$link.'>';
if($sum_of1>0)
$str .="<td colspan='".($sum_of1-1)."'><span style='text-align:right;'> Total: </span></td>";
if($sum_of2>0)
{
$str .="<td colspan='".($sum_of2-$sum_of1)."'>".number_format($total_qty,2)."</td>";
$str .="<td colspan='".($cols-$sum_of1)."'>".number_format($total,2)."</td>";
}
else
//$str .="<td colspan='".(($cols-$sum_of1)+1)."'>".number_format($total_qty,2)."</td>";
if (isset($sum_of1) && isset($total_qty)) {
$str .= "<td colspan='" . (($cols - $sum_of1) + 1) . "'>" . number_format($total_qty, 2) . "</td>";
} else {
// Handle the case when either or both variables are not defined
$str .= "<td colspan='1'>N/A</td>"; // You can customize this part as needed
}
$str .='</tr></tfoot>';
$str .='</table>';
return $str;
}11.2 Line 355: replace the header loop#
for ($i = 1; $i < $cols; $i++) {
$field = mysqli_fetch_field_direct($res, $i);
$name = $field->name;
$str .= '<th>' . ucwords(str_replace('_', ' ', $name)) . '</th>';
}11.3 Line 602: replace the two total lines in link_report_add_del_auto()#
if ($row[$sum_of1-1] !== null && is_numeric($row[$sum_of1-1])) {
$total_qty = $total_qty + intval($row[$sum_of1-1]);
}
if ($row[$sum_of2-1] !== null && is_numeric($row[$sum_of2-1])) {
$total = $total + intval($row[$sum_of2-1]);
}12 mod.php#
12.1 Lines 2752 and 2790: replace return false; with break;
return false;break;12.1 auto_complete_from_db() : wrap the function body#
if($led){
}13 assets/template/inc.main_layout.php#
Line 11
Add double quotes around .PROJECT :
<?= ".PROJECT" ?>14 Template Update#
Set the module in the session only when a module ID is passed:
if ($_GET['mod_id'] > 0) {
$_SESSION['mod'] = $_GET['mod_id'];
}15 assets/support/temp_function.php#
| LINE | ACTION |
|---|---|
| 249–269 | Wrap in if($res){ … } |
| 252 | Comment out $name = mysqli_field_name($res,$i) and add the replacement below |
$fieldinfo = mysqli_fetch_field_direct($res,$i);
$name = $coloum[$i] =$fieldinfo -> name;Part C: Troubleshooting#
Sections 16–38. Use when a page fails during testing. Find the error, then the page.
16 Common Errors#
| ERROR | FIX |
|---|---|
mysqli_fetch_object(false) , mysqli_fetch_row(false) | The query failed. Wrap the fetch block in if($query){ … } so false is never passed to mysqli_fetch_*() . |
crud->__construct(NULL) | No table name was set. Create the object only when $table is set (Sections 9 and 20). |
each() undefined | Replace while (list($key, $value)=each($data)) with foreach ($data as $key => $value) (Section 4). |
mysql_field_name() / mysqli_field_name() undefined | Use mysqli_fetch_field_direct() (Section 7.4). |
| Optional parameter declared before required parameter | Give the parameter a default value (Section 7.3). |
DivisionByZeroError | Check the divisor before dividing (Section 33). |
Access denied for user ''@'localhost'(using password: NO) | db_connect.php was loaded with empty session credentials. Check the login flow in check_login.php (Sections 8.1 and 8.3). |
Undefined constant in $_POST[fdate] | Quote the key: $_POST['fdate'] (Section 6). |
17 Accounts: Vouchers#
17.1 Payment Voucher: debitenote.php#
| LINE | ACTION |
|---|---|
| 62 | Comment out $cash_and_bank_balance |
| 827 | Comment out foreign_relation |
| 886 | Comment out v_type |
17.2 Payment Voucher: creditnote.php#
| LINE | ACTION |
|---|---|
| 69 | Comment out $cash_and_bank_balance |
| 695 | Remove foreign_relation |
| 762 | Comment out v_type |
17.3 Journal Voucher: journal_note_new.php#
| LINE | ACTION |
|---|---|
| 62 | Comment out $cash_and_bank_balance ( find_a_field ) |
| 723 | Comment out v_type |
| 911 | Comment out find_a_field |
| 962 to end | Remove the <?php/*> … <*/?> block |
17.4 Contra Voucher: countra_note_new.php#
| LINE | ACTION |
|---|---|
| 62 | Comment out $cash_and_bank_balance ( find_a_field ) |
| 817 | Comment out v_type |
| 911 | Comment out find_a_field |
| 1000 | Comment out find_a_field |
| 1039 to end | Remove the <?php/*> … <*/?> block |
17.5 Voucher Recheck: unchecked_voucher_list.php#
| LINE | ACTION |
|---|---|
| 353 to end | Remove the <?php/*> … <*/?> block |
18 Accounts: Other Pages#
| PAGE | ACTION |
|---|---|
| General ledger configuration → Chart of account details | Comment out auto_complete . Still open: see Section 38. |
| Finance Report → Budget comparison report | Comment out auto_complete |
19 Sales#
19.1 Sales Chalan Verification: chalan_verify/ch_recived_amt.php#
| LINE | ACTION |
|---|---|
| 158 | Comment out foreign_relation |
19.2 Sales Return Verification: sales_return_verify/sr_recived_amt.php#
| LINE | ACTION |
|---|---|
| 158 | Comment out foreign_relation |
19.3 Sale Return Verify, line 111: replace the branch select loop#
<select name="region_id[]" id="region_id[]" class="form-control">if (in_array("Irix", $os))
<? //foreign_relation('branch','BRANCH_ID','BRANCH_NAME',$_POST['region_id'],' 1 order by BRANCH_NAME');
$sql = 'select BRANCH_ID,BRANCH_NAME from branch where 1 order by BRANCH_NAME';
$query = mysql_query($sql);
while($info = mysql_fetch_object($query)){
?>
<option></option>
<option value="<?=$info->BRANCH_ID?>" <?=(@in_array($info->BRANCH_ID, $_POST['region_id']))?'Selected':'';?>><?=$info->BRANCH_NAME?></option>
<?
}
?>
</select><select name="region_id[]" id="region_id[]" class="form-control">
<?php
if (isset($_POST['region_id']) && is_array($_POST['region_id'])) {
$sql = 'select BRANCH_ID, BRANCH_NAME from branch where 1 order by BRANCH_NAME';
$query = db_query($sql);
while ($info = mysqli_fetch_object($query)) {
?>
<option value="<?= $info->BRANCH_ID ?>" <?= (in_array($info->BRANCH_ID, $_POST['region_id'])) ? 'selected' : ''; ?>><?= $info->BRANCH_NAME ?></option>
<?php
}
}
?>
</select>19.4 Invoice Wise Sales Return → Sale Return Status#
Close the if(isset[$_POST['submitit']]) bracket where the while($querry) loop ends.
19.5 Bulk Sales Return → Sale Return Status#
Add if(isset[$_POST['desired_value']]) and close its bracket where the while($querry) loop ends.
19.6 sales_mod/pages/dealer/dealer_info.php , line 89#
Comment out find_a_field('accounts_ledger', 'ledger_id', 'ledger_name=…') .
20 MIS#
20.1 mis_mod/pages/user_management/roll_manage_create.php#
Line 252 of the temp-function page: apply Section 15.
20.2 mis_mod/pages/item/old_2_new_item.php , line 23#
Error: crud->__construct(NULL) .
$crud =new crud($table);if($table){
$crud =new crud($table);
}20.3 mis_mod/pages/purchase/status_change.php , line 73#
Error: crud->__construct(NULL) . Apply the same change:
if($table){
$crud =new crud($table);
}21 Purchase#
21.1 Purchase Quotation → PQ Create#
Page: /purchase_mod/pages/quotation/mr_create.php?mhafuz=2
21.2 Purchase Quotation → Unapproved PQ, lines 24 and 42#
@session_destroy($_SESSION['quotation_no']);unset($_SESSION['quotation_no']);21.3 purchase_mod/pages/vendor/vendor_info.php , line 140#
Comment out $ledger_gl_found = find_a_field('accounts_ledger','ledger_id','ledger_name='.$_POST['le
dger_name']);22 Warehouse#
| PAGE | ACTION |
|---|---|
warehouse_mod/pages/main/home.php | Line 996 |
warehouse_mod/pages/po_receiving/po_receive.php?po_no=254 | Line 538: comment out |
warehouse_mod/pages/po_receiving/chalan_view2.php?v_no=24011100001 | Lines 55, 57, 73, 74: comment out find_a_field |
warehouse_mod/pages/pr/master_report.php | Apply Sections 7.3 and 7.4 |
warehouse_mod/pages/wo/delivery_challan.php?do_no=621 | Line 1059: comment out |
warehouse_mod/pages/production_issue/production_issue_status.php | report.class.php line 148: apply Section 7.4 |
warehouse_mod/pages/po_return/pr_status.php | Lines 118 and 127: quote the fdate key (below) |
warehouse_mod/pages/purchase_return/new_return.php | auto_complete_from_db : apply Section 12.2 |
warehouse_mod/pages/purchase_return/unapproved_pr.php | Line 35: auto_insert_sales_return_secoundary("11"); |
<input type="text" name="fdate" id="fdate" value="<?=$_POST[fdate]?>" autocomplete="off"/><input type="text" name="fdate" id="fdate" value="<?=$_POST['fdate']?>" autocomplete="off"/>Pages listed for recheck, no fix recorded:
warehouse_mod/pages/wo/delivery_challan_status.phpwarehouse_mod/pages/sales_return_invoice/sales_return_status.phpwarehouse_mod/pages/sales_return/select_unfinished_do.php
23 Production#
23.1 Daily Floor Requisition → Create New STR, line 932#
<? foreign_relation('production_requisition_master','req_no','req_no',$do_number,'status="CHECKED"');?><?php
if ($do_number){
foreign_relation('production_requisition_master','req_no','req_no',$do_number,'status="CHECKED"');
};
?>23.2 WIP Issue → WIP Entry Issue → Initiate Request Information#
Line 66: wrap in if($data1){ … } .
Error /production_mod/pages/wip/mr_create.php(639): mysqli_fetch_row(false) :
if($a1){
while($a=mysqli_fetch_row($a1)){
if($a[0]==$_SESSION['session_sub_group'])
echo "<option value=\"".$a[0]."\" selected>".$a[1]."</option>";
else
echo "<option value=\"".$a[0]."\">".$a[1]."</option>";
}$a1=db_query($a2);
if($a1){
while($a=mysqli_fetch_row($a1)){
if($a[0]==$_SESSION['session_sub_group'])
echo "<option value=\"".$a[0]."\" selected>".$a[1]."</option>";
else
echo "<option value=\"".$a[0]."\">".$a[1]."</option>";
}
}23.3 Daily Floor Requisition → Create New STR → Initiate Requisition Information#
| LINE | ACTION |
|---|---|
| 135 | Wrap the while loop in if($data1){ … } |
| 1234 | Wrap in if($a1){ … } |
23.4 FG Issue → FG Issue, lines 460 and 488#
<?
if(!$$field){
foreign_relation('warehouse','warehouse_id','warehouse_name',$$field,'1 and use_type!="PL" order by warehouse_name asc');
}?>24 Loan#
24.1 loan_mod/pages/loan/loan_status.php , line 45#
Error: crud->__construct('loan_info') .
$crud =new crud($table);if(!$table){
$crud =new crud($table);
}24.2 loan_mod/pages/loan/pending_loan_list.php , line 38#
$crud =new crud($table);if(!$table){
$crud =new crud($table);
}24.3 loan_mod/pages/loan/installment_receive.php , line 293#
Error: foreign_relation('loan_details', …, NULL, 'loan_no=') . Add the condition:
if(!$installment_no && $loan_no)25 Customer Portal#
25.1 Sales Order → Sales Order, line 919#
while (list($key, $value)=each($data))foreach ($data as $key => $value)26 Vendor Portal#
26.1 Vendor Management → Vendor Info, line 385#
<?
if(!$user_to_vendor)
{ foreign_relation('vendor','vendor_id','','vendor_id="'.$user_to_vendor.'"');
}27 Fixed Asset#
27.1 Asset Register → Department Entry, line 535#
Wrap in:
if($report) {
}28 POS#
28.1 Gift Offer → Gift Offer, line 113#
Wrap in if($query_i){ … } .
28.2 Report → Shop Report, lines 204 and 234#
Comment out the foreign_relation() calls whose surrounding HTML is already commented.
29 Export L/C#
| PAGE | ACTION |
|---|---|
export_mod/pages/wo/select_check_invoice.php | Line 126: add the value attribute below |
export_mod/pages/pi/pi_status.php | Line 126: add the value attribute below |
export_mod/pages/commercial/commercial_statement_status.php | Line 125: add the value attribute below |
value="<?=($_POST['fdate']!='')?$_POST['fdate']:date('Y-m-1')?>29.1 export_mod/pages/commercial/pending_lc_list.php , line 168#
Error: mysqli_fetch_object(false) .
while($info=mysqli_fetch_object($query)){
$revise_request[$info->do_no]=$info->revise_request;
}if($query){
while($info=mysqli_fetch_object($query)){
$revise_request[$info->do_no]=$info->revise_request;
}
}30 Task#
30.1 Setup → Product List: task_mod/pages/include/custom.php#
| LINE | ACTION |
|---|---|
| 130 | Wrap in if($WeekendRslt){ … } |
| 141 | Wrap in if($partialWeekendRslt){ … } |
30.2 Project Issue → Issue List, line 98 · Task → Task List, line 93#
if($query){
$data=mysqli_fetch_object($query);
}31 User Portal#
Error mysqli_fetch_object(false) : wrap in if($query){ … } .
| PAGE | LINE |
|---|---|
user_mod/pages/transportation/car_req_status.php | Line 173 |
user_mod/pages/transportation/transport_unchecked.php | Line 324 |
user_mod/pages/transportation/gl_unchecked.php | Line 173 |
user_mod/pages/transportation/hrm_unapproved_bhaiya.php | Line 173 |
Menu route problems are still open: see Section 38.
32 CRM#
32.1 Dashboard: crm_mod/pages/home/home.php , line 198#
if($project_id){
foreign_relation('crm_project_lead','id','contact_person_name',$project_id,'1') ;
}32.2 crm_mod/pages/include/custom.php#
| LINE | ACTION |
|---|---|
| 130 | Wrap in if($WeekendRslt){ … } |
| 142 | Wrap in if($partialWeekendRslt){ … } |
32.3 Customer → Customer Info → Edit: crm_mod/pages/org/show.php?id=129 , line 8#
Replace the each() loop with:
foreach ($data as $key => $value)33 Import L/C#
33.1 lc_mod/pages/main/home.php?mod_id=8#
if($sq){
$result1 = mysqli_fetch_object($sq);
}if($sq2){
$result2 = mysqli_fetch_object($sq2);
}$first_percentage = (100 / $total_sale) * $sum_reg_sale;
$second_percentage = (100 / $total_sale) * $sum_pos_sale;if ($total_sale != 0) {
$first_percentage = (100 / $total_sale) * $sum_reg_sale;
$second_percentage = (100 / $total_sale) * $sum_pos_sale;
} else {
// Handle the case where $total_sale is zero to avoid DivisionByZeroError
$first_percentage = 0;
$second_percentage = 0;
}33.2 LC Journal Recheck → LC Payment Recheck, line 128#
value="<?=($_POST["fdate"]!='')?$_POST["fdate"]:date('Y-m-1')?>34 Vehicle Management#
34.1 Setup → Vehicle Information, line 247#
Wrap in if($typequery){ … } .
34.2 Vehicle Requisition → Approval → Approve, line 18#
Add the if condition and replace @each with foreach :
if($data){
//while (list($key, $value) = @each($data)) {
foreach ($data as $key => $value){
$$key = $value;
}}34.3 Fuel Expense Management → Draft List → row click#
Apply Section 11.3.
35 HRM#
35.1 Roster Schedule → Single Roster Report, line 338#
Wrap in if($query){ … } .
36 PF#
| PAGE | ACTION |
|---|---|
pf_mod/pages/pf/emp_list.php | Line 138, mysqli_fetch_object(false) : wrap in if($query){… } |
37 Previous-Month Date Calculation#
Apply where the report uses the old calculation.
$current_date = $_POST['year'].'-'. $_POST['year'].'-15';
$previous_month_date = date('Y-m-d',strtotime($current_date,'-1 month'));
$previous_month_start_date = date('Y-m-01',strtotime($previous_month_date));
$mdays = date('t',strtotime($previous_month_date));
$previous_month_end_date = date('Y-m-'.$mdays,strtotime($previous_month_date));$current_date = $_POST['year'] . '-' . $_POST['month'] . '-15';
$previous_month_date = date('Y-m-d', strtotime('-1 month', strtotime($current_date)));
$previous_month_start_date = date('Y-m-01', strtotime($previous_month_date));
$mdays = date('t', strtotime($previous_month_date));
$previous_month_end_date = date('Y-m-' . $mdays, strtotime($previous_month_date));38 Open Issues#
| MODULE | ISSUE |
|---|---|
| Accounts | General ledger configuration → Chart of account details |
| MIS | mis_mod/pages/sec_mod/setup_region.php : page not found |
| User Portal | Change password: menu route problem |
| User Portal | Leave Management → Application for leave: menu route problem |
| User Portal | Outside Duty (OD) Management → Application for OD: menu route problem |
| User Portal | user_mod/pages/communication/task_report.php (Conveyance Report): Show button does not render the correct route |
| HRM | HRM Configuration → Roster schedule type; Roster Schedule → Roster set date-wise individual; HRM Company Policy → Leave rule manage; Attendance Sync System → Machine data sync (roster) |
| KPI | kpi_management/pages/home/index.php |
mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /home/clouderp/controller/clouderp8/controller/configure/db_connect.php on line 11mysqli_select_db('erpengine_cloud...')
Failed opening required '../../../config/db_connect_scb_main.php'