'پيوست يک', 2 => 'پيوست دو', 3 => 'پيوست سه', 4 => 'پيوست چهار', 5 => 'پيوست پنج'); //------------------------------------------------------------------- $ValidationRules = array( 'required' => array('name', 'family', 'student_id', 'question', 'major', 'email', 'mobile'), // 'size' => array('student_id' => 9), 'email' => array('email'), 'mobile' => array('mobile')); //------------------------------------------------------------------- if ($question_id == '') { $sql = "INSERT INTO alborz_main.staff_question (status) VALUES ('0')"; ExecSQL($sql, $link); $question_id = mysql_insert_id($link); } //---------------------------------------------------------------------------------------------------------------------- $link = Connect(); if (isset($SUBMIT) || isset($UPLOAD)) { if ($DP != "" && $question_id != "") { $sql = "SELECT Val FROM alborz_main.temp WHERE Var = '$question_id' AND Row = '$DP'"; $res = ExecSQL($sql, $link); $row = mysql_fetch_array($res); $filename = $row['Val']; if (file_exists($filename) && $filename != "") { unlink($filename); } $sql = "DELETE FROM alborz_main.temp WHERE Var = '$question_id' AND Row = '$DP'"; ExecSQL($sql, $link); } // ---------------------- UPLOADING DATA ------------------------ $link = Connect(); $anyupload = false; $FILE_UPLOAD_ERROR = false; for ($i = 0; $i <= PEYVASTS_MAX; $i++) { $peyvast[$i] = UploadFile('userfile', $i, PEYVAST_PATH, '', $msg[$i]); registerUpload(PEYVAST_PATH.$peyvast[$i], '', sanitizeFilename($userfile_name[$i])); $peyvast_counter++; if ($peyvast[$i] != '') { $sql = "SELECT Val FROM alborz_main.temp WHERE Var = '$question_id' AND Row = '$i'"; $res3 = ExecSQL($sql, $link); $row3 = mysql_fetch_array($res3); $old_filename = $row3['Val']; if (file_exists($old_filename) && $old_filename != "") { unlink($old_filename); } $sql = "DELETE FROM alborz_main.temp WHERE Var = '$question_id' AND Row = '$i'"; ExecSQL($sql, $link); $path = 'peyvast/'.$peyvast[$i]; $sql = "INSERT INTO alborz_main.temp (Row, Var, Val) VALUES ('$i', '$question_id', '$path')"; ExecSQL($sql, $link); $anyupload = true; } } } //------------------------------------------------------------------------------------------- $sql = "SELECT * FROM alborz_main.temp WHERE Var = '$question_id'"; $res2 = ExecSQL($sql, $link); while ($row = mysql_fetch_array($res2)) { $attachment[$row['Row']] = $row['Val']; } //------------------------------------------------------------------------------------------- if (isset($UPLOAD) || isset($SUBMIT)) { if (isset($SUBMIT)) { $validationResult = ValidateForm($ValidationRules); if (count($validationResult) > 0) { $error_msg = 'شما برخي فيلد‌هاي اجباري را پر نکرده ايد و يا مقدار آنها معتبر نيستند. اين موارد فيلدها با رنگ قرمز مشخص شده اند. اگر موشواره را روي انها نگه داريد خطاي مربوطه نشان داده مي‌شود.'; GoLight("#error"); } } // Updating thesis Table --------------------------- $posted = time(); $mobile = NormalizeMobile($mobile); $student_id = UString($student_id); $attachments = implode('|', (array)$attachment); $sql = "UPDATE alborz_main.staff_question SET name = '$name', family = '$family', student_id = '$student_id', major = '$major', mobile = '$mobile', email = '$email', topic = '$topic', question = '$question', posted = '$posted', recipient = '$staff_id', attachments = '$attachments' WHERE id = '$question_id'"; ExecSQL($sql, $link); if (isset($SUBMIT) && count($validationResult) == 0 && !$FILE_UPLOAD_ERROR) { $sql = "UPDATE alborz_main.staff_question SET status = '1' WHERE id = '$question_id'"; ExecSQL($sql, $link); $sql = "DELETE FROM alborz_main.temp WHERE Var = '$question_id'"; ExecSQL($sql, $link); if ($mobile != '') { $sms = "با سلام،\r\nبا تشکر پيغام شما به شماره ارجاع $question_id دريافت و به کارشناس ".$recipient_row['Nam']." ارسال شد. در صورت نياز ايشان با شما تماس خواهند گرفت.\r\nبا احترام،"; QueueSMSHigh($mobile, $sms); if ($recipient_row['Username'] == 'darrudi') { QueueSMSHigh(WWW_ADMIN_MOBILE, $question); QueueEmail('ALBORZ: Ticket', $question, 'alborz.portal@ut.ac.ir', 'darrudi@gmail.com'); } } GoMessage('نتيجه', 'با تشکر پيغام شما به شماره ارجاع '.NUni($question_id).' دريافت و به کارشناس «'.$recipient_row['Nam'].'» ارسال شد. در صورت نياز ايشان با شما تماس خواهند گرفت.', '', false); } elseif (isset($NEXT)) { GoLight("#top"); } } //---------------------------------------------------------------------------------------------------------------------- $sql = "SELECT * FROM alborz_main.staff_question WHERE id = '$question_id'"; $row = GetRow($sql, $link); if (!isset($UPLOAD) && !isset($SUBMIT) && $prevQuestion) { $row['name'] = $prevQuestion['name']; $row['family'] = $prevQuestion['family']; $row['student_id'] = $prevQuestion['student_id']; $row['major'] = $prevQuestion['major']; $row['mobile'] = $prevQuestion['mobile']; $row['email'] = $prevQuestion['email']; } //---------------------------------------------------------------------------------------------------------------------- ?>

کارشناس گيرنده پيغام:   از

مشخصات متقاضي:

style="width:100%;" /> نام:
style="width:100%;" /> نام خانوادگي:
شماره دانشجويي:
style="width:100%;" /> رشته/مقطع: