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');
 }
 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);
 }
 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);
 }
Exemplo n.º 4
0
 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>';
     }
 }
 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);
 }
Exemplo n.º 6
0
			<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">
</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');
 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;
 }
 $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}'");
 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);
 }
Exemplo n.º 11
0
	function tag ($property,$options=array()) {
		global $Ecart;

		$Order =& $Ecart->Order;
		$checkout = false;
		if (isset($Ecart->Flow->Controller->checkout))
			$checkout = $Ecart->Flow->Controller->checkout;

		// Return strings with no options
		switch ($property) {
			case "url":
				return ecarturl(array('acct'=>null),'account',$Ecart->Gateways->secure); break;
			case "action":
				$action = null;
				if (isset($this->pages[$_GET['acct']])) $action = $_GET['acct'];
				return ecarturl(array('acct'=>$action),'account');
				break;

			case "accounturl": return ecarturl(false,'account'); break;
			case "recover-url": return add_query_arg('acct','recover',ecarturl(false,'account'));
			case "registration-form":
				$regions = Lookup::country_zones();
				add_storefrontjs("var regions = ".json_encode($regions).";",true);
				return $_SERVER['REQUEST_URI'];
				break;
			case "registration-errors":
				$Errors =& EcartErrors();
				if (!$Errors->exist(ECART_ERR)) return false;
				ob_start();
				include(ECART_TEMPLATES.'/errors.php');
				$markup = ob_get_contents();
				ob_end_clean();
				return $markup;
				break;
			case "register":
				return '<input type="submit" name="ecart_registration" value="Register" />';
				break;
			case "process":
				if (!empty($_GET['acct']) && isset($this->pages[$_GET['acct']])) return $_GET['acct'];
				return false;

			case "loggedin": return $Ecart->Order->Customer->login; break;
			case "notloggedin": return (!$Ecart->Order->Customer->login && $Ecart->Settings->get('account_system') != "none"); break;
			case "login-label":
				$accounts = $Ecart->Settings->get('account_system');
				$label = __('Email Address','Ecart');
				if ($accounts == "wordpress") $label = __('Login Name','Ecart');
				if (isset($options['label'])) $label = $options['label'];
				return $label;
				break;
			case "email-login":
			case "loginname-login":
			case "account-login":
				$id = "account-login".($checkout?"-checkout":'');
				if (!empty($_POST['account-login']))
					$options['value'] = $_POST['account-login'];
				if (!isset($options['autocomplete'])) $options['autocomplete'] = "off";
				return '<input type="text" name="account-login" id="'.$id.'"'.inputattrs($options).' />';
				break;
			case "password-login":
				if (!isset($options['autocomplete'])) $options['autocomplete'] = "off";
				$id = "password-login".($checkout?"-checkout":'');

				if (!empty($_POST['password-login']))
					$options['value'] = $_POST['password-login'];
				return '<input type="password" name="password-login" id="'.$id.'"'.inputattrs($options).' />';
				break;
			case "recover-button":
				if (!isset($options['value'])) $options['value'] = __('Get New Password','Ecart');
 					return '<input type="submit" name="recover-login" id="recover-button"'.inputattrs($options).' />';
				break;
			case "submit-login": // Deprecating
			case "login-button":
				if (!isset($options['value'])) $options['value'] = __('Login','Ecart');
				$string = "";
				$id = "submit-login";

				$request = $_GET;
				if (isset($request['acct']) && $request['acct'] == "logout") unset($request['acct']);

				if ($checkout) {
					$id .= "-checkout";
					$string .= '<input type="hidden" name="process-login" id="process-login" value="false" />';
					$string .= '<input type="hidden" name="redirect" value="checkout" />';
				} else $string .= '<input type="hidden" name="process-login" value="true" /><input type="hidden" name="redirect" value="'.ecarturl($request,'account',$Order->security()).'" />';
				$string .= '<input type="submit" name="submit-login" id="'.$id.'"'.inputattrs($options).' />';
				return $string;
				break;
			case "profile-saved":
				$saved = (isset($this->_saved) && $this->_saved);
				unset($this->_saved);
				return $saved;
			case "password-changed":
				$change = (isset($this->_password_change) && $this->_password_change);
				unset($this->_password_change);
				return $change;
			case "errors-exist": return true;
				$Errors = &EcartErrors();
				return ($Errors->exist(ECART_AUTH_ERR));
				break;
			case "login-errors": // @deprecated
			case "errors":
				if (!apply_filters('ecart_show_account_errors',true)) return false;
				$Errors = &EcartErrors();
				if (!$Errors->exist(ECART_AUTH_ERR)) return false;

				ob_start();
				include(ECART_TEMPLATES."/errors.php");
				$errors = ob_get_contents();
				ob_end_clean();
				return $errors;
				break;

			case "menu":
				if (!isset($this->_menu_looping)) {
					reset($this->menus);
					$this->_menu_looping = true;
				} else next($this->menus);

				if (current($this->menus) !== false) return true;
				else {
					unset($this->_menu_looping);
					reset($this->menus);
					return false;
				}
				break;
			case "management":
				$page = current($this->menus);
				if (array_key_exists('url',$options)) return ecarturl(array('acct'=>$page->request),'account');
				if (array_key_exists('action',$options)) return $page->request;
				return $page->label;
			case "accounts": return $Ecart->Settings->get('account_system'); break;
			case "hasaccount":
				$system = $Ecart->Settings->get('account_system');
				if ($system == "wordpress") return ($this->wpuser != 0);
				elseif ($system == "ecart") return (!empty($this->password));
				else return false;
			case "wpuser-created": return $this->newuser;
			case "order-lookup":
				$auth = $Ecart->Settings->get('account_system');
				if ($auth != "none") return true;

				if (!empty($_POST['vieworder']) && !empty($_POST['purchaseid'])) {
					require_once("Purchase.php");
					$Purchase = new Purchase($_POST['purchaseid']);
					if ($Purchase->email == $_POST['email']) {
						$Ecart->Purchase = $Purchase;
						$Purchase->load_purchased();
						ob_start();
						include(ECART_TEMPLATES."/receipt.php");
						$content = ob_get_contents();
						ob_end_clean();
						return apply_filters('ecart_order_lookup',$content);
					}
				}

				ob_start();
				include(ECART_ADMIN_PATH."/orders/account.php");
				$content = ob_get_contents();
				ob_end_clean();
				return apply_filters('ecart_order_lookup',$content);
				break;

			case "firstname":
				if (isset($options['mode']) && $options['mode'] == "value") return $this->firstname;
				if (!empty($this->firstname))
					$options['value'] = $this->firstname;
				return '<input type="text" name="firstname" id="firstname"'.inputattrs($options).' />';
				break;
			case "lastname":
				if (isset($options['mode']) && $options['mode'] == "value") return $this->lastname;
				if (!empty($this->lastname))
					$options['value'] = $this->lastname;
				return '<input type="text" name="lastname" id="lastname"'.inputattrs($options).' />';
				break;
			case "company":
				if (isset($options['mode']) && $options['mode'] == "value") return $this->company;
				if (!empty($this->company))
					$options['value'] = $this->company;
				return '<input type="text" name="company" id="company"'.inputattrs($options).' />';
				break;
			case "email":
				if (isset($options['mode']) && $options['mode'] == "value") return $this->email;
				if (!empty($this->email))
					$options['value'] = $this->email;
				return '<input type="text" name="email" id="email"'.inputattrs($options).' />';
				break;
			case "loginname":
				if (isset($options['mode']) && $options['mode'] == "value") return $this->loginname;
				if (!isset($options['autocomplete'])) $options['autocomplete'] = "off";
				if (!empty($this->loginname))
					$options['value'] = $this->loginname;
				return '<input type="text" name="loginname" id="login"'.inputattrs($options).' />';
				break;
			case "password":
				if (!isset($options['autocomplete'])) $options['autocomplete'] = "off";
				if (isset($options['mode']) && $options['mode'] == "value")
					return strlen($this->password) == 34?str_pad('&bull;',8):$this->password;
				$options['value'] = "";
				return '<input type="password" name="password" id="password"'.inputattrs($options).' />';
				break;
			case "confirm-password":
				if (!isset($options['autocomplete'])) $options['autocomplete'] = "off";
				$options['value'] = "";
				return '<input type="password" name="confirm-password" id="confirm-password"'.inputattrs($options).' />';
				break;
			case "phone":
				if (isset($options['mode']) && $options['mode'] == "value") return $this->phone;
				if (!empty($this->phone))
					$options['value'] = $this->phone;
				return '<input type="text" name="phone" id="phone"'.inputattrs($options).' />';
				break;
			case "hasinfo":
			case "has-info":
				if (!is_object($this->info) || empty($this->info->meta)) return false;
				if (!isset($this->_info_looping)) {
					reset($this->info->meta);
					$this->_info_looping = true;
				} else next($this->info->meta);

				if (current($this->info->meta) !== false) return true;
				else {
					unset($this->_info_looping);
					reset($this->info->meta);
					return false;
				}
				break;
			case "info":
				$defaults = array(
					'mode' => 'input',
					'type' => 'text',
					'name' => false,
					'value' => false
				);
				$options = array_merge($defaults,$options);
				extract($options);

				if ($this->_info_looping)
					$info = current($this->info->meta);
				elseif ($name !== false && is_object($this->info->named[$name]))
					$info = $this->info->named[$name];

				switch ($mode) {
					case "name": return $info->name; break;
					case "value": return $info->value; break;
				}

				if (!$name && !empty($info->name)) $options['name'] = $info->name;
				elseif (!$name) return false;

				if (!$value && !empty($info->value)) $options['value'] = $info->value;

				$allowed_types = array("text","password","hidden","checkbox","radio");
				$type = in_array($type,$allowed_types)?$type:'hidden';
				return '<input type="'.$type.'" name="info['.$options['name'].']" id="customer-info-'.sanitize_title_with_dashes($options['name']).'"'.inputattrs($options).' />';
				break;

			// SHIPPING TAGS
			case "shipping": return $Order->Shipping;
			case "shipping-address":
				if ($options['mode'] == "value") return $Order->Shipping->address;
				if (!empty($Order->Shipping->address))
					$options['value'] = $Order->Shipping->address;
				return '<input type="text" name="shipping[address]" id="shipping-address" '.inputattrs($options).' />';
				break;
			case "shipping-xaddress":
				if ($options['mode'] == "value") return $Order->Shipping->xaddress;
				if (!empty($Order->Shipping->xaddress))
					$options['value'] = $Order->Shipping->xaddress;
				return '<input type="text" name="shipping[xaddress]" id="shipping-xaddress" '.inputattrs($options).' />';
				break;
			case "shipping-city":
				if ($options['mode'] == "value") return $Order->Shipping->city;
				if (!empty($Order->Shipping->city))
					$options['value'] = $Order->Shipping->city;
				return '<input type="text" name="shipping[city]" id="shipping-city" '.inputattrs($options).' />';
				break;
			case "shipping-province":
			case "shipping-state":
				if ($options['mode'] == "value") return $Order->Shipping->state;
				if (!isset($options['selected'])) $options['selected'] = false;
				if (!empty($Order->Shipping->state)) {
					$options['selected'] = $Order->Shipping->state;
					$options['value'] = $Order->Shipping->state;
				}
				$countries = Lookup::countries();
				$output = false;
				$country = $base['country'];
				if (!empty($Order->Shipping->country))
					$country = $Order->Shipping->country;
				if (!array_key_exists($country,$countries)) $country = key($countries);

				if (empty($options['type'])) $options['type'] = "menu";
				$regions = Lookup::country_zones();
				$states = $regions[$country];
				if (is_array($states) && $options['type'] == "menu") {
					$label = (!empty($options['label']))?$options['label']:'';
					$output = '<select name="shipping[state]" id="shipping-state" '.inputattrs($options,$select_attrs).'>';
					$output .= '<option value="" selected="selected">'.$label.'</option>';
				 	$output .= menuoptions($states,$options['selected'],true);
					$output .= '</select>';
				} else if ($options['type'] == "menu") {
					$options['disabled'] = 'disabled';
					$options['class'] = ($options['class']?" ":null).'unavailable';
					$label = (!empty($options['label']))?$options['label']:'';
					$output = '<select name="shipping[state]" id="shipping-state" '.inputattrs($options,$select_attrs).'></select>';
				} else $output .= '<input type="text" name="shipping[state]" id="shipping-state" '.inputattrs($options).'/>';
				return $output;
				break;
			case "shipping-postcode":
				if ($options['mode'] == "value") return $Order->Shipping->postcode;
				if (!empty($Order->Shipping->postcode))
					$options['value'] = $Order->Shipping->postcode;
				return '<input type="text" name="shipping[postcode]" id="shipping-postcode" '.inputattrs($options).' />'; break;
			case "shipping-country":
				if ($options['mode'] == "value") return $Order->Shipping->country;
				$base = $Ecart->Settings->get('base_operations');
				if (!empty($Order->Shipping->country))
					$options['selected'] = $Order->Shipping->country;
				else if (empty($options['selected'])) $options['selected'] = $base['country'];

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

				$output = '<select name="shipping[country]" id="shipping-country" '.inputattrs($options,$select_attrs).'>';
			 	$output .= menuoptions($countries,$options['selected'],true);
				$output .= '</select>';
				return $output;
				break;
			case "same-shipping-address":
				$label = __("Same shipping address","Ecart");
				if (isset($options['label'])) $label = $options['label'];
				$checked = ' checked="checked"';
				if (isset($options['checked']) && !value_is_true($options['checked'])) $checked = '';
				$output = '<label for="same-shipping"><input type="checkbox" name="sameshipaddress" value="on" id="same-shipping" '.$checked.' /> '.$label.'</label>';
				return $output;
				break;
			case "residential-shipping-address":
				$label = __("Residential shipping address","Ecart");
				if (isset($options['label'])) $label = $options['label'];
				if (isset($options['checked']) && value_is_true($options['checked'])) $checked = ' checked="checked"';
				$output = '<label for="residential-shipping"><input type="hidden" name="shipping[residential]" value="no" /><input type="checkbox" name="shipping[residential]" value="yes" id="residential-shipping" '.$checked.' /> '.$label.'</label>';
				return $output;
				break;

			// BILLING TAGS
			case "billing-address":
				if ($options['mode'] == "value") return $Order->Billing->address;
				if (!empty($Order->Billing->address))
					$options['value'] = $Order->Billing->address;
				return '<input type="text" name="billing[address]" id="billing-address" '.inputattrs($options).' />';
				break;
			case "billing-xaddress":
				if ($options['mode'] == "value") return $Order->Billing->xaddress;
				if (!empty($Order->Billing->xaddress))
					$options['value'] = $Order->Billing->xaddress;
				return '<input type="text" name="billing[xaddress]" id="billing-xaddress" '.inputattrs($options).' />';
				break;
			case "billing-city":
				if ($options['mode'] == "value") return $Order->Billing->city;
				if (!empty($Order->Billing->city))
					$options['value'] = $Order->Billing->city;
				return '<input type="text" name="billing[city]" id="billing-city" '.inputattrs($options).' />';
				break;
			case "billing-province":
			case "billing-state":
				if ($options['mode'] == "value") return $Order->Billing->state;
				if (!isset($options['selected'])) $options['selected'] = false;
				if (!empty($Order->Billing->state)) {
					$options['selected'] = $Order->Billing->state;
					$options['value'] = $Order->Billing->state;
				}
				if (empty($options['type'])) $options['type'] = "menu";
				$countries = Lookup::countries();

				$output = false;
				$country = $base['country'];
				if (!empty($Order->Billing->country))
					$country = $Order->Billing->country;
				if (!array_key_exists($country,$countries)) $country = key($countries);

				$regions = Lookup::country_zones();
				$states = $regions[$country];
				if (is_array($states) && $options['type'] == "menu") {
					$label = (!empty($options['label']))?$options['label']:'';
					$output = '<select name="billing[state]" id="billing-state" '.inputattrs($options,$select_attrs).'>';
					$output .= '<option value="" selected="selected">'.$label.'</option>';
				 	$output .= menuoptions($states,$options['selected'],true);
					$output .= '</select>';
				} else if ($options['type'] == "menu") {
					$options['disabled'] = 'disabled';
					$options['class'] = ($options['class']?" ":null).'unavailable';
					$label = (!empty($options['label']))?$options['label']:'';
					$output = '<select name="billing[state]" id="billing-state" '.inputattrs($options,$select_attrs).'></select>';
				} else $output .= '<input type="text" name="billing[state]" id="billing-state" '.inputattrs($options).'/>';
				return $output;
				break;
			case "billing-postcode":
				if ($options['mode'] == "value") return $Order->Billing->postcode;
				if (!empty($Order->Billing->postcode))
					$options['value'] = $Order->Billing->postcode;
				return '<input type="text" name="billing[postcode]" id="billing-postcode" '.inputattrs($options).' />';
				break;
			case "billing-country":
				if ($options['mode'] == "value") return $Order->Billing->country;
				$base = $Ecart->Settings->get('base_operations');

				if (!empty($Order->Billing->country))
					$options['selected'] = $Order->Billing->country;
				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;

		}
	}
