Exemplo n.º 1
0
 /**
  * Gives sales reports csv export.
  *
  * @since   2.2.2
  * @return   null.
  */
 public function csvexport()
 {
     $model = $this->getModel("salesreport");
     $CSVData = $model->getCsvexportData();
     $filename = "SalesReport_" . date("Y-m-d");
     $csvDataString = null;
     $headColumn = array();
     $headColumn[0] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ITEMID');
     $headColumn[1] = JText::_('COM_QUICK2CART_SALESREPORT_PROD_NAME');
     $headColumn[2] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_NAME');
     $headColumn[3] = JText::_('COM_QUICK2CART_SALESREPORT_STORE_ID');
     $headColumn[4] = JText::_('COM_QUICK2CART_SALESREPORT_SALES_COUNT');
     $headColumn[5] = JText::_('COM_QUICK2CART_SALESREPORT_AMOUNT');
     $headColumn[6] = JText::_('COM_QUICK2CART_SALESREPORT_CREATED_BY');
     $csvDataString .= implode(";", $headColumn);
     $csvDataString .= "\n";
     header("Content-type: application/vnd.ms-excel");
     header("Content-disposition: csv" . date("Y-m-d") . ".csv");
     header("Content-disposition: filename=" . $filename . ".csv");
     // Getting all store list
     $comquick2cartHelper = new comquick2cartHelper();
     $store_details = $comquick2cartHelper->getAllStoreDetails();
     $productHelper = new productHelper();
     if (!empty($CSVData)) {
         foreach ($CSVData as $data) {
             $store_id = $data['store_id'];
             $csvrow = array();
             $csvrow[0] = '"' . $data['item_id'] . '"';
             $csvrow[1] = '"' . $data['item_name'] . '"';
             $csvrow[2] = '""';
             if (!empty($store_details[$store_id])) {
                 $csvrow[2] = '"' . $store_details[$store_id]['title'] . '"';
             }
             $csvrow[3] = '"' . $data['store_id'] . '"';
             $csvrow[4] = '"' . $data['saleqty'] . '"';
             // GETTING PRODUCT PRICE
             $prodAttDetails = $productHelper->getProdPriceWithDefltAttributePrice($data['item_id']);
             // CONSIDERING FIELD DISCOUNT, NOT COUPON DISCOUNT
             $discountPrice = $prodAttDetails['itemdetail']['discount_price'];
             $prodBasePrice = !empty($discountPrice) ? $discountPrice : $prodAttDetails['itemdetail']['price'];
             $prodPrice = $prodBasePrice + $prodAttDetails['attrDetail']['tot_att_price'];
             $prodPrice = strip_tags($comquick2cartHelper->getFromattedPrice($prodPrice));
             $csvrow[5] = '"' . $prodPrice . '"';
             $csvrow[6] = '""';
             if (!empty($store_details[$store_id])) {
                 $csvrow[6] = '"' . $store_details[$store_id]['firstname'] . '"';
             }
             $csvDataString .= implode(";", $csvrow);
             $csvDataString .= "\n";
         }
     }
     ob_clean();
     echo $csvDataString . "\n";
     jexit();
     $link = 'index.php?option=com_quick2cart&view=salesreport';
     $this->setRedirect($link);
 }
