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


PHP mktimestamp函数代码示例

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


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

示例1: _testFor_show_admprojects_basics

 function _testFor_show_admprojects_basics(&$d, $bgc)
 {
     global $t;
     $this->_checkFor_a_box('Pending Project Administration');
     $this->_checkFor_columns(7);
     $v = array('Project Title' => array('', '15%', ''), 'Type' => array('center', '10%', ''), 'Description' => array('center', '30%', ''), 'User' => array('center', '10%', ''), 'Volume' => array('center', '7%', ''), 'Configured?' => array('center', '7%', ''), 'Creation' => array('center', '12%', ''));
     while (list($key, $va) = each($v)) {
         $this->_checkFor_column_titles(array($key), $va[0], $va[1], $va[2]);
     }
     $v = array(html_link('summary.php3', array('proid' => $d['proid']), $d['project_title']) => array('', '', $bgc), $d['type'] => array('', '', $bgc), $d['description'] => array('', '', $bgc), lib_nick($d['description_user']) => array('center', '', $bgc), $d['volume'] => array('center', '', $bgc), timestr_short(mktimestamp($d['description_creation'])) => array('center', '', $bgc));
     while (list($key, $va) = each($v)) {
         $this->_checkFor_column_titles(array($key), $va[0], $va[1], $va[2]);
     }
     $this->_testFor_box_colspan(8, 'center', '#FFFFF', ' ');
     $this->_testFor_box_colspan(8, 'center', '#FEDCBA', $t->translate('Sponsored projects'));
     $this->_testFor_box_colspan(8, 'center', '#ABCDEF', $t->translate('Developing projects'));
     $this->_checkFor_a_form('PHP_SELF', array(), 'POST');
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:18,代码来源:TestAdmprojectslib.php

示例2: testCooperation_show

 function testCooperation_show()
 {
     global $t, $bx, $db, $sess;
     $qs = array(0 => "SELECT * FROM cooperation,auth_user WHERE devid='%s'" . " AND developer=username ORDER BY creation DESC", 1 => "SELECT * FROM comments,auth_user WHERE proid='%s' " . "AND type='%s' AND number='%s' AND ref='%s' AND " . "user_cmt=username ORDER BY creation_cmt ASC");
     $db_config = new mock_db_configure(3);
     $args = $this->_generate_records(array('proid', 'devid'), 10);
     $dat = $this->_generate_records(array('creation', 'cost', 'status', 'developer'), 20);
     // test one
     $db_config->add_query(sprintf($qs[0], $args[0]['devid']), 0);
     $db_config->add_num_row(0, 0);
     // test two
     $db_config->add_query(sprintf($qs[0], $args[1]['devid']), 1);
     $db_config->add_num_row(1, 1);
     $db_config->add_record($dat[0], 1);
     $db_config->add_record(false, 1);
     $db_config->add_query(sprintf($qs[1], $args[1]['proid'], 'Cooperation', $dat[0]['creation'], '0'), 2);
     $db_config->add_num_row(0, 2);
     // test one: no records
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('cooperation_show', 77, $args[0]);
     $this->assertEquals("<p>There have not been posted any cooperation " . "proposals by any developer.<p>\n", $this->get_text());
     // test two: one row of data
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('cooperation_show', 916, $args[1]);
     $this->_checkFor_a_box('Cooperation');
     $this->_testFor_lib_nick($dat[0]['developer']);
     $str = ' - ' . timestr(mktimestamp($dat[0]['creation'])) . "</b>";
     $this->_testFor_pattern($this->_to_regexp($str));
     $str = '<p><b>Cost</b>: ' . $dat[0]['cost'] . " euro\n";
     $this->_testFor_pattern($this->_to_regexp($str));
     $str = '<br><b>Status</b>: ' . show_status($dat[0]['status']) . "\n";
     $this->_testFor_pattern($this->_to_regexp($str));
     $this->_testFor_lib_comment_it($args[1]['proid'], 'Cooperation', $dat[0]['creation'], 0, '', $t->translate('Comment This Cooperation!'));
     $this->_check_db($db_config);
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:37,代码来源:TestCooperationlib.php

示例3: testShow_consultants

 function testShow_consultants()
 {
     global $db, $t, $bx;
     $db_config = new mock_db_configure(2);
     $db_q = array(0 => "SELECT * FROM consultants,auth_user WHERE " . "proid='%s' AND username=consultant ORDER " . "BY creation");
     $dat = $this->_generate_records(array("proid"), 2);
     $rows = $this->_generate_records(array("username", "status", "creation"), 3);
     $db_config->add_query(sprintf($db_q[0], $dat[0]["proid"]), 0);
     $db_config->add_query(sprintf($db_q[0], $dat[1]["proid"]), 1);
     $db_config->add_num_row(0, 0);
     $db_config->add_num_row(3, 1);
     $db_config->add_record($rows[0], 1);
     $db_config->add_record($rows[1], 1);
     $db_config->add_record($rows[2], 1);
     // first test: no data to list, print error message
     $db = new DB_SourceAgency();
     $bx = new box();
     $this->set_msg("test 1");
     $this->capture_call('show_consultants', 64, &$dat[0]);
     $this->_testFor_pattern("No developers have offered " . "themselves as consultants yet");
     // second test: three pieces of data
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->set_msg('test 2');
     $this->capture_call('show_consultants', 3573, &$dat[1]);
     $this->_checkFor_a_box('Consultants');
     $this->_checkFor_columns(4);
     $this->_checkFor_column_titles(array("Number", "Username", "Status", "Creation"), '', '', '');
     $colors = array(1 => 'gold', 0 => '#FFFFFF');
     for ($idx = 1; $idx < 4; $idx++) {
         $row = $rows[$idx - 1];
         $this->set_msg("Test {$idx}");
         $this->_testFor_box_next_row_of_columns();
         $this->_checkFor_column_values(array('<b>' . $idx . '</b>', '<b>' . lib_nick($row['username']), '<b>' . show_status($row["status"]) . '</b>', '<b>' . timestr(mktimestamp($row["creation"])) . '</b>'), '', '', $colors[$idx % 2]);
     }
     $this->_check_db($db_config);
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:37,代码来源:TestConsultantslib.php

示例4: column_date

 public function column_date($Item)
 {
     echo date($this->dates, mktimestamp($Item->created));
     if (isset($this->statuses[$Item->status])) {
         echo '<br /><strong>' . esc_html($this->statuses[$Item->status]) . '</strong>';
     }
 }
开发者ID:msigley,项目名称:shopp,代码行数:7,代码来源:Orders.php

示例5: testShow_referees

 function testShow_referees()
 {
     global $t, $bx, $db;
     $db_config = new mock_db_configure(2);
     $pid1 = "this sit he proid";
     $pid2 = "this sit he proid two";
     $q = $this->queries['show_referees'];
     $db_config->add_query(sprintf($q, $pid1), 0);
     $db_config->add_num_row(0, 0);
     $db_config->add_num_row(0, 0);
     $db_config->add_query(sprintf($q, $pid2), 1);
     $dat = $this->_generate_records(array('username', 'status', 'creation'), 5);
     $db_config->add_num_row(count($dat), 1);
     $db_config->add_num_row(count($dat), 1);
     for ($idx = 0; $idx < count($dat); $idx++) {
         $db_config->add_record($dat[$idx], 1);
     }
     // test one, no record/data
     $bx = $this->_create_default_box();
     $db = new DB_SourceAgency();
     capture_reset_and_start();
     show_referees($pid1);
     $this->set_text(capture_stop_and_get());
     $this->push_msg("Test One");
     $this->_testFor_string_length(72);
     $msg = $t->translate("There are no developers that have " . "offered themselves as referees");
     $this->_testFor_pattern($this->_to_regexp($msg));
     $this->pop_msg();
     // test two, data is defined
     $bx = $this->_create_default_box();
     $db = new DB_SourceAgency();
     capture_reset_and_start();
     show_referees($pid2);
     $this->set_text(capture_stop_and_get());
     $this->push_msg("Test Two");
     $this->_testFor_string_length(4940);
     $msg = $t->translate("There are no developers that have " . "offered themselves as referees");
     $this->reverse_next_test();
     $this->_testFor_pattern($this->_to_regexp($msg));
     $this->_checkFor_a_box('Referees');
     $this->_checkFor_columns(4);
     $this->_checkFor_column_titles(array('Number', 'Username', 'Status', 'Creation'), '', '', '');
     $colors = array(0 => '#FFFFFF', 1 => 'gold');
     for ($idx = 0; $idx < count($dat); $idx++) {
         $v = array("<b>" . ($idx + 1) . "</b>", '<b>' . lib_nick($dat[$idx]['username']) . '</b>', '<b>' . show_status($dat[$idx]['status']) . '</b>', '<b>' . timestr(mktimestamp($dat[$idx]['creation'])) . '</b>');
         $this->push_msg("Test {$idx}");
         $this->_checkFor_column_values($v, '', '', $colors[$idx % 2]);
         $this->pop_msg();
     }
     $this->pop_msg();
     $this->_check_db($db_config);
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:52,代码来源:TestRefereeslib.php

示例6: esc_url

			<td class="name column-name"><a class='row-title' href='<?php echo esc_url( add_query_arg(array('page'=>'ecart-customers','id'=>$Customer->id),admin_url('admin.php'))); ?>' title='<?php _e('Edit','Ecart'); ?> &quot;<?php echo esc_attr($CustomerName); ?>&quot;'><?php echo esc_html($CustomerName); ?></a><?php echo !empty($Customer->company)?"<br />".esc_html($Customer->company):""; ?></td>
			<td class="login column-login<?php echo in_array('login',$hidden)?' hidden':''; ?>"><?php echo esc_html($Customer->user_login); ?></td>
			<td class="email column-email<?php echo in_array('email',$hidden)?' hidden':''; ?>"><a href="mailto:<?php echo esc_attr($Customer->email); ?>"><?php echo esc_html($Customer->email); ?></a></td>

			<td class="location column-location<?php echo in_array('location',$hidden)?' hidden':''; ?>"><?php
				$location = '';
				$location = $Customer->city;
				if (!empty($location) && !empty($Customer->state)) $location .= ', ';
				$location .= $Customer->state;
				if (!empty($location) && !empty($Customer->country))
					$location .= ' &mdash; ';
				$location .= $Customer->country;
				echo esc_html($location);
				 ?></td>
			<td class="total column-total<?php echo in_array('total',$hidden)?' hidden':''; ?>"><a href="<?php echo esc_url( add_query_arg(array('page'=>'ecart-orders','customer'=>$Customer->id),admin_url('admin.php'))); ?>"><?php echo $Customer->orders; ?> &mdash; <?php echo money($Customer->total); ?></a></td>
			<td class="date column-date<?php echo in_array('date',$hidden)?' hidden':''; ?>"><?php echo date("Y/m/d",mktimestamp($Customer->created)); ?></td>
		</tr>
		<?php endforeach; ?>
		</tbody>
	<?php else: ?>
		<tbody><tr><td colspan="6"><?php _e('No','Ecart'); ?> <?php _e('customers, yet.','Ecart'); ?></td></tr></tbody>
	<?php endif; ?>
	</table>

	</form>
	<div class="tablenav" style="display:none !important;">
		<?php if(current_user_can('ecart_export_customers')): ?>
		<div class="alignleft actions">
			<form action="<?php echo esc_url(add_query_arg(array_merge($_GET,array('src'=>'export_customers')),admin_url("admin.php"))); ?>" id="log" method="post">
			<button type="button" id="export-settings-button" name="export-settings" class="button-secondary"><?php _e('Export Options','Ecart'); ?></button>
			<div id="export-settings" class="hidden">
开发者ID:robbiespire,项目名称:paQui,代码行数:31,代码来源:customers.php

示例7: in_array

</td>
			<td class="total column-total<?php 
        echo in_array('total', $hidden) ? ' hidden' : '';
        ?>
"><?php 
        echo $Customer->orders;
        ?>
 &mdash; <?php 
        echo money($Customer->total);
        ?>
</td>
			<td class="date column-date<?php 
        echo in_array('date', $hidden) ? ' hidden' : '';
        ?>
"><?php 
        echo date("Y/m/d", mktimestamp($Customer->created));
        ?>
</td>
		</tr>
		<?php 
    }
    ?>
		</tbody>
	<?php 
} else {
    ?>
		<tbody><tr><td colspan="6"><?php 
    _e('No', 'Shopp');
    ?>
 <?php 
    _e('customers, yet.', 'Shopp');
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:31,代码来源:customers.php

示例8: dashboard_orders

 function dashboard_orders($args = null)
 {
     global $Shopp;
     $db = DB::get();
     $defaults = array('before_widget' => '', 'before_title' => '', 'widget_name' => '', 'after_title' => '', 'after_widget' => '');
     if (!$args) {
         $args = array();
     }
     $args = array_merge($defaults, $args);
     if (!empty($args)) {
         extract($args, EXTR_SKIP);
     }
     $statusLabels = $this->Settings->get('order_status');
     echo $before_widget;
     echo $before_title;
     echo $widget_name;
     echo $after_title;
     $purchasetable = DatabaseObject::tablename(Purchase::$table);
     $purchasedtable = DatabaseObject::tablename(Purchased::$table);
     $Orders = $db->query("SELECT p.*,count(i.id) as items FROM {$purchasetable} AS p LEFT JOIN {$purchasedtable} AS i ON i.purchase=p.id GROUP BY i.purchase ORDER BY created DESC LIMIT 6", AS_ARRAY);
     if (!empty($Orders)) {
         echo '<table class="widefat">';
         echo '<tr><th scope="col">' . __('Name', 'Shopp') . '</th><th scope="col">' . __('Date', 'Shopp') . '</th><th scope="col" class="num">' . __('Items', 'Shopp') . '</th><th scope="col" class="num">' . __('Total', 'Shopp') . '</th><th scope="col" class="num">' . __('Status', 'Shopp') . '</th></tr>';
         echo '<tbody id="orders" class="list orders">';
         $even = false;
         foreach ($Orders as $Order) {
             echo '<tr' . (!$even ? ' class="alternate"' : '') . '>';
             $even = !$even;
             echo '<td><a class="row-title" href="' . add_query_arg(array('page' => $this->Admin->orders, 'id' => $Order->id), $Shopp->wpadminurl . "admin.php") . '" title="View &quot;Order ' . $Order->id . '&quot;">' . (empty($Order->firstname) && empty($Order->lastname) ? '(no contact name)' : $Order->firstname . ' ' . $Order->lastname) . '</a></td>';
             echo '<td>' . date("Y/m/d", mktimestamp($Order->created)) . '</td>';
             echo '<td class="num">' . $Order->items . '</td>';
             echo '<td class="num">' . money($Order->total) . '</td>';
             echo '<td class="num">' . $statusLabels[$Order->status] . '</td>';
             echo '</tr>';
         }
         echo '</tbody></table>';
     } else {
         echo '<p>' . __('No orders, yet.', 'Shopp') . '</p>';
     }
     echo $after_widget;
 }
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:41,代码来源:Flow.php

示例9: ereg_replace

 $db->next_record();
 $pmesssubject = $db->f("pmesssubject");
 //$bs->box_strip($t->translate("Show request"));
 $bx->box_begin();
 $bx->box_body_begin();
 $bx->box_columns_begin(2);
 $bx->box_colspan(2, "center", $th_strip_title_bgcolor, "<b><FONT SIZE=+2>" . $pmesssubject . "</FONT></b>", "");
 $bgcolor = "#FFFFFF";
 $bx->box_next_row_of_columns();
 $bx->box_column("left", "30%", $bgcolor, "<B>" . $t->translate("Sender") . ":</B> &nbsp; ");
 $pmessfrom = $db->f("pmessfrom");
 $pmessfrom = ereg_replace("mailto:", "", $pmessfrom);
 $bx->box_column("left", "70%", $bgcolor, $pmessfrom);
 $bx->box_next_row_of_columns();
 $bx->box_column("left", "30%", $bgcolor, "<B>" . $t->translate("Time") . ":</B> &nbsp; ");
 $timestamp = mktimestamp($db->f("pmesstime"));
 $bx->box_column("left", "70%", $bgcolor, timestr_short($timestamp));
 $bx->box_next_row_of_columns();
 $bx->box_colspan(2, "center", $bgcolor, "<b>&nbsp;</b>", "");
 $bgcolor = "#F0F0F0";
 $bx->box_next_row_of_columns();
 $pmessmessage = $db->f("pmessmessage");
 $bx->box_colspan(2, "left", $bgcolor, "<B>" . $t->translate("Content") . ":</B> &nbsp;<BR>\n" . "<PRE>" . $pmessmessage . "</PRE>");
 $bx->box_next_row_of_columns();
 $bgcolor = "#FFFFFF";
 $bx->box_colspan(2, "center", $bgcolor, html_form_action("pmess_edit.php", array(), "POST") . html_form_hidden("pmessid", $pmessid) . html_form_submit($t->translate("Reply"), "") . html_form_action("req_manage.php", array(), "POST") . html_form_hidden("pmessid", $pmessid) . html_form_hidden("option", "delete") . html_form_submit($t->translate("Delete"), ""));
 $bx->box_next_row_of_columns();
 $bx->box_columns_end();
 $bx->box_body_end();
 $bx->box_end();
 $db->query("UPDATE pmessages SET pmessstatus='read' WHERE pmessid='{$pmessid}' AND pmessto='{$username}'");
开发者ID:BackupTheBerlios,项目名称:devcounter-svn,代码行数:31,代码来源:pmess_show.php

示例10: testMonitor_show

 function testMonitor_show()
 {
     global $db, $t, $bx;
     $db_config = new mock_db_configure(2);
     $proid = array(0 => "proid_0", 1 => "proid_1");
     $db_q = array(0 => $this->queries['monitor_show']);
     $db_config->add_query(sprintf($db_q[0], $proid[0]), 0);
     $db_config->add_query(sprintf($db_q[0], $proid[1]), 1);
     $db_config->add_num_row(0, 0);
     $db_config->add_num_row(4, 1);
     $row = $this->_generate_records(array("username", "perms", "importance", "creation"), 4);
     $db_config->add_record($row[0], 1);
     $db_config->add_record($row[1], 1);
     $db_config->add_record($row[2], 1);
     $db_config->add_record($row[3], 1);
     //
     // first call, no records
     //
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     capture_reset_and_start();
     monitor_show($proid[0]);
     $this->set_text(capture_stop_and_get());
     $this->set_msg('test 1');
     $this->_testFor_string_length(41);
     $this->_testFor_pattern("<p>" . $t->translate("Nobody is monitoring this " . "project") . "[.]<p>\n");
     //
     // second call, 4 records
     //
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     capture_reset_and_start();
     monitor_show($proid[1]);
     $this->set_text(capture_stop_and_get());
     $this->set_msg('test 2');
     $this->_testFor_string_length(5255);
     $color = array(0 => "gold", 1 => "#FFFFFF");
     $this->_checkFor_a_box('All these users are monitor this project');
     $this->_checkFor_columns(5);
     $w = array('Number' => '10%', 'Username' => '20%', 'Type' => '20%', 'Importance filter' => '20%', 'Creation' => '30%');
     while (list($key, $val) = each($w)) {
         $this->_checkFor_column_titles(array($key), 'center', $val, '');
     }
     for ($idx = 0; $idx < 4; $idx++) {
         $this->set_msg('test ' . $idx);
         $this->_testFor_box_column('center', '', $color[$idx % 2], '<b>' . ($idx + 1) . '</b>');
         $this->_testFor_box_column('center', '', $color[$idx % 2], '<b>' . lib_nick($row[$idx]['username']) . '</b>');
         $this->_testFor_box_column('center', '', $color[$idx % 2], '<b>' . $row[$idx]['perms'] . '</b>');
         $this->_testFor_box_column('center', '', $color[$idx % 2], '<b>' . $row[$idx]['importance'] . '</b>');
         $str = timestr_middle(mktimestamp($row[$idx]['creation']));
         $this->_testFor_box_column('center', '', $color[$idx % 2], '<b>' . $str . '</b>');
     }
     // finally check that everything went smoothly with the DB
     $this->_check_db($db_config);
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:55,代码来源:TestMonitorlib.php

示例11: tag


//.........这里部分代码省略.........
				else if (empty($options['selected'])) $options['selected'] = $base['country'];

				$countries = $Ecart->Settings->get('target_markets');

				$output = '<select name="billing[country]" id="billing-country" '.inputattrs($options,$select_attrs).'>';
			 	$output .= menuoptions($countries,$options['selected'],true);
				$output .= '</select>';
				return $output;
				break;

			case "save-button":
				if (!isset($options['label'])) $options['label'] = __('Save','Ecart');
				$result = '<input type="hidden" name="customer" value="true" />';
				$result .= '<input type="submit" name="save" id="save-button"'.inputattrs($options).' />';
				return $result;
				break;
			case "marketing":
				if ($options['mode'] == "value") return $this->marketing;
				if (!empty($this->marketing) && value_is_true($this->marketing)) $options['checked'] = true;
				$attrs = array("accesskey","alt","checked","class","disabled","format",
					"minlength","maxlength","readonly","size","src","tabindex",
					"title");
				$input = '<input type="hidden" name="marketing" value="no" />';
				$input .= '<input type="checkbox" name="marketing" id="marketing" value="yes" '.inputattrs($options,$attrs).' />';
				return $input;
				break;


			// Downloads UI tags
			case "hasdownloads":
			case "has-downloads": return (!empty($this->downloads)); break;
			case "downloads":
				if (empty($this->downloads)) return false;
				if (!isset($this->_dowload_looping)) {
					reset($this->downloads);
					$this->_dowload_looping = true;
				} else next($this->downloads);

				if (current($this->downloads) !== false) return true;
				else {
					unset($this->_dowload_looping);
					reset($this->downloads);
					return false;
				}
				break;
			case "download":
				$download = current($this->downloads);
				$df = get_option('date_format');
				$properties = unserialize($download->properties);
				$string = '';
				if (array_key_exists('id',$options)) $string .= $download->download;
				if (array_key_exists('purchase',$options)) $string .= $download->purchase;
				if (array_key_exists('name',$options)) $string .= $download->name;
				if (array_key_exists('variation',$options)) $string .= $download->optionlabel;
				if (array_key_exists('downloads',$options)) $string .= $download->downloads;
				if (array_key_exists('key',$options)) $string .= $download->dkey;
				if (array_key_exists('created',$options)) $string .= $download->created;
				if (array_key_exists('total',$options)) $string .= money($download->total);
				if (array_key_exists('filetype',$options)) $string .= $properties['mimetype'];
				if (array_key_exists('size',$options)) $string .= readableFileSize($download->size);
				if (array_key_exists('date',$options)) $string .= _d($df,mktimestamp($download->created));
				if (array_key_exists('url',$options))
					$string .= ECART_PRETTYURLS?
						ecarturl("download/$download->dkey"):
						ecarturl(array('ecart_download'=>$download->dkey),'account');

				return $string;
				break;

			// Downloads UI tags
			case "haspurchases":
			case "has-purchases":
				$filters = array();
				if (isset($options['daysago']))
					$filters['where'] = "UNIX_TIMESTAMP(o.created) > UNIX_TIMESTAMP()-".($options['daysago']*86400);
				if (empty($Ecart->purchases)) $this->load_orders($filters);
				return (!empty($Ecart->purchases));
				break;
			case "purchases":
				if (!isset($this->_purchaseloop)) {
					reset($Ecart->purchases);
					$Ecart->Purchase = current($Ecart->purchases);
					$this->_purchaseloop = true;
				} else {
					$Ecart->Purchase = next($Ecart->purchases);
				}

				if (current($Ecart->purchases) !== false) return true;
				else {
					unset($this->_purchaseloop);
					return false;
				}
				break;
			case "receipt": // DEPRECATED
			case "order":
				return ecarturl(array('acct'=>'order','id'=>$Ecart->Purchase->id),'account');
				break;

		}
	}
开发者ID:robbiespire,项目名称:paQui,代码行数:101,代码来源:Customer.php

示例12: testViews_show

 function testViews_show()
 {
     global $t, $bx, $db, $sess;
     $db_config = new mock_db_configure(3);
     $qs = array(0 => "SELECT * FROM views,description WHERE views.proid" . "=description.proid AND views.proid='%s'", 1 => "SELECT * FROM comments,auth_user WHERE proid='%s' AND " . "type='%s' AND number='%s' AND ref='%s' AND user_cmt" . "=username ORDER BY creation_cmt ASC");
     $args = $this->_generate_records(array('proid'), 2);
     $d = $this->_generate_records(array('creation', 'description_user', 'configure', 'news', 'comments', 'history', 'step3', 'step4', 'step5', 'cooperation', 'views'), 1);
     // test one: no records
     $db_config->add_query(sprintf($qs[0], $args[0]['proid']), 0);
     $db_config->add_num_row(0, 0);
     // test two: one record
     $db_config->add_query(sprintf($qs[0], $args[1]['proid']), 1);
     $db_config->add_num_row(1, 1);
     $db_config->add_record($d[0], 1);
     $db_config->add_record(false, 1);
     $db_config->add_query(sprintf($qs[1], $args[1]['proid'], 'Views', '0', '0'), 2);
     $db_config->add_num_row(0, 2);
     // test one
     $db = new DB_SourceAgency();
     $this->capture_call('views_show', 46, $args[0]);
     $this->assertEquals("<p>The views have not been configured yet.<p>\n", $this->get_text(), 'Line: ' . __LINE__);
     // test two
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('views_show', 4698 + strlen(timestr(mktimestamp($d[0]['creation']))), $args[1]);
     $this->_checkFor_a_box('Project Information Access');
     $this->_testFor_lib_nick($d[0]['description_user']);
     $str = " - " . timestr(mktimestamp($d[0]['creation'])) . "</b>";
     $this->_testFor_pattern($this->_to_regexp($str));
     $titles = array("View Project Configuration", "Write and Modify news", "Write comments", "See Project History", "See Step 3 (Milestones)", "See Step 4 (Referees)", "See Step 5 (Project Follow-up)", "See Developing Cooperation Proposals", "Project Permission Access");
     $this->_checkFor_column_titles($titles, 'right', '30%', '', '<b>%s</b>: ');
     $this->_testFor_lib_comment_it($args[1]['proid'], "Views", "", "0", "", "Comments on the views?");
     $values = array($d[0]["views"], $d[0]["cooperation"], $d[0]["step5"], $d[0]["step4"], $d[0]["step3"], $d[0]["history"], $d[0]["comments"], $d[0]["news"], $d[0]["configure"]);
     $this->_checkFor_column_values($values);
     $this->_check_db($db_config);
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:36,代码来源:TestViewslib.php

示例13: in_array

				</div>

			</td>
			<td class="discount column-discount<?php echo in_array('discount',$hidden)?' hidden':''; ?>"><?php
				if ($Promotion->type == "Percentage Off") echo percentage($Promotion->discount);
				if ($Promotion->type == "Amount Off") echo money($Promotion->discount);
				if ($Promotion->type == "Free Shipping") echo $this->Settings->get("free_shipping_text");
				if ($Promotion->type == "Buy X Get Y Free") echo __('Buy','Ecart').' '.$Promotion->buyqty.' '.__('Get','Ecart').' '.$Promotion->getqty.' '.__('Free','Ecart');
			?></td>
			<td class="applied column-applied<?php echo in_array('applied',$hidden)?' hidden':''; ?>"><?php echo $Promotion->target; ?></td>
			<td class="eff column-eff<?php echo in_array('eff',$hidden)?' hidden':''; ?>"><strong><?php echo $status[$Promotion->status]; ?></strong><?php
				$starts = (mktimestamp($Promotion->starts) > 1) ?
				                 _d(get_option('date_format'),mktimestamp($Promotion->starts)) :
				                 _d(get_option('date_format'),mktimestamp($Promotion->created));
				$ends = (mktimestamp($Promotion->ends) > 1) ?
				               " — " . _d(get_option('date_format'),mktimestamp($Promotion->ends)) :
				               ", " . __('does not expire','Ecart');
				echo "<br />".$starts.$ends;
			?></td>
		</tr>
		<?php endforeach; ?>
		</tbody>
	<?php else: ?>
		<tbody><tr><td colspan="5"><?php _e('No promotions found.','Ecart'); ?></td></tr></tbody>
	<?php endif; ?>
	</table>
	</form>
	<div class="tablenav">
		<?php if ($page_links) echo "<div class='tablenav-pages'>$page_links</div>"; ?>
		<div class="clear"></div>
	</div>
开发者ID:robbiespire,项目名称:paQui,代码行数:31,代码来源:promotions.php

示例14: load

 /**
  * Load an existing product property index if it exists
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @param int $product Id of the indexed product
  * @param string $type Type of product property indexed
  * @return void
  **/
 function load($product = false, $type = false)
 {
     $this->product = $product;
     $this->type = $type;
     if (empty($product) || empty($type)) {
         return false;
     }
     // Nothing to load
     $r = sDB::query("SELECT id,created FROM {$this->_table} WHERE product='{$product}' AND type='{$type}' LIMIT 1");
     if (!empty($r->id)) {
         $this->id = $r->id;
         $this->created = mktimestamp($r->created);
         $this->_loaded = true;
     }
 }
开发者ID:forthrobot,项目名称:inuvik,代码行数:25,代码来源:Search.php

示例15: testDeveloping_preview

 function testDeveloping_preview()
 {
     global $t, $bx, $auth;
     global $cost, $license, $cooperation, $valid_day, $valid_month, $valid_year, $start_day, $start_month, $start_year, $duration;
     $proid = 'this is the proid';
     $cost = 'ths is the cost';
     $license = 'thsi is the license';
     $cooperation = 'this is the coopeartion';
     $valid_day = 'this is the valid_day';
     $valid_month = 'thsi si the valid month';
     $valid_year = 'this is the valid year';
     $start_day = 'this is the start day';
     $start_month = 'this is the start month';
     $start_year = 'this is the start year';
     $duration = 'this is the duration';
     $slen = strlen(timestr(time())) + 1188;
     $bx = $this->_create_default_box();
     $this->capture_call('developing_preview', $slen, array($proid));
     $this->_checkFor_a_box('PREVIEW', '<center><b>%s</b></center>');
     $this->_checkFor_a_box('Developing Proposal');
     $v = array('Cost' => $cost . " euros", 'License' => $license, 'Cooperation' => $cooperation, 'Status' => 'Proposed', 'Validity' => timestr_middle(mktimestamp(date_to_timestamp($valid_day, $valid_month, $valid_year))), 'Start possible' => timestr_middle(mktimestamp(date_to_timestamp($start_day, $start_month, $start_year))), 'Duration' => $duration . " weeks");
     while (list($key, $val) = each($v)) {
         $str = sprintf('<b>%s:</b> %s\\n', $t->translate($key), $val);
         $this->_testFor_pattern('[<]..?[>]' . $this->_to_regexp($str));
     }
 }
开发者ID:BackupTheBerlios,项目名称:sourceagency,代码行数:26,代码来源:TestDevelopinglib.php


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