Exemplo n.º 12
0
 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);
 }
Exemplo n.º 13
0
				</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>
Exemplo n.º 14
0
 /**
  * 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;
     }
 }
 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));
     }
 }
Exemplo n.º 16
0
	function tag ($property,$options=array()) {
		global $Ecart;

		$taxes = isset($options['taxes'])?$options['taxes']:false;
		$taxrate = 0;
		if ($property == "item-unitprice" || $property == "item-total")
			$taxrate = ecart_taxrate($taxes);

		// Return strings with no options
		switch ($property) {
			case "receipt":
				// Skip the receipt processing when sending order notifications in admin without the receipt
				if (defined('WP_ADMIN') && isset($_POST['receipt']) && $_POST['receipt'] == "no") return;
				if (isset($options['template']) && is_readable(ECART_TEMPLATES."/".$options['template']))
					return $this->receipt($template);
				else return $this->receipt();
				break;
			case "url": return ecarturl(false,'account'); break;
			case "id": return $this->id; break;
			case "customer": return $this->customer; break;
			case "date":
				if (empty($options['format'])) $options['format'] = get_option('date_format').' '.get_option('time_format');
				return _d($options['format'],((is_int($this->created))?$this->created:mktimestamp($this->created)));
				break;
			case "card": return (!empty($this->card))?sprintf("%'X16d",$this->card):''; break;
			case "cardtype": return $this->cardtype; break;
			case "txnid":
			case "transactionid": return $this->txnid; break;
			case "firstname": return esc_html($this->firstname); break;
			case "lastname": return esc_html($this->lastname); break;
			case "company": return esc_html($this->company); break;
			case "email": return esc_html($this->email); break;
			case "phone": return esc_html($this->phone); break;
			case "address": return esc_html($this->address); break;
			case "xaddress": return esc_html($this->xaddress); break;
			case "city": return esc_html($this->city); break;
			case "state":
				if (strlen($this->state > 2)) return esc_html($this->state);
				$regions = Lookup::country_zones();
				$states = $regions[$this->country];
				return $states[$this->state];
				break;
			case "postcode": return esc_html($this->postcode); break;
			case "country":
				$countries = $Ecart->Settings->get('target_markets');
				return $countries[$this->country]; break;
			case "shipaddress": return esc_html($this->shipaddress); break;
			case "shipxaddress": return esc_html($this->shipxaddress); break;
			case "shipcity": return esc_html($this->shipcity); break;
			case "shipstate":
				if (strlen($this->shipstate > 2)) return esc_html($this->shipstate);
				$regions = Lookup::country_zones();
				$states = $regions[$this->country];
				return $states[$this->shipstate];
				break;
			case "shippostcode": return esc_html($this->shippostcode); break;
			case "shipcountry":
				$countries = $Ecart->Settings->get('target_markets');
				return $countries[$this->shipcountry]; break;
			case "shipmethod": return esc_html($this->shipmethod); break;
			case "totalitems": return count($this->purchased); break;
			case "has-items":
			case "hasitems":
				if (empty($this->purchased)) $this->load_purchased();
				return (count($this->purchased) > 0);
				break;
			case "items":
				if (!isset($this->_items_loop)) {
					reset($this->purchased);
					$this->_items_loop = true;
				} else next($this->purchased);

				if (current($this->purchased) !== false) return true;
				else {
					unset($this->_items_loop);
					return false;
				}
			case "item-id":
				$item = current($this->purchased);
				return $item->id; break;
			case "item-product":
				$item = current($this->purchased);
				return $item->product; break;
			case "item-price":
				$item = current($this->purchased);
				return $item->price; break;
			case "item-name":
				$item = current($this->purchased);
				return $item->name; break;
			case "item-description":
				$item = current($this->purchased);
				return $item->description; break;
			case "item-options":
				if (!isset($options['after'])) $options['after'] = "";
				$item = current($this->purchased);
				return (!empty($item->optionlabel))?$options['before'].$item->optionlabel.$options['after']:''; break;
			case "item-sku":
				$item = current($this->purchased);
				return $item->sku; break;
			case "item-download":
				$item = current($this->purchased);
				if (empty($item->download)) return "";
				if (!isset($options['label'])) $options['label'] = __('Download','Ecart');
				$classes = "";
				if (isset($options['class'])) $classes = ' class="'.$options['class'].'"';
				$request = ECART_PRETTYURLS?
					"download/$item->dkey":
					array('src'=>'download','ecart_download'=>$item->dkey);
				$url = ecarturl($request,'catalog');
				return '<a href="'.$url.'"'.$classes.'>'.$options['label'].'</a>'; break;
			case "item-quantity":
				$item = current($this->purchased);
				return $item->quantity; break;
			case "item-unitprice":
				$item = current($this->purchased);
				$amount = $item->unitprice+($this->taxing == 'inclusive'?$item->unittax:0);
				return money($amount); break;
			case "item-total":
				$item = current($this->purchased);
				$amount = $item->total+($this->taxing == 'inclusive'?$item->unittax*$item->quantity:0);
				return money($amount); break;
			case "item-has-inputs":
			case "item-hasinputs":
				$item = current($this->purchased);
				return (count($item->data) > 0); break;
			case "item-inputs":
				$item = current($this->purchased);
				if (!isset($this->_iteminputs_loop)) {
					reset($item->data);
					$this->_iteminputs_loop = true;
				} else next($item->data);

				if (current($item->data) !== false) return true;
				else {
					unset($this->_iteminputs_loop);
					return false;
				}
				break;
			case "item-input":
				$item = current($this->purchased);
				$data = current($item->data);
				$name = key($item->data);
				if (isset($options['name'])) return esc_html($name);
				return esc_html($data);
				break;
			case "item-inputs-list":
			case "item-inputslist":
			case "item-inputs-list":
			case "iteminputslist":
				$item = current($this->purchased);
				if (empty($item->data)) return false;
				$before = ""; $after = ""; $classes = ""; $excludes = array();
				if (!empty($options['class'])) $classes = ' class="'.$options['class'].'"';
				if (!empty($options['exclude'])) $excludes = explode(",",$options['exclude']);
				if (!empty($options['before'])) $before = $options['before'];
				if (!empty($options['after'])) $after = $options['after'];

				$result .= $before.'<ul'.$classes.'>';
				foreach ($item->data as $name => $data) {
					if (in_array($name,$excludes)) continue;
					$result .= '<li><strong>'.esc_html($name).'</strong>: '.esc_html($data).'</li>';
				}
				$result .= '</ul>'.$after;
				return $result;
				break;
			case "item-has-addons":
			case "item-hasaddons":
				$item = current($this->purchased);
				return (count($item->addons) > 0); break;
			case "item-addons":
				$item = current($this->purchased);
				if (!isset($this->_itemaddons_loop)) {
					reset($item->addons->meta);
					$this->_itemaddons_loop = true;
				} else next($item->addons->meta);

				if (current($item->addons->meta) !== false) return true;
				else {
					unset($this->_itemaddons_loop);
					return false;
				}
				break;
			case "item-addons":
				$item = current($this->purchased);
				$addon = current($item->addons->meta);
				if (isset($options['id'])) return esc_html($addon->id);
				if (isset($options['name'])) return esc_html($addon->name);
				if (isset($options['label'])) return esc_html($addon->name);
				if (isset($options['type'])) return esc_html($addon->value->type);
				if (isset($options['onsale'])) return $addon->value->onsale;
				if (isset($options['inventory'])) return $addon->value->inventory;
				if (isset($options['sku'])) return esc_html($addon->value->sku);
				if (isset($options['unitprice'])) return money($addon->value->unitprice);
				return money($addon->value->unitprice);
				break;
			case "item-addons-list":
			case "item-addonslist":
			case "item-addons-list":
			case "itemaddonslist":
				$item = current($this->purchased);
				if (empty($item->addons)) return false;
				$defaults = array(
					'prices' => "on",
					'download' => __('Download','Ecart'),
					'before' => '',
					'after' => '',
					'classes' => '',
					'excludes' => ''
				);
				$options = array_merge($defaults,$options);
				extract($options);

				$class = !empty($classes)?' class="'.join(' ',explode(',',$classes)).'"':'';
				$taxrate = 0;
				if ($item->unitprice > 0)
					$taxrate = round($item->unittax/$item->unitprice,4);

				$result = $before.'<ul'.$class.'>';
				foreach ($item->addons->meta as $id => $addon) {
					if (in_array($addon->name,$excludes)) continue;
					if ($this->taxing == "inclusive")
						$price = $addon->value->unitprice+($addon->value->unitprice*$taxrate);
					else $price = $addon->value->unitprice;

					$link = false;
					if (isset($addon->value->download) && isset($addon->value->dkey)) {
						$dkey = $addon->value->dkey;
						$request = ECART_PRETTYURLS?"download/$dkey":array('ecart_download'=>$dkey);
						$url = ecarturl($request,'catalog');
						$link = '<br /><a href="'.$url.'">'.$download.'</a>';
					}

					$pricing = value_is_true($prices)?" (".money($price).")":"";
					$result .= '<li>'.esc_html($addon->name.$pricing).$link.'</li>';
				}
				$result .= '</ul>'.$after;
				return $result;
				break;
			case "has-data":
			case "hasdata": return (is_array($this->data) && count($this->data) > 0); break;
			case "orderdata":
				if (!isset($this->_data_loop)) {
					reset($this->data);
					$this->_data_loop = true;
				} else next($this->data);

				if (current($this->data) !== false) return true;
				else {
					unset($this->_data_loop);
					return false;
				}
				break;
			case "data":
				if (!is_array($this->data)) return false;
				$data = current($this->data);
				$name = key($this->data);
				if (isset($options['name'])) return esc_html($name);
				return esc_html($data);
				break;
			case "promolist":
			case "promo-list":
				$output = "";
				if (!empty($this->promos)) {
					$output .= '<ul>';
					foreach ($this->promos as $promo)
						$output .= '<li>'.$promo.'</li>';
					$output .= '</ul>';
				}
				return $output;
			case "has-promo":
			case "haspromo":
				if (empty($options['name'])) return false;
				return (in_array($options['name'],$this->promos));
				break;
			case "subtotal": return money($this->subtotal); break;
			case "hasfreight": return (!empty($this->shipmethod) || $this->freight > 0);
			case "freight": return money($this->freight); break;
			case "hasdownloads": return ($this->downloads);
			case "hasdiscount": return ($this->discount > 0);
			case "discount": return money($this->discount); break;
			case "hastax": return ($this->tax > 0)?true:false;
			case "tax": return money($this->tax); break;
			case "total": return money($this->total); break;
			case "status":
				$labels = $Ecart->Settings->get('order_status');
				if (empty($labels)) $labels = array('');
				return $labels[$this->status];
				break;
			case "paid": return ($this->txnstatus == "CHARGED"); break;
			case "notpaid": return ($this->txnstatus != "CHARGED"); break;
			case "payment":
				$labels = Lookup::payment_status_labels();
				return isset($labels[$this->txnstatus])?$labels[$this->txnstatus]:$this->txnstatus; break;
		}
	}
Exemplo n.º 17
0
# This is the text backend of the system
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require "./include/prepend.php3";
page_open(array("sess" => "SourceContact_Session"));
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceContact_Session", "auth" => "SourceContact_Auth", "perm" => "SourceContact_Perm"));
}
header("Content-Type: text/plain");
// Disabling cache
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// HTTP/1.0
require "./include/config.inc";
require "./include/lib.inc";
$db = new DB_SourceContact();
$db->query("SELECT * FROM contact WHERE contact.status='A' ORDER BY contact.modification DESC limit 10");
$i = 0;
while ($db->next_record()) {
    echo $db->f("name") . "\n";
    $timestamp = mktimestamp($db->f("modification"));
    echo timestr($timestamp) . "\n";
    echo $sys_url . "conbyconid.php?id=" . $db->f("conid") . "\n";
    $i++;
}
@page_close();
Exemplo n.º 18
0
</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 $states[$Promotion->status];
        ?>
</strong><?php 
        $starts = mktimestamp($Promotion->starts) > 1 ? Shopp::_d(get_option('date_format'), Shopp::mktimestamp($Promotion->starts)) : Shopp::_d(get_option('date_format'), Shopp::mktimestamp($Promotion->created));
        $ends = Shopp::mktimestamp($Promotion->ends) > 1 ? " — " . Shopp::_d(get_option('date_format'), Shopp::mktimestamp($Promotion->ends)) : ", " . __('does not expire', 'Shopp');
        echo "<br />" . $starts . $ends;
        ?>
</td>
		</tr>
		<?php 
    }
    ?>
		</tbody>
	<?php 
} else {
    ?>
		<tbody><tr><td colspan="5"><?php 
    Shopp::esc_html_e('No discounts found.');
    ?>
Exemplo n.º 19
0
 /**
  * Renders the recent orders dashboard widget
  *
  * @author Jonathan Davis
  * @since 1.0
  *
  * @return void
  **/
 public static function orders_widget($args = false)
 {
     $defaults = array('before_widget' => '', 'before_title' => '', 'widget_name' => '', 'after_title' => '', 'after_widget' => '');
     $args = array_merge($defaults, (array) $args);
     extract($args, EXTR_SKIP);
     $statusLabels = shopp_setting('order_status');
     echo $before_widget;
     echo $before_title;
     echo $widget_name;
     echo $after_title;
     $purchasetable = ShoppDatabaseObject::tablename(ShoppPurchase::$table);
     $purchasedtable = ShoppDatabaseObject::tablename(Purchased::$table);
     $txnlabels = Lookup::txnstatus_labels();
     if (!($Orders = get_transient('shopp_dashboard_orders'))) {
         $Orders = sDB::query("SELECT p.*,count(*) as items FROM (SELECT * FROM {$purchasetable} WHERE txnstatus != 'purchased' AND txnstatus != 'invoiced' ORDER BY created DESC LIMIT 6) AS p LEFT JOIN {$purchasedtable} AS i ON i.purchase=p.id GROUP BY p.id ORDER BY p.id DESC", 'array');
         set_transient('shopp_dashboard_orders', $Orders, 90);
         // Keep for the next 1 minute
     }
     if (!empty($Orders)) {
         echo '<table class="widefat">' . '<thead>' . '	<tr>' . '		<th scope="col">' . __('Name', 'Shopp') . '</th>' . '		<th scope="col">' . __('Date', 'Shopp') . '</th>' . '		<th scope="col" class="num">' . Shopp::__('Items') . '</th>' . '		<th scope="col" class="num">' . Shopp::__('Total') . '</th>' . '		<th scope="col" class="num">' . Shopp::__('Status') . '</th>' . '	</tr>' . '</thead>' . '	<tbody id="orders" class="list orders">';
         $even = false;
         foreach ($Orders as $Order) {
             $classes = array();
             if ($even = !$even) {
                 $classes[] = 'alternate';
             }
             $txnstatus = isset($txnlabels[$Order->txnstatus]) ? $txnlabels[$Order->txnstatus] : $Order->txnstatus;
             $status = isset($statusLabels[$Order->status]) ? $statusLabels[$Order->status] : $Order->status;
             $contact = '' == $Order->firstname . $Order->lastname ? '(no contact name)' : $Order->firstname . ' ' . $Order->lastname;
             $url = add_query_arg(array('page' => ShoppAdmin()->pagename('orders'), 'id' => $Order->id), admin_url('admin.php'));
             $classes[] = strtolower(preg_replace('/[^\\w]/', '_', $Order->txnstatus));
             echo '<tr class="' . join(' ', $classes) . '">' . '	<td><a class="row-title" href="' . $url . '" title="View &quot;Order ' . $Order->id . '&quot;">' . (empty($Order->firstname) && empty($Order->lastname) ? '(no contact name)' : $Order->firstname . ' ' . $Order->lastname) . '</a></td>' . '	<td>' . date("Y/m/d", mktimestamp($Order->created)) . '</td>' . '	<td class="num items">' . $Order->items . '</td>' . '	<td class="num total">' . money($Order->total) . '</td>' . '	<td class="num status">' . $statusLabels[$Order->status] . '</td>' . '</tr>';
         }
         echo '</tbody></table>';
     } else {
         echo '<p>' . Shopp::__('No orders, yet.') . '</p>';
     }
     echo $after_widget;
 }
