Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
datazen committed Dec 13, 2013
2 parents 5b48110 + 24a1fe1 commit 4f57031
Show file tree
Hide file tree
Showing 31 changed files with 221 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,15 @@ public static function save($id = null, $data) {
$lC_Database->startTransaction();

if ( isset($id) && $id != null ) {
$Qadmin = $lC_Database->query('update :table_administrators set user_name = :user_name, first_name = :first_name, last_name = :last_name, image = :image, access_group_id = :access_group_id, language_id = :language_id ');

$Qadmin = $lC_Database->query('update :table_administrators set user_name = :user_name, first_name = :first_name, last_name = :last_name, image = :image, access_group_id = :access_group_id, language_id = :language_id, verify_key = :verify_key');
if ( isset($data['user_password']) && !empty($data['user_password']) ) {
$Qadmin->appendQuery(', user_password = :user_password');
$Qadmin->bindValue(':user_password', lc_encrypt_string(trim($data['user_password'])));
}

$Qadmin->appendQuery('where id = :id');
$Qadmin->bindInt(':id', $id);
} else {
$Qadmin = $lC_Database->query('insert into :table_administrators (user_name, user_password, first_name, last_name, image, access_group_id, language_id) values (:user_name, :user_password, :first_name, :last_name, :image, :access_group_id,:language_id)');
$Qadmin = $lC_Database->query('insert into :table_administrators (user_name, user_password, first_name, last_name, image, access_group_id, language_id, verify_key) values (:user_name, :user_password, :first_name, :last_name, :image, :access_group_id,:language_id, :verify_key)');
$Qadmin->bindValue(':user_password', lc_encrypt_string(trim($data['user_password'])));
}

Expand All @@ -152,6 +150,7 @@ public static function save($id = null, $data) {
$Qadmin->bindValue(':image', $data['avatar']);
$Qadmin->bindInt(':access_group_id', $data['access_group_id']);
$Qadmin->bindInt(':language_id', $data['language_id']);
$Qadmin->bindValue(':verify_key', '');
$Qadmin->setLogging($_SESSION['module'], $id);
$Qadmin->execute();

Expand All @@ -160,6 +159,7 @@ public static function save($id = null, $data) {
$id = $lC_Database->nextID();
}
} else {
die($lC_Database->getError());
$error = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ public static function getAll() {
$code = '<td>' . $Qcoupons->value('code') . '</td>';
$reward = '<td>' . $rewardStr . '</td>';
$limits = '<td>' . (($Qcoupons->value('purchase_over') > 0 || $Qcoupons->value('uses_per_customer') > 0 || $Qcoupons->value('uses_per_coupon') > 0 || $Qcoupons->value('start_date') != null || $Qcoupons->value('expires_date') != null) ? (($Qcoupons->value('purchase_over') > 0) ? '<small class="tag purple-bg no-wrap">' . $lC_Language->get('text_purchase_over') . ': ' . $lC_Currencies->format($Qcoupons->value('purchase_over')) .'</small>' : null) . ' ' . (($Qcoupons->value('uses_per_customer') > 0) ? '<small class="tag orange-bg no-wrap">' . $Qcoupons->value('uses_per_customer') . ' ' . $lC_Language->get('text_per_customer') .'</small>' : null) . ' ' . (($Qcoupons->value('uses_per_coupon') > 0) ? '<small class="tag red-bg no-wrap">' . $Qcoupons->value('uses_per_coupon') . ' ' . $lC_Language->get('text_per_coupon') . '</small>' : null) . ' ' . (($Qcoupons->value('start_date') != null) ? '<small class="tag grey-bg no-wrap">' . $lC_Language->get('text_start_date') . ': ' . lC_DateTime::getShort($Qcoupons->value('start_date')) . '</small>' : null) . ' ' . (($Qcoupons->value('expires_date') != null) ? '<small class="tag grey-bg no-wrap">' . $lC_Language->get('text_expire_date') . ': ' . lC_DateTime::getShort($Qcoupons->value('expires_date')) . '</small>' : null) : '<small class="tag green-bg no-wrap" title="' . $lC_Language->get('text_no_restrictions') . '">' . $lC_Language->get('text_none') . '</small>') . '</td>';
$restrictions = '<td>' . ((!empty($rtProdsString) || !empty($rtCatsString) || !empty($rtCustString)) ? $rtProdsString . ' ' . $rtCatsString . ' ' . $rtCustString : '<small class="tag green-bg no-wrap">' . $lC_Language->get('text_none') . '</small>') . '</td>';
// $restrictions = '<td>' . ((!empty($rtProdsString) || !empty($rtCatsString) || !empty($rtCustString)) ? $rtProdsString . ' ' . $rtCatsString . ' ' . $rtCustString : '<small class="tag green-bg no-wrap">' . $lC_Language->get('text_none') . '</small>') . '</td>';
$action = '<td class="align-right vertical-center"><span class="button-group compact">
<a href="' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, $_module . '=' . $Qcoupons->valueInt('coupons_id') . '&action=save')) . '" class="button icon-pencil' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? ' disabled' : NULL) . '">' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . '</a>
<a href="' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://" onclick="copyCoupon(\'' . $Qcoupons->valueInt('coupons_id') . '\', \'' . $Qcoupons->value('name') . '\', \'' . $Qcoupons->value('code') . '\')') . '" class="button icon-pages with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_copy') . '"></a>
<a href="' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://" onclick="deleteCoupon(\'' . $Qcoupons->valueInt('coupons_id') . '\', \'' . $Qcoupons->value('name') . '\')') . '" class="button icon-trash with-tooltip' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>
</span></td>';
$result['aaData'][] = array("$check", "$name", "$status", "$code", "$reward", "$limits", "$restrictions", "$action");
$result['aaData'][] = array("$check", "$name", "$status", "$code", "$reward", "$limits", "$action");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
{ "sWidth": "10%", "bSortable": true, "sClass": "dataColCode hide-on-tablet" },
{ "sWidth": "10%", "bSortable": true, "sClass": "dataColReward hide-on-mobile-portrait" },
{ "sWidth": "20%", "bSortable": false, "sClass": "dataColLimits hide-on-mobile" },
{ "sWidth": "%", "bSortable": false, "sClass": "dataColRestrictions hide-on-mobile" },
{ "sWidth": "25%", "bSortable": false, "sClass": "dataColAction" }]
});
$('#dataTable').responsiveTable();
Expand Down
16 changes: 8 additions & 8 deletions catalog/admin/includes/applications/coupons/pages/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="new-row-mobile twelve-columns twelve-columns-mobile mid-margin-bottom">
<div class="columns">
<div class="new-row-mobile six-columns twelve-columns-mobile">
<span class="button-group upsellwrapper">
<!-- span class="button-group upsellwrapper">
<label for="mode_coupon" class="button blue-active">
<input type="radio" name="mode" id="mode_coupon" value="coupon" checked>
<?php echo $lC_Language->get('text_coupon'); ?>
Expand All @@ -41,7 +41,7 @@
<input type="radio" name="mode" id="mode_rule" value="rule" disabled>
<?php echo $lC_Language->get('text_rule') . lc_go_pro(); ?>
</label>
</span>
</span -->
</div>
<div class="new-row-mobile six-columns twelve-columns-mobile align-right" id="switch">
<input type="checkbox" name="status" id="status" class="switch wider" data-text-off="<?php echo $lC_Language->get('slider_switch_disabled'); ?>" data-text-on="<?php echo $lC_Language->get('slider_switch_enabled'); ?>"<?php echo ((isset($cInfo) && $cInfo->get('status') != 1) ? null : ' checked'); ?> />
Expand Down Expand Up @@ -94,13 +94,13 @@
<span class="input-info mid-margin-left"><?php echo $lC_Language->get('text_free_shipping'); ?></span>
<?php echo lc_show_info_bubble($lC_Language->get('info_bubble_free_shipping'), null, 'info-spot on-left grey margin-left'); ?>
</div>
<div class="mid-margin-top upsellwrapper">
<!-- div class="mid-margin-top upsellwrapper">
<label for="type_free_product" class="label"></label>
<input type="radio" name="type" value="P" id="type_3" class="switch tiny mid-margin-right small-margin-left disabled<?php if (isset($cInfo)) { echo ($cInfo->get('type') == 'P') ? ' checked' : null; } ?>" onchange="updateRewardField($(this).val());">
<span class="input-info mid-margin-left"><?php echo $lC_Language->get('text_free_product'); ?></span>
<span class="small-margin-left upsellinfo" upselltitle="<?php echo $lC_Language->get('text_free_product_upsell_title'); ?>" upselldesc="<?php echo $lC_Language->get('text_free_product_upsell_desc'); ?>"><?php echo lc_go_pro(); ?></span>
<?php echo lc_show_info_bubble($lC_Language->get('info_bubble_free_product'), null, 'info-spot on-left grey margin-left'); ?>
</div>
</div -->
<input type="hidden" name="type" id="type" value="<?php echo $type; ?>" />
</div>
</fieldset>
Expand Down Expand Up @@ -154,7 +154,7 @@ function updateReward(val) {
</div>
</fieldset>
</div>
<div class="new-row-mobile twelve-columns twelve-columns-mobile" id="restrictions">
<!-- div class="new-row-mobile twelve-columns twelve-columns-mobile" id="restrictions">
<fieldset class="fieldset fields-list upsellwrapper">
<legend class="legend upsellinfo" upselltitle="<?php echo $lC_Language->get('text_coupon_restrictions_upsell_title'); ?>" upselldesc="<?php echo $lC_Language->get('text_coupon_restrictions_upsell_desc'); ?>"><?php echo $lC_Language->get('legend_restrictions'); ?><?php echo lc_go_pro(true); ?></legend>
<div class="field-block button-height">
Expand All @@ -167,13 +167,13 @@ function updateReward(val) {
<input type="checkbox" class="switch wider disabled" data-text-off="<?php echo $lC_Language->get('slider_switch_disabled'); ?>" data-text-on="<?php echo $lC_Language->get('slider_switch_enabled'); ?>" />
<?php echo lc_show_info_bubble($lC_Language->get('info_bubble_customers_restrictions'), null, 'info-spot on-left grey margin-left'); ?>
</div>
<!-- div class="field-block button-height margin-bottom">
<div class="field-block button-height margin-bottom">
<label for="" class="label"><b><?php //echo $lC_Language->get('label_groups'); ?></b><small class="tag orange-bg small-margin-left">B2B</small></label>
<input type="checkbox" class="switch wider disabled" data-text-off="<?php echo $lC_Language->get('slider_switch_disabled'); ?>" data-text-on="<?php echo $lC_Language->get('slider_switch_enabled'); ?>" />
<?php //echo lc_show_info_bubble($lC_Language->get('info_bubble_groups_restrictions'), null, 'info-spot on-left grey margin-left'); ?>
</div -->
</div>
</fieldset>
</div>
</div -->
</div>
<?php echo lc_draw_hidden_field('subaction', 'confirm'); ?>
</form>
Expand Down
12 changes: 6 additions & 6 deletions catalog/admin/includes/applications/coupons/pages/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<th scope="col"><?php echo $lC_Language->get('table_heading_code'); ?></th>
<th scope="col"><?php echo $lC_Language->get('table_heading_reward'); ?></th>
<th scope="col"><?php echo $lC_Language->get('table_heading_limits'); ?></th>
<th scope="col" class="no-wrap upsellwrapper"><span class="upsellinfo" upselltitle="<?php echo $lC_Language->get('text_coupon_restrictions_upsell_title'); ?>" upselldesc="<?php echo $lC_Language->get('text_coupon_restrictions_upsell_desc'); ?>"><?php echo $lC_Language->get('table_heading_restrictions') . lc_go_pro(); ?></span></th>
<!-- th scope="col" class="no-wrap upsellwrapper"><span class="upsellinfo" upselltitle="<?php //echo $lC_Language->get('text_coupon_restrictions_upsell_title'); ?>" upselldesc="<?php //echo $lC_Language->get('text_coupon_restrictions_upsell_desc'); ?>"><?php //echo $lC_Language->get('table_heading_restrictions') . lc_go_pro(); ?></span></th -->
<th scope="col" class="align-right">
<span class="button-group compact" style="white-space:nowrap;">
<a style="display:none;" href="javascript:void(0);" style="cursor:pointer" class="on-mobile button with-tooltip icon-plus-round green<?php echo (((int)$_SESSION['admin']['access'][$lC_Template->getModule()] < 2) ? ' disabled' : NULL); ?>" href="<?php echo (((int)$_SESSION['admin']['access'][$lC_Template->getModule()] < 2) ? '#' : 'javascript://" onclick="newCoupon(); return false;'); ?>" title="<?php echo $lC_Language->get('button_new_coupon'); ?>"></a>
Expand All @@ -53,7 +53,7 @@
</tbody>
<tfoot>
<tr>
<th colspan="8">&nbsp;</th>
<th colspan="7">&nbsp;</th>
</tr>
</tfoot>
</table>
Expand All @@ -75,12 +75,12 @@
<span class="icon-plus"></span>
</span><?php echo $lC_Language->get('button_new_coupon'); ?>
</a>&nbsp;
<a upselltitle="<?php echo $lC_Language->get('button_new_rule'); ?>" upselldesc="<?php echo $lC_Language->get('text_new_rule_upsell_desc'); ?>" class="upsellinfo button" href="javascript:void(0);" onclick="showProUpsellSpot(this); return false;">
<!-- a upselltitle="<?php //echo $lC_Language->get('button_new_rule'); ?>" upselldesc="<?php //echo $lC_Language->get('text_new_rule_upsell_desc'); ?>" class="upsellinfo button" href="javascript:void(0);" onclick="showProUpsellSpot(this); return false;">
<span class="button-icon green-gradient">
<span class="icon-plus"></span>
</span><?php echo $lC_Language->get('button_new_rule'); ?>
<small data-tooltip-options="{&quot;classes&quot;:[&quot;anthracite-gradient glossy small no-padding&quot;],&quot;position&quot;:&quot;right&quot;}" title="&nbsp;<?php echo $lC_Language->get('text_click_for_info'); ?>&nbsp;" class="tag red-bg with-tooltip"><?php echo $lC_Language->get('text_pro'); ?></small>
</a>&nbsp;
</span><?php //echo $lC_Language->get('button_new_rule'); ?>
<small data-tooltip-options="{&quot;classes&quot;:[&quot;anthracite-gradient glossy small no-padding&quot;],&quot;position&quot;:&quot;right&quot;}" title="&nbsp;<?php //echo $lC_Language->get('text_click_for_info'); ?>&nbsp;" class="tag red-bg with-tooltip"><?php echo $lC_Language->get('text_pro'); ?></small>
</a>&nbsp; -->
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct() {
$Qadmin = $lC_Database->query('select * from :table_administrators where user_name = :user_name');
$Qadmin->bindTable(':table_administrators', TABLE_ADMINISTRATORS);
$Qadmin->bindValue(':user_name', $_POST['user_name']);
$Qadmin->execute();
$Qadmin->execute();
if ( $Qadmin->numberOfRows() > 0) {
if ( lc_validate_password($_POST['user_password'], $Qadmin->value('user_password')) ) {
$_SESSION['admin'] = array('id' => $Qadmin->valueInt('id'),
Expand Down
Loading

0 comments on commit 4f57031

Please sign in to comment.