Я получил ошибку в своем проекте, если есть какие-то, пожалуйста, дайте решение. Я опубликовал свое кодирование с этим и ошибкой.
Notice: Undefined variable: class in C:\xampp\htdocs\cecri karikudi\Attendancereport.php on line 212
<?php @ob_start(); session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CECRI KARAIKUDI</title> <?php include('css.php'); ?> </head> <body> <div class="row" align="center"><a href="index.php"><img src="img/header.png" class="img img-responsive" alt="" align="center" /></div><div class="clear_fix"></div><div class="row header_bot"><div class="col-sm-8"></div><div class="col-sm-4 pull-right" align="right"> <?php if(isset($_SESSION['username'])){ ?> <span class="header_bot_span"><a href="logout.php">Logout</a></span> <?php } else { ?> <span class="header_bot_span"><a href="admin.php">Admin</a></span> <span class="header_bot_span"><a href="student_login.php">Student</a></span> <?php } ?> </div> </div> <!-- Start Content --> <div class="clearfix"></div> <div class="row strip"> <a href="index.php"><span class="strip_font">Home</span></a> / <a class="active" href=""><span class="strip_font" style="color:#C00;">Monthly Attendance Report</span></a> </div> <div class="clearfix"></div> <div class="col-md-12"> <div class="col-md-3 left_side_menu"> <?php include('admin_menu.php'); include('db.php'); if(isset($_SESSION['username'])){ if(isset($_POST['submit'])){ $class = $_POST['class']; $subject_name_and_subject_code = $_POST['subject_name_and_subject_code']; $subject_handle_by = $_POST['subject_handle_by']; $batch=$_POST['batch']; $semester=$_POST['semester']; $period=$_POST['period']; } ?> </div> <div class="col-md-9 col-sm-9 col-xs-12 content_border" style="margin-top:10px; padding:10px;"> <div class="row"> <div class="col-md-6 ol-sm-6 col-xs-12"> <table class="table table-bordered table-responsive"> <form name="" method="post" action="" enctype="multipart/form-data"> <?php $query = $db->query("select * from class") or die(mysqli_error()); ?> <tr> <th>Select class </th> <td> <select name="class" class="form-control my_form"> <?php while($row = mysqli_fetch_assoc($query)){ ?> <option value="<?php echo $row['class_name']; ?>"><?php echo $row['class_name']; ?></option> <?php } ?> </select> </td> </tr> <tr> <th>subject name and subject code</th> <td> <select name="subject_name_and_subject_code" required="required" class="form-control my_form"> <option value="">subject name and subject code</option> <option value="HS851-TECHNICAL ENGLISH:(4004)-(II-SEM)">HS851-TECHNICAL ENGLISH:(4004)-(II-SEM)</option> <option value="MA8251-ENGINEERING MATHEMATICS-II:(4004)-(II-SEM)">MA8251-ENGINEERING MATHEMATICS-II:(4004)-(II-SEM)</option> <option value="PH8254-PHYSICS OF MATERIALS:(3003)-(II-SEM)">PH8254-PHYSICS OF MATERIALS:(3003)-(II-SEM)</option> <option value="CY8292-CHEMISTRY FOR TECHNOLOGISTS:(3003)-(II-SEM)">CY8292-CHEMISTRY FOR TECHNOLOGISTS:(3003)-(II-SEM)</option> <option value="BE8251-BASIC ELECTRICAL AND ELECTRONICS ENGINEERING:(3003)-(II-SEM)">BE8251-BASIC ELECTRICAL AND ELECTRONICS ENGINEERING:(3003)-(II-SEM)</option> <option value="EL8201-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(II-SEM)">EL8201-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(II-SEM)</option> <option value="MA6459-NUMERICAL METHODS:(3104)-(IV-SEM)">MA6459-NUMERICAL METHODS:(3104)-(IV-SEM)</option> <option value="CH6455-CHEMICAL ENGINEERING THERMODYNAMICS:(3104)-(IV-SEM)">CH6455-CHEMICAL ENGINEERING THERMODYNAMICS:(3104)-(IV-SEM)</option> <option value="EL6401-CHEMICAL RECTION ENGINEERING:(3003)-(IV-SEM)">EL6401-CHEMICAL RECTION ENGINEERING:(3003)-(IV-SEM)</option> <option value="CH6460-MATERIAL TECHNOLOGY:(3003)-(IV-SEM)">CH6460-MATERIAL TECHNOLOGY:(3003)-(IV-SEM)</option> <option value="EL6402-HEAT TRANSFER AND ITS APPILCTION:(3003)-(IV-SEM)">EL6402-HEAT TRANSFER AND ITS APPILCTION:(3003)-(IV-SEM)</option> <option value="EL6403-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(IV-SEM)">EL6403-PRINCIPLES OF ELECTROCHEMISTRY:(3003)-(IV-SEM)</option> <option value="EL6601-ELECTROCHEMICAL MATERIALS SCIENCE:(3003)-(VI-SEM)">EL6601-ELECTROCHEMICAL MATERIALS SCIENCE:(3003)-(VI-SEM)</option> <option value="CH6653-MASS TRANSFER-II:(3003)">CH6653-MASS TRANSFER-II:(3003)</option> <option value="EL6602-INDUSTRIAL MATERIAL FINISHING:(3003)-(VI-SEM)">EL6602-INDUSTRIAL MATERIAL FINISHING:(3003)-(VI-SEM)</option> <option value="EL6603-INSTRUMENTATION:(3003)-(VI-SEM)">EL6603-INSTRUMENTATION:(3003)-(VI-SEM)</option> <option value="EL6604-ELECTROCHEMICAL PROCESS TECHNOLOGY:(3003)-(VI-SEM)">EL6604-ELECTROCHEMICAL PROCESS TECHNOLOGY:(3003)-(VI-SEM)</option> <option value="EL6605-PROCESS DYNAMICS AND CONTROL:(3104)-(VI-SEM)">EL6605-PROCESS DYNAMICS AND CONTROL:(3104)-(VI-SEM)</option> <option value="EL6801-ELECTROCHEMICAL ENERGY CONVERSION & STORAGE:(3003)-(VIII-SEM)">EL6801-ELECTROCHEMICAL ENERGY CONVERSION & STORAGE:(3003)-(VIII-SEM)</option> <option value="EL6802 SURFACE SCIENCE:(3003)-(VIII-SEM)">EL6802 SURFACE SCIENCE:(3003)-(VIII-SEM)</option> <option value="ELECTIVE-II EL6005 CATHODIC PROTECTION & ELECTROPHRETIC COATINGS-(VIII-SEM)">ELECTIVE-II EL6005 CATHODIC PROTECTION & ELECTROPHRETIC COATINGS-(VIII-SEM)</option> </select> </td> </tr> <tr> <th>Subject handle by</th> <td> <select name="Subject_handle_by" required="required" class="form-control my_form"> <option value="">subject handle by</option> <option value="Mr.THOMAS ALEXANDER,M.A.M.Phil(TECHNICAL ENGLISH)">Mr.THOMAS ALEXANDER,M.A.M.Phil(TECHNICAL ENGLISH)</option> <option value="Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(ENGINEERING MATHS-II">Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(ENGINEERING MATHS-II</option> <option value="Mr.D.SHERWOOD,M.Sc,P.G.D.C.A(ENGINEERING MATHS-II)">Mr.D.SHERWOOD,M.Sc,P.G.D.C.A(ENGINEERING MATHS-II)</option> <option value="Dr.V.SARANYAN,M.Sc,Ph.D(PHYSICS OF MATERIALS)">Dr.V.SARANYAN,M.Sc,Ph.D(PHYSICS OF MATERIALS)</option> <option value="Dr.M.RAMESH,M.Sc,Ph.D(PHYSICS OF MATERIALS">Dr.M.RAMESH,M.Sc,Ph.D(PHYSICS OF MATERIALS</option> <option value="Dr.A.SUBBIAH,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)">Dr.A.SUBBIAH,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)</option> <option value="Dr.M.KATHIRESAN,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)">Dr.M.KATHIRESAN,M.Sc,Ph.D(CHEMISTRY FOR TECHNOLOGISTS)</option> <option value="Mr.P.THIPPERUDRASAMY.PGD(emb.sys).M.Tech(BASIC ELECTRICAL AND ELECTRONICS ENGINEERING)">Mr.P.THIPPERUDRASAMY.PGD(emb.sys).M.Tech(BASIC ELECTRICAL AND ELECTRONICS ENGINEERING)</option> <option value="Er.V.GOPALAKRISHAN,B.E(BASICS ELECTRICAL AND ELECTRONICS ENGINEERING)">Er.V.GOPALAKRISHAN,B.E(BASICS ELECTRICAL AND ELECTRONICS ENGINEERING)</option> <option value="Dr.J.MATHIYARASU,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY)">Dr.J.MATHIYARASU,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY)</option> <option value="Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY">Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINCIPLES OF ELECTROCHEMISTRY</option> <option value="Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(NUMERICAL METHODS)">Mr.S.SIVAKUMAR,M.Sc,M.Phil,P.G.D.C.A(NUMERICAL METHODS)</option> <option value="Mr.D.SHERWOORD,M.Sc,P.G.D.C.A(NUMERICAL METHODS)">Mr.D.SHERWOORD,M.Sc,P.G.D.C.A(NUMERICAL METHODS)</option> <option value="Dr.R.MALINI,M.Tech,Ph.D(CHEMICAL ENGINEERING THERMODYNAMICS)">Dr.R.MALINI,M.Tech,Ph.D(CHEMICAL ENGINEERING THERMODYNAMICS)</option> <option value="Dr.V.RAVI BABU,M.Tech,Ph.D(CHEMICAL REACTION ENGINEERING)">Dr.V.RAVI BABU,M.Tech,Ph.D(CHEMICAL REACTION ENGINEERING)</option> <option value="Dr.L.JHON BERCHMANS,M.Tech,Ph.D(MATERIALS TECHNOLOGY)">Dr.L.JHON BERCHMANS,M.Tech,Ph.D(MATERIALS TECHNOLOGY)</option> <option value="Dr.M.SATHISH,M.Sc,Ph.D(MATERIALS TECHNOLOGY)">Dr.M.SATHISH,M.Sc,Ph.D(MATERIALS TECHNOLOGY)</option> <option value="Dr.G.SREEDHAR,M.Tech,Ph.D(HEAT TRANSFER AND ITS APPLICATIONS)">Dr.G.SREEDHAR,M.Tech,Ph.D(HEAT TRANSFER AND ITS APPLICATIONS)</option> <option value="Dr.J.MATHIYARASU,M.Sc,PH.D(PRINICIPLES OF ELECTROCHEMISTRY)">Dr.J.MATHIYARASU,M.Sc,PH.D(PRINICIPLES OF ELECTROCHEMISTRY)</option> <option value="Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINICIPLES OF ELECTROCHEMISTRY)">Dr.JAMES JOSEPH,M.Sc,Ph.D(PRINICIPLES OF ELECTROCHEMISTRY)</option> <option value="Dr.B.SUBRAMANIAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">Dr.B.SUBRAMANIAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option> <option value="Dr.N.LAKSHMINARASIMHAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">Dr.N.LAKSHMINARASIMHAN,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option> <option value="Dr.KARTHIK,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">r.KARTHIK,M.Sc,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option> <option value="Dr.V.MURUGAN,B.Phram,M.S,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S,Ph.D(ELECTROCHEMICAL MATERIALS SCIENCE)</option> <option value="Dr.SUNDAR MAYAVAN,B.Tech,M.S.Ph.D(MASS TRANSFER)">Dr.SUNDAR MAYAVAN,B.Tech,M.S.Ph.D(MASS TRANSFER)</option> <option value="Dr.R.SEKAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)">Dr.R.SEKAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)</option> <option value="Dr.M.JAYAKUMAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)">Dr.M.JAYAKUMAR,M.Sc,M.Phil,Ph.D(INDUSTRIAL METAL FINISHING)</option> <option value="Dr.N.RAJASHAKARANM.Sc,Ph.D(INDUSTRIAL METAL FINISHING)">Dr.N.RAJASHAKARANM.Sc,Ph.D(INDUSTRIAL METAL FINISHING)</option> <option value="Dr.S.RADHAKRISHAN,M.Sc,Ph.D(INSTRUMENTATION)">Dr.S.RADHAKRISHAN,M.Sc,Ph.D(INSTRUMENTATION)</option> <option value="Dr.G.SOZHAN,M.E,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.G.SOZHAN,M.E,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option> <option value="Dr.T.VIJAYABHARATHI,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.T.VIJAYABHARATHI,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option> <option value="Dr.V.SURIYANARAYANAN,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.V.SURIYANARAYANAN,M.Sc,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option> <option value="Dr.S.VENGATESAN,M.Sc,M.Tech,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)">Dr.S.VENGATESAN,M.Sc,M.Tech,Ph.D(ELECTROCHEMICAL PROCESS TECHNOLOGY)</option> <option value="Dr.R.MAYANDI,BTech,Ph.D(PROCESS DYNAMICS AND CONTROL)">Dr.R.MAYANDI,BTech,Ph.D(PROCESS DYNAMICS AND CONTROL)</option> <option value="Dr.M.V.T.DHANAJEYAN,M.Sc,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)">Dr.M.V.T.DHANAJEYAN,M.Sc,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)</option> <option value="Dr.M.RAJU,M.E,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)">Dr.M.RAJU,M.E,Ph.D(ELECTROCHEMICAL ENGERY CONVERSION &STORAGE)</option> <option value="Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.V.SARANYAN,M.Sc,Ph.D(SURFACE SCIENCE)</option> <option value="Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)'>Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.K.SELVAKUMAR,M.Sc,Ph.D(SURFACE SCIENCE)</option> <option value="Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)">Dr.V.MURUGAN,B.Phram,M.S.Ph.D(SURFACE SCIENCE)</option> <option value="Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)">Dr.A.SUBBIAH,M.Sc,Ph.D(SURFACE SCIENCE)</option> <option value="Dr.S.MARUTHAMUTHU,M.Sc,M.Phil,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">Dr.S.MARUTHAMUTHU,M.Sc,M.Phil,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option> <option value="DR.SUNDAR MAYAVAN,B.Tech,M.S,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">DR.SUNDAR MAYAVAN,B.Tech,M.S,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option> <option value="Dr.S.P.MANOHARAN,M.Sc,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">Dr.S.P.MANOHARAN,M.Sc,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option> <option value="Dr.S.SREEJAKUMARI,M.Sc,M.Tech,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)">Dr.S.SREEJAKUMARI,M.Sc,M.Tech,Ph.D(ELECTIVE-II CATHODIC PROTECTION & ELECTROPHRETIC COATINGS)</option> </select> </td> </tr> <tr> <th>Batch</th> <td> <select name="batch" required="required" class="form-control my_form"> <option value="">batch</option> <option value="2016">2016</option> <option value="2017">2017</option> <option value="2018">2018</option> <option value="2019">2019</option> <option value="2020">2020</option> </select> </td> </tr> <tr> <th>semester</th> <td> <select name="semester" required="required" class="form-control my_form"> <option value="">semester</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select> </td> </tr> <tr> <th>period</th> <td> <select name="period" required="required" class="form-control my_form"> <option value="">period</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select> </td> </tr> <tr> <td colspan=2><center> <input type="submit" value="submit" class="my_btn" name="submit" /></center></td> </tr></form> </table> </div><div class="col-md-6 ol-sm-6 col-xs-12"></div> </div> <h3 style="font-weight:bold; text-transform:uppercase; padding-bottom:5px;"> Monthly Attendance Report </h3> <?php $query = $db->query("select * from stu_atten where class='$class' and subject_name_and_subject_code='$subject_name_and_subject_code' and subject_handle_by='$subject_handle_by' and batch='$batch' and semester='$semester',period='$period'") or die(mysqli_error($connection)); ?> <table class="table table-bordered table-responsive"> <tr> <th>S.No.</th> <th>Student Roll No.</th> <th>Student Name</th> <th>Class</th> <th>subject name and subject code</th> <th>subject handle by</th> <th>batch</th> <th>semester</th> <th>period</th> <th>No. Of Days Present</th> <th>No. Of Working Days</th> </tr> <?php while($row = mysqli_fetch_assoc($query)){ $roll = $row['roll_no']; $stream = $row['class']; $querys = $db->query("select * from student_details where regno='$roll' and class='$stream'") or die(mysqli_error()); $rows = mysqli_fetch_assoc($querys); $mob = $rows['parent_mob']; //echo $mob; //SMS Code Starts Here $ch = curl_init(); $user="vinay.takeoff@gmail.com:Vinay99@"; $receipientno= $mob; $senderID="TAKEOF"; $msgtxt= "Dear Parent, Your Son/Daughter ".$row['name']." has attended ".$row['present_days']." days out of ".$row['work_days']." days for the month of ".$row['month']." in the year ".$row['year']; curl_setopt($ch,CURLOPT_URL, "http://api.mVaayoo.com/mvaayooapi/MessageCompose"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "user=$user&senderID=$senderID&receipientno=$receipientno&msgtxt=$msgtxt&state=0"); $buffer = curl_exec($ch); //SMS Code Ends Here ?> <tr> <td><center><?php echo $row['id']; ?></center></td> <td><center><?php echo $row['roll_no']; ?></center></td> <td><center><?php echo $row['name']; ?></center></td> <td><center><?php echo $row['class']; ?></center></td> <td><center><?php echo $row['subject_name_and_subject_code']; ?></center></td> <td><center><?php echo $row['subject_handle_by']; ?></center></td> <td><center><?php echo $row['batch'];?></center></td> <td><center><?php echo $row['semester'];?></center></td> <td><center><?php echo $row['period'];?></center></td> <td><center><?php echo $row['present_days']; ?></center></td> <td><center><?php echo $row['work_days']; ?></center></td> </tr> <?php } ?> </table> </div> </div> <!-- End Content --> <?php include('footer.php'); } else{ header('location:index.php?suc=suc'); } ?> </body> </html> What I have tried: db.php <pre><?php error_reporting(); $db = new mysqli('localhost', 'root', '', 'cecri karaikudi'); if($db->connect_errno){ die('Sorry Database not connected !!!'); } ?>
F-ES Sitecore
И строки 212-это....?