当前位置: 首页>>代码示例>>PHP>>正文


PHP pad函数代码示例

本文整理汇总了PHP中pad函数的典型用法代码示例。如果您正苦于以下问题:PHP pad函数的具体用法?PHP pad怎么用?PHP pad使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pad函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: seconds_to_time

function seconds_to_time($seconds)
{
    $hours = (int) ($seconds / 3600);
    $minutes = (int) (($seconds - $hours * 3600) / 60);
    $seconds = $seconds - $minutes * 60 - $hours * 3600;
    return pad($hours, 2) . ":" . pad($minutes, 2) . ":" . pad($seconds, 2);
}
开发者ID:koad,项目名称:bitvote.github.io,代码行数:7,代码来源:bitvote.php

示例2: log_msg

/**
 *	log a message to file
 *
 *	@param string $level can be error, warn, info or debug
 *	@param string $msg message
 *	@return bool true if successful, false if not
 */
function log_msg($level, $msg)
{
    global $logfile;
    global $loglevels;
    global $request_id;
    // open logfile
    if ($logfile === false) {
        $m = umask(0111);
        // having two processes appending to the same file should
        // work fine (at least on Linux)
        $logfile = @fopen(LOG_FILE, 'ab');
        umask($m);
    }
    if ($logfile === false) {
        return false;
    }
    foreach ($loglevels as $ll) {
        if ($ll == $level) {
            fwrite($logfile, date('Y-m-d H:i:s') . tab() . pad($_SERVER['REMOTE_ADDR'], 15) . tab() . sprintf('%05u', $request_id) . tab() . $level . tab() . $msg . nl());
            fflush($logfile);
            break;
        }
        if ($ll == LOG_LEVEL) {
            break;
        }
    }
    return true;
}
开发者ID:danielfogarty,项目名称:damp,代码行数:35,代码来源:log.inc.php

示例3: printFunc

function printFunc($what, $dif)
{
    $r = realpath(dirname(__FILE__) . "/..");
    echo pad(str_replace($r, "", $what["file"]), 25);
    echo pad($what["line"]);
    echo pad($what["function"] . "(" . implode(", ", $what["args"]) . ") ");
    echo pad(round($dif, 3) . "s", 5);
    echo "\n";
}
开发者ID:primeminister,项目名称:phpjs,代码行数:9,代码来源:Library.php

示例4: pct

 public static function pct($pct, $mod = 1, $pad = 8, $high = 0, $med = 0, $low = 0)
 {
     $num = round($pct * 100, 2);
     $prefix = '';
     $suffix = '';
     if ($num * $mod > $high && $high != 0) {
         $prefix = '<span style="background:black;color:red">';
         $suffix = '</span>';
     } elseif ($num * $mod > $med && $med != 0) {
         $prefix = '<span style="background:black;color:orange">';
         $suffix = '</span>';
     } else {
         if ($num * $mod > $low && $low != 0) {
             $prefix = '<span style="background:black;color:yellow">';
             $suffix = '</span>';
         }
     }
     return $prefix . pad(number_format($num, 2) . '%', $pad) . $suffix;
 }
开发者ID:ArcheonK,项目名称:timings,代码行数:19,代码来源:Util.php

示例5: substr

            $filedata .= $contents;
            $name = substr("{$path}{$obj}", 1);
            $files[$name] = array($offset, strlen($contents));
            unset($contents);
        }
    }
}
add_directory($base);
function pad($fp, $length, $multiple, $mod = 0)
{
    while ($length++ % $multiple != $mod) {
        fwrite($fp, chr(0));
    }
}
echo strlen($filedata) . "\n";
$out = fopen($argv[1], 'wb');
// write 8-byte magic number
fwrite($out, 'THEGAME!');
fwrite($out, pack('N', count($files)));
foreach ($files as $name => $file) {
    fwrite($out, pack('n', strlen($name)));
    fwrite($out, $name);
    fwrite($out, chr(0));
    pad($out, strlen($name) + 1, 4, 2);
    fwrite($out, pack('N', $file[0]));
    fwrite($out, pack('N', $file[1]));
}
pad($out, ftell($out), 16);
fwrite($out, $filedata);
pad($out, strlen($filedata), 4);
开发者ID:prophile,项目名称:xsera,代码行数:30,代码来源:gaf.php

