Example #1
0
/**
* 保存 字体
* @param array $font 字体列表
* @param string $savePath 保存字体路径
* @param string $saveFontListFile 保存字体列表路径
*/
function SaveFont($font, $savePath, $saveFontListFile)
{
    $path = $font['path'];
    $save = GetName($path);
    SaveData($savePath . $save, GetData($path));
    SaveFontList($saveFontListFile, $save . '=' . $font['name']);
}
Example #2
0
 private function Script() {
     $script = array();
     if ($executeOnDomReady) {
         $script[] = 'jQuery(function(){';
     }
     $prefix ='#';
     $script[] = 'jQuery("'.$prefix;
     $script[] = $this.$ID;
     $script[] = '").';
     $script[] = $this.GetName();
     $script[] = '(';
     $script[] = '{}';
     $script[] = ');';
     return implode($script);
 }
Example #3
0
    if (mysql_num_rows($query_result) < 1) {
        echo "Pub #{$idx} does not exist\n";
        PAGEFOOTER();
        return;
    }
    $r = mysql_fetch_assoc($query_result);
    if (!MayEditPub($this_user, $isadmin, $r)) {
        echo "You Do Not Have Permission to Edit this Publication Submission\n";
        PAGEFOOTER();
        return;
    }
    $defaults = $r;
    if ($isadmin && !isset($submit)) {
        GetName('submitted_by');
        GetName('owner', 'submitted_by');
        GetName('last_edit_by', 'submitted_by');
        if ($defaults['created'] == $defaults['last_edit']) {
            unset($fields['last_edit']);
        }
    }
    $fields['submit'] = array('#type' => 'submit', '#value' => "Update");
} else {
    if (!$isadmin) {
        $defaults['project'] = $projectlist[0];
    }
    $defaults['visible'] = true;
    $defaults['editable_owner'] = true;
    $defaults['editable_proj'] = true;
    #$defaults['ownership'] = false;
    $fields['submit'] = array('#type' => 'submit', '#value' => "Submit");
}
 }
 // Get the dates we'll be working with
 $dates = GetQuarterDates($currentyear);
 // Format them in a way I can inject back into SQL (Has the added bonus of making the dates readable by humans)
 for ($i = 0; $i < 4; $i++) {
     $date[$i] = date("Y-m-d", strtotime($dates[$i]));
 }
 // Now generate a table of name|netid|points
 //echo "<table cellpadding=2>";
 //echo "<tr> <td> Name </td> <td> NetID </td> <td> Fall </td> <td> Winter </td> <td> Spring </td> <td> Total </td> </tr>";
 // even if you're familiar with programming, this may be a new one, but it's easy to understand:
 // this iterates along $netids; during each iteration, the current selected netid can be referenced
 // by $netid. This is unset() at the end to prevent any awkward issues of $netid existing outside the loop
 foreach ($netids as $netid) {
     // get a name
     $name = GetName($netid, $date[0], $date[3]);
     // check if the name is valid
     // this is dependent on the points period defined by GetName($netid, $date[0], $date[3]) above
     if ($name == 'INVALID_NETID') {
         continue;
     }
     // this will accumulate a total for the year
     $sum = 0;
     // get fall points
     $record = GetPointsByPeriod($netid, $date[0], $date[1]);
     $fallpoints = $record['total'];
     $sum += $fallpoints;
     // get winter points
     $record = GetPointsByPeriod($netid, $date[1], $date[2]);
     $winterpoints = $record['total'];
     $sum += $winterpoints;
Example #5
0
     $pwd = $_REQUEST['pwd'];
     $action = $_REQUEST['action'];
     $check = CheckPassword($person_id, $pwd);
     switch ($action) {
         case '1':
             if (CheckHere($person_id)) {
                 WorkerStart($person_id);
             } else {
                 $error = "შეცდომა: " . GetName($person_id) . "  უკვე არის აღრიცხული";
             }
             break;
         case '2':
             if (!CheckHere($person_id)) {
                 WorkerEnd($person_id);
             } else {
                 $error = "შეცდომა: " . GetName($person_id) . "  არ  არის აღრიცხული";
             }
             break;
         case '3':
             GoTimeOut($person_id);
             break;
         case '4':
             BackTimeOut($person_id);
             break;
         default:
             break;
     }
     break;
 case 'get_balance':
     $page = GetBalance();
     $data = array('page' => $page);
-->
<?php 
session_start();
// We'll keep some variables across pages
include_once 'header.php';
// header info (CSS, etc) is consistent. This will make updating style easier. I think.
include_once 'GetPoints.php';
// Functions used to collect points information
?>
<body>
<div id="container">
<h1> Chapin Hall Points - View Points </h1>

<?php 
$netid = strtolower(sanitize_input($_POST['netid']));
$name = GetName($netid);
// This returns 'INVALID_NETID' if it fails to find a single record
if ($name != 'INVALID_NETID') {
    $currentmonth = date('n');
    // n is format symbol for numerical month, no leading zeros
    $currentyear = date('Y');
    // Y is format symbol for numerical year, 4 digits
    // if it's July or later, we can assume it's fall quarter, and the year is correct.
    // If it's earlier than that, it's winter or spring, and the current year is not
    // the same as the school year as held by the database (That is defined as the year of fall quarter)
    // (See 'AdminSetDates.php for clarification if this doesn't make sense)
    if ($currentmonth <= 7) {
        $currentyear--;
        // the year of fall quarter was the numerical year before 'now'
    }
    // Get the dates we'll be working with
Example #7
0
if (isset($pageno)) {
    $pageno = intval(preg_replace("/[^\\d]/", '', $pageno));
}
//当前页
if ($tid == '7') {
    $sql = "select * from #@__leave where reply is null and approval='1' order by addtime desc";
} else {
    if ($tid == '8') {
        $sql = "select * from #@__leave where reply is not null and approval='1' order by addtime desc";
    } else {
        $sql = "select * from #@__leave where typeid='{$tid}' and approval='1' order by addtime desc";
    }
}
$pv = new ListView($typeid);
$pv->listGetChannelKeywords($typeid);
//根据栏目类型获取关键词.介绍,栏目名称
$pv->Fields['name'] = GetName($tid);
$pv->pagesize = 30;
//分页条数.
$pv->SetSql($sql);
//注意以下这两句与伪静态规则有关系,不能写反了.
$pv->SetParameter('tid', $tid);
$pv->SetTemplet(SLINETEMPLATE . "/" . $cfg_df_style . "/" . "questions/" . "list.htm");
$pv->Display();
function GetName($typeid)
{
    global $dsql;
    $sql = "select shortname from #@__nav where webid='0' and isopen='1' and typeid='{$typeid}'";
    $row = $dsql->GetOne($sql);
    return $row['shortname'];
}
// Sample:
// Flatten all form fields in a document.
// Note that this sample is intended to show that it is possible to flatten
// individual fields. PDFNet provides a utility function PDFDoc.FlattenAnnotations()
// that will automatically flatten all fields.
//----------------------------------------------------------------------------------
$doc = new PDFDoc($output_path . "forms_test1.pdf");
$doc->InitSecurityHandler();
// Traverse all pages
if (true) {
    $doc->FlattenAnnotations();
} else {
    for ($pitr = $doc->GetPageIterator(); $pitr->HasNext(); $pitr->Next()) {
        $page = $pitr->Current();
        $annots = $page->GetAnnots();
        if ($annots) {
            // Look for all widget annotations (in reverse order)
            for ($i = $annots->Size() - 1; $i >= 0; --$i) {
                if (!strcmp(annots . GetAt(i) . Get("Subtype") . Value() . GetName(), "Widget")) {
                    $field($annots->GetAt(i));
                    $field->Flatten($page);
                    // Another way of making a read only field is by modifying
                    // field's e_read_only flag:
                    //    field.SetFlag(Field::e_read_only, true);
                }
            }
        }
    }
}
$doc->Save($output_path . "forms_test1_flattened.pdf", 0);
echo nl2br("Done.\n");