Exemplo n.º 20
0
 if ($db->f("contact") != "no") {
     echo "<tr><td align=right width=30%>" . $t->translate("Contact") . ":</td><td width=70%>";
     $pquery["devname"] = $db->f("username");
     htmlp_link("pmess_compose.php", $pquery, $t->translate("write Developer"));
 }
 if ($db->f("showemail") == "yes") {
     echo "<tr><td align=right width=30%>" . $t->translate("E-Mail") . ":</td><td width=70%><a href=\"mailto:" . $db->f("email_usr") . "\">" . ereg_replace("@", " at ", htmlentities($db->f("email_usr"))) . "</a>\n";
 }
 echo "<tr><td align=right width=30%>" . $t->translate("Developer last modified") . ":</td><td width=70%>\n";
 $timestamp = mktimestamp($db->f("modification_usr"));
 echo timestr($timestamp) . "</td></tr>\n";
 echo "<tr><td align=right width=30%>" . $t->translate("Developer created") . ":</td><td width=70%>\n";
 $timestamp = mktimestamp($db->f("creation_usr"));
 echo timestr($timestamp) . "</td></tr>\n";
 echo "<tr><td align=right width=30%>" . $t->translate("Profile last modified") . ":</td><td width=70%>\n";
 $timestamp = mktimestamp($db->f("creation"));
 echo timestr($timestamp) . "</td></tr>\n";
 $db2->query("SELECT devel_cnt FROM counter WHERE develid='{$develid}'");
 $db2->next_record();
 echo "<tr><td align=right width=30%>" . $t->translate("# of Visits") . ":</td><td width=70%>\n";
 echo $db2->f("devel_cnt") . "</td></tr>\n";
 echo "<tr><td align=right width=30%>" . $t->translate("Registration Number") . ":</td><td width=70%>\n";
 echo printf("#%09d", $develid) . "</td></tr>\n";
 echo "</table>\n";
 $bx->box_body_end();
 $bx->box_end();
 $bx->box_begin();
 $bx->box_title($t->translate("Professional Data"));
 $bx->box_body_begin();
 echo "<table border=0 width=100% align=center cellspacing=3 cellpadding=3>\n";
 $profid = $db->f("profession");
 function testshow_selected_content()
 {
     global $t, $bx, $db;
     $qs = array(0 => $this->queries['show_selected_content']);
     $db_config = new mock_db_configure(1);
     $args = $this->_generate_records(array('proid'), 1);
     $dat = $this->_generate_records(array('creation', 'username', 'skills', 'platform', 'architecture', 'docs', 'environment', 'specification'), 1);
     $db_config->add_query(sprintf($qs[0], $args[0]['proid']), 0);
     $db_config->add_record($dat[0], 0);
     $db = new DB_SourceAgency();
     $bx = $this->_create_default_box();
     $this->capture_call('show_selected_content', 944, $args[0]);
     $str = '</a> - ' . timestr(mktimestamp($dat[0]['creation'])) . '</b>';
     $this->_testFor_pattern($this->_to_regexp($str));
     $this->_testFor_lib_nick($dat[0]['username']);
     $template = "<b>%s:</b> %s\n";
     $v = array('Skills' => $dat[0]['skills'], 'Plattform' => $dat[0]['platform'], 'Architecture' => $dat[0]['architecture'], 'Environment' => $dat[0]['environment'], 'Documentation' => $dat[0]['docs'], 'Technical Specification' => $dat[0]['specification']);
     while (list($key, $val) = each($v)) {
         $str = sprintf($template, $t->translate($key), $val);
         $this->_testFor_pattern('[<]..?[>]' . $this->_to_regexp($str));
     }
     $this->_check_db($db_config);
 }
