ok
Direktori : /proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/add-api/ |
Current File : //proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/add-api/add-subject-form.php |
<?php include "../config/config.php"; if($_POST['type']=='add_subject_form'){ error_log("inside if condition"); try{ $date = date("Y-m-d"); //for($i=0;$i<count($_POST['question']);$i++){ if($_FILES['subject_image']["name"]!=""){ $file_name = $_FILES['subject_image']['subject_image']; $tmp = explode('.', $file_name); $extension = end($tmp); //$extension = end(explode(".", $_FILES["subject_image"]["name"])); $image = rand(10,1000000000)."-".$date."-subject." . $extension; $upload = move_uploaded_file($_FILES['subject_image']['tmp_name'], '../upload/subject/' . $image); $suject_image = 'upload/subject/' . $image; }else{ $suject_image=""; } $subject = $_POST['subject']; $discription_content = $_POST['discription_content']; $discription_keywords = $_POST['discription_keywords']; $discription_titles = $_POST['discription_titles']; $subject_content = $_POST['subject_content']; error_log("INSERT INTO `tbl_subject`(`subject_name`,`discription_content`,`subject_content`,`discription_keywords`,`discription_titles`,`image`) VALUES ($subject,$discription_content,$subject_content,$discription_keywords,$discription_titles,$suject_image)"); $statement = $pdo->prepare("INSERT INTO `tbl_subject`(`subject_name`,`discription_content`,`subject_content`,`discription_keywords`,`discription_titles`,`image`) VALUES (?,?,?,?,?,?)"); $result=$statement->execute(array($subject,$discription_content,$subject_content,$discription_keywords,$discription_titles,$suject_image)); error_log(); if($result){ echo '<script type="text/javascript"> alert("New Placemnt Added successfully"); window.location.href = "placement-details.php"; </script>'; unset($_POST); }else{ echo '<script type="text/javascript"> alert("Something went wrong try again..."); window.location.href = "banner-add.php"; </script>'; } }catch(Exception $e){ $error=$e; } } // Exam Type Add Api Start Here if($_POST['type']=='add_exam_type_form'){ try{ //for($i=0;$i<count($_POST['question']);$i++){ $exam_type = $_POST['exam_type']; $statement = $pdo->prepare("INSERT INTO `mock_exam_type`(`exam_type`) VALUES (?)"); $result=$statement->execute(array($exam_type)); error_log(); if($result){ echo '<script type="text/javascript"> alert("Exam Type Added successfully"); window.location.href = "exam-type-list.php"; </script>'; unset($_POST); }else{ echo '<script type="text/javascript"> alert("Something went wrong try again..."); window.location.href = "mock-exam-type-add.php"; </script>'; } }catch(Exception $e){ $error=$e; } } // Exam Type Add Api Ends Here ?>