Esempio n. 1
0
function updateDetailedCalendar($id, $st, $et, $sub, $ade, $dscr, $loc, $color, $tz, $id_sekolah, $id_kelas, $id_mengajar)
{
    $ret = array();
    try {
        $db = new DBConnection();
        $db->getConnection();
        $qnamapelajaran = mysql_query('SELECT ap.nama, apg.nama as nama_pegawai FROM ak_pelajaran ap JOIN ak_mengajar am JOIN ak_pegawai apg ON ap.id=am.id_pelajaran AND am.id_pegawai=apg.id WHERE am.id=' . $id_mengajar . '');
        $namamapel = mysql_fetch_array($qnamapelajaran);
        $namsubject = "" . $namamapel['nama'] . " (" . $namamapel['nama_pegawai'] . ")";
        $sql = "update `ak_jadwal` set" . " `id_sekolah`='" . $id_sekolah . "', " . " `id_kelas`='" . $id_kelas . "', " . " `id_mengajar`='" . $id_mengajar . "', " . " `starttime`='" . php2MySqlTime(js2PhpTime($st)) . "', " . " `endtime`='" . php2MySqlTime(js2PhpTime($et)) . "', " . " `subject`='" . mysql_real_escape_string($namsubject) . "', " . " `isalldayevent`='" . mysql_real_escape_string($ade) . "', " . " `description`='" . mysql_real_escape_string($dscr) . "', " . " `location`='" . mysql_real_escape_string($loc) . "', " . " `color`='" . mysql_real_escape_string($color) . "' " . "where `id`=" . $id;
        //echo $sql;die();
        if (mysql_query($sql) == false) {
            $ret['IsSuccess'] = false;
            $ret['Msg'] = mysql_error();
        } else {
            $ret['IsSuccess'] = true;
            $ret['Msg'] = 'Succefully';
        }
    } catch (Exception $e) {
        $ret['IsSuccess'] = false;
        $ret['Msg'] = $e->getMessage();
    }
    return $ret;
}
Esempio n. 2
0
function updateDetailedCalendar($id, $st, $et, $sub, $ade, $dscr, $loc, $color, $tz)
{
    $ret = array();
    try {
        $db = new DBConnection();
        $db->getConnection();
        $sql = "update `jqcalendar` set" . " `starttime`='" . php2MySqlTime(js2PhpTime($st)) . "', " . " `endtime`='" . php2MySqlTime(js2PhpTime($et)) . "', " . " `subject`='" . mysql_real_escape_string($sub) . "', " . " `isalldayevent`='" . mysql_real_escape_string($ade) . "', " . " `description`='" . mysql_real_escape_string($dscr) . "', " . " `location`='" . mysql_real_escape_string($loc) . "', " . " `color`='" . mysql_real_escape_string($color) . "' " . "where `id`=" . $id;
        //echo $sql;
        if (mysql_query($sql) == false) {
            $ret['IsSuccess'] = false;
            $ret['Msg'] = mysql_error();
        } else {
            $ret['IsSuccess'] = true;
            $ret['Msg'] = 'Succefully';
        }
    } catch (Exception $e) {
        $ret['IsSuccess'] = false;
        $ret['Msg'] = $e->getMessage();
    }
    return $ret;
}
Esempio n. 3
0
function updateDetailedCalendar($id, $st, $et, $sub, $ade, $dscr, $loc, $color, $tz)
{
    $ret = array();
    try {
        $event = Events::model()->findByPk($id);
        $event->title = mysql_real_escape_string($sub);
        $event->starttime = php2MySqlTime(js2PhpTime($st));
        $event->endtime = php2MySqlTime(js2PhpTime($et));
        $event->isalldayevent = mysql_real_escape_string($ade);
        $event->description = mysql_real_escape_string($dscr);
        $event->location = mysql_real_escape_string($loc);
        $event->color = mysql_real_escape_string($color);
        if ($event->save() == false) {
            $ret['IsSuccess'] = false;
            $ret['Msg'] = $event->error();
        } else {
            $ret['IsSuccess'] = true;
            $ret['Msg'] = 'Succefully';
        }
    } catch (Exception $e) {
        $ret['IsSuccess'] = false;
        $ret['Msg'] = $e->getMessage();
    }
    return $ret;
}