<?php include 'config/conn.php'; include 'shwegeneratekey.php'; $sid = 'supplierid'; $r_sid = My_Generate_Key($db, "SELECT supplierid FROM supplier Order By supplierid desc ", $sid, "S", 4); echo json_encode(array('supplierid' => $r_sid));
$function = "unit"; break; case 'countermasters': $field = "CounterID"; $prefix = "C-"; $num = 5; $function = "unit"; break; case 'units': $field = "UnitCode"; $prefix = "U-"; $num = 2; $function = "unit"; break; case 'suppliers': $field = "SupplierID"; $prefix = "S"; $num = 5; $function = ""; break; default: return; } if ($function == "unit") { $id = Generate_UnitKey($db, $table, $field, $prefix, $num); } else { $id = My_Generate_Key($db, $table, $field, $prefix, $num); } $return["id"] = $id; echo json_encode($return); return;
<?php include 'config/conn.php'; include 'shwegeneratekey.php'; $pid = 'purchaseno'; $r_pid = My_Generate_Key($db, "SELECT purchaseno FROM purchase_header Order By purchaseno desc ", $pid, "P", 4); $return["purchaseid"] = $r_pid; echo json_encode($return);