示例#1
0
function listCalendarByRange($sd, $ed)
{
    $ret = array();
    $ret['events'] = array();
    $ret["issort"] = true;
    $ret["start"] = php2JsTime($sd);
    $ret["end"] = php2JsTime($ed);
    $ret['error'] = null;
    try {
        $db = new DBConnection();
        $db->getConnection();
        $sql = "select * from `jqcalendar` where `starttime` between '" . php2MySqlTime($sd) . "' and '" . php2MySqlTime($ed) . "'";
        $handle = mysql_query($sql);
        //echo $sql;
        while ($row = mysql_fetch_object($handle)) {
            //$ret['events'][] = $row;
            //$attends = $row->AttendeeNames;
            //if($row->OtherAttendee){
            //  $attends .= $row->OtherAttendee;
            //}
            //echo $row->StartTime;
            $ret['events'][] = array($row->Id, $row->Subject, php2JsTime(mySql2PhpTime($row->StartTime)), php2JsTime(mySql2PhpTime($row->EndTime)), $row->IsAllDayEvent, 0, 0, $row->Color, 1, $row->Location, '');
        }
    } catch (Exception $e) {
        $ret['error'] = $e->getMessage();
    }
    return $ret;
}
示例#2
0
function listCalendarByRange($sd, $ed)
{
    $ret = array();
    $ret['events'] = array();
    $ret["issort"] = true;
    $ret["start"] = php2JsTime($sd);
    $ret["end"] = php2JsTime($ed);
    $ret['error'] = null;
    try {
        $db = new DBConnection();
        $db->getConnection();
        //$sql = "select * from `ak_jadwal` where id_kelas='".$_POST['id_kelas']."' AND `starttime` between '" .php2MySqlTime($sd)."' and '". php2MySqlTime($ed)."'";
        $sql = "\r\n\tSELECT aj . *\r\n\tFROM `ak_mengajar` am\r\n\tJOIN ak_jadwal aj\r\n\tJOIN ak_pelajaran ap\r\n\tON ap.id = am.id_pelajaran\r\n\tAND aj.id_mengajar=am.id\r\n\tWHERE aj.id_kelas='" . $_POST['id_kelas'] . "' \r\n\tAND ap.semester='" . $_POST['semester'] . "' \r\n\tAND aj.`starttime` between '" . php2MySqlTime($sd) . "' \r\n\tAND '" . php2MySqlTime($ed) . "'";
        $handle = mysql_query($sql);
        //echo $sql;
        while ($row = mysql_fetch_object($handle)) {
            //$ret['events'][] = $row;
            //$attends = $row->AttendeeNames;
            //if($row->OtherAttendee){
            //  $attends .= $row->OtherAttendee;
            //}
            //echo $row->StartTime;
            $ret['events'][] = array($row->Id, $row->Subject, php2JsTime(mySql2PhpTime($row->StartTime)), php2JsTime(mySql2PhpTime($row->EndTime)), $row->IsAllDayEvent, 0, 0, $row->Color, 1, $row->Location, '');
        }
    } catch (Exception $e) {
        $ret['error'] = $e->getMessage();
    }
    return $ret;
}
示例#3
0
function listCalendarByRange($sd, $ed)
{
    global $sqlcn, $uidview;
    $ret = array();
    $ret['events'] = array();
    $ret["issort"] = true;
    $ret["start"] = php2JsTime($sd);
    $ret["end"] = php2JsTime($ed);
    $ret['error'] = null;
    try {
        $sql = "select * from jqcalendar where uidview=" . $uidview . " and `starttime` between '" . php2MySqlTime($sd) . "' and '" . php2MySqlTime($ed) . "'";
        //$handle = mysql_query($sql);
        //echo "!$sql!";
        $handle = $sqlcn->ExecuteSQL($sql) or die("Не могу сделать выборку событий из календаря!" . mysqli_error($sqlcn->idsqlconnection));
        while ($row = mysqli_fetch_array($handle)) {
            //$ret['events'][] = $row;
            //$attends = $row->AttendeeNames;
            //if($row->OtherAttendee){
            //  $attends .= $row->OtherAttendee;
            //}
            //echo $row->StartTime;
            $ret['events'][] = array($row["Id"], $row["Subject"], php2JsTime(mySql2PhpTime($row["StartTime"])), php2JsTime(mySql2PhpTime($row["EndTime"])), $row["IsAllDayEvent"], 0, 0, $row["Color"], 1, $row["Location"], '');
        }
    } catch (Exception $e) {
        $ret['error'] = $e->getMessage();
    }
    return $ret;
}
示例#4
0
文件: datafeed.php 项目: ranvirp/rdp
function listCalendarByRange($sd, $ed)
{
    $ret = array();
    $ret['events'] = array();
    $ret["issort"] = true;
    $ret["start"] = php2JsTime($sd);
    $ret["end"] = php2JsTime($ed);
    $ret['error'] = null;
    try {
        $events = Events::model()->findAllByAttributes(array(), 'starttime between :sd AND   :ed', array(':sd' => php2MySqlTime($sd), ':ed' => php2MySqlTime($ed)));
        //echo $sql;
        foreach ($events as $event) {
            $ret['events'][] = array($event->id, $event->title, php2JsTime(mySql2PhpTime($event->starttime)), php2JsTime(mySql2PhpTime($event->endtime)), $event->isalldayevent, 0, 0, $event->color, 1, $event->location, '');
        }
    } catch (Exception $e) {
        $ret['error'] = $e->getMessage();
    }
    return $ret;
}
示例#5
0
echo isset($_GET['id_sekolah']) ? $_GET['id_sekolah'] : "0";
?>
" />                
            <input id="colorvalue" name="colorvalue" type="hidden" value="<?php 
