$query = ' UPDATE press set deleted=1 WHERE id="' . $data['press_id'] . '" '; $component->db->query($query, true, ""); } } // Inks Save ----------------------------------------------------/ $componentInk1 = new ComponentInk(); //$component->check_modified_fields($keys, $componentInk1, $component->id); $componentInk1->mark_deletedByComponentId($return_id); $inks_sides = array(0 => "a", 1 => "b"); for ($l = 0; $l < count($inks_sides); $l++) { $sum = 0; for ($i = 0; $i < $count; $i++) { if (substr_count($keys[$i], "colorId_side_" . $inks_sides[$l] . "_") > 0) { $index = substr($keys[$i], -1, 1); $color_id = $_POST["colorId_side_" . $inks_sides[$l] . "_" . $index]; $componentInk = new ComponentInk(); $componentInk->color_id = $color_id; $componentInk->side = $inks_sides[$l]; $componentInk->component_id = $component->id; $componentInk->save(); } } } //Operations save ----------------------------------------------/ $operations1 = new ProductOperation(); $component->check_modified_fields($keys, $operations1, $component->id); $operations1->mark_deletedByComponentId($return_id); $operation_types = array(0 => 'CutngOperations', 1 => 'OtherOperations'); for ($p = 0; $p < count($operation_types); $p++) { for ($i = 0; $i < $count; $i++) { if (substr_count($keys[$i], "{$operation_types[$p]}_Id_") > 0) {
function getInkRows() { $return_array = array(); if ($this->id != "") { $componentink = new ComponentInk(); $return_array = $componentink->get_full_list("id", "component_id='" . $this->id . "'"); } return $return_array; }