Skip to content

Commit

Permalink
V1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BasheirHassan committed May 9, 2020
1 parent 8d74a12 commit bb394ce
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 190 deletions.
2 changes: 1 addition & 1 deletion .idea/webServers.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 56 additions & 10 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
$_['text_version'] = '1.3.0';

// Heading
$_['heading_title'] = 'Available on Stores';
$_['heading_title'] = 'Available on Stores - متوفر لدى';
$_['header_customer_message'] = ' اعدادات المستخدم';


Expand Down Expand Up @@ -59,3 +59,4 @@

// helper
$_['text_help_edit'] = 'انقر هنا لتعديل المسمى';

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

/**
* Created by Basheir Hassan.
*/


$_['available_on_stores_tab_title'] = 'متوفر على متجر';
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@

// helper
$_['text_help_edit'] = 'Click her to edit Name';

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

/**
* Created by Basheir Hassan.
*/


$_['available_on_stores_tab_title'] = 'Available On Stores';
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ class ModelExtensionModuleAvailableOnStores extends Model {


public function getStores() {


return $this->db->query( "SELECT * from `" . DB_PREFIX . "available_on_stores` ORDER BY `stores_id` ASC;" )->rows;

}


public function addStores($name) {

return $this->db->query( "INSERT INTO " . DB_PREFIX. "available_on_stores (`name`) VALUES ('". $this->db->escape($name) . "')" );

}


Expand All @@ -36,14 +38,14 @@ public function deleteStores($store_id) {
$this->db->query( "DELETE from `" . DB_PREFIX . "available_on_stores` WHERE `stores_id` = '". $this->db->escape($store_id). "';" );
$this->db->query( "DELETE from " . DB_PREFIX. "available_on_stores_urls WHERE `stores_id` ='". $this->db->escape($store_id)."' " );
$this->db->query( "DELETE from " . DB_PREFIX. "available_on_stores_dashboard WHERE `stores_id` ='". $this->db->escape($store_id)."' " );

return $this->db->countAffected();

}





public function updateStores($name,$id) {

Expand All @@ -54,7 +56,7 @@ public function updateStores($name,$id) {
. "' WHERE `stores_id` = '"
. $this->db->escape($id)
. "';" );

return $this->db->countAffected() ;
}

Expand All @@ -64,11 +66,11 @@ public function updateStores($name,$id) {
// -------------------------------------------



public function addUrls($url,$product_id ,$stores_id) {

return $this->db->query( "INSERT INTO " . DB_PREFIX. "available_on_stores_urls (`url`,`product_id`,`stores_id`) VALUES ('". $this->db->escape($url) . "','". $this->db->escape($product_id) . "','". $this->db->escape($stores_id) . "')" );


}

Expand All @@ -77,14 +79,14 @@ public function addUrls($url,$product_id ,$stores_id) {
public function getUrls($product_id) {

return $this->db->query( "SELECT * from `" . DB_PREFIX . "available_on_stores_urls` WHERE `product_id` ='". $this->db->escape($product_id)."' ;" )->rows;

}




public function editUrls($url, $product_id,$stores_id) {

return $this->db->query( "INSERT INTO " . DB_PREFIX. "available_on_stores_urls (`url`,`product_id`,`stores_id`) VALUES ('". $this->db->escape($url) . "','". $this->db->escape($product_id) . "','". $this->db->escape($stores_id) . "')" );

}
Expand All @@ -94,41 +96,41 @@ public function editUrls($url, $product_id,$stores_id) {


public function deleteUrls($product_id) {

return $this->db->query( "DELETE from " . DB_PREFIX. "available_on_stores_urls WHERE `product_id` ='".$this->db->escape($product_id)."' " );

}






//------------------- DashBorad




public function getDashboardStore($ID) {

return $this->db->query( "SELECT * from " . DB_PREFIX. "available_on_stores_dashboard WHERE `stores_id` ='".$this->db->escape($ID)."' " );

}




public function deleteDashboard($product_Id) {

$this->db->query( "DELETE from " . DB_PREFIX. "available_on_stores_dashboard WHERE `product_id` ='".$this->db->escape($product_Id)."' " );

return $this->db->countAffected();

}




/**
public function getDashboardAllData() {
Expand All @@ -153,17 +155,17 @@ public function getCountAllRows() {






public function getDashboardByPage($page=1, $limit=10) {

if ($page) {
$start = ($page - 1) * $limit;
}

return $this->db->query("SELECT `product_id`,`stores_id`,`stores_id`,`date`,COUNT(`product_id`) as totalClicked from " . DB_PREFIX. "available_on_stores_dashboard group by `product_id`,`stores_id` order by `totalClicked` desc LIMIT " .$this->db->escape($start).",".$this->db->escape($limit))->rows;

}


Expand All @@ -175,27 +177,27 @@ public function getDashboardByPage($page=1, $limit=10) {
*/

public function getDashboardByProductIDAndStoresID($product_id,$stores_id) {

return $this->db->query( "SELECT count(`product_id`) as Total FROM `" . DB_PREFIX . "available_on_stores_dashboard` WHERE `product_id` ='". $this->db->escape($product_id)."' and `stores_id` ='". $this->db->escape($stores_id) ."';" )->rows[0]['Total'];


}













public function getLastProductId() {
$query = $this->db->query("SELECT product_id FROM " . DB_PREFIX . "product ORDER BY product_id DESC LIMIT 0,1");

return $query->row['product_id'];
}





}

Expand Down
Loading

0 comments on commit bb394ce

Please sign in to comment.