Changeset 3265698
- Timestamp:
- 04/02/2025 02:06:11 PM (12 months ago)
- Location:
- emarksheet
- Files:
-
- 51 added
- 1 deleted
- 12 edited
-
tags/5.4.4 (added)
-
tags/5.4.4/bootstrap (added)
-
tags/5.4.4/bootstrap/css (added)
-
tags/5.4.4/bootstrap/css/bootstrap.css (added)
-
tags/5.4.4/bootstrap/css/print.css (added)
-
tags/5.4.4/bootstrap/img (added)
-
tags/5.4.4/bootstrap/img/glyphicons-halflings-white.png (added)
-
tags/5.4.4/bootstrap/img/glyphicons-halflings.png (added)
-
tags/5.4.4/bootstrap/js (added)
-
tags/5.4.4/bootstrap/js/bootstrap.js (added)
-
tags/5.4.4/bootstrap/js/bootstrap.min.js (added)
-
tags/5.4.4/emarksheet.php (added)
-
tags/5.4.4/install-script.php (added)
-
tags/5.4.4/menu-pages (added)
-
tags/5.4.4/menu-pages/emark_add_class.php (added)
-
tags/5.4.4/menu-pages/emark_add_marks.php (added)
-
tags/5.4.4/menu-pages/emark_add_student.php (added)
-
tags/5.4.4/menu-pages/emark_add_student_list.php (added)
-
tags/5.4.4/menu-pages/emark_add_sub.php (added)
-
tags/5.4.4/menu-pages/help.php (added)
-
tags/5.4.4/menu-pages/print.php (added)
-
tags/5.4.4/menu-pages/settings.php (added)
-
tags/5.4.4/menu-pages/uninstall.php (added)
-
tags/5.4.4/readme.txt (added)
-
tags/5.4.4/screenshot-1.jpg (added)
-
tags/5.4.4/screenshot-1.png (added)
-
tags/5.4.4/screenshot-2.jpg (added)
-
tags/5.4.4/screenshot-2.png (added)
-
tags/5.4.4/screenshot-3.jpg (added)
-
tags/5.4.4/screenshot-3.png (added)
-
tags/5.4.4/screenshot-4.jpg (added)
-
tags/5.4.4/screenshot-4.png (added)
-
tags/5.4.4/screenshot-5.jpg (added)
-
tags/5.4.4/screenshot-5.png (added)
-
tags/5.4.4/screenshot-6.jpg (added)
-
tags/5.4.4/screenshot-6.png (added)
-
tags/5.4.4/screenshot-7.jpg (added)
-
tags/5.4.4/screenshot-7.png (added)
-
tags/5.4.4/screenshot-8.jpg (added)
-
tags/5.4.4/screenshot-8.png (added)
-
tags/5.4.4/screenshot-9.png (added)
-
trunk/bootstrap (added)
-
trunk/bootstrap/css (added)
-
trunk/bootstrap/css/bootstrap.css (added)
-
trunk/bootstrap/css/print.css (added)
-
trunk/bootstrap/img (added)
-
trunk/bootstrap/img/glyphicons-halflings-white.png (added)
-
trunk/bootstrap/img/glyphicons-halflings.png (added)
-
trunk/bootstrap/js (added)
-
trunk/bootstrap/js/bootstrap.js (added)
-
trunk/bootstrap/js/bootstrap.min.js (added)
-
trunk/emarksheet.php (modified) (10 diffs)
-
trunk/install-script.php (modified) (5 diffs)
-
trunk/menu-pages/bootstrap (deleted)
-
trunk/menu-pages/emark_add_class.php (modified) (6 diffs)
-
trunk/menu-pages/emark_add_marks.php (modified) (6 diffs)
-
trunk/menu-pages/emark_add_student.php (modified) (2 diffs)
-
trunk/menu-pages/emark_add_student_list.php (modified) (11 diffs)
-
trunk/menu-pages/emark_add_sub.php (modified) (7 diffs)
-
trunk/menu-pages/help.php (modified) (1 diff)
-
trunk/menu-pages/print.php (modified) (7 diffs)
-
trunk/menu-pages/settings.php (modified) (2 diffs)
-
trunk/menu-pages/uninstall.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
emarksheet/trunk/emarksheet.php
r3265424 r3265698 5 5 Description: This is a simple and unique wordpress plugin to create a simple marksheet using wordpress. You can also give a link to your users to see the result and print it. 6 6 Author: rohitashv 7 Version: 5.4. 37 Version: 5.4.4 8 8 License: GPL v2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 32 32 { 33 33 wp_enqueue_script( 'jquery' ); 34 $plugin_url = plugin_dir_url( __FILE__ ); 35 36 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 34 37 include('menu-pages/emark_add_class.php'); 35 38 } … … 37 40 { 38 41 wp_enqueue_script( 'jquery' ); 42 $plugin_url = plugin_dir_url( __FILE__ ); 43 44 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 39 45 include('menu-pages/emark_add_sub.php'); 40 46 } … … 42 48 { 43 49 wp_enqueue_script( 'jquery' ); 50 $plugin_url = plugin_dir_url( __FILE__ ); 51 52 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 44 53 include('menu-pages/emark_add_student.php'); 45 54 } … … 47 56 { 48 57 wp_enqueue_script( 'jquery' ); 58 $plugin_url = plugin_dir_url( __FILE__ ); 59 60 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 49 61 include('menu-pages/emark_add_student_list.php'); 50 62 } … … 52 64 { 53 65 wp_enqueue_script( 'jquery' ); 66 $plugin_url = plugin_dir_url( __FILE__ ); 67 68 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 54 69 include('menu-pages/emark_add_marks.php'); 55 70 } … … 57 72 { 58 73 wp_enqueue_script( 'jquery' ); 74 $plugin_url = plugin_dir_url( __FILE__ ); 75 76 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 59 77 include('menu-pages/settings.php'); 60 78 } … … 62 80 { 63 81 wp_enqueue_script( 'jquery' ); 82 $plugin_url = plugin_dir_url( __FILE__ ); 83 84 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 64 85 include('menu-pages/print.php'); 65 86 } … … 67 88 { 68 89 wp_enqueue_script( 'jquery' ); 90 $plugin_url = plugin_dir_url( __FILE__ ); 91 92 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 69 93 include('menu-pages/help.php'); 70 94 } … … 72 96 { 73 97 wp_enqueue_script( 'jquery' ); 98 $plugin_url = plugin_dir_url( __FILE__ ); 99 100 wp_enqueue_style( 'style', $plugin_url . "/bootstrap/css/bootstrap.css"); 74 101 include('menu-pages/uninstall.php'); 75 102 } -
emarksheet/trunk/install-script.php
r2006371 r3265698 1 1 <?php 2 2 global $wpdb; 3 $ add_subject ="CREATE TABLE IF NOT EXISTS `emarksheet_class` (3 $wpdb->query("CREATE TABLE IF NOT EXISTS `emarksheet_class` ( 4 4 `id` int(11) NOT NULL AUTO_INCREMENT, 5 5 `class_name` varchar(255) NOT NULL, 6 6 PRIMARY KEY (`id`) 7 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;"; 8 $wpdb->query($add_subject); 7 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ;"); 9 8 10 $ add_quiz ="CREATE TABLE IF NOT EXISTS `emarksheet_marks` (9 $wpdb->query("CREATE TABLE IF NOT EXISTS `emarksheet_marks` ( 11 10 `id` int(11) NOT NULL AUTO_INCREMENT, 12 11 `student_id` int(11) NOT NULL, … … 14 13 `marks` TEXT NOT NULL, 15 14 PRIMARY KEY (`id`) 16 ) AUTO_INCREMENT=4 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; 17 $wpdb->query($add_quiz); 15 ) AUTO_INCREMENT=4 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); 18 16 19 $ add_question ="CREATE TABLE IF NOT EXISTS `emarksheet_setting` (17 $wpdb->query("CREATE TABLE IF NOT EXISTS `emarksheet_setting` ( 20 18 `id` int(11) NOT NULL AUTO_INCREMENT, 21 19 `school_name` varchar(255) NOT NULL, … … 26 24 `name_of_principal` varchar(255) NOT NULL, 27 25 PRIMARY KEY (`id`) 28 ) AUTO_INCREMENT=5 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; 29 $wpdb->query($add_question); 26 ) AUTO_INCREMENT=5 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); 30 27 31 $ result ="CREATE TABLE IF NOT EXISTS `emarksheet_student` (28 $wpdb->query("CREATE TABLE IF NOT EXISTS `emarksheet_student` ( 32 29 `id` int(11) NOT NULL AUTO_INCREMENT, 33 30 `class_id` int(11) NOT NULL, … … 42 39 `mother_n` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 43 40 PRIMARY KEY (`id`) 44 ) AUTO_INCREMENT=6 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; 45 $wpdb->query($result); 41 ) AUTO_INCREMENT=6 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); 46 42 47 $ result1 ="CREATE TABLE IF NOT EXISTS `emarksheet_subject` (43 $wpdb->query("CREATE TABLE IF NOT EXISTS `emarksheet_subject` ( 48 44 `id` int(11) NOT NULL AUTO_INCREMENT, 49 45 `class` int(11) NOT NULL, … … 52 48 `min_pass` int(11) DEFAULT 33, 53 49 PRIMARY KEY (`id`) 54 )AUTO_INCREMENT=6 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"; 55 $wpdb->query($result1); 50 )AUTO_INCREMENT=6 ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); 56 51 ?> -
emarksheet/trunk/menu-pages/emark_add_class.php
r3265638 r3265698 1 <!---load bootstrap css----->2 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' />3 4 1 <div class='span12' style='margin-top:20px;'> 5 2 <?php 6 3 global $wpdb; 4 $nonce = wp_create_nonce( 'my-nonce' ); 5 if(isset($_POST['addsubject'])){ 6 $nonce1 = $_REQUEST['_wpnonce']; 7 8 if ( ! wp_verify_nonce( $nonce1, 'my-nonce' ) ) { 9 10 die( 'Security check' ); 11 12 } else { 13 7 14 if(isset($_POST['addsubject'])) 8 15 { 9 $subname = strip_tags($_POST['name']); 10 $insert_query=$wpdb->prepare("insert into `emarksheet_class`(`id`,`class_name`) values('','$subname')"); 11 $wpdb->query($insert_query); 16 $subname = wp_strip_all_tags($_POST['name']); 17 $wpdb->query($wpdb->prepare("insert into `emarksheet_class`(`id`,`class_name`) values('','$subname')")); 12 18 echo "<div class='alert alert-success'>Class Name Added Successfully</div>"; 13 19 } 14 20 if(isset($_POST['update_name'])) 15 21 { 16 $up_su_n = strip_tags($_POST['up_su_n']); 17 $up_su_id = strip_tags($_POST['up_id']); 18 $update_query = $wpdb->prepare("update `emarksheet_class` set `class_name`='$up_su_n' where `id`='$up_su_id'"); 19 $wpdb->query($update_query); 22 $up_su_n = wp_strip_all_tags($_POST['up_su_n']); 23 $up_su_id = wp_strip_all_tags($_POST['up_id']); 24 $wpdb->query($wpdb->prepare("update `emarksheet_class` set `class_name`='$up_su_n' where `id`='$up_su_id'")); 20 25 echo "<div class='alert alert-success'>Class Name Updated Successfully</div>"; 21 26 } … … 25 30 { 26 31 $iddelt = esc_html($_GET['id']); 27 $delete_query = $wpdb->prepare("delete from `emarksheet_class` where `id`='$iddelt'"); 28 $wpdb->query($delete_query); 32 $wpdb->query($wpdb->prepare("delete from `emarksheet_class` where `id`='$iddelt'")); 29 33 echo "<div class='alert alert-success'>Class Name Deleted Successfully</div>"; 30 34 echo "<script>setTimeout(location.href='".esc_url(admin_url("admin.php?page=eMarksheet-main"))."',6000)</script>"; … … 33 37 { 34 38 $idd = esc_html($_GET['id']); 35 $selectd_query = $wpdb->prepare("select * from `emarksheet_class` where `id`='$idd'"); 36 $selectd_row = $wpdb->get_results($selectd_query); 39 $selectd_row = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class` where `id`='$idd'")); 37 40 $su_n = $selectd_row[0]->class_name; 38 41 ?> … … 45 48 </div> 46 49 <?php 50 }} 47 51 } 48 52 } 53 49 54 ?> 50 55 <script type="text/javascript"> … … 54 59 </script> 55 60 <?php 56 $select_query = $wpdb->prepare("select * from `emarksheet_class`"); 57 $select_row = $wpdb->get_results($select_query); 61 $select_row = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class`")); 58 62 ?> 59 63 <span style="float:right;"> … … 109 113 </div> 110 114 <div class="modal-body"> 111 <form action=" " method="post">115 <form action="?page=eMarksheet-main&_wpnonce=<?php echo esc_html($nonce); ?>" method="post"> 112 116 Enter the Name of the Class You want to add<br/> 113 117 <input type="text" autocomplete="off" class="span4 text" name="name" style="margin-top:12px;height:25px;" id="subname"><br/> -
emarksheet/trunk/menu-pages/emark_add_marks.php
r3265606 r3265698 1 <!---load bootstrap css----->2 <link rel='stylesheet' type='text/css' href='<?php echo esc_html(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' />3 1 <br/><br/> 4 2 <?php … … 7 5 { 8 6 $id = esc_html($_GET['id']); 9 $selectd_query = $wpdb->prepare("select * from `emarksheet_student` where `id`='$id'"); 10 $selectd_row = $wpdb->get_results($selectd_query); 7 $selectd_row = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_student` where `id`='$id'")); 11 8 $su_n = $selectd_row[0]->class_id; 12 9 13 $selectd_query1 = $wpdb->prepare("select * from `emarksheet_subject` where `class`='$su_n'"); 14 $selectd_row1 = $wpdb->get_results($selectd_query1); 10 $selectd_row1 = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_subject` where `class`='$su_n'")); 15 11 ?> 16 12 <form action='<?php echo esc_url(admin_url("admin.php?page=eMarksheet-add-marks&action_new=add_marks_final&class_id=$su_n")); ?>' method='post'> … … 38 34 $student_id = esc_html($_POST['st_id']); 39 35 $data = serialize($_POST); 40 $gt_old = $wpdb->prepare("select * from `emarksheet_marks` where `student_id`='$student_id' AND `class_id`='$class_n'"); 41 $gt_old = $wpdb->get_results($gt_old); 36 $gt_old = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_marks` where `student_id`='$student_id' AND `class_id`='$class_n'")); 42 37 if($gt_old) 43 38 { 44 39 $mk_id = $gt_old[0]->id; 45 $upds = $wpdb->prepare("update `emarksheet_marks` set `marks`='$data' where `id`='$mk_id'"); 46 $wpdb->query($upds); 47 //echo $wpdb->last_error; 40 $wpdb->query($wpdb->prepare("update `emarksheet_marks` set `marks`='$data' where `id`='$mk_id'")); 41 48 42 echo "<div class='alert alert-success'> Marks Updated Successfully !!! </div>"; 49 43 } 50 44 else 51 45 { 52 $insert_st = $wpdb->prepare("insert into `emarksheet_marks`(`id`,`student_id`,`class_id`,`marks`) values('','$student_id','$class_n','$data')"); 53 $wpdb->query($insert_st); 46 $wpdb->query($wpdb->prepare("insert into `emarksheet_marks`(`id`,`student_id`,`class_id`,`marks`) values('','$student_id','$class_n','$data')")); 54 47 echo "<div class='alert alert-success'> Marks Added Successfully !!! </div>"; 55 48 } 56 49 } 57 $select_qury1 = "select * from `emarksheet_class` where `id`='$class_n'"; 58 $select_data1 = $wpdb->get_results($select_qury1); 50 $select_data1 = $wpdb->get_results("select * from `emarksheet_class` where `id`='$class_n'"); 59 51 $class_name = $select_data1[0]->class_name; 60 52 ?> … … 65 57 <tr><th>Sr No</th><th>Roll No</th><th>Student Name</th><th>Father's Name</th><th>Mother's Name</th><th>Date Of Birth</th><th>Action</th></tr> 66 58 <?php 67 $select_qury2 = $wpdb->prepare("select * from `emarksheet_student` where `class_id`='$class_n'"); 68 $select_data2 = $wpdb->get_results($select_qury2); 59 $select_data2 = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_student` where `class_id`='$class_n'")); 69 60 $i = 1; 70 61 if($select_data2) … … 77 68 echo esc_html($i); 78 69 ?> 79 </td><td> .<?php echo esc_html($select_data2->roll_no)."</td><td>".esc_html($select_data2->first_n)." ".esc_html($select_data2->last_n)."</td><td>".esc_html($select_data2->father_n)."</td><td>".esc_html($select_data2->mother_n)."</td><td>".esc_html($select_data2->dob_date)."-".esc_html($select_data2->dob_month)."-".esc_html($select_data2->dob_year)."</td><td><a href='".esc_url(admin_url("admin.php?page=eMarksheet-add-marks&action=add_marks&id=$select_data2->id"))."' class='btn btn-danger'><i class='icon-white icon-plus'></i> Add Marks</a></td></tr>";70 </td><td><?php echo esc_html($select_data2->roll_no)."</td><td>".esc_html($select_data2->first_n)." ".esc_html($select_data2->last_n)."</td><td>".esc_html($select_data2->father_n)."</td><td>".esc_html($select_data2->mother_n)."</td><td>".esc_html($select_data2->dob_date)."-".esc_html($select_data2->dob_month)."-".esc_html($select_data2->dob_year)."</td><td><a href='".esc_url(admin_url("admin.php?page=eMarksheet-add-marks&action=add_marks&id=$select_data2->id"))."' class='btn btn-danger'><i class='icon-white icon-plus'></i> Add Marks</a></td></tr>"; 80 71 $i++; 81 72 } … … 94 85 See the list of Enrolled Students for each Class. First Select the class : 95 86 <?php 96 $select_qury = $wpdb->prepare("select * from `emarksheet_class`"); 97 $select_data = $wpdb->get_results($select_qury); 87 $select_data = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class`")); 98 88 ?> 99 89 <form method="post" action="#"> -
emarksheet/trunk/menu-pages/emark_add_student.php
r3265646 r3265698 1 <!---load bootstrap css----->2 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' />3 1 <br/><br/><div class='alert alert-info'>Enroll the students in the class</div> 4 2 <?php 5 3 global $wpdb; 6 $ select_qury = $wpdb->prepare("select * from `emarksheet_class`");7 $select_data = $wpdb->get_results($ select_qury);4 $nonce = wp_create_nonce( 'my-nonce' ); 5 $select_data = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class`")); 8 6 if(isset($_POST['enroll'])) 9 7 { 10 $class = strip_tags($_POST['class_n']); 11 $roll_n = strip_tags($_POST['roll_number']); 12 $first_n = strip_tags($_POST['first_n']); 13 $last_n = strip_tags($_POST['last_n']); 14 $father_n = strip_tags($_POST['f_name']); 15 $mother_n = strip_tags($_POST['m_name']); 16 $dob_date = strip_tags($_POST['dob_date']); 17 $dob_m= strip_tags($_POST['dob_month']); 18 $dob_y = strip_tags($_POST['dob_year']); 19 $insert_query= $wpdb->prepare("insert into `emarksheet_student`(`id`,`class_id`,`roll_no`,`first_n`,`last_n`,`father_n`,`mother_n`,`dob_date` ,`dob_month`,`dob_year`) values('','$class','$roll_n','$first_n','$last_n','$father_n','$mother_n','$dob_date','$dob_m','$dob_y')"); 20 $wpdb->query($insert_query); 8 $nonce1 = $_REQUEST['_wpnonce']; 9 10 if ( ! wp_verify_nonce( $nonce1, 'my-nonce' ) ) { 11 12 die( 'Security check' ); 13 14 } else { 15 $class = wp_strip_all_tags($_POST['class_n']); 16 $roll_n = wp_strip_all_tags($_POST['roll_number']); 17 $first_n = wp_strip_all_tags($_POST['first_n']); 18 $last_n = wp_strip_all_tags($_POST['last_n']); 19 $father_n = wp_strip_all_tags($_POST['f_name']); 20 $mother_n = wp_strip_all_tags($_POST['m_name']); 21 $dob_date = wp_strip_all_tags($_POST['dob_date']); 22 $dob_m= wp_strip_all_tags($_POST['dob_month']); 23 $dob_y = wp_strip_all_tags($_POST['dob_year']); 24 $wpdb->query($wpdb->prepare("insert into `emarksheet_student`(`id`,`class_id`,`roll_no`,`first_n`,`last_n`,`father_n`,`mother_n`,`dob_date` ,`dob_month`,`dob_year`) values('','$class','$roll_n','$first_n','$last_n','$father_n','$mother_n','$dob_date','$dob_m','$dob_y')")); 21 25 echo "<div class='alert alert-success'>New Student Enrolled Successfully !!!</div>"; 22 26 } 27 } 23 28 ?> 24 <form method="post" action=" #">29 <form method="post" action="?page=eMarksheet-student&_wpnonce=<?php echo esc_html($nonce); ?>"> 25 30 <table class="responsive display table table-bordered"> 26 31 <tr><td> Select Class : </td><td> … … 95 100 </select> 96 101 97 <input type="text" style="width:100px;" name="dob_year" placeholder="YEAR" />102 <input type="text" style="width:100px;" required name="dob_year" minlength="4" maxlength="4" placeholder="YEAR" /> 98 103 </td> 99 104 </tr> -
emarksheet/trunk/menu-pages/emark_add_student_list.php
r3265638 r3265698 1 <!---load bootstrap css-----> 2 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' /> 1 3 2 <script type="text/javascript"> 4 3 function show_confirm() { … … 11 10 if(isset($_POST['update_name'])) 12 11 { 13 $up_id = esc_html($_POST['up_id']);14 $class = esc_html($_POST['class_nm']);15 $roll_n = esc_html($_POST['roll_number']);16 $first_n = esc_html($_POST['first_n']);17 $last_n = esc_html($_POST['last_n']);18 $father_n = esc_html($_POST['f_name']);19 $mother_n = esc_html($_POST['m_name']);20 $dob_date = esc_html($_POST['dob_date']);21 $dob_m= esc_html($_POST['dob_month']);22 $dob_y = esc_html($_POST['dob_year']);23 $ update_query =$wpdb->prepare("update `emarksheet_student` set `class_id`='$class',12 $up_id = wp_unslash($_POST['up_id']); 13 $class = wp_unslash($_POST['class_nm']); 14 $roll_n = wp_unslash($_POST['roll_number']); 15 $first_n = wp_unslash($_POST['first_n']); 16 $last_n = wp_unslash($_POST['last_n']); 17 $father_n = wp_unslash($_POST['f_name']); 18 $mother_n = wp_unslash($_POST['m_name']); 19 $dob_date = wp_unslash($_POST['dob_date']); 20 $dob_m= wp_unslash($_POST['dob_month']); 21 $dob_y = wp_unslash($_POST['dob_year']); 22 $wpdb->query($wpdb->prepare("update `emarksheet_student` set `class_id`='$class', 24 23 `roll_no`='$roll_n',`first_n`='$first_n',`last_n`='$last_n',`father_n`='$father_n',`mother_n`='$mother_n', 25 `dob_date`='$dob_date',`dob_month`='$dob_m',`dob_year`='$dob_y' where `id`='$up_id'"); 26 $wpdb->query($update_query); 24 `dob_date`='$dob_date',`dob_month`='$dob_m',`dob_year`='$dob_y' where `id`='$up_id'")); 27 25 echo "<div class='alert alert-success'>Student Name Updated Successfully</div>"; 28 26 echo "<script>setTimeout(location.href='".esc_url(admin_url("admin.php?page=eMarksheet-student-list"))."',6000)</script>"; … … 33 31 { 34 32 $iddelt = $_GET['id']; 35 $delete_query = $wpdb->prepare("delete from `emarksheet_student` where `id`='$iddelt'"); 36 $wpdb->query($delete_query); 33 $wpdb->query($wpdb->prepare("delete from `emarksheet_student` where `id`='$iddelt'")); 37 34 echo "<div class='alert alert-success'>Student Name Deleted Successfully</div>"; 38 35 echo "<script>setTimeout(location.href='".esc_url(admin_url("admin.php?page=eMarksheet-student-list"))."',6000)</script>"; … … 41 38 { 42 39 $idd = $_GET['id']; 43 $selectd_query = $wpdb->prepare("select * from `emarksheet_student` where `id`='$idd'"); 44 $selectd_row = $wpdb->get_results($selectd_query); 40 $selectd_row = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_student` where `id`='$idd'")); 45 41 $class_ida = $selectd_row[0]->class_id; 46 42 $rollno = $selectd_row[0]->roll_no; … … 52 48 $dob_m = $selectd_row[0]->dob_month; 53 49 $dob_y = $selectd_row[0]->dob_year; 54 $select_dd = $wpdb->prepare("select * from `emarksheet_class`"); 55 $select_data = $wpdb->get_results($select_dd); 50 $select_data = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class`")); 56 51 ?> 57 52 <form method="post" action="#"> … … 63 58 foreach($select_data as $select_data) 64 59 { 65 if($select_data->id == $class_ida) 66 echo "<option value='$select_data->id' selected='selected'>$select_data->class_name </option>"; 67 else 68 echo "<option value='$select_data->id'>$select_data->sem </option>"; 60 if($select_data->id == $class_ida){ 61 ?> 62 <option value='<?php echo esc_html($select_data->id); ?>' selected='selected'><?php echo esc_html($select_data->class_name);?> </option> 63 <?php 64 }else 65 ?><option value='<?php echo esc_html($select_data->id);?>'><?php echo esc_html($select_data->sem); ?> </option> 66 <?php 69 67 } 70 68 ?> … … 149 147 { 150 148 $class_n = $_POST['class_n']; 151 $select_qury1 = $wpdb->prepare("select * from `emarksheet_class` where `id`='$class_n'"); 152 $select_data1 = $wpdb->get_results($select_qury1); 149 $select_data1 = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class` where `id`='$class_n'")); 153 150 $class_name = $select_data1[0]->class_name; 154 151 ?> … … 159 156 <tr><th>Sr No</th><th>Roll No</th><th>Student Name</th><th>Father's Name</th><th>Mother's Name</th><th>Date Of Birth</th><th>Action</th></tr> 160 157 <?php 161 $select_qury2 = $wpdb->prepare("select * from `emarksheet_student` where `class_id`='$class_n'"); 162 $select_data2 = $wpdb->get_results($select_qury2); 158 $select_data2 = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_student` where `class_id`='$class_n'")); 163 159 $i = 1; 164 160 if($select_data2) … … 173 169 </td><td><?php echo esc_html($select_data2->mother_n); ?></td><td><?php echo esc_html($select_data2->dob_date)."-".esc_html($select_data2->dob_month)."-".esc_html($select_data2->dob_year); ?> 174 170 </td><td> <a href='<?php echo esc_url(admin_url("admin.php?page=eMarksheet-student-list&action=update&id=$select_data2->id"));?>' rel='tooltip' title='update' class='update'> 175 <i class='icon-pencil'></i></a> <a href='<?php echo esc_url(admin_url("admin.php?page=eMarksheet-student-list&action=delete&id=$select_data2->id"));?>' onclick='return show_confirm();' rel='tooltip' title='Delete' class='delete'><i class='icon-trash'></i></a></td></tr> ";171 <i class='icon-pencil'></i></a> <a href='<?php echo esc_url(admin_url("admin.php?page=eMarksheet-student-list&action=delete&id=$select_data2->id"));?>' onclick='return show_confirm();' rel='tooltip' title='Delete' class='delete'><i class='icon-trash'></i></a></td></tr> 176 172 <?php 177 173 $i++; … … 191 187 See the list of Enrolled Students for each Class. First Select the class : 192 188 <?php 193 $select_qury = $wpdb->prepare("select * from `emarksheet_class`"); 194 $select_data = $wpdb->get_results($select_qury); 189 $select_data = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class`")); 195 190 ?> 196 191 <form method="post" action="#"> … … 199 194 foreach($select_data as $select_data) 200 195 { 201 echo "<option value='$select_data->id'>$select_data->class_name </option>"; 196 ?> 197 <option value='<?php echo esc_html($select_data->id); ?>'><?php echo esc_html($select_data->class_name);?> </option> 198 <?php 202 199 } 203 200 ?> -
emarksheet/trunk/menu-pages/emark_add_sub.php
r3265606 r3265698 1 <!---load bootstrap css-----> 2 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' /> 1 3 2 4 3 <div class='span12' style='margin-top:20px;'> … … 8 7 if(isset($_POST['add_quiz'])) 9 8 { 10 $quiz_n = wp_strip_all_tags($_POST['qz_n']); 11 $sub_id = wp_strip_all_tags($_POST['sub_nm']); 12 $tot_m = wp_strip_all_tags($_POST['tot_m']); 13 $min_pass = wp_strip_all_tags($_POST['min_pass']); 14 $insert_queryr = $wpdb->prepare("insert into `emarksheet_subject`(`id`,`class`,`sub_name`,`min_pass`,`total_marks`) values('','$sub_id','$quiz_n','$min_pass','$tot_m')"); 15 $wpdb->query($insert_queryr); 9 $quiz_n = wp_unslash($_POST['qz_n']); 10 $sub_id = wp_unslash($_POST['sub_nm']); 11 $tot_m = wp_unslash($_POST['tot_m']); 12 $min_pass = wp_unslash($_POST['min_pass']); 13 $wpdb->query($wpdb->prepare("insert into `emarksheet_subject`(`id`,`class`,`sub_name`,`min_pass`,`total_marks`) values('','$sub_id','$quiz_n','$min_pass','$tot_m')")); 16 14 echo "<div class='alert alert-success'>Subject Name Added Successfully</div>"; 17 15 } … … 19 17 if(isset($_POST['update_name'])) 20 18 { 21 $up_su_n = wp_strip_all_tags($_POST['up_su_n']); 22 $up_su_id = wp_strip_all_tags($_POST['up_id']); 23 $up_su_ss = wp_strip_all_tags($_POST['sub_nm']); 24 $up_su_tm = wp_strip_all_tags($_POST['tot_m']); 25 $up_su_mp = wp_strip_all_tags($_POST['min_pass']); 26 $update_query = $wpdb->prepare("update `emarksheet_subject` set `sub_name`='$up_su_n',`class`='$up_su_ss',`total_marks`='$up_su_tm',`min_pass`='$up_su_mp' where `id`='$up_su_id'"); 27 $wpdb->query($update_query); 19 $up_su_n = wp_unslash($_POST['up_su_n']); 20 $up_su_id = wp_unslash($_POST['up_id']); 21 $up_su_ss = wp_unslash($_POST['sub_nm']); 22 $up_su_tm = wp_unslash($_POST['tot_m']); 23 $up_su_mp = wp_unslash($_POST['min_pass']); 24 $wpdb->query($wpdb->prepare("update `emarksheet_subject` set `sub_name`='$up_su_n',`class`='$up_su_ss',`total_marks`='$up_su_tm',`min_pass`='$up_su_mp' where `id`='$up_su_id'")); 28 25 echo "<div class='alert alert-success'>Subject Name Updated Successfully</div>"; 29 26 echo "<script>setTimeout(location.href='".esc_url(admin_url("admin.php?page=eMarksheet-subject"))."',6000)</script>"; 30 27 } 31 $select_qury = "select * from `emarksheet_class`"; 32 $select_data = $wpdb->get_results($select_qury); 28 $select_data = $wpdb->get_results("select * from `emarksheet_class`"); 33 29 34 $select_quiz = "select * from `emarksheet_subject`"; 35 $select_data_quiz = $wpdb->get_results( $select_quiz);30 31 $select_data_quiz = $wpdb->get_results("select * from `emarksheet_subject`"); 36 32 if(isset($_GET['action'])) 37 33 { … … 39 35 { 40 36 $iddelt = esc_html($_GET['id']); 41 $delete_query = $wpdb->prepare("delete from `emarksheet_subject` where `id`='$iddelt'"); 42 $wpdb->query($delete_query); 37 $wpdb->query($wpdb->prepare("delete from `emarksheet_subject` where `id`='$iddelt'")); 43 38 echo "<div class='alert alert-success'>subject Name Deleted Successfully</div>"; 44 39 echo "<script>setTimeout(location.href='".esc_url(admin_url("admin.php?page=eMarksheet-subject"))."',6000)</script>"; … … 47 42 { 48 43 $idd = $_GET['id']; 49 $selectd_ query = $wpdb->prepare("select * from `emarksheet_subject` where `id`='$idd'");50 $selectd_row = $wpdb->get_results($selectd_query);44 $selectd_row = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_subject` where `id`='$idd'")); 45 //$selectd_row = $wpdb->get_results($selectd_query); 51 46 $su_n = $selectd_row[0]->sub_name; 52 47 $sub_id = $selectd_row[0]->class; … … 62 57 foreach($select_data as $select_data) 63 58 { 64 if($select_data->id == $sub_id) 65 echo "<option value='$select_data->id' selected='selected'>$select_data->class_name </option>"; 66 else 67 echo "<option value='$select_data->id'>esc_html($select_data->class_name)</option>"; 68 } 59 if($select_data->id == $sub_id){ 60 ?><option value='<?php echo esc_html($select_data->id);?>' selected='selected'><?php echo esc_html($select_data->class_name); ?> </option> 61 <?php 62 }else{ 63 ?><option value='<?php echo esc_html($select_data->id); ?>'><?php echo esc_html($select_data->class_name); ?></option> 64 <?php 65 }} 69 66 ?> 70 67 </select> … … 123 120 foreach($select_data_quiz as $select_data_quiz) 124 121 { 125 $select_sub = $wpdb->prepare("select * from `emarksheet_class` where `id`='$select_data_quiz->class'"); 126 $select_sub_quiz = $wpdb->get_results($select_sub); 122 $select_sub_quiz = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class` where `id`='$select_data_quiz->class'")); 127 123 ?> 128 <tr><td><?php echo $i; ?></td><td><?php echo esc_html(ucfirst($select_sub_quiz[0]->class_name)); ?></td><td><?php echo esc_html(ucfirst($select_data_quiz->sub_name)); ?></td>124 <tr><td><?php echo esc_html($i); ?></td><td><?php echo esc_html(ucfirst($select_sub_quiz[0]->class_name)); ?></td><td><?php echo esc_html(ucfirst($select_data_quiz->sub_name)); ?></td> 129 125 <td><?php echo esc_html($select_data_quiz->total_marks);?></td><td><?php echo esc_html($select_data_quiz->min_pass);?></td><td> <a href='<?php echo esc_url("admin.php?page=eMarksheet-subject&action=update&id=$select_data_quiz->id");?>' rel='tooltip' title='update' class='update'><i class='icon-pencil'></i></a> <a href='<?php echo esc_url("admin.php?page=eMarksheet-subject&action=delete&id=$select_data_quiz->id");?>' onclick='return show_confirm();' rel='tooltip' title='Delete' class='delete'><i class='icon-trash'></i></a></td></tr> 130 126 <?php -
emarksheet/trunk/menu-pages/help.php
r3265541 r3265698 1 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' /> 2 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap-responsive.css', __FILE__)); ?>' /> 1 3 2 <div class=" span12 alert alert-info" style="margin-top:20px;"> 4 3 <h3>Help & Support</h3> -
emarksheet/trunk/menu-pages/print.php
r3265646 r3265698 1 <!---load bootstrap css-----> 2 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' /> 1 3 2 <style> 4 3 #print { … … 27 26 if(isset($_GET['action'])) 28 27 { 29 $sett = $wpdb->prepare("select * from `emarksheet_setting`"); 30 $get_s = $wpdb->get_results($sett); 31 28 $get_s = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_setting`")); 29 32 30 $sid = $_GET['id']; 33 $get_m = $wpdb->prepare("select * from `emarksheet_marks` where `student_id` = '$sid'"); 34 $get_st_l = $wpdb->get_results($get_m); 31 $get_st_l = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_marks` where `student_id` = '$sid'")); 35 32 $gee_cl = $get_st_l[0]->class_id; 36 33 … … 40 37 $count = count($marks)/2; 41 38 42 $select_qury5 = $wpdb->prepare("select * from `emarksheet_student` where `id`='$sid'"); 43 $select_data5 = $wpdb->get_results($select_qury5); 39 $select_data5 = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_student` where `id`='$sid'")); 40 41 $get_cl_l = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_subject` where `class` = '$gee_cl'")); 44 42 45 $get_class_l = $wpdb->prepare("select * from `emarksheet_subject` where `class` = '$gee_cl'"); 46 $get_cl_l = $wpdb->get_results($get_class_l); 43 $get_cl_li = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_class` where `id` = '$gee_cl'")); 47 44 48 $get_class_li = $wpdb->prepare("select * from `emarksheet_class` where `id` = '$gee_cl'");49 $get_cl_li = $wpdb->get_results($get_class_li);50 45 51 46 echo "<div class='print' id='print'><center><h1>".esc_html($get_s[0]->school_name)."</h1></center><center><div style='font-size:18px;'>".esc_html($get_s[0]->address)." , ".esc_html($get_s[0]->district)." ( ". esc_html($get_s[0]->state) ." ) "."<br/><br/>PROGRESS REPORT</div></center><br/><br/>"; … … 75 70 { 76 71 $fails = '0'; 72 $fail2 = '0'; 77 73 } 78 74 ?> … … 127 123 { 128 124 $class_n = $_POST['class_n']; 129 $select_qury1 = "select * from `emarksheet_class` where `id`='$class_n'"; 130 $select_data1 = $wpdb->get_results($select_qury1); 125 $select_data1 = $wpdb->get_results("select * from `emarksheet_class` where `id`='$class_n'"); 131 126 $class_name = $select_data1[0]->class_name; 132 127 ?> … … 137 132 <tr><th>Sr No</th><th>Roll No</th><th>Student Name</th><th>Father's Name</th><th>Mother's Name</th><th>Date Of Birth</th><th>Action</th></tr> 138 133 <?php 139 $select_qury2 = "select * from `emarksheet_student` where `class_id`='$class_n'"; 140 $select_data2 = $wpdb->get_results($select_qury2); 134 $select_data2 = $wpdb->get_results("select * from `emarksheet_student` where `class_id`='$class_n'"); 141 135 $i = 1; 142 136 if($select_data2) … … 168 162 To Print the marksheet of the student, Please First Select the class : 169 163 <?php 170 $select_qury = "select * from `emarksheet_class`"; 171 $select_data = $wpdb->get_results($select_qury); 164 $select_data = $wpdb->get_results("select * from `emarksheet_class`"); 172 165 ?> 173 166 <form method="post" action="#"> -
emarksheet/trunk/menu-pages/settings.php
r3265638 r3265698 1 <!---load bootstrap css-----> 2 <link rel='stylesheet' type='text/css' href='<?php echo esc_url(plugins_url('/bootstrap/css/bootstrap.css', __FILE__)); ?>' /> 1 3 2 <br/><br/> 4 3 <?php … … 6 5 if(isset($_POST['save'])) 7 6 { 8 $name_sc = strip_tags($_POST['sch_name']); 9 $address = strip_tags($_POST['address']); 10 $district = strip_tags($_POST['district']); 11 $state = strip_tags($_POST['state']); 12 $phone_n = strip_tags($_POST['phone_n']); 13 $principal = strip_tags($_POST['principle']); 14 $insert_q = $wpdb->prepare("insert into `emarksheet_setting`(`id`,`school_name`,`address`,`district`,`state`,`phone`,`name_of_principal`) values('','$name_sc','$address','$district','$state','$phone_n','$principal')"); 15 $wpdb->query($insert_q); 7 $name_sc = wp_unslash($_POST['sch_name']); 8 $address = wp_unslash($_POST['address']); 9 $district = wp_unslash($_POST['district']); 10 $state = wp_unslash($_POST['state']); 11 $phone_n = wp_unslash($_POST['phone_n']); 12 $principal = wp_unslash($_POST['principle']); 13 $wpdb->query($wpdb->prepare("insert into `emarksheet_setting`(`id`,`school_name`,`address`,`district`,`state`,`phone`,`name_of_principal`) values('','$name_sc','$address','$district','$state','$phone_n','$principal')")); 16 14 echo "<div class='alert alert-success'>Settins Saved Successfully !!! </div>"; 17 15 } 18 $select = $wpdb->prepare("select * from `emarksheet_setting` ORDER BY `id` DESC limit 1"); 19 $get_r = $wpdb->get_results($select); 16 $get_r = $wpdb->get_results($wpdb->prepare("select * from `emarksheet_setting` ORDER BY `id` DESC limit 1")); 20 17 ?> 21 18 <form method="post" action="#"> -
emarksheet/trunk/menu-pages/uninstall.php
r958028 r3265698 3 3 { 4 4 global $wpdb; 5 $query1 = "DROP table `emarksheet_class`"; 6 $wpdb->query($query1); 5 $wpdb->query("DROP table `emarksheet_class`"); 7 6 8 $query = "DROP table `emarksheet_marks`"; 9 $wpdb->query($query); 7 $wpdb->query("DROP table `emarksheet_marks`"); 10 8 11 $query2 = "DROP table `emarksheet_setting`"; 12 $wpdb->query($query2); 13 $query3 = "DROP table `emarksheet_student`"; 14 $wpdb->query($query3); 9 $wpdb->query("DROP table `emarksheet_setting`"); 15 10 16 $query4 = "DROP table `emarksheet_subject`"; 17 $wpdb->query($query4); 11 $wpdb->query("DROP table `emarksheet_student`"); 12 13 $wpdb->query("DROP table `emarksheet_subject`"); 18 14 19 15 $plugin = "eMarksheet/emarksheet.php"; -
emarksheet/trunk/readme.txt
r3265541 r3265698 7 7 Requires at least: 4.1 8 8 Tested up to: 6.7.2 9 Stable tag: 5.4. 39 Stable tag: 5.4.4 10 10 11 11 == Short Description == … … 117 117 =5.4.0= 118 118 XSS Vulnerability resolved 119 120 =5.4.4= 121 XSS Vulnerability resolved
Note: See TracChangeset
for help on using the changeset viewer.