Exemplo n.º 2
0
 function csvexport()
 {
     $model = $this->getModel("vendor");
     $CSVData = $model->getCsvexportData();
     $filename = "SalesPerSellerReport_" . date("Y-m-d");
     $csvData = null;
     //$csvData.= "Item_id;Product Name;Store Name;Store Id;Sales Count;Amount;Created By;";
     $headColumn = array();
     $headColumn[0] = JText::_('COM_QUICK2CART_SALESPERSELLER_STORENAME');
     $headColumn[1] = JText::_('COM_QUICK2CART_SALESPERSELLER_VENDORNAME');
     // 'Product Name';
     $headColumn[2] = JText::_('COM_QUICK2CART_SALESPERSELLER_STATUS');
     $headColumn[3] = JText::_('COM_QUICK2CART_SALESPERSELLER_EMAIL');
     $headColumn[4] = JText::_('COM_QUICK2CART_SALESPERSELLER_PHONE');
     $headColumn[5] = JText::_('COM_QUICK2CART_SALESPERSELLER_SALE');
     $csvData .= implode(";", $headColumn);
     $csvData .= "\n";
     header("Content-type: application/vnd.ms-excel");
     header("Content-disposition: csv" . date("Y-m-d") . ".csv");
     header("Content-disposition: filename=" . $filename . ".csv");
     if (!empty($CSVData)) {
         $storeHelper = new storeHelper();
         foreach ($CSVData as $data) {
             $csvrow = array();
             $csvrow[0] = '"' . $data['title'] . '"';
             $csvrow[1] = '"' . $data['username'] . '"';
             if ($data['published'] == 1) {
                 $status = JText::_('COM_QUICK2CART_PUBLISH');
             } else {
                 $status = JText::_('COM_QUICK2CART_UNPUBLISH');
             }
             $csvrow[2] = '"' . $status . '"';
             $csvrow[3] = '"' . $data['store_email'] . '"';
             $csvrow[4] = '"' . $data['phone'] . '"';
             $storeHelper = new storeHelper();
             $comquick2cartHelper = new comquick2cartHelper();
             $total_sale = $storeHelper->getTotalSalePerStore($data['id']);
             if ($total_sale) {
                 $sale = $comquick2cartHelper->getFromattedPrice($total_sale);
             }
             $csvrow[5] = '"' . $sale . '"';
             $csvData .= implode(";", $csvrow);
             $csvData .= "\n";
         }
     }
     ob_clean();
     echo $csvData . "\n";
     jexit();
     $link = JUri::base() . substr(JRoute::_('index.php?option=com_quick2cart&view=vendor&layout=salespervendor', false), strlen(JUri::base(true)) + 1);
     $this->setRedirect($link);
 }
Exemplo n.º 3
0
		<?php 
    $discount_present = $params->get('usedisc') && isset($this->price['discount_price']) && $this->price['discount_price'] != 0 ? 1 : 0;
    if (empty($this->qtcExtraParam['hideOriginalPrice'])) {
        ?>
			<div class="control-group">
				<label class="control-label"><strong><?php 
        echo JText::_('QTC_ITEM_AMT');
        ?>
</strong></label>
				<div class="controls qtc_controls_text"><span id="<?php 
        echo isset($this->price['discount_price']) ? $this->product_id . '_price' : '';
        ?>
" >
				<?php 
        //echo (($params->get('usedisc'))?((isset($this->price['discount_price']))  ? '<del>'.$this->price['price'].'</del>':$this->price['price']):$this->price);
        $pprice = $discount_present == 1 ? '<del>' . $comquick2cartHelper->getFromattedPrice($this->price['price']) . '</del>' : $comquick2cartHelper->getFromattedPrice($this->price['price']);
        echo $pprice;
        ?>
</span></div>
			</div>
		<?php 
    }
    if ($discount_present && empty($this->qtcExtraParam['hideDiscountPrice'])) {
        ?>
			<div class="control-group">

				<label class="control-label"><strong><?php 
        echo JText::_('QTC_ITEM_DIS_AMT');
        ?>
</strong></label>
				<div class="controls qtc_controls_text">
Exemplo n.º 4
0
        // user field data - eg text to print on T-shirt
        if (!empty($cart['product_attributesUserData']) && 0) {
            $productHelper = new productHelper();
            $userdata = json_decode($cart['product_attributesUserData'], true);
            echo $productHelper->getFormattedAttributesUserData($userdata);
        }
        ?>
</span>
				</td>
			<?php 
    }
    ?>
				<td class="cartitem_price" id="cart_price[]" name="cart_price[]">
					<div>
						<span><?php 
    echo $helperobj->getFromattedPrice(number_format($cart['amt'] + $cart['opt_amt'], 2));
    ?>
 </span>
					</div>
				</td>
				<td class="cartitem_qty"  >
					<span><?php 
    echo $cart['qty'];
    ?>
</span>
				</td>
				<td class="cartitem_tprice"  <?php 
    echo $align_style;
    ?>
>
					<span id="cart_total_price<?php 
Exemplo n.º 5
0
?>
				<!-- Start - stat boxes -->
				<div class="row">
					<div class="col-sm-4 col-lg-4 col-md-12">
						<div class="panel panel-green">
							<div class="panel-heading">
								<div class="row">
									<div class="col-xs-3">
										<i class="<?php 
echo Q2C_DASHBORD_ICON_SALES;
?>
"></i>
									</div>
									<div class="col-xs-9 text-right">
										<div class="huge"><?php 
echo !empty($perdIncome['amount']) ? $comquick2cartHelper->getFromattedPrice(number_format($perdIncome['amount'], 2)) : "0";
?>
</div>
									</div>
								</div>
							</div>
							<a href="<?php 
echo JRoute::_('index.php?option=com_quick2cart&view=orders&layout=storeorder&Itemid=' . $this->orders_itemid, false);
?>
">
								<div class="panel-footer">
									<span class="pull-left">
										<?php 
echo JText::_('COM_Q2C_PRD_REVENUE');
?>
									</span>
Exemplo n.º 6
0
        }
        $payout->id = $append . $payout->id;
    }
    echo $payout->id;
    ?>
					</td>
					<td>
						<?php 
    if (JVERSION < '1.6.0') {
        echo JHtml::_('date', $payout->date, '%Y/%m/%d');
    } else {
        echo JHtml::_('date', $payout->date, "Y-m-d");
    }
    ?>
					</td><td><?php 
    echo $comquick2cartHelper->getFromattedPrice(number_format($payout->amount, 2));
    ?>
</td>
		<!--			<td><?php 
    //echo $payout->cashback;
    ?>
</td>	 -->
				</tr>
			<?php 
    $i++;
}
?>
			<tr rowspan="2" height="20">
				<td class="com_quick2cart_align_right" colspan="3"></td>
				<td></td>
			</tr>
Exemplo n.º 7
0
 /**
  * Function used to calculate final price
  *
  * @param   Obj  $ipdata  idata should in formats tdClass Object ( [totalprice] => 174.375 [country] => Bangladesh [region] => Dhaka [city] => punt )
  *
  * @return  json
  *
  * @since  1.0.0
  */
 public function calFinalShipPrice($ipdata = '')
 {
     $jinput = JFactory::getApplication()->input;
     // If called from Ajax
     if (empty($ipdata)) {
         $postdata = $jinput->post();
         $jsondata = $postdata->get('data', '', 'STRING');
         $data = json_decode($jsondata);
     } else {
         $data = $ipdata;
     }
     // Call model
     $model = $this->getModel('cartcheckout');
     $finalshipdata = $model->getFinalShipPrice($data);
     // If not called from Ajax
     if (!empty($ipdata)) {
         return $finalshipdata;
     }
     $comquick2cartHelper = new comquick2cartHelper();
     $finalshipdata['charges'] = $comquick2cartHelper->getFromattedPrice(number_format($finalshipdata['charges'], 2));
     $finalshipdata['totalamt'] = $comquick2cartHelper->getFromattedPrice(number_format($finalshipdata['totalamt'], 2));
     echo $json_ship_data = json_encode($finalshipdata);
     jexit();
 }
Exemplo n.º 8
0
echo JText::_('COM_QUICK2CART_HAVE_INSTALLED_VER') . ': ' . $this->version;
?>
									</span>
								</div>
								<div class="clearfix">&nbsp;</div>
							</div>
							<!-- /.col-lg-12 -->
						</div>
						<!-- /.row -->
						<div class="clearfix">&nbsp;</div>

						<?php 
if (!$this->allincome) {
    $this->allincome = 0;
}
$this->allincome = $comquick2cartHelper->getFromattedPrice($this->allincome);
?>

						<!-- Start - stat boxes -->
						<div class="row">
							<div class="col-lg-3 col-md-6">
								<div class="panel panel-green">
									<div class="panel-heading">
										<div class="row">
											<div class="col-xs-3 ">
												<i class="fa fa-money fa-4x"></i>
											</div>
											<div class="col-xs-9 text-right">
												<div class="huge"><?php 
echo $this->allincome;
?>
Exemplo n.º 9
0
 public function getPrefix($attoptionIds)
 {
     $comquick2cartHelper = new comquick2cartHelper();
     $currency = $comquick2cartHelper->getCurrencySession();
     //getFromattedPrice($price,$curr=NULL)
     $prefixarray = array();
     $db = JFactory::getDBO();
     foreach ($attoptionIds as $key => $attid) {
         $query = "Select i.`itemattributeoption_prefix` as prefix,op.`price` FROM `#__kart_itemattributeoptions`  as i\n\t\t\t\t\t\tLEFT JOIN `#__kart_option_currency` AS op\n\t\t\t\t\t\t ON i.`itemattributeoption_id`=op.`itemattributeoption_id`\n\t\t\t\t\t\tWHERE i.`itemattributeoption_id`=" . $attid . " AND op.`currency`='" . $currency . "'";
         $db->setQuery($query);
         $option_detail = $db->loadObject();
         if (empty($option_detail)) {
             $option_detail = new stdClass();
             $option_detail->price = 0;
             $option_detail->prefix = '+';
         }
         $price = $comquick2cartHelper->getFromattedPrice($option_detail->price);
         $prefixarray[$key] = $option_detail->prefix . " " . $price;
     }
     return $prefixarray;
 }
Exemplo n.º 10
0
									<?php 
        echo $row->saleqty;
        ?>
								</td>

								<td class="q2c_width_10" data-title="<?php 
        echo JText::_('COM_QUICK2CART_SALESREPORT_AMOUNT');
        ?>
">
									<?php 
        $productHelper = new productHelper();
        $prodAttDetails = $productHelper->getProdPriceWithDefltAttributePrice($row->item_id);
        // CONSIDERING FIELD DISCOUND, NOT COUP DISCOUNT
        $prodBasePrice = !empty($prodAttDetails['itemdetail']['discount_price']) ? $prodAttDetails['itemdetail']['discount_price'] : $prodAttDetails['itemdetail']['price'];
        $prodPrice = $prodBasePrice + $prodAttDetails['attrDetail']['tot_att_price'];
        echo $comquick2cartHelper->getFromattedPrice($prodPrice);
        ?>
								</td>

								<!-- created by-->
								<td class="q2c_width_10" data-title="<?php 
        echo JText::_('COM_QUICK2CART_SALESREPORT_CREATED_BY');
        ?>
">
									<?php 
        if (!empty($store_details[$row->store_id])) {
            echo $store_details[$row->store_id]['firstname'];
        }
        ?>
								</td>
							</tr>
                    ?>
">

									<label class="radio">
									  <input type="radio" name="<?php 
                    echo $radioFieldName;
                    ?>
" id="" value="<?php 
                    echo $shipMeth['methodId'];
                    ?>
" <?php 
                    echo $checked;
                    ?>
 >
											<?php 
                    $pricetext = $comquick2cartHelper->getFromattedPrice(number_format($shipMeth['totalShipCost'], 2));
                    echo $pricetext . ' - ' . $shipMeth['name'];
                    //	echo  $shipMeth['name'];
                    ?>
									</label>

								</div>

								<?php 
                }
            } else {
                echo JText::_('COM_QUICK2CART_NO_SHIPPING_METHOS_WE_WILL_CONTACT_U');
            }
            ?>
					</div>
