public function check($data) { $db = new DB(); $table = $db->getAllFrom('style'); foreach ($data as $key => $value) { for ($j = 0; $j < count($table); $j++) { if ($value['style'] == $table[$j]['style']) { throw new Exception('Вид ' . $value['style'] . ' уже существует!'); } } } return true; }
public function check($data) { $db = new DB(); $table = $db->getAllFrom('worker'); foreach ($data as $key => $value) { for ($j = 0; $j < count($table); $j++) { if ($value['name'] == $table[$j]['name'] && $value['second_name'] == $table[$j]['second_name']) { throw new Exception('Работник ' . $value["name"] . ' ' . $value["second_name"] . 'уже существует!'); } } } return true; }
public function getTable($table) { $db = new DB(); $data = $db->getAllFrom($table); return $data; }
public function getPlan() { $db = new DB(); return $db->getAllFrom('plan'); }
public function getDefect() { $db = new DB(); return $db->getAllFrom('defect'); }