当前位置: 首页>>代码示例>>PHP>>正文


PHP Student::delete方法代码示例

本文整理汇总了PHP中Student::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::delete方法的具体用法?PHP Student::delete怎么用?PHP Student::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Student的用法示例。


在下文中一共展示了Student::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Student

 function test_delete()
 {
     //Arrange
     $name = "Shmuel Irving-Jones";
     $enroll_date = "2015-08-25";
     $test_student = new Student($name, $enroll_date);
     $test_student->save();
     $name2 = "Billy Bartle-Barnaby";
     $enroll_date2 = "2015-07-09";
     $test_student2 = new Student($name2, $enroll_date2);
     $test_student2->save();
     //Act
     $test_student->delete();
     //Assert
     $result = Student::getAll();
     $this->assertEquals($test_student2, $result[0]);
 }
开发者ID:umamiMike,项目名称:registar_epic,代码行数:17,代码来源:StudentTest.php

示例2: Database

<!doctype html>
<html>
<?php 
include 'config/database.php';
include 'object/student.php';
//make a database object:
$database = new Database();
//make it connect:
$conn = $database->getConnection();
// instantiate a new student object
$student = new Student($conn);
if (isset($_GET['deleteid'])) {
    //if there is a delete id, it sets the Student ID to it
    $student->stud_id = $_GET['deleteid'];
    //Then runs function delete
    $stmt = $student->delete();
}
?>

<head>
    <meta charset="utf-8">
    <title>Community Service</title>
    <link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
    <!-- <link rel="stylesheet" type="text/css" href="css/app.css"> -->
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <link rel="icon" type="image/ico" href="images/favicon.ico">
</head>

<body class="clearfix">
    <div class="content_div">
        <div class="msg-container">
开发者ID:TannerWoodworth,项目名称:community,代码行数:31,代码来源:award.php

示例3: testDelete

 function testDelete()
 {
     $name = "Bob";
     $enrollment_date = "2015-01-01";
     $test_student = new Student($name, $enrollment_date);
     $test_student->save();
     $name = "History";
     $course_number = "HIST100";
     $test_course = new Course($name, $course_number);
     $test_course->save();
     //act
     $test_student->addCourse($test_course);
     $test_student->delete();
     $this->assertEquals([], $test_student->getCourses());
 }
开发者ID:julianstewart,项目名称:university_registrar2,代码行数:15,代码来源:StudentTest.php

示例4:

<?php

require_once 'classes/Entity/Student.php';
require_once 'classes/View.php';
require_once 'classes/Data.php';
if (isset($_GET['del_id'])) {
    Student::delete($_GET['del_id']);
}
$students = Student::findAll();
Data::setData('students', $students);
View::render('students');
开发者ID:GutsVadim,项目名称:webseo9new.dev,代码行数:11,代码来源:students.php

示例5: showStudent

function showStudent()
{
    global $connector;
    global $result;
    $student = new Student();
    $course = new Course();
    $plan = new Plan();
    $student->setConnector($connector);
    $course->setConnector($connector);
    $plan->setConnector($connector);
    if (isset($_POST['operation'])) {
        list($operation, $params) = explode("#", $_POST['operation']);
        switch ($operation) {
            case 'delete':
                $error_msg = $student->delete($params);
                break;
            case 'edit':
                $stud = $student->getById($params);
                $result['edit'] = $stud;
                $result['edit']->student = $stud;
                $exam = new Exam();
                $exam->setConnector($connector);
                $result['edit']->exam = $exam->getList($result['edit']->student);
                break;
            case 'editChanges':
                $student->storeFormValues($_POST);
                $error_msg = $student->update();
                break;
            case 'saveChanges':
                $student->storeFormValues($_POST);
                $error_msg = $student->insert();
                if ($error_msg) {
                    $result['edit'] = $student;
                }
                break;
            case 'nextPage':
                $student->storeFormValues($_POST);
                $result['edit'] = $student;
                break;
            case 'createPassword':
                $stud = $student->getById($params);
                $stud->setConnector($connector);
                $error_msg = $stud->generatePassword();
                $result['edit'] = $stud;
                break;
            default:
                $error_msg = "Operazione non valida";
        }
        if ($error_msg != "") {
            $result["errorMessage"] = $error_msg;
        } elseif ($operation != 'edit' && $operation != "nextPage") {
            $result["statusMessage"] = "Operazione completata!";
        }
    }
    if (isset($_POST['search'])) {
        $result["students"] = $student->search($_POST['search']);
    } else {
        $result["students"] = $student->getList();
    }
    $result["plans"] = $plan->getList("id_piano");
    $result["courses"] = $course->getList("nome");
    $page = "student.php";
    include_once BASE_PATH . "template.php";
}
开发者ID:christian-rizza,项目名称:sis-portal,代码行数:64,代码来源:index.php

