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


PHP position函数代码示例

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


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

示例1: pdftransactionAction

 public function pdftransactionAction()
 {
     //rupees right alignment
     function position($amt, $posValue)
     {
         $len = strlen($amt);
         $pos = $posValue - 35 - $len * 4;
         return $pos;
     }
     $fromDate = $this->_request->getParam('date');
     $branchid = $this->_request->getParam('office');
     $this->view->field1 = $fromDate;
     $this->view->branchid = $branchid;
     //         $fromDate = $this->_request->getParam('field1');
     //         $this->view->field1 = $fromDate;
     //date format instance
     $dateconvertor = new App_Model_dateConvertor();
     $cfromDate = $dateconvertor->mysqlformat($fromDate);
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
     $pdf->pages[] = $page;
     //Path
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = $word[1];
     // Image
     $image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
     $image = Zend_Pdf_Image::imageWithPath($image_name);
     $page->drawImage($image, 30, 770, 130, 820);
     $page->setLineWidth(1)->drawLine(25, 25, 570, 25);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(25, 25, 25, 820);
     //left vertical
     $page->setLineWidth(1)->drawLine(570, 25, 570, 820);
     //right vertical
     $page->setLineWidth(1)->drawLine(570, 820, 25, 820);
     //top horizontal
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 9);
     $page->drawText("Cash Scroll", 270, 780);
     $page->drawText("Cash Scroll", 270, 780);
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
     $y1 = 745;
     $page->drawText("Credit", 50, $y1);
     $page->drawText("Debit", 310, $y1);
     $y1 = 745;
     $y2 = 740;
     $page->drawText("As of From " . $fromDate, 465, $y1);
     //For Top Header
     $text = array("", "SL No.", "Particulars", "Amount", "Total", "Particulars", "Opening Cash", "Closing Cash");
     $this->view->savings = 10;
     $page->drawText("Date : " . date('d-m-Y'), 500, 800);
     //date('Y-m-d')
     //         $page->drawText("Date : ".date('d-m-Y'),500, 800);
     $page->drawText($text[0], 240, 780);
     $page->drawText($text[0], 240, 780);
     $x1 = 60;
     $x2 = 120;
     $x3 = 310;
     $x4 = 315;
     $x5 = 390;
     $x6 = 570;
     $page->drawLine(50, 740, 550, 740);
     $page->drawLine(50, 720, 550, 720);
     $page->drawText($text[1], $x1, 725);
     $page->drawText($text[2], $x2, 725);
     $page->drawText($text[3], 250, 725);
     $page->drawText($text[1], $x4, 725);
     $page->drawText($text[5], $x5, 725);
     $page->drawText($text[3], 510, 725);
     $y1 = 710;
     $y2 = 710;
     $transaction = new Cashscroll_Model_Cashscroll();
     $this->view->savings = 10;
     $this->view->savingsCredit = $transaction->totalSavingsCredit($cfromDate, $branchid);
     $this->view->savingsDebit = $transaction->totalSavingsDebit($cfromDate, $branchid);
     //Credit and Debit
     $savingsCredit = $transaction->totalSavingsCredit($cfromDate, $branchid);
     $savingsDebit = $transaction->totalSavingsDebit($cfromDate, $branchid);
     // Opening Cash
     $openingBalance = 0;
     $osc = $transaction->openingBalance($cfromDate, $branchid);
     foreach ($osc as $osc1) {
         $openingBalance = $osc1->openingBalance;
     }
     $this->view->openingBalance = $openingBalance;
     $amountCredit = "0";
     $amountDebit = "0";
     $i = 0;
     $j = 0;
     foreach ($savingsCredit as $savingsCredit) {
         $i++;
         $page->drawText($i, $x1, $y1);
         $page->drawText($savingsCredit->account_number, $x2, $y1);
         //             $page->drawText($savingsCredit->amount_to_bank,$x3, $y1);
         $pos = position(sprintf("%4.2f", $savingsCredit->amount_to_bank), $x3);
         $page->drawText(sprintf("%4.2f", $savingsCredit->amount_to_bank), $pos + 2, $y1);
         $amountCredit = $amountCredit + $savingsCredit->amount_to_bank;
         $y1 = $y1 - 15;
     }
//.........这里部分代码省略.........
开发者ID:maniargaurav,项目名称:OurBank,代码行数:101,代码来源:IndexController.php

示例2: url

				<?php 
    }
    ?>
					<p style="margin-top:10px;">
						<a href="<?php 
    echo url('user/i/' . $value['id']);
    ?>
"><?php 
    echo $value['firstname'];
    ?>