Exemplo n.º 22
0
	/**
	 * Gets data from the session data table and loads Member
	 * objects into the User from the loaded data.
	 *
	 * @since 1.1
	 *
	 * @return boolean
	 **/
	function load ($id) {
		$db = &DB::get();

		if (is_robot() || empty($this->session)) return true;

		$loaded = false;

		$query = "SELECT * FROM $this->_table WHERE session='$this->session'";
		if ($result = $db->query($query)) {
			if (substr($result->data,0,1) == "!") {
				$key = $_COOKIE[ECART_SECURE_KEY];
				if (empty($key) && !is_ecart_secure())
					ecart_redirect(force_ssl(raw_request_url(),true));
				$readable = $db->query("SELECT AES_DECRYPT('".
										mysql_real_escape_string(
											base64_decode(
												substr($result->data,1)
											)
										)."','$key') AS data");
				$result->data = $readable->data;
			}
			$this->ip = $result->ip;
			$this->data = unserialize($result->data);
			$this->created = mktimestamp($result->created);
			$this->modified = mktimestamp($result->modified);
			$loaded = true;

			do_action('ecart_session_loaded');
		} else {
			if (!empty($this->session))
				$db->query("INSERT INTO $this->_table (session, ip, data, created, modified)
							VALUES ('$this->session','$this->ip','',now(),now())");
		}
		do_action('ecart_session_load');

		// Read standard session data
		if (@file_exists("$this->path/sess_$id"))
			return (string) @file_get_contents("$this->path/sess_$id");

		return $loaded;
	}
Exemplo n.º 23
0
 $bx->box_body_begin();
 echo "<table border=0 align=center cellspacing=1 cellpadding=1 width=100%>\n";
 echo "<tr><td><b>" . $t->translate("No") . ".</b></td>\n";
 echo "<td><b>" . $t->translate("Document") . "</b></td>\n";
 echo "<td><b>" . $t->translate("Subject") . "</b></td>\n";
 echo "<td><b>" . $t->translate("Author") . "</b></td>\n";
 echo "<td><b>" . $t->translate("Posted on") . "</b></td>\n";
 echo "<td>&nbsp;</td>\n";
 echo "<td>&nbsp;</td></tr>\n";
 $i = 1;
 while ($db->next_record()) {
     echo "<tr><td>{$i}</td>\n";
     echo "<td><a href=\"" . $sess->url("docbyid.php?id=" . $db->f("ID") . "") . "\">" . $db->f("TITEL") . "</a></td>\n";
     echo "<td>" . $db->f("SUBJECT") . "</td>\n";
     echo "<td>" . $db->f("AUTOR") . "</td>\n";
     $timestamp = mktimestamp($db->f("DATUM"));
     echo "<td>" . timestr_short($timestamp) . "</td>\n";
     echo "<td><form action=\"" . $sess->url("comment.php") . "\" method=\"POST\">\n";
     echo "<input type=\"hidden\" name=\"modify\" value=\"1\">\n";
     echo "<input type=\"hidden\" name=\"delete\" value=\"0\">\n";
     echo "<input type=\"hidden\" name=\"modification\" value=\"" . $db->f("DATUM") . "\">\n";
     echo "<input type=\"hidden\" name=\"id\" value=\"" . $db->f("ID") . "\">\n";
     echo "<input type=\"submit\"value=\"" . $t->translate("Modify") . "\">\n";
     echo "</form></td>\n";
     echo "<td><form action=\"" . $sess->url("comment.php") . "\" method=\"POST\">\n";
     echo "<input type=\"hidden\" name=\"delete\" value=\"1\">\n";
     echo "<input type=\"hidden\" name=\"modify\" value=\"0\">\n";
     echo "<input type=\"hidden\" name=\"modification\" value=\"" . $db->f("DATUM") . "\">\n";
     echo "<input type=\"hidden\" name=\"id\" value=\"" . $db->f("ID") . "\">\n";
     echo "<input type=\"submit\"value=\"" . $t->translate("Delete") . "\">\n";
     echo "</form></td>\n";
Exemplo n.º 24
0
 function testSummary_news()
 {
     global $sess, $t;
     $fname = 'summary_news';
     $db_config = new mock_db_configure(5);
     $qs = array(0 => $this->queries[$fname . '_1'], 1 => $this->queries[$fname . '_2']);
     $args = $this->_generate_records(array('proid'), 10);
     $d1 = $this->_generate_records(array('creation_news', 'subject_news', 'user_news'), 10);
     // test one
     $db_config->add_query(sprintf($qs[0], $args[0]['proid']), 0);
     $db_config->add_num_row(0, 0);
     // test two
     $db_config->add_query(sprintf($qs[0], $args[1]['proid']), 1);
     $db_config->add_num_row(1, 1);
     $db_config->add_record($d1[0], 1);
     $db_config->add_record(false, 1);
     $db_config->add_query(sprintf($qs[1], $args[1]['proid'], $d1[0]['creation_news']), 2);
     $db_config->add_num_row(0, 2);
     // test three
     $db_config->add_query(sprintf($qs[0], $args[2]['proid']), 3);
     $db_config->add_num_row(1, 3);
     $db_config->add_record($d1[1], 3);
     $db_config->add_record(false, 3);
     $db_config->add_query(sprintf($qs[1], $args[2]['proid'], $d1[1]['creation_news']), 4);
     $db_config->add_num_row(1, 4);
     $db_config->add_num_row(1, 4);
     $this->capture_call($fname, 189, $args[0]);
     $strings = array("&nbsp;" . $t->translate("There have not been posted any news by the " . "project owner(s)") . ".\n", "<p align=right><a href=\"" . $sess->url("news_edit.php3") . $sess->add_query(array("proid" => $args[0]['proid'])) . "\"><FONT SIZE=\"-1\">[" . $t->translate("Submit News") . "]</FONT></a>&nbsp;&nbsp;" . "<br>&nbsp;\n");
     foreach ($strings as $str) {
         $this->_testFor_pattern($this->_to_regexp($str));
     }
     $this->capture_call($fname, 269, $args[1]);
     $strings = array(html_link('news.php3', array('proid' => $args[1]['proid']), '<b>' . $d1[0]['subject_news'] . '</b><br>'), "<b><font size=\"-1\">&nbsp;" . lib_nick($d1[0]['user_news']) . ' - ' . timestr_comment(mktimestamp($d1[0]['creation_news'])) . "</b></font><br>\n", "<p align=right><a href=\"" . $sess->url("news_edit.php3") . $sess->add_query(array("proid" => $args[1]['proid'])) . "\"><FONT SIZE=\"-1\">[" . $t->translate("Submit News") . "]</FONT></a>&nbsp;&nbsp;" . "<br>&nbsp;\n");
     foreach ($strings as $str) {
         $this->_testFor_pattern($this->_to_regexp($str));
     }
     $this->capture_call($fname, 407, $args[2]);
     $strings = array(html_link('news.php3', array('proid' => $args[2]['proid']), '<b>' . $d1[1]['subject_news'] . '</b><br>'), "<b><font size=\"-1\">&nbsp;" . lib_nick($d1[1]['user_news']) . ' - ' . timestr_comment(mktimestamp($d1[1]['creation_news'])) . "</b></font><br>\n", "<p align=right><a href=\"" . $sess->url("news_edit.php3") . $sess->add_query(array("proid" => $args[2]['proid'])) . "\"><FONT SIZE=\"-1\">[" . $t->translate("Submit News") . "]</FONT></a>&nbsp;&nbsp;" . "<br>&nbsp;\n", "&nbsp;<font size=-1>[ 1 " . html_link('comments.php3', array('proid' => $args[2]['proid'], 'type' => 'News', 'number' => $d1[1]['creation_news'], 'ref' => '0'), $t->translate('comments')) . $t->translate(' on it') . " ]</font>\n");
     foreach ($strings as $str) {
         $this->_testFor_pattern($this->_to_regexp($str));
     }
     $this->_check_db($db_config);
 }
Exemplo n.º 25
0
 $bx->box_column("center", "15%", $th_strip_title_bgcolor, "<b>" . $t->translate("Language") . "</b>");
 $bx->box_next_row_of_columns();
 $bgcolor = "#FFFFFF";
 while ($counter != $number_of_requests) {
     $db->next_record();
     $counter++;
     if ($counter % 2 != 0) {
         $bgcolor = "#FFFFFF";
     } else {
         $bgcolor = "#E0E0E0";
     }
     $bx->box_column("right", "", $bgcolor, $db->f("reqid"));
     $pquery["reqid"] = $db->f("reqid");
     $bx->box_column("center", "", $bgcolor, html_link("req_show.php", $pquery, $db->f("reqsubject")));
     $bx->box_column("center", "", $bgcolor, $db->f("username"));
     $timestamp = mktimestamp($db->f("reqtime"));
     $bx->box_column("center", "", $bgcolor, timestr_short($timestamp));
     $tasktype = $db->f("tasktype");
     if ($tasktype != "other") {
         $db2->query("SELECT * FROM prog_abilities WHERE translation='{$la}' AND code='{$tasktype}'");
         $db2->next_record();
         $tasktype = $db2->f("ability");
     }
     $bx->box_column("center", "", $bgcolor, $tasktype);
     $category = $db->f("category");
     switch ($category) {
         case "member":
             $bx->box_column("center", "", $bgcolor, $t->translate("new project member"));
             break;
         case "task":
             $bx->box_column("center", "", $bgcolor, $t->translate("specific task"));
Exemplo n.º 26
0
	/**
	 * Load an existing product property index if it exists
	 *	 
	 * @since 1.1
	 *
	 * @param int $product Id of the indexed product
	 * @param string $type Type of product property indexed
	 * @return void
	 **/
	function load ($product,$type) {
		$this->product = $product;
		$this->type = $type;
		if (empty($product) || empty($type)) return false; // Nothing to load

		$db = DB::get();
		$r = $db->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;
		}
	}
Exemplo n.º 27
0
    ?>
"></td></tr>
<tr>
<?php 
    $time = mktimestamp($db->f("modification_usr"));
    ?>
<td align=right><?php 
    echo $t->translate("Last modified");
    ?>
:</td><td><?php 
    echo timestr($time);
    ?>
</td></tr>
<tr>
<?php 
    $time = mktimestamp($db->f("creation_usr"));
    ?>
<td align=right><?php 
    echo $t->translate("Created");
    ?>
:</td><td><?php 
    echo timestr($time);
    ?>
</td></tr>
<tr>
<td align=right><?php 
    echo $t->translate("Permission");
    ?>
:</td><td><?php 
    $db->p("perms");
    ?>
        ?>
"><?php 
        echo $Order->transactionid;
        ?>
<br /><strong><?php 
        echo $Order->gateway;
        ?>
</strong> &mdash; <?php 
        echo $txnstatus;
        ?>
</td>
			<td class="date column-date<?php 
        echo in_array('date', $hidden) ? ' hidden' : '';
        ?>
"><?php 
        echo date("Y/m/d", mktimestamp($Order->created));
        ?>
<br />
				<strong><?php 
        echo $statusLabels[$Order->status];
        ?>
</strong></td>
		</tr>
		<?php 
    }
    ?>
		</tbody>
	<?php 
} else {
    ?>
		<tbody><tr><td colspan="6"><?php 
Exemplo n.º 29
0
                 $bx->box_title($title);
                 break;
             case "update":
                 $db3 = new DB_SourceWell();
                 $db3->query("UPDATE software SET modification='{$db2_creation_his}' WHERE appid='{$db_appid}'");
                 $timestamp = mktimestamp($db2_creation_his);
                 $title = "Modification date is updated to " . timestr($timestamp) . "\n";
                 $bx->box_title($title);
                 break;
             case "insert":
                 $db3 = new DB_SourceWell();
                 $db_user = $db->f("user");
                 $db_version = $db->f("version");
                 $db3->query("INSERT history SET appid='{$db_appid}', user_his='{$db_user}', creation_his='{$db_modification}', version_his='{$db_version}'");
                 // echo "<p>INSERT history SET appid='$db_appid', user_his='$db_user', creation_his='$db_modification', version_his='$db_version'\n";
                 $timestamp = mktimestamp($db_modification);
                 $title = "History date is updated to " . timestr($timestamp) . "\n";
                 $bx->box_title($title);
                 break;
             default:
                 $be->box_full($t->translate("Error"), $t->translate("Invalid action"));
                 break;
         }
         $bx->box_end();
         $i++;
     }
 }
 if ($i < 1) {
     $msg = $t->translate("All dates are consistent");
     $bi->box_full($t->translate("Check Date"), $msg);
 }
