Empty '; } //loop into errors array and echo it foreach($formErrors as $error){ echo '
' . $error . '
' ; } if (empty($formErrors)){ $wsh_code =rand(0000000,1000000); $stmt = $conn->prepare("INSERT INTO workshops(wsh_customer_name, wsh_customer_phone, wsh_type, wsh_place, wsh_desc, wsh_cus_code, adddate) VALUES (:zname, :zphon, :ztype, :zplac, :zdesc, :zcode, now() ) "); $stmt->execute(array( 'zname' => $wsh_cusname, 'zphon' => $wsh_cusphone, 'ztype' => $wsh_type, 'zplac' => $wsh_place, 'zdesc' => $wsh_desc, 'zcode' => $wsh_code )); header('location:workshops.php'); exit(); } else{ $msg=urlencode("البيانات المدخلة تحتوي على مشكلة" . "، أعد المحاولة"); header('location:add_customer_template.php?Message='. $msg); exit(); } } ?>

إضافة ورشة عمل