</a>
						<br/><?php 
    echo $value['nickname'];
    ?>
 ( <?php 
    echo position($value['role_id']);
    ?>
 )
						<br/>
				<?php 
    if (role_check(1)) {
        ?>
					<?php 
        if ($value['active'] === '1') {
            ?>
						<span class="label label-success">ยืนยันแล้ว</span>
					<?php 
        } else {
            ?>
						<span class="label label-danger">ยังไม่ได้ยืนยัน</span>
					<?php 
开发者ID:Jakkarin,项目名称:Anchor-system-for-branch-or-group,代码行数:31,代码来源:members.blade.php

示例3: _listdata

 /**
  * 解析标签list
  */
 protected function _listdata($param)
 {
     $_param = explode(' ', $param);
     $param = array();
     foreach ($_param as $p) {
         $mark = strpos($p, '=');
         if ($p && $mark !== false) {
             $var = substr($p, 0, $mark);
             $val = substr($p, $mark + 1);
             if (isset($var) && $var) {
                 $param[$var] = $val;
             }
         }
     }
     $system = $fields = $_fields = $not = $in = $or = $between = $like = array();
     $dbcache = isset($param['cache']) ? (int) $param['cache'] : 0;
     unset($param['cache']);
     if (is_array($param)) {
         foreach ($param as $key => $val) {
             //参数归类
             if (in_array($key, array('return', 'more', 'page', 'urlrule', 'num', 'join', 'on', 'order', 'table', 'pagesize', 'pagerule', 'action', 'tag', 'extend', 'site', 'form', 'fields'))) {
                 $system[$key] = $val;
             } else {
                 if (substr($key, 0, 3) == 'NOT') {
                     $key = substr($key, 3);
                     $not[] = $key;
                 } elseif (substr($key, 0, 2) == 'OR') {
                     $key = substr($key, 2);
                     $or[] = $key;
                 } elseif (substr($key, 0, 2) == 'IN') {
                     $key = substr($key, 2);
                     $in[] = $key;
                 } elseif (substr($key, 0, 2) == 'BW') {
                     $key = substr($key, 2);
                     $between[] = $key;
                 } elseif (substr($key, 0, 4) == 'LIKE') {
                     $key = substr($key, 4);
                     $like[] = $key;
                 }
                 $fields[$key] = $val;
                 $_fields[] = $key;
             }
         }
     }
     $where = '';
     //设置站点id
     $system['site'] = !isset($system['site']) || empty($system['site']) ? App::get_site_id() : $system['site'];
     //Action判断
     if (isset($system['action']) && $system['action'] == 'position') {
         //推荐位
         $data = position($system['site'], $fields['id'], isset($fields['catid']) ? $fields['catid'] : 0, isset($system['num']) ? $system['num'] : 0);
         if ($data) {
             $db = Controller::model('content');
             foreach ($data as $i => $t) {
                 if ($t['contentid']) {
                     $row = $db->db->where('id', $t['contentid'])->get('content_' . $system['site'])->row_array();
                     $data[$i] = $t + $row;
                 }
             }
         }
         if (isset($system['return']) && $system['return'] && $system['return'] != 't') {
             return array('return_' . $system['return'] => $data, 'total_' . $system['return'] => count($data));
         }
         return array('return' => $data, 'total' => count($data));
     } elseif (isset($system['action']) && $system['action'] == 'keywords') {
         //搜索关键字
         $search = Controller::model('search');
         $num = $system['num'] ? (int) $system['num'] : 5;
         if (isset($system['order']) && $system['order']) {
             $order = null;
             $orders = explode(',', $system['order']);
             foreach ($orders as $t) {
                 list($_field, $_order) = explode('_', $t);
                 if (in_array($_field, array('id', 'keywords', 'addtime', 'total'))) {
                     $_orderby = isset($_order) && strtoupper($_order) == 'ASC' ? 'ASC' : 'DESC';
                     $order .= '`' . $_field . '` ' . $_orderby . ',';
                 }
             }
             if (substr($order, -1) == ',') {
                 $order = substr($order, 0, -1);
             }
         } else {
             $order = '`total` DESC';
         }
         $data = $search->execute('select distinct keywords as title from ' . $search->prefix . 'search order by ' . $order . ' limit ' . $num, true, $dbcache);
         if (isset($system['return']) && $system['return'] && $system['return'] != 't') {
             return array('return_' . $system['return'] => $data, 'total_' . $system['return'] => count($data));
         }
         return array('return' => $data, 'total' => count($data));
     } elseif (isset($system['action']) && $system['action'] == 'sql') {
         //
     } elseif (isset($system['action']) && $system['action'] == 'relation') {
         if (isset($system['tag']) && $system['tag']) {
             //按关键字搜索
             if (isset($fields['id']) && $fields['id']) {
                 $where .= '`id`<>' . (int) $fields['id'];
             }
//.........这里部分代码省略.........
开发者ID:kennyhonghui,项目名称:zhuoxi,代码行数:101,代码来源:View.php

示例4: runAstar

//0;
$start_col = $ui_start_index_2d['col'];
//0;
$goal_row = $ui_goal_index_2d['row'];
//4;
$goal_col = $ui_goal_index_2d['col'];
//5;
$max_row = $ui_num_row - 1;
$max_col = $ui_num_col - 1;
$b_find_path = runAstar($grid_1, $start_row, $start_col, $goal_row, $goal_col, $max_row, $max_col);
$start_node = $grid_1->nodes[$start_row][$start_col];
$goal_node = $grid_1->nodes[$goal_row][$goal_col];
$last_node = null;
$raw_path = array();
if ($b_find_path) {
    $raw_path = findReversePath($start_node, $goal_node, $last_node);
    $raw_path = array_reverse($raw_path);
}
$path = array();
foreach ($raw_path as $node) {
    $row = $node->row;
    $col = $node->col;
    $path[] = position($row, $col);
}
//$path = [position(0, 0),
// position(0, 1),
//    position(1, 1)];
$output = array('path' => $path);
//$post_data = json_encode(array('like_votes' => $audio_file['like_votes'], 'dislike_votes' => $audio_file['dislike_votes']));
$post_data = json_encode($output);
echo $post_data;
开发者ID:AbdullahAlfaraj,项目名称:machine-learning-web,代码行数:31,代码来源:astar_handler.php

示例5: encode

    /* vypis pouzite abecedy - standardne znaky a-z */
    //echo "Abeceda: ", $alphabet . "<br/><br/>";
    $result = "";
    $result_numbers = "";
    for ($i = 0; $i < strlen($input); $i++) {
        /* projedeme cely retezec */
        if ($encode) {
            /* kodujeme */
            $new_position = encode($input[$i], $cipher[$i], $alphabet);
            /* ziskame novou pozici */
        } else {
            /* dekodujeme */
            $new_position = decode($input[$i], $cipher[$i], $alphabet);
            /* ziskame novou pozici */
        }
        $char = position($new_position, $alphabet);
        /* pozice noveho znaku */
        $result .= $char;
        $result_numbers .= $new_position . " ";
        /* pro zajimavost si ukladam i cisla, jak to bylo v augustove verzi */
    }
    if (!$encode) {
        /* pokud dekodujeme, musime zase nahradit znaky z abecedy */
        $result = reverseReplaceChars($result, $inputChars);
    }
    /* vypíšeme si výsledek */
    //print_r($result);
}
?>
        <header>
            <h1>Augustova šifra</h1>
开发者ID:EyeOfThReindeer,项目名称:Augustus-cipher,代码行数:31,代码来源:index.php

示例6: date

	<tr>
		<th align="center" colspan="25">
			<b>Karte Sektor ' . ($map['end'] / 500 - 1) . ':</b> (stand: ' . date('H:i') . ' update: %update%' . ')
		</th>
	</tr>';
    //date('H:i',(date('U')+14400)).
    $select = "SELECT * FROM `clans` WHERE `userid` = '" . $_SESSION['user']['omni'] . "' LIMIT 1;";
    $result = mysql_query($select);
    $myclan = mysql_fetch_array($result);
    if ($myclan == 0) {
        $myclan = 'keiner';
    }
    do {
        $map['start']++;
        $col++;
        $to_position = position($map['start']);
        $own_pos = $own_position['x'] + ($own_position['y'] + $own_position['z'] * 20);
        $to_pos = $to_position['x'] + ($to_position['y'] + $to_position['z'] * 20);
        if ($own_position['x'] > $to_position['x']) {
            $entfernung = $own_position['x'] - $to_position['x'];
        } else {
            $entfernung = $to_position['x'] - $own_position['x'];
        }
        if ($own_position['y'] + $own_position['z'] * 20 > $to_position['y'] + $to_position['z'] * 20) {
            $entfernung += $own_position['y'] + $own_position['z'] * 20 - ($to_position['y'] + $to_position['z'] * 20);
        } else {
            $entfernung += $to_position['y'] + $to_position['z'] * 20 - ($own_position['y'] + $own_position['z'] * 20);
        }
        $select = "SELECT * FROM `user` WHERE 1 AND `omni` =" . $map['start'] . ";";
        $result = mysql_query($select);
        $row = mysql_fetch_array($result);
开发者ID:o-wars,项目名称:o-wars,代码行数:31,代码来源:karte.php

示例7: position

	<li><span style="font-weight: bold">Selected Clients:</span> Hostirian, Systematic Revenue, Venture Draft, St. Louis Arch Angels.</li>
	</ul>', "");
position("Washington University Student Investment Fund", "St. Louis, MO", "Communication Chair", "1/10-6/12", '
	<ul>
	<li>Managed the investment of over $100,000 of the university endowment via qualitative, multiples, and DCF analysis, resulting in  growth exceeding S&P 500 Midcap Index on invested funds.</li>
	<li>Competed nationally in investment competitions, and was a Finalist in the Spring 2011 <a href="http://miiuic.org/" target="_BLANK">Michigan Interactive Investments Competition</a>.</li>
	<li><span style="font-style:italic;">Previous Positions:</span> Technology Portfolio Manager (2010), Webmaster (2010-2011), Healthcare Analyst (2010).</li>
	</ul>', "http://wusif.org");
position("Washington University in St. Louis Department of Computer Science", "St. Louis, MO", "Teaching Assistant, Introduction to Computing Tools: MATLAB", "1/11-6/11", "", "");
position("Washington University School of Medicine in St. Louis", "St. Louis, MO", "Research Assistant, Dr. Jennifer Lodge Laboratory", "9/09-1/12", '
	<ul>
	<li>Studied pathogenic fungus <a href="http://en.wikipedia.org/wiki/Cryptococcus_neoformans" target="_BLANK"><span style="font-style:italic;">Cryptococcus neoformans</span></a> with in vitro, in vivo, and computational techniques.</li>
	<li>Selected Project Experience:
		<ul>
			<li>Bioinformatics – Designed, developed, and implemented a scalable <span style="font-style:italic;">C. neoformans</span> Strain Database for collaborative use in the scientific community. </li>
			<li>Gene research – Studied stress sensors involved with nitrositive stress.</li>
			<li>Animal testing – Analyzed strain virulence with <span style="font-style"italic;">in vitro</span> studies in mice.</li>
		<ul>

			
	</li>
	</ul>', "");
?>
    
    
      </section>
      
      <section id="technical">
            <div class="row">

      <div class="page-header">
开发者ID:briangrace,项目名称:cv-philipithomas,代码行数:31,代码来源:index.php

示例8: elseif

</a>
<?php 
} elseif (front::get('case') == 'mailsubscription') {
    ?>
<a href="#" title="<?php 
    echo lang(mailsubscription);
    ?>
"><?php 
    echo lang(mailsubscription);
    ?>
</a>
                <?php 
} else {
    ?>
            	<?php 
    foreach (position($catid) as $t) {
        ?>
<a title="<?php 
        echo $t['name'];
        ?>
" href="<?php 
        echo $t['url'];
        ?>
"><?php 
        echo $t['name'];
        ?>
</a>
<?php 
    }
    ?>
                <?php 
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:31,代码来源:#position.php

示例9: pdftransactionAction

 function pdftransactionAction()
 {
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
     $pdf->pages[] = $page;
     // Image
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = '';
     for ($i = 0; $i < count($word); $i++) {
         if ($i > 0 && $i < count($word) - 1) {
             $projname .= '/' . $word[$i];
         }
     }
     // Image
     $image_name = "/var/www" . $projname . "/public/images/logo.jpg";
     $image = Zend_Pdf_Image::imageWithPath($image_name);
     $page->drawImage($image, 30, 770, 130, 820);
     $page->setLineWidth(1)->drawLine(25, 25, 570, 25);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(25, 25, 25, 820);
     //left vertical
     $page->setLineWidth(1)->drawLine(570, 25, 570, 820);
     //right vertical
     $page->setLineWidth(1)->drawLine(570, 820, 25, 820);
     //top horizontal
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 10);
     $text = array($this->view->translate("Deposit Summary"), $this->view->translate("Product"), $this->view->translate('Deposit summary'), $this->view->translate("No. of Savings"), $this->view->translate("Total Savings Amount"));
     function position($amt)
     {
         $len = strlen($amt);
         $pos = 490 - $len * 4;
         return $pos;
     }
     $xx = 50;
     $xy = 550;
     $x1 = 60;
     $x2 = 190;
     $x3 = 330;
     $x4 = 420;
     $page->drawText($text[0], 260, 750);
     $y1 = 725;
     if ($this->_request->getParam('field1')) {
         $officename = new Depositsummary_Model_Depositsummary();
         $OffName = $officename->officeNamefetch($this->_request->getParam('field1'));
         foreach ($OffName as $OffName) {
         }
         $this->view->officeName = $OffName['name'];
         $page->drawText($this->view->translate("Branch Name : "), $x1, $y1);
         $page->drawText($OffName['name'], $x2, $y1);
         $y1 -= 20;
     }
     //point to draw Side line
     $startlinepoint = $y1;
     $page->drawLine($xx, $y1, $xy, $y1);
     $y1 -= 20;
     $page->drawText($text[1], $x1, $y1);
     $page->drawText($text[2], $x2, $y1);
     $page->drawText($text[3], $x3, $y1);
     $page->drawText($text[4], $x4, $y1);
     $y1 -= 5;
     $page->drawLine($xx, $y1, $xy, $y1);
     $y1 -= 20;
     $this->view->depositAmount = 0;
     $this->view->withdrawlAmount = 0;
     $this->view->totalAmount = 0;
     $this->view->deposit = 0;
     $this->view->withdrawl = 0;
     $this->view->sum = 0;
     if ($this->_request->getParam('field1')) {
         $office_id = $this->_request->getParam('field1');
         $this->view->office_id = $office_id;
         $savingsummary = new Depositsummary_Model_Depositsummary();
         $result = $savingsummary->fetchSavingsDetails($office_id);
         $this->view->result = $result;
         $depositAmount = 0;
         $deposit = 0;
         $withdrawlAmount = 0;
         $withdrawl = 0;
         $totalamount = 0;
         $sum = 0;
         foreach ($result as $result) {
             $page->drawText($result['productname'], $x1, $y1);
             $page->drawText($result['prodoffername'], $x2, $y1);
             $page->drawText($result['countvalue'], $x3, $y1);
             $y1 -= 15;
             $accountBalanc = $savingsummary->accountBalanceDetails($office_id);
             $this->view->accountBalanc = $accountBalanc;
             foreach ($accountBalanc as $accountBalanc) {
                 if ($result['id'] == $accountBalanc['offerprodid']) {
                     if ($accountBalanc['transactiontype_id'] == 1) {
                         $depositAmount = $depositAmount + $accountBalanc['amount_to_bank'];
                         $deposit = $deposit + $accountBalanc['amount_to_bank'];
                     }
                     if ($accountBalanc['transactiontype_id'] == 2) {
                         $withdrawlAmount = $withdrawlAmount + $accountBalanc['amount_from_bank'];
                         $withdrawl = $withdrawl + $accountBalanc['amount_from_bank'];
                     }
                     $totalamount = $depositAmount - $withdrawlAmount;
//.........这里部分代码省略.........
开发者ID:maniargaurav,项目名称:OurBank,代码行数:101,代码来源:IndexController.php

示例10: pdftransactionAction

 function pdftransactionAction()
 {
     $pdf = new Zend_Pdf();
     //create a new page
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
     $pdf->pages[] = $page;
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = '';
     for ($i = 0; $i < count($word); $i++) {
         if ($i > 0 && $i < count($word) - 1) {
             $projname .= '/' . $word[$i];
         }
     }
     // Image
     $image_name = "/var/www" . $app . "/images/logo.jpg";
     $image = Zend_Pdf_Image::imageWithPath($image_name);
     $page->drawImage($image, 30, 770, 130, 820);
     $page->setLineWidth(1)->drawLine(25, 25, 570, 25);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(25, 25, 25, 820);
     //left vertical
     $page->setLineWidth(1)->drawLine(570, 25, 570, 820);
     //right vertical
     $page->setLineWidth(1)->drawLine(570, 820, 25, 820);
     //top horizontal
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 12);
     echo $title = $this->_request->getParam('pagetitle');
     $len = strlen($title);
     $pos = 550 - $len * 7;
     $page->drawText($title, $pos, 760);
     $z1 = 50;
     $z2 = 550;
     $y1 = 740;
     $y2 = 740;
     $x = array(60, 92, 180, 240, 340, 400, 460);
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 10);
     //Amount Formatting
     function position($spaceFlag, $amt)
     {
         if ($spaceFlag == 0) {
             $len = strlen($amt);
             $pos = 300 - $len * 5;
             return $pos;
         }
         if ($spaceFlag == 1) {
             $len = strlen($amt);
             $pos = 230 - $len * 5;
             return $pos;
         }
     }
     function position1($spaceFlag1, $amt)
     {
         if ($spaceFlag1 == 0) {
             $len = strlen($amt);
             $pos = 370 - $len * 5;
             return $pos;
         }
         if ($spaceFlag1 == 1) {
             $len = strlen($amt);
             $pos = 300 - $len * 5;
             return $pos;
         }
     }
     function balPosi($spaceFlag, $amt)
     {
         if ($spaceFlag == 0) {
             $len = strlen($amt);
             $pos = 450 - $len * 5;
             return $pos;
         }
         if ($spaceFlag == 1) {
             $len = strlen($amt);
             $pos = 370 - $len * 5;
             return $pos;
         }
     }
     echo $accountnumber = $this->view->accno = $this->_request->getParam('accno');
     echo $fromdate = $this->view->fromdate = $this->_request->getParam('fromdate');
     echo $todate = $this->view->todate = $this->_request->getParam('todate');
     $transaction = new Savingsledger_Model_Savingsledger();
     if ($accountnumber != '') {
         $accountDetails = $transaction->getAccountDetails($accountnumber);
         $balance = $transaction->balance($accountnumber);
         foreach ($accountDetails as $arraytran2) {
             $page->drawText("Name  ", 50, $y1);
             $page->drawText(": " . $arraytran2['membername'], 120, $y1);
             $y1 -= 15;
             $page->drawText("ID  ", 50, $y1);
             $page->drawText(": " . $arraytran2['membercode'], 120, $y1);
             $y1 -= 15;
             $page->drawText("Office name ", 50, $y1);
             $page->drawText(": " . $arraytran2['office_name'], 120, $y1);
             $y1 -= 15;
             $page->drawText("Product name ", 300, $y2);
             $page->drawText(": " . $arraytran2['offername'], 390, $y2);
             $y2 -= 15;
             $page->drawText("Account no.  ", 300, $y2);
             $page->drawText(": " . $arraytran2['account_number'], 390, $y2);
//.........这里部分代码省略.........
开发者ID:maniargaurav,项目名称:OurBank,代码行数:101,代码来源:IndexController.php

示例11: pdfmeetingAction

 public function pdfmeetingAction()
 {
     //rupees right alignment
     function position($amt, $posValue)
     {
         $len = strlen($amt);
         $pos = $posValue - 35 - $len * 4;
         return $pos;
     }
     //view details on pdf page
     $meeting_id = $this->_request->getParam('meeting_name');
     $meetingno = $this->_request->getParam('meetingno');
     $this->view->field1 = $meetingno;
     $this->view->branchid = $meeting_id;
     //for meeting details
     $meetingbook = new Meetingbookreport_Model_Meetingbook();
     // 	$this->view->fetchgroupid=$groupid1=$meetingbook->fetchgroupid($meeting_id);
     // 	$groupid= $groupid1[0]['group_id'];
     $this->view->meeting = $ff = $meetingbook->fetchmeeting($meeting_id);
     //echo '<pre>';print_r($ff);
     //fetch member details
     $this->view->members = $aa = $meetingbook->fetchMembers($meeting_id);
     //echo '<pre>';print_r($aa);
     //fetch attendance details
     $this->view->attendance = $meetingbook->fetchattendance($meeting_id, $meetingno);
     //fetch loan officer
     $loanofficer = $meetingbook->fetchloanofficer($meeting_id);
     if ($loanofficer) {
         $this->view->loanofficer = $loanofficer[0]['loanofficer'];
     }
     //$cfromDate = $dateconvertor->mysqlformat($fromDate);
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
     $pdf->pages[] = $page;
     //Path
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = $word[1];
     // Image
     $image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
     $image = Zend_Pdf_Image::imageWithPath($image_name);
     $page->drawImage($image, 30, 770, 130, 820);
     $page->setLineWidth(1)->drawLine(25, 25, 570, 25);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(25, 25, 25, 820);
     //left vertical
     $page->setLineWidth(1)->drawLine(570, 25, 570, 820);
     //right vertical
     $page->setLineWidth(1)->drawLine(570, 820, 25, 820);
     //top horizontal
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
     $text = array();
     $this->view->savings = 10;
     $page->drawText("Date : " . date('d/m/Y'), 500, 800);
     //date('Y-m-d')
     $page->drawText("Meeting Book", 270, 770);
     $page->drawText("Meeting Book", 270, 770);
     $x1 = 50;
     $x2 = 320;
     $y1 = 725;
     $y2 = 710;
     $page->drawText("Meeting Information", $x1, $y1);
     $page->drawText("Meeting Information", $x1, $y1);
     //fetching meeting details
     if ($this->view->meeting) {
         $count = count($this->view->meeting);
         foreach ($this->view->meeting as $meeting) {
         }
         $page->drawText("Group name: " . $meeting['groupname'], $x1, $y1 = $y1 - 20);
         $page->drawText("Week Day: " . $meeting['weekday'], $x2, $y1);
         $page->drawText("Group head: " . $meeting['grouphead_name'], $x1, $y1 = $y1 - 15);
         $page->drawText("Time: " . $meeting['time'], $x2, $y1);
         $page->drawText("Number of members: " . $count, $x1, $y1 = $y1 - 15);
         $page->drawText("Place: " . $meeting['place'], $x2, $y1);
         $page->drawText("Loan Officer: " . $this->view->loanofficer, $x1, $y1 = $y1 - 15);
     }
     //         $this->view->savings = 10;
     $y1 = $y1 - 30;
     $page->drawText("Attendance Information", $x1, $y1);
     $page->drawText("Attendance Information", $x1, $y1);
     //fetching attendance details
     foreach ($this->view->attendance as $attendance) {
     }
     $page->drawText("Meeting name: " . $attendance['meetingname'], $x1, $y1 = $y1 - 20);
     $page->drawText("Held on: " . $this->view->dateconvertor->phpnormalformat($attendance['meeting_date']), $x2, $y1);
     $page->drawText("Meeting Number: " . $attendance['week_no'], $x1, $y1 = $y1 - 15);
     $page->drawText("Time: " . $attendance['time'], $x2, $y1);
     $y1 = $y1 - 30;
     $page->drawText("Member Details", $x1, $y1);
     $page->drawText("Member Details", $x1, $y1);
     $y1 = $y1 - 15;
     $page->drawLine(50, $y1, 550, $y1);
     //table top line
     $y3 = $y1;
     // assign for left and right lines
     $y1 = $y1 - 15;
     $page->drawText("Sl", 55, $y1);
     $page->drawText("Members", 70, $y1);
     $page->drawText("UID", 180, $y1);
//.........这里部分代码省略.........
开发者ID:maniargaurav,项目名称:OurBank,代码行数:101,代码来源:IndexController.php

示例12: htmlspecialchars

}
$_GET[id] = htmlspecialchars($_GET[id]);
// html head setzen
$content = head("Uebersicht");
// spielerstatus ausgeben
$content .= '<center>' . spielerstatus() . '</center>';
$content .= '<br />';
$dbh = db_connect();
//if ($_GET[id]) {
$select = "SELECT * FROM `user` WHERE `omni` = '" . htmlspecialchars($_GET[id]) . "' ;";
$selectResult = mysql_query($select, $dbh);
$row = mysql_fetch_array($selectResult, MYSQL_ASSOC);
if (!$row[name]) {
    $row[name] = "unbewohnt (Taliban-Area)";
}
$to_position = position($_GET[id]);
$own_pos = $own_position[x] + ($own_position[y] + $own_position[z] * 500);
$to_pos = $to_position[x] + ($to_position[y] + $to_position[z] * 20);
if ($own_pos == $to_pos and $own_position[y] != $to_position[y]) {
    $entfernung = 2;
} elseif ($own_pos >= $to_pos) {
    $entfernung = $own_pos - $to_pos;
} elseif ($own_pos <= $to_pos) {
    $entfernung = $to_pos - $own_pos;
}
if (!$row[base]) {
    $row[base] = 'unbekannt';
}
if (!$row[clan]) {
    $row[clan] = '-';
}
开发者ID:o-wars,项目名称:o-wars,代码行数:31,代码来源:karte_popup.php

示例13: session_name

////////////////////////////////////
if ($time['karte'] < date('U') - 3600) {
    $karte .= '<br />';
    $karte .= '	<script language="javascript">
	<!--
	var session = "' . session_name() . '=' . session_id() . '";
	-->
	</script>
	<script language="javascript" src="karte.js"></script>';
    $select = "SELECT * FROM `user` WHERE `omni` = '" . htmlspecialchars($_GET[id]) . "' ;";
    $selectResult = mysql_query($select);
    $row = mysql_fetch_array($selectResult);
    if (!$row['name']) {
        $row['name'] = "unbewohnt (Taliban-Area)";
    }
    $to_position = position($_GET['id']);
    $own_pos = $own_position['x'] + ($own_position['y'] + $own_position['z'] * 500);
    $to_pos = $to_position['x'] + ($to_position['y'] + $to_position['z'] * 20);
    if ($own_pos == $to_pos and $own_position['y'] != $to_position['y']) {
        $entfernung = 2;
    } elseif ($own_pos >= $to_pos) {
        $entfernung = $own_pos - $to_pos;
    } elseif ($own_pos <= $to_pos) {
        $entfernung = $to_pos - $own_pos;
    }
    if (!$row['base']) {
        $row['base'] = 'unbekannt';
    }
    if (!$row['clan']) {
        $row['clan'] = '-';
    }
开发者ID:o-wars,项目名称:o-wars,代码行数:31,代码来源:karte_new.php

示例14: pdftransactionAction

 public function pdftransactionAction()
 {
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
     $pdf->pages[] = $page;
     //Path
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = '';
     for ($i = 0; $i < count($word); $i++) {
         if ($i > 0 && $i < count($word) - 1) {
             $projname .= '/' . $word[$i];
         }
     }
     // Image
     $image_name = "/var/www" . $app . "/images/logo.jpg";
     $image = Zend_Pdf_Image::imageWithPath($image_name);
     $page->drawImage($image, 30, 520, 150, 570);
     $page->setLineWidth(1)->drawLine(25, 25, 810, 25);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(25, 25, 25, 570);
     //left vertical
     $page->setLineWidth(1)->drawLine(810, 25, 810, 570);
     //right vertical
     $page->setLineWidth(1)->drawLine(25, 570, 810, 570);
     //top horizontal
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 14);
     $text = array("Month", "Loan A/C", "On Time", "1-30 Days", "31-60 Days", "61-90 Days", "91-180 Days", "181-360 Days", "361 Days above", "O/S Loan", "Total");
     $this->view->savings = 10;
     $this->view->fromdate = $fromdate = $this->_request->getParam('fromdate');
     $this->view->branch = $branch = $this->_request->getParam('branch');
     $this->view->officer = $officer = $this->_request->getParam('officer');
     $viewdate = $this->view->dateconvert->phpnormalformat($fromdate);
     $par = new Par_Model_Par();
     $disp = "As of <font color=#039>" . $this->view->dateconvert->phpnormalformat($fromdate) . "</font>";
     if ($branch) {
         foreach ($par->fetchbranch($branch) as $branchname) {
         }
         $disp .= "<br> Branch : <font color=#039>" . $branchname['name'] . "</font>";
     }
     if ($officer) {
         foreach ($par->getUser1($branch) as $officername) {
         }
         $disp .= "<br> Loan officer : <font color=#039>" . $officername['officername'] . "</font>";
     }
     $this->view->resultshow = $disp;
     $parrisk1 = $this->view->parrisk = $par->parrisk($fromdate, $branch, $officer);
     $page->drawText("Portfolio at risk as of {$viewdate}", 380, 520);
     //date('Y-m-d')
     //right alignment
     function position($amt, $posValue)
     {
         $len = strlen($amt);
         $pos = $posValue - 10 - $len * 5;
         return $pos;
     }
     $pos = position("Amount in Rs", 780);
     $page->drawText("Amount in Rs", $pos, 460);
     $pos = position("Loan officer: " . $officername['officername'], 780);
     $page->drawText("Loan officer: " . $officername['officername'], $pos + 5, 480);
     $pos = position("Branch: " . $branchname['name'], 780);
     $page->drawText("Branch: " . $branchname['name'], $pos, 500);
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 10);
     //         $page->drawText("Date : ".date('d-m-Y'),600, 510); //date('Y-m-d')
     $x = array(40, 100, 200, 250, 320, 400, 470, 540, 640, 730);
     $xl = array(35, 95, 195, 245, 315, 395, 465, 535, 615, 725, 800);
     $y = 450;
     $startpoint = $y;
     $xh1 = 95;
     $xh2 = 800;
     $page->drawLine($xh1, $y, $xh2, $y);
     $y -= 15;
     //Top line1
     for ($i = 1; $i < count($text) - 1; $i++) {
         $page->drawText($text[$i], $x[$i], $y);
     }
     $y -= 10;
     $page->drawLine($xh1, $y, $xh2, $y);
     $y -= 15;
     //Top line2
     $total30 = "0.00";
     $total60 = "0.00";
     $total90 = "0.00";
     $total180 = "0.00";
     $total360 = "0.00";
     $total360days = "0.00";
     $total = "0.00";
     $today = $this->view->fromdate;
     $date30 = date('Y-m-d', strtotime(date("Y-m-d", strtotime($today)) . " -30 days"));
     $date60 = date('Y-m-d', strtotime(date("Y-m-d", strtotime($today)) . " -60 days"));
     $date90 = date('Y-m-d', strtotime(date("Y-m-d", strtotime($today)) . " -90 days"));
     $date180 = date('Y-m-d', strtotime(date("Y-m-d", strtotime($today)) . " -180 days"));
     $date360 = date('Y-m-d', strtotime(date("Y-m-d", strtotime($today)) . " -360 days"));
     $day30 = "0.00";
     $day60 = "0.00";
     $day90 = "0.00";
     $day180 = "0.00";
     $day360 = "0.00";
     $day360above = "0.00";
     $r = "0.00";
//.........这里部分代码省略.........
开发者ID:maniargaurav,项目名称:OurBank,代码行数:101,代码来源:IndexController.php

示例15: array

		FROM ?_quest_template
		WHERE
			ReqCreatureOrGOId1=?
			OR ReqCreatureOrGOId2=?
			OR ReqCreatureOrGOId3=?
			OR ReqCreatureOrGOId4=?
		', $quest_cols[2], $id, $id, $id, $id);
    if ($rows_qo) {
        $npc['objectiveof'] = array();
        foreach ($rows_qo as $numRow => $row) {
            $npc['objectiveof'][] = GetQuestInfo($row, 0xffffff);
        }
    }
    unset($rows_qo);
    // Положения созданий божих:
    position($npc['entry'], 'creature');
    save_cache(1, $npc['entry'], $npc);
}
global $page;
$page = array('Mapper' => true, 'Book' => false, 'Title' => $npc['name'] . ' - ' . $smarty->get_config_vars('NPCs'), 'tab' => 0, 'type' => 1, 'typeid' => $npc['entry'], 'path' => '[0,4,' . $npc['type'] . ']');
$smarty->assign('page', $page);
// Комментарии
$smarty->assign('comments', getcomments($page['type'], $page['typeid']));
// Если хоть одна информация о вещи найдена - передаём массив с информацией о вещях шаблонизатору
if (isset($allitems)) {
    $smarty->assign('allitems', $allitems);
}
if (isset($allspells)) {
    $smarty->assign('allspells', $allspells);
}
$smarty->assign('npc', $npc);
开发者ID:Refuge89,项目名称:World-of-Warcraft-Trinity-Core-MaNGOS,代码行数:31,代码来源:npc.php


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