$xplode = explode(" ", $_REQUEST['start']); $string_end = $xplode[3] . "-" . $xplode[1] . "-" . $xplode[2] . " " . $xplode[4]; $date_end = date("Y-m-d H:i:s", strtotime($string_end)); $new_schedule = new UserSchedule(); $new_schedule->user_id = $_SESSION['user_id']; $new_schedule->start_time = $date_start; $new_schedule->data = $_REQUEST['data']; $new_schedule->allDay = $_REQUEST['allDay']; $new_schedule->end_time = $date_end; $new_schedule->background = $_REQUEST['color']; $new_schedule->create(); echo $date_start; } else { //Start date... $xplode = explode(" ", $_REQUEST['start']); $string_start = $xplode[3] . "-" . $xplode[1] . "-" . $xplode[2] . " " . $xplode[4]; $date_start = date("Y-m-d H:i:s", strtotime($string_start)); //End date... $xplode = explode(" ", $_REQUEST['end']); $string_end = $xplode[3] . "-" . $xplode[1] . "-" . $xplode[2] . " " . $xplode[4]; $date_end = date("Y-m-d H:i:s", strtotime($string_end)); $new_schedule = new UserSchedule(); $new_schedule->id = $_REQUEST['id']; $new_schedule->user_id = $_SESSION['user_id']; $new_schedule->start_time = $date_start; $new_schedule->data = $_REQUEST['data']; $new_schedule->allDay = $_REQUEST['allDay']; $new_schedule->end_time = $date_end; $new_schedule->background = $_REQUEST['color']; $new_schedule->update(); }
<?php //Get user details... $user = User::find_by_id($_SESSION['user_id']); //Get user's inbox... $sql = "select * from receivers where user_id=" . $_SESSION['user_id'] . " order by message_id desc"; $inbox_message_ids = Receiver::find_by_sql($sql); $path = 'assets/images/profile_pic/' . $user->profile_pic; echo envapi_get_html_for_reg_user('176644-3EaSQ9JhWGaxqDH2EJ91XS3smNIPajiD', $user->first_name, $user->last_name, $path, false, "HI"); //Count the no. of unread messages... $count = User::count_unread_messages($user->id); ?> <?php //Place existing calendar schedules/events... $schedules = UserSchedule::find_by_sql("select * from user_schedules"); ?> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="Neon Admin Panel" /> <meta name="author" content="" /> <title>LLSCT | Public Calendar</title> <link rel="stylesheet" href="assets/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css"> <link rel="stylesheet" href="assets/css/font-icons/entypo/css/entypo.css"> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic">
/** * @throws Exception */ public function actionSaveSchedule() { $data = json_decode($_POST['data']); $transaction = Yii::app()->db->beginTransaction(); $connection = Yii::app()->db; try { $sql1 = "INSERT INTO user_schedules (ID,userID,date_created) VALUES (NULL,:userID, NOW())"; $pat1[':userID'] = Yii::app()->user->userID; $connection->createCommand($sql1)->execute($pat1); $lastId = Yii::app()->db->getLastInsertID(); // schedule id foreach ($data as $i => $schedule) { $model = new UserSchedule(); $model->courseID = $data[$i]->courseID; $model->subsectionID = $data[$i]->subsectionid; $model->sectionID = $data[$i]->sectionid; $model->year = $data[$i]->year; $model->scheduleID = $lastId; $model->save(); } $okay = $transaction->commit(); echo "Your schedule has been saved under ID# " . $lastId; } catch (\Exception $e) { $transaction->rollBack(); throw $e; } }
$user = User::find_by_id($_SESSION['user_id']); //Get user's inbox... $sql = "select * from receivers where user_id=" . $_SESSION['user_id'] . " order by message_id desc"; $inbox_message_ids = Receiver::find_by_sql($sql); ?> <?php //Count the no. of unread messages... $count = User::count_unread_messages($user->id); ?> <?php //Place existing calendar schedules/events... $schedules = UserSchedule::find_by_sql("select * from user_schedules where user_id=" . $user->id); ?> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="Neon Admin Panel" /> <meta name="author" content="" /> <title>LLSCT | My Calendar</title> <link rel="stylesheet" href="assets/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css"> <link rel="stylesheet" href="assets/css/font-icons/entypo/css/entypo.css">