ok

Mini Shell

Direktori : /proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/api/
Upload File :
Current File : //proc/self/root/home2/selectio/www/tnpsctestbatch.com/admin/api/select_standard.php

<?php 
 
include"../config/config.php";


 if(isset($_POST['type']) && $_POST['type']=='standard'){

     
     $subject_id = $_POST['subject'];
      
      $where = "WHERE status=1";
     
     if($subject_id){
         $where.=" and subject_id=".$subject_id;
     }
        error_log("SELECT * FROM tbl_standard ".$where);
        $standard_query = $pdo->prepare("SELECT * FROM tbl_standard ".$where);
        $standard_query->execute();
        $standard_result = $standard_query->fetchAll(PDO::FETCH_ASSOC);
        $totals = $standard_query->rowCount();
                                     
         if($totals){
              echo   '<option>--Select Standard--</option>';
             foreach ($standard_result as $standard_result) { 
                echo   '<option value="'.$standard_result['id'].'">' .$standard_result['standard'].'</option>';
                   
            }
         }    
}else{
  /* echo '<option value="">Select Thirumanam First !!!</option>';*/
} 



 if(isset($_POST['type']) && $_POST['type']=='topics'){

     
     $standard_id = $_POST['standard'];
     $subject_id = $_POST['subject'];
      
      $where = "WHERE status=1";
     
     if($standard_id){
         $where.=" and standard_id=".$standard_id;
     }
      if($subject_id){
         $where.=" and subject_id=".$subject_id;
     }
        error_log("SELECT * FROM tbl_topic ".$where);
        $topic_query = $pdo->prepare("SELECT * FROM tbl_topic ".$where);
        $topic_query->execute();
        $result_topic = $topic_query->fetchAll(PDO::FETCH_ASSOC);
        $totals = $topic_query->rowCount();
                                     
         if($totals){
              echo   '<option> ---Select Topics--- </option>';
             foreach ($result_topic as $topic_result) { 
                echo   '<option value="'.$topic_result['id'].'">' .$topic_result['topic'].'</option>';
                   
            }
         }    
}else{
  /* echo '<option value="">Select Thirumanam First !!!</option>';*/
} 

Zerion Mini Shell 1.0