Ejemplo n.º 1
0
 public function home($year = null, $month = null)
 {
     $kalendar = new Calendar();
     $this->view->kalendar = $kalendar->show($year, $month);
     $this->view->aksi = 'kalendar';
     $this->view->render('wekdal/kalendar');
 }
Ejemplo n.º 2
0
                                        <div class="col-sm-7 col-xs-12">
                                    		<div class="calendar" id="calendar_training">
						    <?php 
$calendar = new Calendar();
$year = date("Y");
$month = date("m");
$where_meal = array('client_id' => $user_details[0]['id'], 'MONTH(workout_date)' => $month, 'YEAR(workout_date)' => $year);
$user_progrm = $ci->common_model->get('user_program_exercises', array('*'), $where_meal);
$all_dates = array();
$date_val = array();
foreach ($user_progrm as $programs) {
    $date_val['date_work'] = $programs['workout_date'];
    $date_val['status'] = $programs['status'];
    $all_dates[] = $date_val;
}
echo $calendar->show($year, $month, $all_dates);
$client_id = $user_details[0]['id'];
$where_meal = array('client_id' => $user_details[0]['id'], 'workout_date' => date("Y-m-d"));
$program_info = $ci->common_model->get('user_program_exercises', array('*'), $where_meal);
?>
						</div>
                                    	</div>
                                    </div>
                                    <div class="clearfix ">
                                    	<div class="col-xs-12">
					    <input type="hidden" name="date_val_training" id="date_val_training" value="<?php 
echo date('Y-m-d');
?>
">
                                        	<div class="panel-group" id="program_value">
						    <?php 
Ejemplo n.º 3
0
<?php

require_once "app/Calendar.class.php";
$calendar = new Calendar();
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Holidays</title>
  <link rel="stylesheet" type="text/css" href="css/main.css">
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body class="home">

<header class="nav">
  <?php 
echo $calendar->createNavi();
?>
</header>

<?php 
echo $calendar->show();
?>

</body>
</html>
Ejemplo n.º 4
0
<?php

include JPATH_COMPONENT . DS . 'models' . DS . 'calendarJs.php';
// css file is set in, D:\wamp21\www\FleetMatrix_site\modules\mod_jt_menumatic\tmpl\default.php
// css file is located in, D:\wamp21\www\FleetMatrix_site\modules\mod_jt_menumatic\css\calendar.css
include JPATH_COMPONENT . DS . 'models' . DS . 'calendar.php';
$dateToDisplayed = date('Y-m-d', strtotime("-1 days"));
if (isset($_GET['diffDays'])) {
    // check if diffDays is specified within url
    $diffDaysMinusOneDay = (int) $_GET['diffDays'] + 1;
    $dateToDisplayed = date('Y-m-d', strtotime("-" . $diffDaysMinusOneDay . " days"));
}
echo '<div id="calendarIconContainer" >' . '<div id="calendarIconTitle" >' . 'Scores as of ' . $dateToDisplayed . '. To change, press calendar' . '</div>' . '<div id="calendarIconImage" class="calendarIcon">' . '<img class="aCalendarIcon" src="images/Calendar_40.png" >' . '</div>' . '</div>';
$calendar = new Calendar();
echo '<div id="calendarContainer">' . $calendar->show() . '</div>';
Ejemplo n.º 5
0
<?php 
$calendar = new Calendar();
/* if year or month is specified from jquery ajax, invoke show() with the specified value */
if (isset($_POST['year']) && isset($_POST['month'])) {
    // both are specified
    echo $calendar->show($_POST['year'], $_POST['month']);
} elseif (isset($_POST['month'])) {
    // only month is specified
    echo $calendar->show(null, $_POST['month']);
} elseif (isset($_POST['year'])) {
    // only year. Should not happen though
    echo $calendar->show($_POST['year'], null);
}
class Calendar
{
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->naviHref = htmlentities($_SERVER['PHP_SELF']);
    }
    /********************* PROPERTY ********************/
    private $dayLabels = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
    private $currentYear = 0;
    private $currentMonth = 0;
    private $currentDay = 0;
    private $currentDate = null;
    private $daysInMonth = 0;
    private $naviHref = null;