示例6: delete

 public static function delete($id)
 {
     session_start();
     $headers = apache_request_headers();
     $token = $headers['X-Auth-Token'];
     if (!$headers['X-Auth-Token']) {
         header('Invalid CSRF Token', true, 401);
         return print json_encode(array('success' => false, 'status' => 400, '1msg' => 'Invalid CSRF Token / Bad Request / Unauthorized ... Please Login again'), JSON_PRETTY_PRINT);
         die;
     } else {
         if ($token != $_SESSION['form_token']) {
             header('Invalid CSRF Token', true, 401);
             return print json_encode(array('success' => false, 'status' => 400, 'msg' => 'Invalid CSRF Token / Bad Request / Unauthorized ... Please Login again'), JSON_PRETTY_PRINT);
             die;
         } else {
             Student::delete($id);
         }
     }
 }
开发者ID:jbagaresgaray,项目名称:ENTRANCE-EXAM,代码行数:19,代码来源:controller.php

示例7: Department

 function test_delete()
 {
     //Arrange
     $test_department = new Department("Biology", "346 Stupid Avenue");
     $test_department->save();
     $name = "Ashlin Aronin";
     $enrollment_date = "2015-08-24";
     $test_student = new Student($name, $enrollment_date, $test_department->getId());
     $test_student->save();
     $name2 = "John Nolastname";
     $enrollment_date2 = "2015-07-20";
     $test_student2 = new Student($name, $enrollment_date, $test_department->getId());
     $test_student2->save();
     //Act
     $test_student->delete();
     //Assert
     $result = Student::getAll();
     $this->assertEquals([$test_student2], $result);
 }
开发者ID:ashlinaronin,项目名称:back2school_fam,代码行数:19,代码来源:StudentTest.php

示例8: testDeleteStudent

 function testDeleteStudent()
 {
     //Arrange
     $id = null;
     $name = "Micah";
     $enrollment_date = "2015-08-28";
     $test_student = new Student($id, $name, $enrollment_date);
     $test_student->save();
     $name2 = "Intro to History";
     $number = "HIST100";
     $test_course = new Course($id, $name2, $number);
     $test_course->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->delete();
     //Act
     $this->assertEquals([], $test_course->getStudents());
 }
开发者ID:kellimargaret,项目名称:University_Registrar_Part2,代码行数:18,代码来源:StudentTest.php

示例9: Student

<?php

require_once "../init.php";
$student = new Student(new PDOdb("mysql:host=localhost;dbname=usjr", "root", ""));
$studid = $_POST['stid'];
$studfname = $_POST['stfname'];
$studmname = $_POST['stmname'];
$studlname = $_POST['stlname'];
$studcourse = $_POST['stcourse'];
$studyear = $_POST['styear'];
$result = $student->delete(array('studid'), array($studid));
// if($result > 0)
// 	 echo "Data added";
// else
//      echo "Data was not added";
header("Location:studentDeleteList.php");
开发者ID:rickyb1970,项目名称:Rabsky,代码行数:16,代码来源:studentDelete.php

