- Timestamp:
- 01/03/14 09:23:03 (11 years ago)
- Location:
- schedule
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/Scheduling.php
r16982 r17422 1 1 <?php 2 2 include '../include/factdb.php'; 3 include ' ../function/SplitDelete.php';3 include 'control.php'; 4 4 ?> 5 5 <table width="100%" id="TableHolder" > … … 13 13 <td width="141" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Transaction</td> 14 14 </tr> 15 16 15 </table> 17 16 <div id="Data"> 17 <script>addRowClone();</script> 18 18 </div> 19 <table width="100%">20 <tr>21 22 23 <td style="border:0px solid white; color:#37DFB1; font-size:14px;" width="80%" align="center"> </td>24 25 </tr>26 </table> -
schedule/Module/calendar.php
r16926 r17422 58 58 var CAL = Calendar.setup({ 59 59 cont: "cont", 60 // weekNumbers: true,61 60 selectionType: Calendar.SEL_MULTIPLE, 62 61 showTime: 24, 63 //fdow : 1,64 62 dateInfo:getDateInfo 65 // titleFormat: "%B %Y"66 63 }) 67 64 </script> 68 65 </td> 69 70 66 <tr> 71 67 <td> 72 68 <script type="text/javascript"> 73 $(document).ready(function(){ 74 Graph(); 75 }); 76 </script> 77 <script type="text/javascript"> 69 $(document).ready(function(){ 70 Graph(); 71 }); 78 72 var day; 79 73 var year; 80 74 var month; 81 75 CAL.addEventListener("onSelect", function(){ 82 day =this.selection.print("%d").join("\n"); 83 month =this.selection.print("%m").join("\n"); 84 year =this.selection.print("%Y").join("\n"); 85 GetData(); 86 GetDate(); 87 $('#Scheduling').load('Module/Scheduling.php?days='+year+'-'+month+'-'+day); 88 //$.get("function/function.php", {days:year+'-'+month+'-'+day}); 89 //$load("function/function.php?days:year+-'+month+'-'+day); 90 //$.get("function/SplitDelete.php", {days:year+'-'+month+'-'+day}); 91 92 93 //GetDate(); 94 95 96 97 }); 98 99 100 76 day =this.selection.print("%d").join("\n"); 77 month =this.selection.print("%m").join("\n"); 78 year =this.selection.print("%Y").join("\n"); 79 GetData(); 80 GetDate(day,month,year); 81 $('#Scheduling').load('Module/Scheduling.php?days='+year+'-'+month+'-'+day); 82 }); 101 83 </script> 102 84 </td> … … 107 89 </tr> 108 90 </table> 109 110 91 </body> 111 92 </html> -
schedule/Module/link.php
r16982 r17422 1 2 3 4 5 6 7 8 <script src="js/jquery-1.9.1.js"></script> 1 <script src="js/jquery-1.7.1.js"></script> 9 2 <script src="js/jquery-ui-1.10.1.custom.js"></script> 10 3 <link href="css/jquery-ui-1.10.1.custom.css" rel="stylesheet"> -
schedule/Transaction/insert.php
r16926 r17422 1 <?php2 // Build by: khristofer Usman3 //Modified by: Jaypee Tanio 4 // June 14,2013 1 <?php 2 //connect to the mysql 3 $db = mysql_connect('localhost', 'root', '') or die("Could not connect database"); 4 mysql_select_db('sandboxschedule', $db) or die("Could not select database"); 5 5 6 include '../include/factdb.php'; 7 $Time =$_POST['Time']; 8 $SelectedSource = $_POST['Source']; 9 $Date = $_POST['Date']; 10 echo $Date; 11 $SelectedMeasure = $_POST['measure']; 12 $value = $_POST['Data']; 13 $date = $_POST['Date']; 14 echo "<br />"; 15 $n_value = explode(",",$value); 16 $Times = explode(",",$Time); 17 $select = explode(",",$SelectedSource); 18 $measure = explode(",",$SelectedMeasure); 19 $limtex = count(explode(",",$SelectedMeasure)); 20 echo "<br />"; 21 for($i=0;$i<=$limtex-1;$i++) 22 { 23 $n1 = $n_value[$i]; 24 $selectf = $select[$i]; 25 $measuref = $measure[$i]; 26 $dateTime=new DateTime($date." ".$Times[$i]); 27 $parsed_date = $dateTime->format('Y-m-d H:i:s'); 6 7 $GTimes=$_POST['GTime']; 8 $Source=$_POST['Source']; 9 $measure=$_POST['measure']; 10 $data=$_POST['Data']; 11 $Gdates = $_POST['GDate']; 12 $seq = $_POST['seq']; 28 13 29 mysql_query("INSERT INTO schedule VALUES('null','".$parsed_date."','".$UpdateDate."','".$measuref."','','".$n1."','".$selectf."','".$measuref."')"); 30 31 } 14 $date = new DateTime($Gdates.$GTimes); 15 $par=$date->format('Y-m-d H:i:s'); 16 $Timez = new DateTime($GTimes); 17 $part = $Timez->format('H:i:s'); 18 //database query 19 mysql_query("INSERT INTO schedule VALUES('null','".$par."','".$part."','".$seq."','','".$data."','".$Source."','".$measure."')"); 20 32 21 33 22 ?> -
schedule/Transaction/update.php
r16926 r17422 1 2 <?php 3 //Build by: khristofer Usman 4 //Modified by: Jaypee Tanio 5 // June 22,2013 6 include '../include/factdb.php'; 7 $Time =$_POST['Time']; 8 $SelectedSource = $_POST['Source']; 9 $SelectedMeasure = $_POST['measure']; 10 $limtex = count(explode(",",$SelectedSource)); 11 $Upd=$_POST['upd']; 12 $Upt=$_POST['upt']; 13 $value = $_POST['Data']; 14 $date = $_POST['Date']; 15 $n_value = explode(",",$value); 16 $Times = explode(",",$Time); 17 $select = explode(",",$SelectedSource); 18 $measure = explode(",",$SelectedMeasure); 19 //date_default_timezone_set('Asia/Manila'); // Setting up the localTimeZone in asia 20 $UpdateDate=(date('Y-m-d H:i:s')); 1 <?php 2 //connect to the mysql 3 $db = mysql_connect('localhost', 'root', '') or die("Could not connect database"); 4 mysql_select_db('sandboxschedule', $db) or die("Could not select database"); 21 5 22 6 23 $days = Date('Y-m-d',strtotime($date)); 7 $GTimes=$_POST['GTime']; 8 $Source=$_POST['Source']; 9 $measure=$_POST['measure']; 10 $data=$_POST['Data']; 11 $Gdates = $_POST['GDate']; 12 $seq = $_POST['seq']; 13 14 $date = new DateTime($Gdates.$GTimes); 15 $par=$date->format('Y-m-d H:i:s'); 16 $UpdateDate=(date('Y-m-d H:i:s')); 24 17 25 $fetch = mysql_query("SELECT * FROM schedule") or die(mysql_error()); 26 27 while($rows = mysql_fetch_array($fetch)) 28 { 29 $timestamp=strtotime($rows['fStart']); 30 $timestamp2 = date('Y-m-d',$timestamp); 31 $date_time = date('H:i',$timestamp); 32 //$time_new = $date_time->format('H:i:s') 33 if($days == $timestamp2) 34 { 35 36 $delete = mysql_query("DELETE FROM `schedule` WHERE `fStart`='{$rows['fStart']}'"); 18 $days = Date('Y-m-d',strtotime($Gdates)); 19 $cnt = 0; 20 //QUERY TO DELETE THE TABLE INSIDE THE DATABASE 21 //$fetch = mysql_query("SELECT * FROM schedule WHERE date(fStart)='$days'") or die(mysql_error()); 22 //while($rows = mysql_fetch_array($fetch)){ 23 //$update=mysql_query("UPDATE schedule SET `fStart`='$par',`fLastUpdate`='$UpdateDate',`fMeasurementID`='$seq',`fData`='$data',`fSourceKey`='$Source',`fMeasurementTypeKey`='$measure' WHERE fScheduleID = '".$rows['fSchecduleID']."' "); 24 25 //mysql_query("DELETE FROM schedule WHERE date(fStart)='".$rows['fStart']."'"); 26 mysql_query("INSERT INTO schedule VALUES('null','".$par."','".$UpdateDate."','".$seq."','','".$data."','".$Source."','".$measure."')"); 27 //} 37 28 38 } 39 } 40 41 42 for($i=0;$i<=$limtex-1;$i++) 43 { 44 $select = explode(",",$SelectedSource); 45 $n1 = $n_value[$i]; 46 $selectf = $select[$i]; 47 $measuref = $measure[$i]; 48 $dateTime=new DateTime($date." ".$Times[$i]); 49 $parsed_date = $dateTime->format('Y-m-d H:i:s'); 29 30 //$delete = mysql_query("DELETE FROM `schedule` WHERE `fStart`='{$rows['fStart']}'"); 31 //database query 50 32 51 mysql_query("INSERT INTO schedule VALUES('null','".$parsed_date."','".$UpdateDate."','".$measuref."','','".$n1."','".$selectf."','".$measuref."')");52 53 }54 33 ?> -
schedule/authenticate/body.php
r16982 r17422 1 <?php2 3 ini_set('error_reporting', E_ALL | E_STRICT);4 ini_set('display_errors', 'Off');5 include 'function/sourcelist.php';6 7 //include 'function/function.php';8 ?>9 10 11 12 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 13 2 <html xmlns="http://www.w3.org/1999/xhtml"> … … 17 6 <meta name="keywords" content="" /> 18 7 <meta name="description" content="" /> 19 <script src="js/function.js"></script> 20 <link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" /> 8 <script src="js/function.js"></script> 9 <?php include 'Module/control.php'; ?> 10 <link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" /> 21 11 </head> 22 12 <body style="background-color: #000;"> … … 24 14 <div id="wrapper1"> 25 15 <div id="header2"> 26 <ul> 27 <li><a href="http://www.fact-project.org">FACT <li2>OBSERVATION SCHEDULING</li2></a></li> 28 </ul> 16 <ul><li><a href="http://www.fact-project.org">FACT <li2>OBSERVATION SCHEDULING</li2></a></li></ul> 29 17 <div class="clear"></div> 30 18 </div> 31 19 <div id="content_bg_top"></div> 32 <div id="content_box"> 33 34 <br /> 20 <div id="content_box"> 35 21 <div id="column_box"> 36 22 <div id="column1"> 37 38 <div id="calendar" align="center"> 39 40 <?php require_once 'Module/calendar.php'; ?> 41 </div> 42 <br/> 43 <div width="100px"> 44 <!-- AKI --> 45 <?php 46 include 'search.php'; 47 ?> 48 49 <br /> 50 </div> 51 </div> 23 <div id="calendar" align="center"><?php require_once 'Module/calendar.php'; ?></div> 24 <div><?php include 'search/search.php'; ?></div> 25 </div> 52 26 <div id="column3"> 53 27 <div id="Graph" style="height: 400px"></div> 54 55 28 </div> 56 29 <div class="clear"> 57 30 </div> 58 31 </div> 59 60 32 <div style="width:100%;" align="right" id='btn'> 61 <?php include 'function/button.php'; ?> 33 <input type="button" id="save" value="SAVE" class="button" title="Click to save"> 34 <input type="button" id="LoadPrev" value="Load Previous Night" class="button" title="Click to load previous night"> 62 35 </div> 63 <div style="border:2px solid white; width:100%;" id="Scheduling"> 64 36 <div style="border:2px solid white; width:100%;" id="Scheduling"> 65 37 <table width="100%" id="TableHolder" > 66 67 38 <tr> 68 39 <td width="184" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Time</td> 69 70 40 <td width="170" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Measurement</td> 71 <td width="1 85" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Source list</td>72 <td width=" 290" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Value</td>41 <td width="145" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Source list</td> 42 <td width="316" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Value</td> 73 43 <td width="141" style="border:1px solid white; color:#37DFB1; font-size:14px;" align="center" >Transaction</td> 74 44 </tr> 75 76 77 </table> 78 <?php 79 include 'function/SplitDelete.php'; 80 ?> 81 82 <div id="Data"> 83 </div> 84 85 </div> 86 87 88 <div id="footer_bot"> 89 <p>© 2012 FACT Project Design by i-SoftTech</p> 90 <p>Western Mindanao State University (<strong><a href="http://www.wmsu.edu.ph">WMSU</a>,Philippines</strong>)</p> 45 </table> 46 <div id="Data"><script>addRowClone();</script></div> 47 </div> 48 <div id="footer_bot"> 49 <p>© 2012 FACT Project Design by i-SoftTech</p> 50 <p>Western Mindanao State University (<strong><a href="http://www.wmsu.edu.ph">WMSU</a>,Philippines</strong>)</p> 91 51 </div> 92 </div> 93 <div id="data"></div> 94 <div id="day"></div> 95 96 52 </div> 53 <div id="data"></div> 54 <div id="day"></div> 97 55 </div> 98 99 56 </body> 100 57 </html> -
schedule/css/styles.css
r16926 r17422 46 46 font-weight: normal; 47 47 color: #0870d7; 48 49 } 50 51 h3{48 padding: 30px 0px 10px 40px; 49 } 50 51 /*h3{ 52 52 background: url(../images/title.png) no-repeat top left; 53 53 font: 18px Arial, Helvetica, sans-serif; … … 59 59 font-weight: normal; 60 60 61 } 61 }*/ 62 62 63 63 body{ … … 345 345 } 346 346 347 348 /*=================================*/349 /* Nivo Slider Demo350 /* November 2010351 /* By: Gilbert Pellegrom352 /* http://dev7studios.com353 /*=================================*/354 355 356 #slider-wrapper {357 width: 876px;358 height: 326px;359 }360 361 #slider {362 position:relative;363 width: 876px;364 height: 326px;365 background:url(../images/loading.gif) no-repeat 50% 50%;366 }367 #slider img {368 position:absolute;369 top:0px;370 left:0px;371 display:none;372 }373 #slider a {374 border:0;375 display:block;376 }377 378 .nivo-controlNav {379 position:absolute;380 left:260px;381 bottom:-42px;382 display: none;383 }384 .nivo-controlNav a.active {385 background-position:0 -22px;386 }387 388 .nivo-directionNav a {389 display:block;390 width:30px;391 height:30px;392 background:url(../images/arrows.png) no-repeat;393 text-indent:-9999px;394 border:0;395 }396 a.nivo-nextNav {397 background-position:-30px 0;398 right:15px;399 }400 a.nivo-prevNav {401 left:15px;402 }403 404 .nivo-caption {405 text-shadow:none;406 font-family: Helvetica, Arial, sans-serif;407 }408 .nivo-caption a {409 color:#efe9d1;410 text-decoration:underline;411 }412 347 .button { 413 348 cursor:pointer; -
schedule/include/factdb.php
r16689 r17422 2 2 3 3 4 //$con=mysql_connect("localhost","root","");5 $con=mysql_connect("localhost","scheduletest","t3stsched");4 $con=mysql_connect("localhost","root",""); 5 //$con=mysql_connect("localhost","scheduletest","t3stsched"); 6 6 mysql_select_db("sandboxschedule",$con); 7 7 ?> -
schedule/index.php
r16926 r17422 1 1 <?php 2 3 2 include 'Module/link.php'; 4 3 include 'include/factdb.php'; -
schedule/js/function.js
r16933 r17422 2 2 // June 16, 2013 3 3 4 function GetDate( )4 function GetDate(d,m,y) 5 5 { 6 $('#save').click(function(){ 7 var Time = []; 8 var Data = []; 9 var Source = []; 10 var Measure = []; 11 var Table = []; 12 $('#TableHolder table').each(function(){ // call all the id of the table inside div#TableHolder 13 id=$(this).attr('id'); //Getting all id's 14 Time.push('#'+id+' input#Time'); // Storing id's of each element 15 Data.push('#'+id+' input#txtData'); 16 Source.push('#'+id+' select#source :selected'); 17 Measure.push('#'+id+' select#measurement :selected'); 18 Table.push(id); 19 }); 20 GetSaveData(Time,Data,Source,Measure,Table); // Function call of saving the data 21 }); 22 }; 6 $('document').ready(function(){ 7 /*var currentdate = new Date(); 8 var datetime = currentdate.getFullYear()+ "-"+(currentdate.getMonth()+1) 9 + "-" + (currentdate.getDay()+1); /* + " @ " 10 + currentdate.getHours() + ":" 11 + currentdate.getMinutes() + ":" + currentdate.getSeconds(); */ 12 var Gdate = y+'-'+m+'-'+d; 13 //alert(Gdate); 14 $('#save').click(function(){ 15 if($('#save').val()=='SAVE') 16 { 17 $('.datalisting').each(function(){ 18 var get_seq = 0; 19 get_time = $(this).find(".time").val(); 20 countchild = $(this).find(".tr").length; 21 $(this).find(".tr").each(function(){ 22 23 get_measure = $(this).find(".measure").val(); 24 get_source = $(this).find(".source").val(); 25 get_selected = $(this).find(".selected").val(); 26 GetSaveData(get_time, get_selected, get_source, get_measure, Gdate,get_seq); 27 get_seq++; 28 }); 29 }); 30 } 31 else 32 { 33 GetDelete(Gdate); 34 $('.datalisting').each(function(){ 35 var get_seq = 0; 36 get_time = $(this).find(".time").val(); 37 countchild = $(this).find(".tr").length; 38 $(this).find(".tr").each(function(){ 39 40 get_measure = $(this).find(".measure").val(); 41 get_source = $(this).find(".source").val(); 42 get_selected = $(this).find(".selected").val(); 43 GetUpdateData(get_time, get_selected, get_source, get_measure, Gdate,get_seq); 44 get_seq++; 45 }); 46 }); 47 } 48 }); 23 49 24 50 25 function GetSaveData(Time,Data,Source,Measure,Table){26 var checks=0;27 TimeSave = [];28 DataSave = [];29 SourceSave = [];30 MeasureSave = [];31 for(i=0;i<Table.length;i++)32 {33 $(Time[i]).each(function(){34 TimeSave.push($(this).val()); // extracting each data into a value35 });36 $(Data[i]).each(function(){37 DataSave.push($(this).val()); // extracting each data into a value38 });39 $(Source[i]).each(function(){40 SourceSave.push($(this).val()); // extracting each data into a value41 });42 $(Measure[i]).each(function(){43 MeasureSave.push($(this).val()); // extracting each data into a value44 });45 }46 if($('#save').val()=='UPDATE')47 {48 if(checks == 0)49 {50 $.ajax({51 type: "POST",52 cache: false,53 url: "Transaction/update.php",54 data: "Time="+TimeSave+'&Source='+SourceSave+'&measure='+MeasureSave+'&Data='+DataSave+'&Date='+year+'-'+month+'-'+day, //posting the data to save55 success: function(data) {56 57 alert('Successfully Updated ! '+year+'-'+month+'-'+day);58 59 }60 });61 }62 else63 {64 51 65 alert("Please fill all the details!"); 66 } 67 } 68 else 69 { 70 if(checks == 0) 71 { 52 function GetSaveData(Time,Data,Source,Measure,date,seq){ 53 //alert("Time:"+Time+" | Measure:"+Measure +" | Source:"+Source+" | Data:"+Data); 72 54 $.ajax({ 73 55 type: "POST", 74 56 cache: false, 75 57 url: "Transaction/insert.php", 76 data: " Time="+TimeSave+'&Source='+SourceSave+'&measure='+MeasureSave+'&Data='+DataSave+'&Date='+year+'-'+month+'-'+day, //posting the data to save58 data: "GTime="+Time+'&Source='+Source+'&measure='+Measure+'&Data='+Data+'&GDate='+date+'&seq='+seq, //posting the data to save 77 59 success: function(data) { 78 79 alert('Successfully added ! '+year+'-'+month+'-'+day);60 alert('Successfully added ! '+date); 61 //$("#Data").append("Ok"+date); 80 62 81 63 } 82 64 }); 83 } 84 else 85 { 86 87 alert("Please fill all the details!"); 88 } 89 90 } 91 65 }; 66 function GetDelete(date){ 67 //alert('del'); 68 $.ajax({ 69 type:"POST", 70 cache:false, 71 url:"Transaction/delete.php", 72 data:"Gdate="+date, 73 success:function(data){ 74 75 } 76 }); 77 }; 78 function GetUpdateData(Time,Data,Source,Measure,date,seq){ 79 //alert("Time:"+Time+" | Measure:"+Measure +" | Source:"+Source+" | Data:"+Data); 80 $.ajax({ 81 type: "POST", 82 cache: false, 83 url: "Transaction/update.php", 84 data: "GTime="+Time+'&Source='+Source+'&measure='+Measure+'&Data='+Data+'&GDate='+date+'&seq='+seq, //posting the data to save 85 success: function(data) { 86 alert('Successfully added ! '+date); 87 //$("#Data").append("Ok"+date); 88 89 } 90 }); 91 }; 92 }); 92 93 };
Note:
See TracChangeset
for help on using the changeset viewer.