fix products owneraccont cannot insert accountid_productowner

This commit is contained in:
mahdahar 2025-11-12 15:52:30 +07:00
parent a552fedca0
commit 41215c1bfb
3 changed files with 8 additions and 6 deletions

View File

@ -480,8 +480,8 @@ class Products extends BaseController {
$where = 0;
$sql = "SELECT a2.accountname, p.statuspart, ps.productservicetext, p.productid, pc.productname, p.productnumber, p.active, pc.catalognumber, pt.texts as type_name, pc.manufacturer, s.sitename,
z.zonename as city, z2.zonename as prov, p.installationdate, p.locationstartdate, p.locationenddate, p.warrantystartdate, p.warrantyenddate
$sql = "SELECT a2.accountname as owneraccount, p.statuspart, ps.productservicetext, p.productid, pc.productname, p.productnumber, p.active, pc.catalognumber, pt.texts as type_name, pc.manufacturer, s.sitename,
z.zonename as city, z2.zonename as prov, p.installationdate, p.locationstartdate, p.locationenddate, p.warrantystartdate, p.warrantyenddate, p.productowner
FROM products p
left join productcatalog pc on pc.catalogid=p.catalogid
-- left join accoun pc2 on pc2.catalogid=p.accountid_productowner

View File

@ -5,7 +5,7 @@ use CodeIgniter\Model;
class ProductsModel extends Model {
protected $table = 'products';
protected $primaryKey = 'productid';
protected $allowedFields = [ 'siteid', 'productnumber', 'productname', 'catalogid',
protected $allowedFields = [ 'siteid', 'productnumber', 'productname', 'catalogid', 'accountid_productowner',
'installationdate', 'locationstartdate', 'locationenddate', 'warrantystartdate', 'warrantyenddate',
'productowner', 'productserviceid', 'statuspart', 'active',
'remotetool', 'remoteid', 'remotepwd', 'createdate', 'enddate' ];

View File

@ -36,6 +36,7 @@
<th scope="col">Product Number</th>
<th scope="col">Catalog Number</th>
<th scope="col">Product Owner</th>
<th scope="col">Owner Account</th>
<th scope="col">Status Service</th>
<th scope="col">Status Parts</th>
<th scope="col">Type</th>
@ -59,7 +60,8 @@
<td><?= htmlspecialchars($item['productname'] ?? '') ?></td>
<td><?= htmlspecialchars($item['productnumber'] ?? '') ?></td>
<td><?= htmlspecialchars($item['catalognumber'] ?? '') ?></td>
<td><?= htmlspecialchars($item['accountname'] ?? '') ?></td>
<td><?= htmlspecialchars($item['productowner'] ?? '') ?></td>
<td><?= htmlspecialchars($item['owneraccount'] ?? '') ?></td>
<td><?= htmlspecialchars($item['service'] ?? '') ?></td>
<td><?= htmlspecialchars($item['statuspart'] ?? '') ?></td>
<td><?= htmlspecialchars($item['type_name'] ?? '') ?></td>
@ -91,8 +93,8 @@ function exportToExcel() {
XLSX.writeFile(wb, "ProductsList.xlsx");
}
window.onload = function() {
document.getElementById('saveButton').click();
window.close();
document.getElementById('saveButton').click();
window.close();
}
</script>
</body>