示例6: send_invoice

function send_invoice(&$_employer, $_paid_postings, $_subscription_period)
{
    if (!is_a($_employer, 'Employer')) {
        return false;
    }
    $today = date('Y-m-d');
    $branch = $_employer->getAssociatedBranch();
    $sales = 'sales.' . strtolower($branch[0]['country']) . '@yellowelevator.com';
    $branch[0]['address'] = str_replace(array("\r\n", "\r"), "\n", $branch[0]['address']);
    $branch['address_lines'] = explode("\n", $branch[0]['address']);
    $currency = Currency::getSymbolFromCountryCode($branch[0]['country']);
    if ($_paid_postings > 0) {
        // 0. get the job postings pricing and currency
        $posting_rates = $GLOBALS['postings_rates'];
        $price = $posting_rates[$currency];
        // 1. generate invoice in the system
        $data = array();
        $data['issued_on'] = $today;
        $data['type'] = 'P';
        $data['employer'] = $_POST['id'];
        $data['payable_by'] = sql_date_add($today, $_employer->getPaymentTermsInDays(), 'day');
        $invoice = Invoice::create($data);
        if ($invoice === false) {
            echo 'ko';
            exit;
        }
        $amount = $price * $_paid_postings;
        $desc = $_paid_postings . ' Job Posting(s) @ ' . $currency . ' $' . $price;
        $item_added = Invoice::addItem($invoice, $amount, '1', $desc);
        $items = array();
        $items[0]['itemdesc'] = $desc;
        $items[0]['amount'] = number_format($amount, '2', '.', ', ');
        // 2. generate the invoice as PDF file
        $pdf = new PaidPostingsInvoice();
        $pdf->AliasNbPages();
        $pdf->SetAuthor('Yellow Elevator. This invoice was automatically generated. Signature is not required.');
        $pdf->SetTitle($GLOBALS['COMPANYNAME'] . ' - Invoice ' . pad($invoice, 11, '0'));
        $pdf->SetCurrency($currency);
        $pdf->SetBranch($branch);
        $pdf->AddPage();
        $pdf->SetFont('Arial', '', 10);
        $pdf->SetTextColor(255, 255, 255);
        $pdf->SetFillColor(54, 54, 54);
        $pdf->Cell(60, 5, "Invoice Number", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(33, 5, "Issuance Date", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(33, 5, "Payable By", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(0, 5, "Amount Payable (" . $currency . ")", 1, 0, 'C', 1);
        $pdf->Ln(6);
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Cell(60, 5, pad($invoice, 11, '0'), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(33, 5, sql_date_format($data['issued_on']), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(33, 5, sql_date_format($data['payable_by']), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(0, 5, number_format($amount, '2', '.', ', '), 1, 0, 'C');
        $pdf->Ln(6);
        $pdf->SetTextColor(255, 255, 255);
        $pdf->Cell(60, 5, "User ID", 1, 0, 'C', 1);
        $pdf->Cell(1);
        $pdf->Cell(0, 5, "Employer Name", 1, 0, 'C', 1);
        $pdf->Ln(6);
        $pdf->SetTextColor(0, 0, 0);
        $pdf->Cell(60, 5, $_employer->getId(), 1, 0, 'C');
        $pdf->Cell(1);
        $pdf->Cell(0, 5, $_employer->getName(), 1, 0, 'C');
        $pdf->Ln(10);
        $table_header = array("No.", "Item", "Amount (" . $currency . ")");
        $pdf->FancyTable($table_header, $items, number_format($amount, '2', '.', ', '));
        $pdf->Ln(13);
        $pdf->SetFont('', 'I');
        $pdf->Cell(0, 0, "This invoice was automatically generated. Signature is not required.", 0, 0, 'C');
        $pdf->Ln(6);
        $pdf->Cell(0, 5, "Payment Notice", 'LTR', 0, 'C');
        $pdf->Ln();
        $pdf->Cell(0, 5, "- Payment shall be made payable to " . $branch[0]['branch'] . ".", 'LR', 0, 'C');
        $pdf->Ln();
        $pdf->Cell(0, 5, "- To facilitate the processing of the payment, please write down the invoice number(s) on your cheque(s)/payment slip(s)", 'LBR', 0, 'C');
        $pdf->Ln(10);
        $pdf->Cell(0, 0, "E. & O. E.", 0, 0, 'C');
        $pdf->Close();
        $pdf->Output($GLOBALS['data_path'] . '/subscription_invoices/' . $invoice . '.pdf', 'F');
        // 3. sends it as an email
        $attachment = chunk_split(base64_encode(file_get_contents($GLOBALS['data_path'] . '/subscription_invoices/' . $invoice . '.pdf')));
        $subject = "Subscription Invoice " . pad($invoice, 11, '0');
        $headers = 'From: YellowElevator.com <admin@yellowelevator.com>' . "\n";
        $headers .= 'Bcc: ' . $sales . "\n";
        $headers .= 'MIME-Version: 1.0' . "\n";
        $headers .= 'Content-Type: multipart/mixed; boundary="yel_mail_sep_' . $invoice . '";' . "\n\n";
        $body = '--yel_mail_sep_' . $invoice . "\n";
        $body .= 'Content-Type: multipart/alternative; boundary="yel_mail_sep_alt_' . $invoice . '"' . "\n";
        $body .= '--yel_mail_sep_alt_' . $invoice . "\n";
        $body .= 'Content-Type: text/plain; charset="iso-8859-1"' . "\n";
        $body .= 'Content-Transfer-Encoding: 7bit"' . "\n";
        $mail_lines = file('../private/mail/employer_posting_invoice.txt');
        $message = '';
        foreach ($mail_lines as $line) {
//.........这里部分代码省略.........
开发者ID:pamalite,项目名称:yel,代码行数:101,代码来源:employer_action.php

示例7: Payable

$pdf->SetTextColor(255, 255, 255);
$pdf->SetFillColor(54, 54, 54);
$pdf->Cell(60, 5, "Invoice Number", 1, 0, 'C', 1);
$pdf->Cell(1);
$pdf->Cell(33, 5, "Issuance Date", 1, 0, 'C', 1);
$pdf->Cell(1);
if (is_null($invoice[0]['paid_on']) || empty($invoice[0]['paid_on'])) {
    $pdf->Cell(33, 5, "Payable By", 1, 0, 'C', 1);
} else {
    $pdf->Cell(33, 5, "Paid On", 1, 0, 'C', 1);
}
$pdf->Cell(1);
$pdf->Cell(0, 5, "Amount Payable (" . $currency . ")", 1, 0, 'C', 1);
$pdf->Ln(6);
$pdf->SetTextColor(0, 0, 0);
$pdf->Cell(60, 5, pad($_GET['id'], 11, '0'), 1, 0, 'C');
$pdf->Cell(1);
$pdf->Cell(33, 5, $invoice[0]['formatted_issued_on'], 1, 0, 'C');
$pdf->Cell(1);
if (is_null($invoice[0]['paid_on']) || empty($invoice[0]['paid_on'])) {
    $pdf->Cell(33, 5, $invoice[0]['formatted_payable_by'], 1, 0, 'C');
} else {
    $pdf->Cell(33, 5, $invoice[0]['formatted_paid_on'], 1, 0, 'C');
}
$pdf->Cell(1);
$pdf->Cell(0, 5, $amount_payable, 1, 0, 'C');
$pdf->Ln(6);
$pdf->SetTextColor(255, 255, 255);
$pdf->Cell(60, 5, "User ID", 1, 0, 'C', 1);
$pdf->Cell(1);
$pdf->Cell(0, 5, "Employer Name", 1, 0, 'C', 1);
开发者ID:pamalite,项目名称:yel,代码行数:31,代码来源:invoice_pdf.php

示例8: pad

         $s_last_index = $stepcount;
     }
 }
 # Case Legend
 $def[$casecount_int] .= rrd::comment(" \\n");
 $def[$casecount_int] .= rrd::comment("Case\\:\\g");
 $def[$casecount_int] .= rrd::comment(" \\n");
 # Case graph, Case runtime on top ###########################################################
 $def[$casecount_int] .= rrd::def("case{$casecount}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
 # not used anymore; formerly used to draw grey TICK-areas if any case is unknown to hide everything.
 $def[$casecount_int] .= rrd::cdef("case" . $casecount . "_unknown", "case{$casecount},UN,1,0,IF");
 if ($s_last_index != "") {
     $def[$casecount_int] .= rrd::cdef("case_diff{$casecount}", "case{$casecount},s_line_stackbase{$s_last_index},-");
     # invisible line to stack upon
     $def[$casecount_int] .= rrd::line1("s_line_stackbase{$s_last_index}", "#00000000");
     $def[$casecount_int] .= rrd::area("case_diff{$casecount}", $col_case_runtime_area, pad($casename, $label_max_length), 1);
     # invisible line to stack upon
     $def[$casecount_int] .= rrd::line1("s_line_stackbase{$s_last_index}", "#00000000");
     $def[$casecount_int] .= rrd::line1("case_diff{$casecount}", $col_case_runtime_line, "", 1);
 } else {
     # no steps, no stacks
     $def[$casecount_int] .= rrd::area("case{$casecount}", $col_case_runtime_area, $casename);
     $def[$casecount_int] .= rrd::line1("case{$casecount}", $col_case_runtime_line, "");
 }
 $def[$casecount_int] .= rrd::gprint("case{$casecount}", "LAST", "%3.2lf s LAST");
 $def[$casecount_int] .= rrd::gprint("case{$casecount}", "MAX", "%3.2lf s MAX ");
 $def[$casecount_int] .= rrd::gprint("case{$casecount}", "AVERAGE", "%3.2lf s AVG \\j");
 $def[0] .= rrd::comment(" \\n");
 # Case graph, Warn/Crit LINE  ##########################################################
 foreach ($this->DS as $k => $v) {
     if (preg_match('/^c_' . $casecount . '__(warning|critical)/', $v['LABEL'], $matches)) {
开发者ID:myersguo,项目名称:sakuli,代码行数:31,代码来源:check_sakuli.php

示例9: makeMonthsView

 public function makeMonthsView(Request $request, $param1)
 {
     $arr = [];
     for ($i = 1; $i < 13; $i++) {
         $date = $param1 . '-' . pad($i, 2) . '-01';
         $arr[$i]['month'] = date('F', strtotime($date));
         $x = $this->dtrs->countByYearMonth($request->user(), $param1, $i);
         $arr[$i]['total'] = $x['total'];
     }
     return view('dtr.months')->with('months', $arr)->with('year', $param1);
 }
开发者ID:jrsalunga,项目名称:gi-manager,代码行数:11,代码来源:DtrController.php

示例10: array

$n = 0;
$skipped = array();
$errors = array();
foreach (array_reverse($posts) as $post) {
    $n++;
    $output = array();
    if (empty($post['title']) || empty($post['slug'])) {
        $errors[] = $post;
        continue;
    }
    $output[] = 'title: ' . $post['title'];
    $output[] = 'date: ' . date($dateformat, $post['date']);
    $output[] = 'text: ' . "\n\n" . trim($post['text']);
    $output[] = 'tags: ' . $post['tags'];
    $output[] = 'categories: ' . $post['cats'];
    $name = pad($n, $len) . '-' . f::safe_name($post['slug']);
    $dir = $root . '/' . $name;
    if (is_dir($dir)) {
        $skipped[] = basename($dir);
        continue;
    }
    dir::make($dir);
    $content = implode("\n\n" . '----' . "\n\n", $output);
    $file = $dir . '/' . $template;
    f::write($file, $content);
}
putmessage('Exported ' . $n . ' articles to ' . $root . '<br /><br />');
if (!empty($errors)) {
    putmessage(count($errors) . ' article(s) could not be imported<br /><br />');
}
if (!empty($skipped)) {
开发者ID:rkallensee,项目名称:kirbycms-extensions,代码行数:31,代码来源:wordpress.php

示例11: pad

             pad('delete', $r['ID']);
         }
         $refer_url = 'doc/';
     }
     // actualiza info en theme
     $result = mysql_query("SELECT COUNT(ID) AS num FROM docs WHERE estado = 'ok' AND pais = '" . PAIS . "'", $link);
     while ($r = mysql_fetch_array($result)) {
         mysql_query("UPDATE " . SQL . "config SET valor = '" . $r['num'] . "' WHERE dato = 'info_documentos' LIMIT 1", $link);
     }
     break;
 case 'editar-documento':
     if ($_POST['titulo'] and $_POST['cat']) {
         $_POST['titulo'] = strip_tags($_POST['titulo']);
         $result = mysql_query("SELECT ID, pais, url, acceso_escribir, acceso_cfg_escribir FROM docs WHERE ID = '" . $_POST['doc_ID'] . "' LIMIT 1", $link);
         while ($r = mysql_fetch_array($result)) {
             $text = str_replace("'", "&#39;", pad('get', $r['ID']));
             // Prevent SSX basic
             $text = str_replace("<script", "nojs", $text);
             $text = str_replace("&lt;script", "nojs", $text);
             if (nucleo_acceso($r['acceso_escribir'], $r['acceso_cfg_escribir']) or nucleo_acceso($vp['acceso']['control_gobierno'])) {
                 // Impide fijar acceso que no tienes.
                 if (!nucleo_acceso($_POST['acceso_escribir'], $_POST['acceso_cfg_escribir']) and !nucleo_acceso($vp['acceso']['control_gobierno'])) {
                     $_POST['acceso_escribir'] = $r['acceso_escribir'];
                     $_POST['acceso_cfg_escribir'] = $r['acceso_cfg_escribir'];
                 }
                 mysql_query("UPDATE docs SET cat_ID = '" . $_POST['cat'] . "', text = '" . $text . "', title = '" . $_POST['titulo'] . "', time_last = '" . $date . "', acceso_leer = '" . $_POST['acceso_leer'] . "', acceso_escribir = '" . $_POST['acceso_escribir'] . "', acceso_cfg_leer = '" . $_POST['acceso_cfg_leer'] . "', acceso_cfg_escribir = '" . $_POST['acceso_cfg_escribir'] . "', version = version + 1 WHERE ID = '" . $r['ID'] . "' LIMIT 1", $link);
             }
             redirect('http://' . strtolower($r['pais']) . '.' . DOMAIN . '/doc/' . $r['url'] . '/editar');
         }
     }
     break;
开发者ID:rafacouto,项目名称:VirtualPol,代码行数:31,代码来源:accion.php

示例12: show

    public function show()
    {
        $this->begin();
        $branch = $this->employee->getBranch();
        $this->top('Rewards - ' . $branch[0]['country']);
        $this->menu_employee('rewards');
        $new_rewards = $this->get_rewards();
        foreach ($new_rewards as $i => $row) {
            $new_rewards[$i]['member'] = htmlspecialchars_decode(stripslashes($row['member']));
            $new_rewards[$i]['employer'] = htmlspecialchars_decode(stripslashes($row['employer']));
            $new_rewards[$i]['title'] = htmlspecialchars_decode(stripslashes($row['title']));
            $new_rewards[$i]['padded_invoice'] = pad($row['invoice'], 11, '0');
            $new_rewards[$i]['total_reward'] = number_format($row['total_reward'], 2, '.', ', ');
            $new_rewards[$i]['paid_reward'] = number_format($row['paid_reward'], 2, '.', ', ');
        }
        $paid_rewards = $this->get_rewards(true);
        foreach ($paid_rewards as $i => $row) {
            $paid_rewards[$i]['member'] = htmlspecialchars_decode(stripslashes($row['member']));
            $paid_rewards[$i]['employer'] = htmlspecialchars_decode(stripslashes($row['employer']));
            $paid_rewards[$i]['title'] = htmlspecialchars_decode(stripslashes($row['title']));
            $paid_rewards[$i]['padded_invoice'] = pad($row['invoice'], 11, '0');
            $paid_rewards[$i]['total_reward'] = number_format($row['total_reward'], 2, '.', ', ');
            $paid_rewards[$i]['paid_reward'] = number_format($row['paid_reward'], 2, '.', ', ');
            $paid_rewards[$i]['gift'] = htmlspecialchars_decode(stripslashes($row['gift']));
        }
        ?>
        <!-- submenu -->
        <div class="menu">
            <ul class="menu">
                <li id="item_new_rewards" style="background-color: #CCCCCC;"><a class="menu" onClick="show_new_rewards();">New</a></li>
                <li id="item_paid_rewards"><a class="menu" onClick="show_paid_rewards();">Paid</a></li>
            </ul>
        </div>
        <!-- end submenu -->
        
        <!-- div class="banner">
            An administration fee of <?php 
        //echo $currency
        ?>
 2.00 will be charged to the referrers for every transfer of rewards into their bank accounts. <br/><br/>Always remember to ensure that the <?php 
        // echo $currency
        ?>
 2.00 administration fee is taken into considration when making an online bank transaction.
        </div -->
        
        <div id="div_status" class="status">
            <span id="span_status" class="status"></span>
        </div>
        
        <div id="new_rewards">
        <?php 
        if (is_null($new_rewards) || count($new_rewards) <= 0 || $new_rewards === false) {
            ?>
            <div class="empty_results">No rewards being offered at this moment.</div>
        <?php 
        } else {
            ?>
            <div id="div_new_rewards">
            <?php 
            $new_rewards_table = new HTMLTable('new_rewards_table', 'new_rewards');
            $new_rewards_table->set(0, 0, "<a class=\"sortable\" onClick=\"sort_by('new_rewards', 'referrals.employed_on');\">Employed On</a>", '', 'header');
            $new_rewards_table->set(0, 1, "<a class=\"sortable\" onClick=\"sort_by('new_rewards', 'jobs.title');\">Job</a>", '', 'header');
            $new_rewards_table->set(0, 2, "<a class=\"sortable\" onClick=\"sort_by('new_rewards', 'members.lastname');\">Referrer</a>", '', 'header');
            $new_rewards_table->set(0, 3, "Receipt", '', 'header');
            $new_rewards_table->set(0, 4, "Reward", '', 'header');
            $new_rewards_table->set(0, 5, 'Actions', '', 'header action');
            foreach ($new_rewards as $i => $new_reward) {
                $new_rewards_table->set($i + 1, 0, $new_reward['formatted_employed_on'], '', 'cell');
                $job = htmlspecialchars_decode(stripslashes($new_reward['title'])) . '</span>' . "\n";
                $job .= '<div class="small_contact"><span class="contact_label">Employer:</span> ' . $new_reward['employer'] . '</div>' . "\n";
                $new_rewards_table->set($i + 1, 1, $job, '', 'cell');
                $referrer_short_details = '';
                if (substr($new_reward['member_id'], 0, 5) == 'team.' && substr($new_reward['member_id'], 7) == '@yellowelevator.com') {
                    $referrer_short_details = 'Yellow Elevator';
                } else {
                    $referrer_short_details = htmlspecialchars_decode(stripslashes($new_reward['member'])) . "\n";
                    $referrer_short_details .= '<div class="small_contact"><span class="contact_label">Tel.:</span> ' . $new_reward['phone_num'] . '</div>' . "\n";
                    $referrer_short_details .= '<div class="small_contact"><span class="contact_label">Email: </span><a href="mailto:' . $new_reward['member_id'] . '">' . $new_reward['member_id'] . '</a></div>' . "\n";
                }
                $new_rewards_table->set($i + 1, 2, $referrer_short_details, '', 'cell');
                $new_rewards_table->set($i + 1, 3, '<a class="no_link" onClick="show_invoice_page(' . $new_reward['invoice'] . ');">' . $new_reward['padded_invoice'] . '</a>&nbsp;<a href="invoice_pdf.php?id=' . $new_reward['invoice'] . '"><img src="../common/images/icons/pdf.gif" /></a>', '', 'cell');
                $new_rewards_table->set($i + 1, 4, $new_reward['currency'] . '$ ' . $new_reward['total_reward'], '', 'cell');
                $actions = '<input type="button" value="Award" onClick="show_award_popup(' . $new_reward['referral'] . ');" />';
                $new_rewards_table->set($i + 1, 5, $actions, '', 'cell action');
            }
            echo $new_rewards_table->get_html();
            ?>
            </div>
        <?php 
        }
        ?>
        </div>
        
        <div id="paid_rewards">
        <?php 
        if (is_null($paid_rewards) || count($paid_rewards) <= 0 || $paid_rewards === false) {
            ?>
            <div class="empty_results">No rewards awarded at this moment.</div>
        <?php 
        } else {
//.........这里部分代码省略.........
开发者ID:pamalite,项目名称:yel,代码行数:101,代码来源:employee_rewards_page.php

示例13: init

function init($string)
{
    $len = strlen($string) * 8;
    $hex = strhex($string);
    // convert ascii string to hex
    $bin = leftpad(hexbin($hex), $len);
    // convert hex string to bin
    $padded = pad($bin);
    $padded = pad($padded, 1, $len);
    $block = str_split($padded, 32);
    foreach ($block as &$b) {
        $b = implode('', array_reverse(str_split($b, 8)));
    }
    return $block;
}
开发者ID:chendeng,项目名称:php-lib,代码行数:15,代码来源:md5.php

示例14: executeQuery

    executeQuery($sql);
    
    *
    ** Finished
    */
    // Phew! - finished
    mysql_close($link);
} else {
    echo " FAILED\n";
    $errors[] = "Database connection failed: " . @mysql_error();
}
echo "\n";
// Check MailScanner settings
echo "Checking MailScanner.conf settings: \n";
$check_settings = array('QuarantineWholeMessage' => 'yes', 'QuarantineWholeMessagesAsQueueFiles' => 'no', 'DetailedSpamReport' => 'yes', 'IncludeScoresInSpamAssassinReport' => 'yes', 'SpamActions' => 'store', 'HighScoringSpamActions' => 'store', 'AlwaysLookedUpLast' => '&MailWatchLogging');
foreach ($check_settings as $setting => $value) {
    echo pad(" - {$setting} ");
    if (preg_match('/' . $value . '/', get_conf_var($setting))) {
        echo " OK\n";
    } else {
        echo " WARNING\n";
        $errors[] = "MailScanner.conf: {$setting} != {$value} (=" . get_conf_var($setting) . ")";
    }
}
echo "\n";
if (is_array($errors)) {
    echo "*** ERROR/WARNING SUMMARY ***\n";
    foreach ($errors as $error) {
        echo $error . "\n";
    }
}
开发者ID:thctlo,项目名称:1.2.0,代码行数:31,代码来源:upgrade.php

示例15: strtotime

</tr>


	

</table>
</div>

<div style="margin:5px 0;">
<input type="text" name="titulo" value="' . $r['title'] . '" size="30" maxlength="50" style="font-size:22px;" /> &nbsp; 
<button onclick="$(\'#doc_opciones\').slideToggle(\'slow\');return false;" style="font-size:16px;color:#666;">Opciones</button> &nbsp; 
<input type="submit" value="Publicar" style="font-size:22px;" /> <a href="/doc/' . $r['url'] . '">Última publicación hace <span class="timer" value="' . strtotime($r['time_last']) . '"></span></a>.</div>

</form>

' . pad('print', $r['ID']);
            $txt_nav = array('/doc' => 'Documentos', '/doc/' . $r['url'] => $r['title'], 'Editar');
            $txt_tab['/doc/' . $r['url']] = 'Ver documento';
            $txt_tab['/doc/' . $r['url'] . '/editar'] = 'Editar';
        } elseif ($_GET['b'] == 'presentacion') {
            //doc/documento-de-test/presentacion
            if (nucleo_acceso($r['acceso_leer'], $r['acceso_cfg_leer'])) {
                presentacion($r['title'], $r['text'], 'http://' . strtolower(PAIS) . '.' . DOMAIN . '/doc/' . $r['url']);
            } else {
                $txt .= '<b style="color:red;">No tienes acceso de lectura.</b>';
            }
        } else {
            //doc/documento-de-test
            if (nucleo_acceso($r['acceso_escribir'], $r['acceso_cfg_escribir']) || nucleo_acceso($vp['acceso']['control_gobierno'])) {
                $boton_editar = boton('Editar', '/doc/' . $r['url'] . '/editar');
                $txt_tab['/doc/' . $r['url'] . '/editar'] = 'Editar';
开发者ID:rafacouto,项目名称:VirtualPol,代码行数:31,代码来源:c-doc.php


注:本文中的pad函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。