|
|
|
|
|
Execute($cc_query_raw);
while (!$cc_list->EOF) {
$rows++;
if (strlen($rows) < 2) {
$rows = '0' . $rows;
}
if (((!$_GET['uid']) || (@$_GET['uid'] == $cc_list->fields['unique_id'])) && (!$cInfo)) {
$cInfo = new objectInfo($cc_list->fields);
}
if ( (is_object($cInfo)) && ($cc_list->fields['unique_id'] == $cInfo->unique_id) ) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
$customer = $db->Execute("select customers_firstname, customers_lastname
from " . TABLE_CUSTOMERS . "
where customers_id = '" . $cc_list->fields['customer_id'] . "'");
?>
fields['customer_id']; ?> |
fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']; ?> |
fields['redeem_ip']; ?> |
fields['redeem_date']); ?> |
fields['unique_id'] == $cInfo->unique_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> |
MoveNext();
}
?>
display_count($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS_REPORTS, $_GET['reports_page'], TEXT_DISPLAY_NUMBER_OF_COUPONS); ?> |
display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS_REPORTS, MAX_DISPLAY_PAGE_LINKS, $_GET['reports_page'], 'action=voucherreport&cid=' . $cInfo->coupon_id, 'reports_page'); ?> |
coupon_id) ? $cInfo->coupon_id : $_GET['cid']) . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . ''; ?> |
|
|
Execute("select coupon_name
from " . TABLE_COUPONS_DESCRIPTION . "
where coupon_id = '" . $_GET['cid'] . "'
and language_id = '" . $_SESSION['languages_id'] . "'");
$count_customers = $db->Execute("select * from " . TABLE_COUPON_REDEEM_TRACK . "
where coupon_id = '" . $_GET['cid'] . "'
and customer_id = '" . $cInfo->customer_id . "'");
$heading[] = array('text' => '[' . $_GET['cid'] . ']' . COUPON_NAME . ' ' . $coupon_desc->fields['coupon_name'] . '');
$contents[] = array('text' => '' . TEXT_REDEMPTIONS . '');
// $contents[] = array('text' => TEXT_REDEMPTIONS_TOTAL . '=' . $cc_list->RecordCount());
$contents[] = array('text' => TEXT_REDEMPTIONS_TOTAL . '=' . $cc_query_numrows);
$contents[] = array('text' => TEXT_REDEMPTIONS_CUSTOMER . '=' . $count_customers->RecordCount());
$contents[] = array('text' => '');
?>
infoBox($heading, $contents);
echo ' | ' . "\n";
?>
Execute("select coupon_code
from " .TABLE_COUPONS . "
where coupon_id = '" . $_GET['cid'] . "'");
$coupon_name = $db->Execute("select coupon_name
from " . TABLE_COUPONS_DESCRIPTION . "
where coupon_id = '" . $_GET['cid'] . "'
and language_id = '" . $_SESSION['languages_id'] . "'");
$audience_select = get_audience_sql_query($_POST['customers_email_address']);
$mail_sent_to = $audience_select['query_name'];
?>
|
|
|
|
fields['coupon_name']; ?> |
|
|
|
|
|
|
|
|
|
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ' ' . zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?> |
|
|
Execute("select coupon_code
from " . TABLE_COUPONS . "
where coupon_id = '" . $_GET['cid'] . "'");
$coupon_name = $db->Execute("select coupon_name
from " . TABLE_COUPONS_DESCRIPTION . "
where coupon_id = '" . $_GET['cid'] . "'
and language_id = '" . $_SESSION['languages_id'] . "'");
?>
|
|
|
fields['coupon_name']; ?> |
|
|
|
|
|
|
|
|
|
|
*/
?>
|
|
|
|
Value = ($_POST['message_html']=='') ? TEXT_COUPON_ANNOUNCE : stripslashes($_POST['message_html']) ;
$oFCKeditor->Width = '97%' ;
$oFCKeditor->Height = '250' ;
// $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
// $oFCKeditor->Create() ;
$output = $oFCKeditor->CreateHtml() ; echo $output;
} else { // using HTMLAREA or just raw "source"
echo zen_draw_textarea_field('message_html', 'soft', '100%', '25', ($_POST['message_html']=='') ? TEXT_COUPON_ANNOUNCE : stripslashes($_POST['message_html']), 'id="message_html"');
}
} ?>
|
|
|
|
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ' ' . zen_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?> |
|
|
|
Execute("select coupon_name,coupon_description
from " . TABLE_COUPONS_DESCRIPTION . "
where coupon_id = '" . $_GET['cid'] . "'
and language_id = '" . $language_id . "'");
$_POST['coupon_name'][$language_id] = $coupon->fields['coupon_name'];
$_POST['coupon_desc'][$language_id] = $coupon->fields['coupon_description'];
}
$coupon = $db->Execute("select coupon_code, coupon_amount, coupon_type, coupon_minimum_order,
coupon_start_date, coupon_expire_date, uses_per_coupon,
uses_per_user, restrict_to_products, restrict_to_categories, coupon_zone_restriction
from " . TABLE_COUPONS . "
where coupon_id = '" . $_GET['cid'] . "'");
$_POST['coupon_amount'] = $coupon->fields['coupon_amount'];
if ($coupon->fields['coupon_type']=='P') {
$_POST['coupon_amount'] .= '%';
}
if ($coupon->fields['coupon_type']=='S') {
$_POST['coupon_free_ship'] = true;
} else {
$_POST['coupon_free_ship'] = false;
}
$_POST['coupon_min_order'] = $coupon->fields['coupon_minimum_order'];
$_POST['coupon_code'] = $coupon->fields['coupon_code'];
$_POST['coupon_uses_coupon'] = $coupon->fields['uses_per_coupon'];
$_POST['coupon_uses_user'] = $coupon->fields['uses_per_user'];
$_POST['coupon_startdate'] = $coupon->fields['coupon_start_date'];
$_POST['coupon_finishdate'] = $coupon->fields['coupon_expire_date'];
$_POST['coupon_zone_restriction'] = $coupon->fields['coupon_zone_restriction'];
case 'new':
// set some defaults
if ($_GET['action'] != 'voucheredit' and $_POST['coupon_uses_user'] == '') $_POST['coupon_uses_user'] = 1;
?>
|
|
'Y', 'text' => TEXT_COUPON_ACTIVE);
$status_array[] = array('id' => 'N', 'text' => TEXT_COUPON_INACTIVE);
$status_array[] = array('id' => '*', 'text' => TEXT_COUPON_ALL);
if ($_GET['status']) {
$status = zen_db_prepare_input($_GET['status']);
} else {
$status = 'Y';
}
echo zen_hide_session_id();
echo HEADING_TITLE_STATUS . ' ' . zen_draw_pull_down_menu('status', $status_array, $status, 'onChange="this.form.submit();"') .
zen_draw_hidden_field('page', $_GET['page']);
?>
|
';
?>
|
|
|
|
|
|
|
|
|
1) $rows = $_GET['page'] * 20 - 20;
if ($status != '*') {
$cc_query_raw = "select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from " . TABLE_COUPONS ." where coupon_active='" . zen_db_input($status) . "' and coupon_type != 'G'";
} else {
$cc_query_raw = "select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_products, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from " . TABLE_COUPONS . " where coupon_type != 'G'";
}
$cc_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS, $cc_query_raw, $cc_query_numrows);
$cc_list = $db->Execute($cc_query_raw);
while (!$cc_list->EOF) {
$rows++;
if (strlen($rows) < 2) {
$rows = '0' . $rows;
}
if (((!$_GET['cid']) || (@$_GET['cid'] == $cc_list->fields['coupon_id'])) && (!$cInfo)) {
$cInfo = new objectInfo($cc_list->fields);
}
if ( (is_object($cInfo)) && ($cc_list->fields['coupon_id'] == $cInfo->coupon_id) ) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
$coupon_desc = $db->Execute("select coupon_name
from " . TABLE_COUPONS_DESCRIPTION . "
where coupon_id = '" . $cc_list->fields['coupon_id'] . "'
and language_id = '" . $_SESSION['languages_id'] . "'");
?>
fields['coupon_name']; ?> |
fields['coupon_type'] == 'P') {
echo $cc_list->fields['coupon_amount'] . '%';
} elseif ($cc_list->fields['coupon_type'] == 'S') {
echo TEXT_FREE_SHIPPING;
} else {
echo $currencies->format($cc_list->fields['coupon_amount']);
}
?>
|
fields['coupon_code']; ?> |
fields['coupon_active']; ?> |
fields['coupon_start_date']); ?> |
fields['coupon_expire_date']); ?> |
fields['coupon_id'] == $cInfo->coupon_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> |
MoveNext();
}
?>
display_count($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_COUPONS); ?> |
display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_DISCOUNT_COUPONS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], (isset($_GET['status']) ? '&status=' . $_GET['status'] : '')); ?> |
coupon_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?> |
|
|
'' . TEXT_HEADING_COUPON_REPORT . '');
$contents[] = array('text' => TEXT_NEW_INTRO);
break;
case 'new':
$heading[] = array('text' => '' . TEXT_HEADING_NEW_COUPON . '');
$contents[] = array('text' => TEXT_NEW_INTRO);
$contents[] = array('text' => ' ' . COUPON_NAME . ' ' . zen_draw_input_field('name'));
$contents[] = array('text' => ' ' . COUPON_AMOUNT . ' ' . zen_draw_input_field('voucher_amount'));
$contents[] = array('text' => ' ' . COUPON_CODE . ' ' . zen_draw_input_field('voucher_code'));
$contents[] = array('text' => ' ' . COUPON_USES_COUPON . ' ' . zen_draw_input_field('voucher_number_of'));
break;
default:
$heading[] = array('text'=>'['.$cInfo->coupon_id.'] '.$cInfo->coupon_code);
$amount = $cInfo->coupon_amount;
if ($cInfo->coupon_type == 'P') {
$amount .= '%';
} else {
$amount = $currencies->format($amount);
}
if ($_GET['action'] == 'voucherdelete' or $_GET['action'] == 'vouchercopy') {
if ($_GET['action'] == 'voucherdelete') {
$contents[] = array('text'=> TEXT_CONFIRM_DELETE . '' .
''.zen_image_button('button_confirm.gif','Confirm Delete ' . TEXT_DISCOUNT_COUPON).'' .
''.zen_image_button('button_cancel.gif','Cancel').''
);
}
if ($_GET['action'] == 'vouchercopy') {
$contents = array('form' => zen_draw_form('new_coupon', FILENAME_COUPON_ADMIN, 'action=confirmcopy' . '&cid='.$_GET['cid'] . (isset($_GET['status']) ? '&status=' . $_GET['status'] : '') . (isset($_GET['page']) ? '&page=' . $_GET['page'] : ''), 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => ' ' . TEXT_COUPON_NEW . ' ' . zen_draw_input_field('coupon_copy_to', '', 6, 6));
$contents[] = array('text'=> TEXT_CONFIRM_COPY . '');
$contents[] = array('text'=> zen_image_submit('button_save.gif', IMAGE_SAVE));
$contents[] = array('text'=>
''.zen_image_button('button_cancel.gif','Cancel').''
);
/*
$contents[] = array('text'=>
''.zen_image_button('button_confirm.gif','Confirm Copy ' . TEXT_DISCOUNT_COUPON).'' .
''.zen_image_button('button_cancel.gif','Cancel').''
);
*/
}
} else {
$prod_details = TEXT_NONE;
//bof 12-6ke
$product_query = $db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $cInfo->coupon_id . "' and product_id != '0'"); if ($product_query->RecordCount() > 0) $prod_details = TEXT_SEE_RESTRICT;
//eof 12-6ke
$cat_details = TEXT_NONE;
//bof 12-6ke
$category_query = $db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id = '" . $cInfo->coupon_id . "' and category_id != '0'"); if ($category_query->RecordCount() > 0) $cat_details = TEXT_SEE_RESTRICT;
//eof 12-6ke
$coupon_name = $db->Execute("select coupon_name
from " . TABLE_COUPONS_DESCRIPTION . "
where coupon_id = '" . $cInfo->coupon_id . "'
and language_id = '" . $_SESSION['languages_id'] . "'");
$uses_coupon = $cInfo->uses_per_coupon;
$uses_user = $cInfo->uses_per_user;
if ($uses_coupon == 0 || $uses_coupon == '') $uses_coupon = TEXT_UNLIMITED;
if ($uses_user == 0 || $uses_user == '') $uses_user = TEXT_UNLIMITED;
$contents[] = array('text'=>COUPON_NAME . ' :: ' . $coupon_name->fields['coupon_name'] . ' ' .
COUPON_AMOUNT . ' :: ' . $amount . ' ' .
COUPON_STARTDATE . ' :: ' . zen_date_short($cInfo->coupon_start_date) . ' ' .
COUPON_FINISHDATE . ' :: ' . zen_date_short($cInfo->coupon_expire_date) . ' ' .
COUPON_USES_COUPON . ' :: ' . $uses_coupon . ' ' .
COUPON_USES_USER . ' :: ' . $uses_user . ' ' .
COUPON_PRODUCTS . ' :: ' . $prod_details . ' ' .
COUPON_CATEGORIES . ' :: ' . $cat_details . ' ' .
DATE_CREATED . ' :: ' . zen_date_short($cInfo->date_created) . ' ' .
DATE_MODIFIED . ' :: ' . zen_date_short($cInfo->date_modified) . '
' .
COUPON_ZONE_RESTRICTION . ' :: ' . zen_get_geo_zone_name($cInfo->coupon_zone_restriction) . '
' .
($cInfo->coupon_id != '' ?
''.zen_image_button('button_email.gif','Email ' . TEXT_DISCOUNT_COUPON).'' .
''.zen_image_button('button_edit.gif','Edit ' . TEXT_DISCOUNT_COUPON) .'' .
''.zen_image_button('button_delete.gif','Delete ' . TEXT_DISCOUNT_COUPON).'' .
' '.zen_image_button('button_restrict.gif','Restrict').''.zen_image_button('button_report.gif',TEXT_DISCOUNT_COUPON . ' Report').
''.zen_image_button('button_copy.gif','Copy ' . TEXT_DISCOUNT_COUPON) . ''
: ' who ' . $cInfo->coupon_id . ' - ' . $_GET['cid'])
);
}
break;
}
?>
infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
| | | |