function NK_schools_scheduler()
{
    require_once ROOTDIR . DS . 'function' . DS . 'loadCSS.php';
    global $wpdb;
    ?>
    <div class="container">
    <h2>Plan zajęć</h2>
    <?php 
    if (isset($_POST['delete'])) {
        $id = $_POST['id'];
        $wpdb->query($wpdb->prepare("DELETE FROM school_scheduler WHERE id = %s", $id));
        $message .= "Lekcja usunięta !";
    }
    if (isset($message)) {
        ?>
        <div class="updated">
            <p><?php 
        echo $message;
        ?>
</p>
        </div>
    <?php 
    }
    $rowsSubject = $wpdb->get_results("SELECT id, name from school_subjects");
    $rowsTeachers = $wpdb->get_results("SELECT u.ID as id, user_login as name\n                                        FROM `wp_users` as u\n                                        LEFT JOIN `wp_usermeta` as m \n                                        ON u.ID = m.user_id\n                                        WHERE m.meta_value LIKE '%teacher_role%'");
    $rowsClass = $wpdb->get_results("SELECT id, name from school_class");
    if (isset($_GET['day'])) {
        $day = $_GET['day'];
        $month = $_GET['month'];
        $year = $_GET['year'];
        $date = $year . '-' . $month . '-' . $day;
        $subject = $_POST["subject"];
        $teacher = $_POST["teacher"];
        $class = $_POST["class"];
        $lesson = $_POST["lesson"];
        $class_room = $_POST["class_room"];
        //insert
        if (isset($_POST['insert'])) {
            global $wpdb;
            $wpdb->insert('school_scheduler', array('subject' => $subject, 'teacher' => $teacher, 'class' => $class, 'lesson' => $lesson, 'class_room' => $class_room, 'subject_date' => $date), array('%s', '%s', '%s', '%s'));
            $message .= "Dodano do planu lekcji !";
        }
        ?>

        <form method="post" action="<?php 
        echo $_SERVER['REQUEST_URI'];
        ?>
">
            <div class="form-group">
              <label for="">Przedmiot</label>
              <select name="subject" class="form-control">
              <?php 
        foreach ($rowsSubject as $row) {
            echo '<option value="' . $row->id . '">' . $row->name . '</option>';
        }
        ?>
              </select>
            </div>
            <div class="form-group">
              <label for="">Godzina Lekcyjna</label>
              <select name="lesson" class="form-control">
                <option>1</option>
                <option>2</option>
                <option>3</option>
                <option>4</option>
                <option>5</option>
                <option>6</option>
                <option>7</option>
              </select>
            </div> 
            <div class="form-group">
              <label for="">Nauczyciel</label>
              <select name="teacher" class="form-control">
              <?php 
        foreach ($rowsTeachers as $row) {
            echo '<option value="' . $row->id . '">' . $row->name . '</option>';
        }
        ?>
              </select>    
            </div>
            <div class="form-group">
              <label for="">Klasa</label>
              <select name="class" class="form-control">
              <?php 
        foreach ($rowsClass as $row) {
            echo '<option value="' . $row->id . '">' . $row->name . '</option>';
        }
        ?>
              </select>  
            </div>  
            <div class="form-group">
              <label for="">Klasa Lekcyjna</label>
              <select name="class_room" class="form-control">
                <option>101</option>
                <option>102</option>
                <option>103</option>
              </select>
            </div>   
            <button type="submit" name="insert" class="btn btn-default">Zapisz</button>
          </form>  
        <?php 
        $rowsScheduler = $wpdb->get_results("SELECT sch.id, sub.name as subject, tea.display_name as teacher, cla.name as class, lesson, class_room \n                                            FROM\n                                            school_scheduler as sch \n                                            LEFT JOIN school_class as cla ON sch.class = cla.id \n                                            LEFT JOIN wp_users as tea ON sch.teacher = tea.id\n                                            LEFT JOIN school_subjects as sub ON sch.subject = sub.id \n                                            WHERE subject_date = '{$date}' ORDER BY class ASC");
        ?>
            <table class="table">
                <thead>
                    <tr>
                        <th>Przedmiot</th><th>Nauczyciel</th><th>Klasa</th><th>Godzina lekcyjna</th><th>Klasa Lekcyjna</th><th>Akcje</th>
                    </tr>
                </thead>
                <tbody>
        <?php 
        foreach ($rowsScheduler as $row) {
            echo '<tr>' . '<td>' . $row->subject . '</td>' . '<td>' . $row->teacher . '</td>' . '<td>' . $row->class . '</td>' . '<td>' . $row->lesson . '</td>' . '<td>' . $row->class_room . '</td>';
            ?>
                        <td class="col-md-5">
                            <div class="col-md-3">
                                <a class='btn btn-default' href="<?php 
            echo admin_url('admin.php?page=NK_schools_scheduler_update&id=' . $row->id);
            ?>
">Popraw dane</a>
                            </div>
                            <div class="col-md-2">
                                <form method="post" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
">
                                    <input type="hidden" name="id" hidden="" value="<?php 
            echo $row->id;
            ?>
">
                                   <button type='submit' name='delete' class='btn btn-default' onclick="return confirm('Czy na pewno chcesz usunąc pozycje z listy ?')">
                                   Usuń</button>
                                </form>
                            </div>    
                        </td>   
                    <?php 
            echo '</tr>';
        }
        ?>
        
                </tbody>
            </table>
        <?php 
    } else {
        $calendar = new Calendar();
        echo $calendar->show();
    }
    ?>
    </div>
<?php 
}
    echo "<li>" . "<a href = \"loginform.php\">Login</a></li>";
} else {
    echo "<li class=\"dropdown\">" . "<a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">My Account <span class=\"caret\"></span></a>" . "<ul class=\"dropdown-menu\">" . "<li><a href=\"My_Account/shwple.php\">Show Profile</a></li>" . "<li><a href=\"My_Account/edit.php\">Edit</a></li>" . "<li><a href=\"My_Account/bkinghtry.php\">Booking History</a></li>" . "<li><a href=\"My_Account/logout.php\">Log Out</a></li>" . "</ul>" . "</li>";
}
?>
                </ul>
            </div>
        </div>
    </nav>

    <!--Page Content-->
    <div class = "container">
        <div class="row">
            <div class="col-lg-12 text-center">
                <h2>Upcoming Events</h2>
                <hr class="star-light">
            </div>
        </div>
        <div class = "cal">
			<?php 
include 'Calendar/starTutorial.php';
$cal1 = new Calendar();
echo $cal1->show();
?>
        </div>
	</div>
	
	<script src="dist/js/jquery.min.js"></script>
	<script src="dist/js/bootstrap.min.js"></script>
</body>
</html>
Ejemplo n.º 8
0
<?php

require_once "header.php";
require_once "calendar.php";
$cal = new Calendar();
echo "<div>";
echo $cal->show();
echo "</div>";
echo <<<_EOT
<script>
window.onload = m1;
function m1(){
\tvar dates = document.getElementsByClassName('day');
\tfor(var i=0;i<dates.length;i++){
\t\tdates[i].addEventListener("click",redirectToTask,false);
\t\tdates[i].addEventListener("mouseover",setCursorPointer,false);
\t\tdates[i].addEventListener("mouseout",setCursorDefault,false);
\t\t}
}
function setCursorPointer(){
\tdocument.body.style.cursor = 'pointer';
}

function setCursorDefault(){
\t document.body.style.cursor = 'default';
}

function redirectToTask(event){
location.href = 'task.php?date=' + this.id;
}
</script>