Exemplo n.º 30
0
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Password') . ':</b>');
$bx->box_column('left', '50%', '', html_input_password('password', 20, 32, $db->f('password')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Confirm Password') . ':</b>');
$bx->box_column('left', '50%', '', html_input_password('cpassword', 20, 32, $db->f('password')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Realname') . ':</b>');
$bx->box_column('left', '50%', '', html_input_text('realname', 20, 64, $db->f('realname')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('E-mail') . ':</b>');
$bx->box_column('left', '50%', '', html_input_text('email_usr', 20, 128, $db->f('email_usr')));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Creation') . ':</b>');
$bx->box_column('left', '50%', '', timestr(mktimestamp($db->f('creation_usr'))));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Last Modification') . ':</b>');
$bx->box_column('left', '50%', '', timestr(mktimestamp($db->f('modification_usr'))));
$bx->box_next_row_of_columns();
$bx->box_column('right', '50%', '', '<b>' . $t->translate('Permission') . ':</b>');
$bx->box_column('left', '50%', '', $db->f('perms'));
$bx->box_next_row_of_columns();
$bx->box_colspan(2, 'center', '', html_form_submit($t->translate('Change'), 'u_edit'));
$bx->box_columns_end();
htmlp_form_hidden('u_id', $db->f('user_id'));
htmlp_form_end();
$bx->box_body_end();
$bx->box_end();
end_content();
require 'include/footer.inc';
@page_close();