Esempio n. 1
0
    }
}
if (isset($_POST)) {
    //To insert data
    if (isset($_GET['adddata'])) {
        $createscheduleFunction = new createscheduleFunction();
        $createscheduleFunction->createschedulename = $_POST['schedule_name'];
        $createscheduleFunction->createschedule_testbatteryid = $_POST['schedule_testbattery'];
        $createscheduleFunction->createscheduledate = $_POST['dateyear'] . '-' . $_POST['datemonth'] . '-' . $_POST['dateday'];
        $createscheduleFunction->createscheduletime = $_POST['schedule_hour'] . ':' . $_POST['schedule_minute'] . ':' . $_POST['schedule_seconds'];
        $createscheduleFunction->createschedulevenue = $_POST['schedule_venue'];
        $scheduledate = $createscheduleFunction->createscheduledate;
        $scheduletime = $createscheduleFunction->createscheduletime;
        $createschedule = $createscheduleFunction->isScheduleExist();
        if (!$createschedule) {
            $createscheduleinsert = $createscheduleFunction->createscheduleInsert();
            if ($createscheduleinsert) {
                $testbattery = mysql_fetch_array($createscheduleFunction->testbatterynameSelect());
                echo "success#Schedule Created#" . $createscheduleinsert . '#' . $_POST['schedule_name'] . '#' . $testbattery['testbattery_name'] . '#' . $scheduledate . '#' . $scheduletime . '#' . $_POST['schedule_venue'];
            } else {
                echo "failure#Schedule Not Created";
            }
            echo "success";
        } else {
            echo "failure#Already Created schedule with the entered name";
        }
    }
    // To delete stored data
    if (isset($_GET['deletedata'])) {
        $createscheduleFunction = new createscheduleFunction();
        $createscheduleFunction->createscheduleid = $_POST['delete_id'];