示例10: delete

 public function delete()
 {
     $this->output->set_content_type('application/json');
     $this->usermanager->teacher_login_protected_redirect();
     $url = $this->uri->ruri_to_assoc(3);
     $student_id = isset($url['student_id']) ? intval($url['student_id']) : 0;
     if ($student_id != 0) {
         $this->_transaction_isolation();
         $this->db->trans_begin();
         $student = new Student();
         $student->get_by_id($student_id);
         $student->delete();
         if ($this->db->trans_status()) {
             $this->db->trans_commit();
             $this->output->set_output(json_encode(TRUE));
         } else {
             $this->db->trans_rollback();
             $this->output->set_output(json_encode(FALSE));
         }
     } else {
         $this->output->set_output(json_encode(FALSE));
     }
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:23,代码来源:students.php

示例11: doDelete

function doDelete()
{
    @($id = $_POST['selector']);
    $key = count($id);
    //multi delete using checkbox as a selector
    for ($i = 0; $i < $key; $i++) {
        $student = new Student();
        $student->delete($id[$i]);
        $details = new Student_details();
        $details->delete($id[$i]);
        $sy = new Schoolyr();
        $sy->delete($id[$i]);
        $req = new Requirements();
        $req->delete($id[$i]);
    }
    message("Student has successfully deleted!", "info");
    redirect('index.php');
}
开发者ID:allybitebo,项目名称:CCECourseCatalogue,代码行数:18,代码来源:controller.php

示例12: testDelete

 function testDelete()
 {
     $student_name = "John Doe";
     $enrollment_date = "2015-09-01";
     $test_student = new Student($student_name, $enrollment_date);
     $test_student->save();
     $student_name2 = "Jane Smith";
     $enrollment_date2 = "2013-09-01";
     $test_student2 = new Student($student_name, $enrollment_date);
     $test_student2->save();
     $test_student->delete();
     $this->assertEquals([$test_student2], Student::getAll());
 }
开发者ID:julianstewart,项目名称:university_registrar,代码行数:13,代码来源:StudentTest.php

示例13: testDelete

 function testDelete()
 {
     //Arrange
     $name = "Rick";
     $date = "2015-08-15";
     $id = 1;
     $test_student = new Student($name, $date, $id);
     $test_student->save();
     //Act
     $test_student->delete();
     $result = Student::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
开发者ID:jlbethel,项目名称:Registrar-switch,代码行数:14,代码来源:StudentTest.php

示例14: Student

 function test_delete()
 {
     //Arange
     $name = "Steve Beekman";
     $date = "2015-08-23";
     $test_student = new Student($name, $date);
     $test_student->save();
     $name2 = "Fred Flintstone";
     $date2 = "0001-01-01";
     $test_student2 = new Student($name2, $date2);
     $test_student2->save();
     //Act
     $test_student->delete();
     $result = Student::getAll();
     //Assert
     $this->assertEquals([$test_student2], $result);
 }
开发者ID:jlbethel,项目名称:Registrar_test,代码行数:17,代码来源:StudentTest.php

示例15: Student

 function test_deleteStudent()
 {
     //Arrange
     $student_name = "Joker";
     $enrollment_date = "6000-12-14";
     $id = 1;
     $student = new Student($student_name, $enrollment_date, $id);
     $student->save();
     $student_name2 = "Riddler";
     $enrollment_date2 = "7000-08-09";
     $id2 = 2;
     $student2 = new Student($student_name2, $enrollment_date2, $id2);
     $student2->save();
     //Act
     $student->delete();
     //Assert
     $this->assertEquals([$student2], Student::getAll());
 }
开发者ID:kevintokheim,项目名称:University_Registrar,代码行数:18,代码来源:StudentTest.php


注:本文中的Student::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。