echo isset($event) ? $event->Color : "";
?>
" />                
          </label>                 
          <label>                    
            <span>*Waktu:
            </span>                    
            <div>  
              <?php 
if (isset($event)) {
    $sarr = explode(" ", php2JsTime(mySql2PhpTime($event->StartTime)));
    $earr = explode(" ", php2JsTime(mySql2PhpTime($event->EndTime)));
}
?>
                    
              <input MaxLength="10" class="required date" id="stpartdate" name="stpartdate" style="padding-left:2px;width:90px;" type="text" value="<?php 
echo isset($event) ? $sarr[0] : "";
?>
" />                       
              <input MaxLength="5" class="required time" id="stparttime" name="stparttime" style="width:40px;" type="text" value="<?php 
echo isset($event) ? $sarr[1] : "";
?>
" />To                       
              <input MaxLength="10" class="required date" id="etpartdate" name="etpartdate" style="padding-left:2px;width:90px;" type="text" value="<?php 
echo isset($event) ? $earr[0] : "";
?>
" />                       
示例#6
0
echo isset($event) ? $event["Subject"] : "";
?>
" />                     
            <input id="colorvalue" name="colorvalue" type="hidden" value="<?php 
echo isset($event) ? $event["Color"] : "";
?>
" />                
          </label>                 
          <label>                    
            <span>*Time:
            </span>                    
            <div>  
              <?php 
if (isset($event)) {
    $sarr = explode(" ", php2JsTime(mySql2PhpTime($event["StartTime"])));
    $earr = explode(" ", php2JsTime(mySql2PhpTime($event["EndTime"])));
}
?>
                    
              <input MaxLength="10" class="required date" id="stpartdate" name="stpartdate" style="padding-left:2px;width:90px;" type="text" value="<?php 
echo isset($event) ? $sarr[0] : "";
?>
" />                       
              <input MaxLength="5" class="required time" id="stparttime" name="stparttime" style="width:40px;" type="text" value="<?php 
echo isset($event) ? $sarr[1] : "";
?>
" />To                       
              <input MaxLength="10" class="required date" id="etpartdate" name="etpartdate" style="padding-left:2px;width:90px;" type="text" value="<?php 
echo isset($event) ? $earr[0] : "";
?>
" />