diff --git a/application/classes/DB.php b/application/classes/DB.php index 2e885b4b..3f9f5d8b 100644 --- a/application/classes/DB.php +++ b/application/classes/DB.php @@ -11,7 +11,7 @@ */ class DB extends Kohana_DB { // Add the site_id to the delete query - public static function delete($table = NULL) + final public static function delete($table = NULL) { $db = new Database_Query_Builder_Delete($table); diff --git a/application/classes/Database/Query/Builder/Insert.php b/application/classes/Database/Query/Builder/Insert.php new file mode 100644 index 00000000..527c7dbe --- /dev/null +++ b/application/classes/Database/Query/Builder/Insert.php @@ -0,0 +1,23 @@ +_columns = Arr::Merge($this->_columns,['site_id']); + + foreach ($this->_values as $k=>$v) + $this->_values[$k] = Arr::Merge($this->_values[$k],[Site::id()]); + + return parent::compile($db); + } +} +?> diff --git a/application/classes/URL.php b/application/classes/URL.php index 431c101b..785290f9 100644 --- a/application/classes/URL.php +++ b/application/classes/URL.php @@ -23,19 +23,19 @@ class URL extends lnApp_URL { foreach (array_reverse(self::$method_directory) as $k=>$v) switch ($k) { - case 'admin': $result[$k] = array('name'=>'Administrator','icon'=>'icon-globe'); + case 'admin': $result[$k] = array('name'=>'Administrator','icon'=>'fa-globe'); break; case 'affiliate': - case 'reseller': $result[$k] = array('name'=>'Reseller','icon'=>'icon-th-list'); + case 'reseller': $result[$k] = array('name'=>'Reseller','icon'=>'fa-dashboard'); break; case 'user': if (is_object(Auth::instance()->get_user())) - $result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'icon-user'); + $result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'fa-user'); break; - default: $result[$k] = array('name'=>$k,'icon'=>'icon-question-sign'); + default: $result[$k] = array('name'=>$k,'icon'=>'fa-question'); } return $result; diff --git a/modules/payment/classes/Controller/Admin/Payment.php b/modules/payment/classes/Controller/Admin/Payment.php index 94d03e65..5ed96955 100644 --- a/modules/payment/classes/Controller/Admin/Payment.php +++ b/modules/payment/classes/Controller/Admin/Payment.php @@ -95,7 +95,7 @@ class Controller_Admin_Payment extends Controller_Payment { private function add_edit($id=NULL,$output='') { $po = ORM::factory('Payment',$id); - $this->meta->title = 'Payment: '.$po->refnum(TRUE); + $this->meta->title = $po->loaded() ? 'Payment: '.$po->refnum(TRUE) : 'A|Payment Add'; if ($this->request->post()) { $po->values($this->request->post()); @@ -113,61 +113,6 @@ class Controller_Admin_Payment extends Controller_Payment { $this->save($po); } - Script::factory() - ->type('file') - ->data('media/theme/bootstrap/js/bootstrap.datepicker.js'); - - Style::factory() - ->type('file') - ->data('media/theme/bootstrap/css/bootstrap.datepicker.css'); - - Script::factory() - ->type('stdin') - ->data(' -$(document).ready(function() { - $("#date_payment_label").datepicker({ - autoclose : true, - todayHighlight: true, - endDate : new Date(), - format : "dd-mm-yyyy", - todayBtn : true, - }).on("hide",function(ev) { - $("input[name=date_payment]").val(ev.date.valueOf()/1000); - }); - - $("input[name=account_id_label]").typeahead({ - minLength: 2, - source: function (query,process) { - search("'.URL::link('admin','payment/ajaxlist').'",query,process); - }, - - matcher: function () { return true; }, - - updater: function (item) { - $("input[name=account_id]").val(users[item]); - - // Send the request and update sub category dropdown - $.ajax({ - type: "GET", - data: "key="+users[item], - dataType: "html", - cache: false, - url: "'.URL::link('admin','payment/ajaxitemlist',TRUE).'", - timeout: 2000, - error: function(x) { - alert("Failed to submit"); - }, - success: function(data) { - $("div[id=items]").empty().append(data); - } - }); - - return item; - }, - }); -}); - '); - if ($po->loaded()) Script::factory() ->type('stdin') diff --git a/modules/payment/views/payment/admin/add_edit.php b/modules/payment/views/payment/admin/add_edit.php index 492f0004..c9944e47 100644 --- a/modules/payment/views/payment/admin/add_edit.php +++ b/modules/payment/views/payment/admin/add_edit.php @@ -2,30 +2,49 @@
+ - - -