Exemplo n.º 12
0
 function getAttrFieldTypeHtml($data)
 {
     $parent = '';
     if (isset($data['parent'])) {
         $parent = $data['parent'];
     }
     $product_id = $data['product_id'];
     $comquick2cartHelper = new comquick2cartHelper();
     // $atri_options = comquick2cartHelper::getAttributeOption($attribute->itemattribute_id);//  commented during multicurrency
     $atri_options = $comquick2cartHelper->getAttributeOptionCurrPrice($data['itemattribute_id']);
     $select_opt = array();
     $userData = array();
     $userData[] = 'Textbox';
     if (!$data['attribute_compulsary'] && !in_array($data['fieldType'], $userData)) {
         $select_opt[] = JHtml::_('select.option', "", "");
     }
     $returnHtml = '';
     foreach ($atri_options as $atri_option) {
         $attOp_price = (int) $atri_option->itemattributeoption_currency_price;
         // IF 0 ATT PRIVE THEN DONT ADD +0 USD
         if (!empty($attOp_price)) {
             $priceText = $comquick2cartHelper->getFromattedPrice($atri_option->itemattributeoption_currency_price, NULL, 0);
             $opt_str = $atri_option->itemattributeoption_name . ": " . $atri_option->itemattributeoption_prefix . " " . $priceText;
         } else {
             //  If no price than dont append like  +00.0 USD
             $opt_str = $atri_option->itemattributeoption_name;
         }
         //  Generate op according to datatype
         if (in_array($data['fieldType'], $userData)) {
             $returnHtml = "<input type='text' name='qtcUserField_" . $atri_option->itemattributeoption_id . "' class='input input-small " . $parent . '-' . $product_id . '_UserField' . "' >";
         } else {
             /* Amol change*/
             $default_value = '';
             if (isset($data['default_value'])) {
                 $default_value = $data['default_value'];
             }
             $field_name = 'attri_option';
             if (isset($data['field_name'])) {
                 $field_name = $data['field_name'];
             }
             //  user data
             $select_opt[] = JHtml::_('select.option', $atri_option->itemattributeoption_id, $opt_str);
             $returnHtml = JHtml::_('select.genericlist', $select_opt, $field_name, "  class='q2c_AttoptionsMaxWidth {$parent}-{$product_id}_options'", 'value', 'text', $default_value, false);
         }
     }
     return $returnHtml;
     /*    if (!in_array($data['fieldType'],$userData)) {
     		echo JHtml::_('select.genericlist', $select_opt, 'attri_option', "  class='span2 {$parent}-{$product_id}_options'", 'value', 'text', '',false);
     		}*/
 }
Exemplo n.º 13
0
						alt="<?php 
echo JText::_('QTC_IMG_NOT_FOUND');
?>
"
						title="<?php 
echo $data['name'];
?>
" />
				</a>
			</div>

			<div class="caption">
				<div class="center">
					<?php 
$p_price = !empty($item_price['discount_price']) && ceil($item_price['discount_price']) ? $item_price['discount_price'] : $item_price['price'];
echo JText::_('QTC_ITEM_AMT') . " : " . $helperobj->getFromattedPrice($p_price + $tot_att_price);
?>
				</div>
				<hr class="hr hr-condensed"/>
				<?php 
$textboxid = $data['parent'] . '-' . $item_id . "_itemcount";
$parent = $data['parent'];
$slab = !empty($data['slab']) ? $data['slab'] : 1;
$limits = $data['min_quantity'] . "," . $data['max_quantity'];
$arg = "'" . $textboxid . "','" . $item_id . "','" . $parent . "','" . $slab . "'," . $limits;
$min_msg = JText::_('QTC_MIN_LIMIT_MSG');
$max_msg = JText::_('QTC_MAX_LIMIT_MSG');
$fun_param = $parent . '-' . $data['product_id'];
//com_content-31_itemcount
$qty_buynow = $com_params->get('qty_buynow', 1);
$qtyDivStyle = "";