コード例 #1
0
<?
include ('../hours.class.php');
include ('admin.class.php');
$hours = new Hours;
$admin = new HoursAdmin;
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
    case 'show-timeframe':
        $details = $hours->GetTimeframeDetails($_REQUEST['timeframe_id']);
        print ($admin->EditTimeframeDetails($details,$hours,$_REQUEST['id']));
        break;
    case 'new-timeframe':
        print ($admin->EditTimeframeDetails($details,$hours,$_REQUEST['id']));
        break;
    case 'show-preset':
        if ($_REQUEST['id'] == 'new') {
            $details = $hours->GetSettingsDetails($_REQUEST['id']);
            print ($admin->ShowPresetDetails($details, $_REQUEST['id'],"edit"));
        }
        //      $details = $hours->GetTimeframeDetails($_REQUEST['id']);
        else {
            $details = $hours->GetSettingsDetails($_REQUEST['id']);
            print ($admin->ShowPresetDetails($details, $_REQUEST['id'],"show"));
        }
        break;

    case 'edit-preset':
        $details = $hours->GetSettingsDetails($_REQUEST['id']);
        print ($admin->ShowPresetDetails($details, $_REQUEST['id'],"edit"));
    }
}
コード例 #2
0
               }
               else {
                   $('#toggle-wrapper').click(function() {
                       $('.debug').toggle();
                   });
               }
           });
</script>
</head>
<body id="edit">
<?
include ("../hours.class.php");
include ("admin.class.php");
include ("nav.php");

$hours = new Hours();
$admin = new HoursAdmin(); 

if (is_array($_REQUEST['action'])) {
    if (in_array('delete_timeframe',$_REQUEST['action'])) {
        if ($hours->DeleteTimeframe($_REQUEST['timeframe_id'])) {
            print '<h2>Success: Timeframe deleted</h2>';
        }
        else {
            print '<h2 class="error">Error: Could not delete timeframe</h2>';
        }
    }
    else {
        $preset_id = '';
        if (in_array('submit_new_preset', $_REQUEST['action'])) {
            $preset_id = $hours->UpdatePreset(json_encode($_REQUEST));
コード例 #3
0
            //Delete selected 
            $('#DeleteSelectedButton').button().click(function () {
                var $selectedRows = $('#ExceptionsTableContainer').jtable('selectedRows');
                $('#ExceptionsTableContainer').jtable('deleteRows', $selectedRows);
            });

		});

	</script>

<div id="DeleteSelectedButton">Delete Selected Rows</div>

     <?
     require_once('admin.class.php');
require_once('../hours.class.php');
$hours = new Hours();
$admin = new HoursAdmin();
$times = $hours->GetTimeframesAndRanks();
$exceptions = $hours->getJSON('exceptions');
$graphJS = $admin->BuildGraphJS($times,$exceptions);
print $graphJS;
?>
<h2 style="text-align:center">Timeline of Date Settings by Rank</h2>
<div class="flot-container">
	<div id="placeholder" class="flot-placeholder"></div>
</div>

  </body>
</html>
コード例 #4
0
<?
include ("hours.class.php");

if (is_array($argv)) { Argv2Request($argv); }
if (isset($_REQUEST['format'])) {
    $format = $_REQUEST['format'];
}
else { $format = "text"; }

if ($format == "xmlIthaca") {
    header("Content-type: text/plain");
    print '<?xml version="1.0"?>'.PHP_EOL;
    print '<hours xsi:noNamespaceSchemaLocation="libraryHours.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'.PHP_EOL;
}

$libHours = new Hours;

switch ($_REQUEST['action']) {
case "getlist":
    print ($libHours->ListDailyHours($format,$_REQUEST));
    break;
case "oneday":
    if ($_REQUEST['date']) { 
        $date = date("Y-m-d",strtotime($_REQUEST['date']));
    }
    else { $date = date("Y-m-d"); }
    print ($libHours->GetHoursByDate($date,$format));
    break;
default: 
    include ("gen_form.php");
    break;
コード例 #5
0
ファイル: hours.php プロジェクト: xuyintao/thindev
 public function verify()
 {
     $res = array();
     $res['Success'] = false;
     if ($this->Action > 1) {
         //不通过,删除操作
         $hours = new Hours();
         $hours->Id = $this->Id;
         $result = $hours->delete();
         if ($result > 0) {
             $res['Success'] = true;
             $res['Message'] = "删除成功";
         } else {
             $res['Message'] = "删除失败";
         }
     } else {
         //通过,计入项目总工时
         $hours = new Hours();
         $hours->Id = $this->Id;
         $hours->Ratio = $this->Ratio;
         $hours->Hours2 = $this->Hours2;
         $result = $hours->update();
         if ($result > 0) {
             //审核成功
             $project = new Project();
             $project->setValue($this->ProjectId);
             $project->Hours = $project->Hours + $hours->Hours2;
             $project->update();
             $res['Success'] = true;
             $res['Message'] = "审核通过";
             $res['NewId'] = $this->Id;
         } else {
             $res['Success'] = false;
             $res['Message'] = "审核失败";
         }
     }
     echo json_encode($res);
     exit;
 }
コード例 #6
0
<?
require_once('../hours.class.php');
$hours = new Hours();
switch($_REQUEST['action']) {
case 'list':
    print ($hours->ExceptionsList());
    break;
case 'create':
    print ($hours->ExceptionsCreate($_REQUEST));
    break;
case 'update':
    print ($hours->ExceptionsUpdate($_REQUEST));
    break;
case 'delete':
    print ($hours->ExceptionsDelete($_REQUEST));
    break;
}
?>