Completed
Pull Request — v3.0 (#136)
by
unknown
25:07
created
web_interface/astpp/application/modules/taxes/libraries/taxes_form.php 3 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -21,62 +21,62 @@
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 if (!defined('BASEPATH'))
24
-    exit('No direct script access allowed');
24
+	exit('No direct script access allowed');
25 25
 
26 26
 class Taxes_form {
27 27
 	function __construct() {
28
-        $this->CI = & get_instance();
29
-    }
30
-    function get_taxes_form_fields() {
31
-        $form['forms'] = array(base_url() . 'taxes/taxes_save/', array('id' => 'taxes_form', 'method' => 'POST', 'name' => 'taxes_form'));
32
-        $form['Tax Information'] = array(
33
-            array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
34
-            array('Name', 'INPUT', array('name' => 'taxes_description', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
35
-            array('Priority', 'INPUT', array('name' => 'taxes_priority', 'size' => '20', 'maxlength' => '5', 'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', ''),
36
-            array('Amount', 'INPUT', array('name' => 'taxes_amount', 'size' => '20', 'maxlength' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
37
-            array('Rate(%)', 'INPUT', array('name' => 'taxes_rate', 'size' => '20','maxlength' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
38
-            array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
28
+		$this->CI = & get_instance();
29
+	}
30
+	function get_taxes_form_fields() {
31
+		$form['forms'] = array(base_url() . 'taxes/taxes_save/', array('id' => 'taxes_form', 'method' => 'POST', 'name' => 'taxes_form'));
32
+		$form['Tax Information'] = array(
33
+			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
34
+			array('Name', 'INPUT', array('name' => 'taxes_description', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
35
+			array('Priority', 'INPUT', array('name' => 'taxes_priority', 'size' => '20', 'maxlength' => '5', 'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', ''),
36
+			array('Amount', 'INPUT', array('name' => 'taxes_amount', 'size' => '20', 'maxlength' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
37
+			array('Rate(%)', 'INPUT', array('name' => 'taxes_rate', 'size' => '20','maxlength' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
38
+			array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
39 39
 
40
-        );
41
-        $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
42
-        $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
43
-        return $form;
44
-    }
40
+		);
41
+		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'button', 'class' => 'btn btn-line-parrot');
42
+		$form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
43
+		return $form;
44
+	}
45 45
 
46
-    function get_search_taxes_form() {
47
-        $form['forms'] = array("", array('id' => "taxes_search"));
48
-        $form['Search'] = array(
49
-            array('Name', 'INPUT', array('name' => 'taxes_description[taxes_description]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'taxes_description[taxes_description-string]', '', '', '', 'search_string_type', ''),
50
-            array('Amount', 'INPUT', array('name' => 'taxes_amount[taxes_amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_amount[taxes_amount-integer]', '', '', '', 'search_int_type', ''),
51
-            array('Rate(%)', 'INPUT', array('name' => 'taxes_rate[taxes_rate]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_rate[taxes_rate-integer]', '', '', '', 'search_int_type', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''),   array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
52
-            array('', 'HIDDEN', 'advance_search', '1', '', '', '')
53
-        );
54
-        $form['button_search'] = array('name' => 'action', 'id' => "taxes_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
55
-        $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
56
-        return $form;
57
-    }
46
+	function get_search_taxes_form() {
47
+		$form['forms'] = array("", array('id' => "taxes_search"));
48
+		$form['Search'] = array(
49
+			array('Name', 'INPUT', array('name' => 'taxes_description[taxes_description]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'taxes_description[taxes_description-string]', '', '', '', 'search_string_type', ''),
50
+			array('Amount', 'INPUT', array('name' => 'taxes_amount[taxes_amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_amount[taxes_amount-integer]', '', '', '', 'search_int_type', ''),
51
+			array('Rate(%)', 'INPUT', array('name' => 'taxes_rate[taxes_rate]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_rate[taxes_rate-integer]', '', '', '', 'search_int_type', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''),   array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
52
+			array('', 'HIDDEN', 'advance_search', '1', '', '', '')
53
+		);
54
+		$form['button_search'] = array('name' => 'action', 'id' => "taxes_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
55
+		$form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
56
+		return $form;
57
+	}
58 58
 
59
-    function build_taxes_list_for_admin() {
59
+	function build_taxes_list_for_admin() {
60 60
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
61 61
 		$currency_id=$account_info['currency_id'];
62 62
 		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
63
-        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
64
-            array("Name", "270", "taxes_description", "", "", "","","true","center"),
65
-            array("Priority", "145", "taxes_priority", "", "", "","","true","center"),
66
-            array("Amount($currency)", "260", "taxes_amount", "taxes_amount", "taxes_amount", "convert_to_currency","","true","right"),
67
-            array("Rate(%)", "230", "taxes_rate", "", "", "","","true","right"),
68
-            array("Status", "160", "status", "status", "taxes", "get_status","","true","center"),
63
+		$grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
64
+			array("Name", "270", "taxes_description", "", "", "","","true","center"),
65
+			array("Priority", "145", "taxes_priority", "", "", "","","true","center"),
66
+			array("Amount($currency)", "260", "taxes_amount", "taxes_amount", "taxes_amount", "convert_to_currency","","true","right"),
67
+			array("Rate(%)", "230", "taxes_rate", "", "", "","","true","right"),
68
+			array("Status", "160", "status", "status", "taxes", "get_status","","true","center"),
69 69
 			array("Action", "175", "", "", "", array("EDIT" => array("url" => "taxes/taxes_edit/", "mode" => "popup"),
70
-                    "DELETE" => array("url" => "taxes/taxes_delete/", "mode" => "single")))
71
-                ));
72
-        return $grid_field_arr;
73
-    }
70
+					"DELETE" => array("url" => "taxes/taxes_delete/", "mode" => "single")))
71
+				));
72
+		return $grid_field_arr;
73
+	}
74 74
 
75
-    function build_grid_buttons() {
76
-        $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/taxes/taxes_add/", "popup"),
77
-            array("Delete","btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/taxes/taxes_delete_multiple/")));
78
-        return $buttons_json;
79
-    }
75
+	function build_grid_buttons() {
76
+		$buttons_json = json_encode(array(array("Create","btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/taxes/taxes_add/", "popup"),
77
+			array("Delete","btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/taxes/taxes_delete_multiple/")));
78
+		return $buttons_json;
79
+	}
80 80
 
81 81
 }
82 82
 
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 # You should have received a copy of the GNU Affero General Public License
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23
-if (!defined('BASEPATH'))
23
+if ( ! defined('BASEPATH'))
24 24
     exit('No direct script access allowed');
25 25
 
26 26
 class Taxes_form {
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
         $this->CI = & get_instance();
29 29
     }
30 30
     function get_taxes_form_fields() {
31
-        $form['forms'] = array(base_url() . 'taxes/taxes_save/', array('id' => 'taxes_form', 'method' => 'POST', 'name' => 'taxes_form'));
31
+        $form['forms'] = array(base_url().'taxes/taxes_save/', array('id' => 'taxes_form', 'method' => 'POST', 'name' => 'taxes_form'));
32 32
         $form['Tax Information'] = array(
33 33
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
34
-            array('Name', 'INPUT', array('name' => 'taxes_description', 'size' => '20',  'class' => "text field medium"), '', 'tOOL TIP', ''),
34
+            array('Name', 'INPUT', array('name' => 'taxes_description', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''),
35 35
             array('Priority', 'INPUT', array('name' => 'taxes_priority', 'size' => '20', 'maxlength' => '5', 'class' => "text field medium"), 'trim|required|numeric', 'tOOL TIP', ''),
36 36
             array('Amount', 'INPUT', array('name' => 'taxes_amount', 'size' => '20', 'maxlength' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''),
37
-            array('Rate(%)', 'INPUT', array('name' => 'taxes_rate', 'size' => '20','maxlength' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
37
+            array('Rate(%)', 'INPUT', array('name' => 'taxes_rate', 'size' => '20', 'maxlength' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''),
38 38
             array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
39 39
 
40 40
         );
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $form['Search'] = array(
49 49
             array('Name', 'INPUT', array('name' => 'taxes_description[taxes_description]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'taxes_description[taxes_description-string]', '', '', '', 'search_string_type', ''),
50 50
             array('Amount', 'INPUT', array('name' => 'taxes_amount[taxes_amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_amount[taxes_amount-integer]', '', '', '', 'search_int_type', ''),
51
-            array('Rate(%)', 'INPUT', array('name' => 'taxes_rate[taxes_rate]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_rate[taxes_rate-integer]', '', '', '', 'search_int_type', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''),   array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
51
+            array('Rate(%)', 'INPUT', array('name' => 'taxes_rate[taxes_rate]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'taxes_rate[taxes_rate-integer]', '', '', '', 'search_int_type', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status', '', ''), array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
52 52
             array('', 'HIDDEN', 'advance_search', '1', '', '', '')
53 53
         );
54 54
         $form['button_search'] = array('name' => 'action', 'id' => "taxes_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 
59 59
     function build_taxes_list_for_admin() {
60 60
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
61
-		$currency_id=$account_info['currency_id'];
62
-		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
63
-        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
64
-            array("Name", "270", "taxes_description", "", "", "","","true","center"),
65
-            array("Priority", "145", "taxes_priority", "", "", "","","true","center"),
66
-            array("Amount($currency)", "260", "taxes_amount", "taxes_amount", "taxes_amount", "convert_to_currency","","true","right"),
67
-            array("Rate(%)", "230", "taxes_rate", "", "", "","","true","right"),
68
-            array("Status", "160", "status", "status", "taxes", "get_status","","true","center"),
61
+		$currency_id = $account_info['currency_id'];
62
+		$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
63
+        $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
64
+            array("Name", "270", "taxes_description", "", "", "", "", "true", "center"),
65
+            array("Priority", "145", "taxes_priority", "", "", "", "", "true", "center"),
66
+            array("Amount($currency)", "260", "taxes_amount", "taxes_amount", "taxes_amount", "convert_to_currency", "", "true", "right"),
67
+            array("Rate(%)", "230", "taxes_rate", "", "", "", "", "true", "right"),
68
+            array("Status", "160", "status", "status", "taxes", "get_status", "", "true", "center"),
69 69
 			array("Action", "175", "", "", "", array("EDIT" => array("url" => "taxes/taxes_edit/", "mode" => "popup"),
70 70
                     "DELETE" => array("url" => "taxes/taxes_delete/", "mode" => "single")))
71 71
                 ));
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     }
74 74
 
75 75
     function build_grid_buttons() {
76
-        $buttons_json = json_encode(array(array("Create","btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/taxes/taxes_add/", "popup"),
77
-            array("Delete","btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/taxes/taxes_delete_multiple/")));
76
+        $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/taxes/taxes_add/", "popup"),
77
+            array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/taxes/taxes_delete_multiple/")));
78 78
         return $buttons_json;
79 79
     }
80 80
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
26
-    exit('No direct script access allowed');
25
+if (!defined('BASEPATH')) {
26
+    exit('No direct script access allowed');
27
+}
27 28
 
28 29
 class Package_form {
29 30
 
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/taxes/models/taxes_model.php 3 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -22,46 +22,46 @@
 block discarded – undo
22 22
 ###############################################################################
23 23
 class Taxes_model extends CI_Model {
24 24
 
25
-    function Taxes_model() {
26
-        parent::__construct();
27
-    }
25
+	function Taxes_model() {
26
+		parent::__construct();
27
+	}
28 28
 
29
-    function get_taxes_list($flag, $start = 0, $limit = 0) {
30
-        $this->db_model->build_search('taxes_list_search');
31
-        if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32
-            $where = array("reseller_id"=>$this->session->userdata["accountinfo"]['id']);
33
-        }else{
34
-	    $where =array("reseller_id"=>0);
35
-        }
36
-        if ($flag) {
37
-            $query = $this->db_model->select("*", "taxes", $where, "id", "ASC", $limit, $start);
38
-        } else {
39
-            $query = $this->db_model->countQuery("*", "taxes", $where);
40
-        }
41
-        return $query;
42
-    }
29
+	function get_taxes_list($flag, $start = 0, $limit = 0) {
30
+		$this->db_model->build_search('taxes_list_search');
31
+		if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32
+			$where = array("reseller_id"=>$this->session->userdata["accountinfo"]['id']);
33
+		}else{
34
+		$where =array("reseller_id"=>0);
35
+		}
36
+		if ($flag) {
37
+			$query = $this->db_model->select("*", "taxes", $where, "id", "ASC", $limit, $start);
38
+		} else {
39
+			$query = $this->db_model->countQuery("*", "taxes", $where);
40
+		}
41
+		return $query;
42
+	}
43 43
 
44
-    function add_tax($data) {
45
-        unset($data["action"]);
46
-        $data["creation_date"] = date("Y-m-d H:i:s");
47
-         if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
44
+	function add_tax($data) {
45
+		unset($data["action"]);
46
+		$data["creation_date"] = date("Y-m-d H:i:s");
47
+		 if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
48 48
 	  $data['reseller_id'] = $this->session->userdata["accountinfo"]['id'];
49
-         }else{
49
+		 }else{
50 50
 	  $data['reseller_id'] =0;
51
-         }
52
-        $this->db->insert("taxes", $data);
53
-    }
51
+		 }
52
+		$this->db->insert("taxes", $data);
53
+	}
54 54
 
55
-    function edit_tax($data, $id) {
56
-        unset($data["action"]);
57
-        $data["last_modified_date"] = date("Y-m-d H:i:s");
58
-        $this->db->where("id", $id);
59
-        $this->db->update("taxes", $data);
60
-    }
55
+	function edit_tax($data, $id) {
56
+		unset($data["action"]);
57
+		$data["last_modified_date"] = date("Y-m-d H:i:s");
58
+		$this->db->where("id", $id);
59
+		$this->db->update("taxes", $data);
60
+	}
61 61
 
62
-    function remove_taxes($id) {
63
-        $this->db->delete('taxes_to_accounts',array('taxes_id'=>$id));
64
-        return $this->db->delete("taxes",array('id'=>$id));
65
-    }
62
+	function remove_taxes($id) {
63
+		$this->db->delete('taxes_to_accounts',array('taxes_id'=>$id));
64
+		return $this->db->delete("taxes",array('id'=>$id));
65
+	}
66 66
 
67 67
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
         $this->db_model->build_search('taxes_list_search');
31 31
         if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32 32
             $where = array("reseller_id"=>$this->session->userdata["accountinfo"]['id']);
33
-        }else{
34
-	    $where =array("reseller_id"=>0);
33
+        } else {
34
+	    $where = array("reseller_id"=>0);
35 35
         }
36 36
         if ($flag) {
37 37
             $query = $this->db_model->select("*", "taxes", $where, "id", "ASC", $limit, $start);
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
         $data["creation_date"] = date("Y-m-d H:i:s");
47 47
          if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
48 48
 	  $data['reseller_id'] = $this->session->userdata["accountinfo"]['id'];
49
-         }else{
50
-	  $data['reseller_id'] =0;
49
+         } else {
50
+	  $data['reseller_id'] = 0;
51 51
          }
52 52
         $this->db->insert("taxes", $data);
53 53
     }
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
     }
61 61
 
62 62
     function remove_taxes($id) {
63
-        $this->db->delete('taxes_to_accounts',array('taxes_id'=>$id));
64
-        return $this->db->delete("taxes",array('id'=>$id));
63
+        $this->db->delete('taxes_to_accounts', array('taxes_id'=>$id));
64
+        return $this->db->delete("taxes", array('id'=>$id));
65 65
     }
66 66
 
67 67
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $this->db_model->build_search('taxes_list_search');
31 31
         if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32 32
             $where = array("reseller_id"=>$this->session->userdata["accountinfo"]['id']);
33
-        }else{
33
+        } else{
34 34
 	    $where =array("reseller_id"=>0);
35 35
         }
36 36
         if ($flag) {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $data["creation_date"] = date("Y-m-d H:i:s");
47 47
          if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
48 48
 	  $data['reseller_id'] = $this->session->userdata["accountinfo"]['id'];
49
-         }else{
49
+         } else{
50 50
 	  $data['reseller_id'] =0;
51 51
          }
52 52
         $this->db->insert("taxes", $data);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/controllers/email.php 3 patches
Indentation   +307 added lines, -307 removed lines patch added patch discarded remove patch
@@ -24,45 +24,45 @@  discard block
 block discarded – undo
24 24
 
25 25
 class Email extends MX_Controller {
26 26
 
27
-    function Email() {
28
-        parent::__construct();
27
+	function Email() {
28
+		parent::__construct();
29 29
 
30
-        $this->load->helper('template_inheritance');
30
+		$this->load->helper('template_inheritance');
31 31
 
32
-        $this->load->library('session');
33
-        $this->load->library('email_form');
34
-        $this->load->library('astpp/form');
35
-        $this->load->model('email_model');
36
-        $this->load->library('csvreader');
32
+		$this->load->library('session');
33
+		$this->load->library('email_form');
34
+		$this->load->library('astpp/form');
35
+		$this->load->model('email_model');
36
+		$this->load->library('csvreader');
37 37
 	$this->load->library('astpp/email_lib');
38
-        if ($this->session->userdata('user_login') == FALSE)
39
-            redirect(base_url() . '/astpp/login');
40
-    }
38
+		if ($this->session->userdata('user_login') == FALSE)
39
+			redirect(base_url() . '/astpp/login');
40
+	}
41 41
 
42
-    function email_edit($edit_id = '') {
43
-        $data['page_title'] = 'Edit Email List';
44
-        if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
45
-            $account_data = $this->session->userdata("accountinfo");
46
-            $reseller = $account_data['id'];
47
-            $where = array('id' => $edit_id, "reseller_id" => $reseller);
48
-        } else {
49
-            $where = array('id' => $edit_id);
50
-        }
51
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
52
-        if ($account->num_rows > 0) {
53
-            foreach ($account->result_array() as $key => $value) {
54
-                $edit_data = $value;
55
-            }
56
-            $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), $edit_data);
57
-            $this->load->view('view_email_add_edit', $data);
58
-        } else {
59
-            redirect(base_url() . 'email/email_history_list/');
60
-        }
61
-            redirect(base_url() . 'email/email_history_list/');
62
-    }
42
+	function email_edit($edit_id = '') {
43
+		$data['page_title'] = 'Edit Email List';
44
+		if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
45
+			$account_data = $this->session->userdata("accountinfo");
46
+			$reseller = $account_data['id'];
47
+			$where = array('id' => $edit_id, "reseller_id" => $reseller);
48
+		} else {
49
+			$where = array('id' => $edit_id);
50
+		}
51
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
52
+		if ($account->num_rows > 0) {
53
+			foreach ($account->result_array() as $key => $value) {
54
+				$edit_data = $value;
55
+			}
56
+			$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), $edit_data);
57
+			$this->load->view('view_email_add_edit', $data);
58
+		} else {
59
+			redirect(base_url() . 'email/email_history_list/');
60
+		}
61
+			redirect(base_url() . 'email/email_history_list/');
62
+	}
63 63
 
64
-    function email_resend() {
65
-        $add_array = $this->input->post();
64
+	function email_resend() {
65
+		$add_array = $this->input->post();
66 66
 /**
67 67
 ASTPP  3.0 
68 68
 For Signup Email broadcast link change 
@@ -72,187 +72,187 @@  discard block
 block discarded – undo
72 72
 	$add_array = $add_array[0];
73 73
 /************************************************************/
74 74
 
75
-        $data['page_title'] = 'Resand Email';
76
-            $where = array('id' => $add_array['id']);
77
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
78
-            foreach ($account->result_array() as $key => $value) {
79
-                $edit_data = $value;
80
-            }
81
-	    $add_array=array('accountid'=>$edit_data['accountid'],
82
-			     'subject'=>$add_array['subject'],
83
-			     'body'=>$add_array['body'],
84
-			     'from'=>$edit_data['from'],
85
-			     'to'=>$edit_data['to'],
86
-			     'status'=>$edit_data['status'],
87
-			     'template'=>$edit_data['template'],
88
-			     'attachment'=>$edit_data['attachment'],
75
+		$data['page_title'] = 'Resand Email';
76
+			$where = array('id' => $add_array['id']);
77
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
78
+			foreach ($account->result_array() as $key => $value) {
79
+				$edit_data = $value;
80
+			}
81
+		$add_array=array('accountid'=>$edit_data['accountid'],
82
+				 'subject'=>$add_array['subject'],
83
+				 'body'=>$add_array['body'],
84
+				 'from'=>$edit_data['from'],
85
+				 'to'=>$edit_data['to'],
86
+				 'status'=>$edit_data['status'],
87
+				 'template'=>$edit_data['template'],
88
+				 'attachment'=>$edit_data['attachment'],
89 89
 			
90
-			    );
91
-                $this->email_re_send($add_array);		
90
+				);
91
+				$this->email_re_send($add_array);		
92 92
         
93
-	    $this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
94
-            redirect(base_url() . 'email/email_history_list/');
95
-    }
96
-    function email_resend_edit($edit_id = '') {
93
+		$this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
94
+			redirect(base_url() . 'email/email_history_list/');
95
+	}
96
+	function email_resend_edit($edit_id = '') {
97 97
 	$data['page_title'] = 'Resend Email';
98
-        $where = array('id' => $edit_id);
99
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
100
-      if ($account->num_rows > 0) {
101
-            foreach ($account->result_array() as $key => $value) {
102
-                $edit_data = $value;
103
-            }
104
-            $data['maildata'] = $edit_data['attachment'];            
105
-            $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_edit(), $edit_data);
98
+		$where = array('id' => $edit_id);
99
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
100
+	  if ($account->num_rows > 0) {
101
+			foreach ($account->result_array() as $key => $value) {
102
+				$edit_data = $value;
103
+			}
104
+			$data['maildata'] = $edit_data['attachment'];            
105
+			$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_edit(), $edit_data);
106 106
 
107
-            $this->load->view('view_email_add_edit', $data);
108
-        } else {
109
-            redirect(base_url() . 'email/email_history_list/');
110
-        }
107
+			$this->load->view('view_email_add_edit', $data);
108
+		} else {
109
+			redirect(base_url() . 'email/email_history_list/');
110
+		}
111 111
 
112
-    }
113
-    function email_resend_edit_customer($edit_id = '') {
112
+	}
113
+	function email_resend_edit_customer($edit_id = '') {
114 114
 	$data['page_title'] = 'Resent Email';
115
-        $where = array('id' => $edit_id);
116
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
117
-      if ($account->num_rows > 0) {
118
-            foreach ($account->result_array() as $key => $value) {
119
-                $edit_data = $value;
120
-            }
121
-            $data['maildata'] = $edit_data['attachment'];
122
-            $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view_cus_edit(), $edit_data);
115
+		$where = array('id' => $edit_id);
116
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
117
+	  if ($account->num_rows > 0) {
118
+			foreach ($account->result_array() as $key => $value) {
119
+				$edit_data = $value;
120
+			}
121
+			$data['maildata'] = $edit_data['attachment'];
122
+			$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view_cus_edit(), $edit_data);
123 123
 
124
-            $this->load->view('view_email_add_edit', $data);
125
-        } else {
126
-            redirect(base_url() . 'email/email_history_list/');
127
-        }
124
+			$this->load->view('view_email_add_edit', $data);
125
+		} else {
126
+			redirect(base_url() . 'email/email_history_list/');
127
+		}
128 128
 
129
-    }
129
+	}
130 130
 
131
-    function email_resend_customer($edit_id = '') {
132
-        $add_array = $this->input->post();
133
-        $data['page_title'] = 'Resand Email';
134
-            $where = array('id' => $add_array['id']);
135
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
136
-            foreach ($account->result_array() as $key => $value) {
137
-                $edit_data = $value;
138
-            }
139
-	    $add_array=array('accountid'=>$edit_data['accountid'],
140
-			     'subject'=>$add_array['subject'],
141
-			     'body'=>$add_array['body'],
142
-			     'from'=>$edit_data['from'],
143
-			     'to'=>$edit_data['to'],
144
-			     'status'=>$edit_data['status'],
145
-			     'template'=>$edit_data['template'],
146
-			     'attachment'=>$edit_data['attachment'],
147
-			    );
148
-            $this->email_model->add_email($add_array);
149
-	        $this->email_lib->send_email('',$add_array,'','',1);
131
+	function email_resend_customer($edit_id = '') {
132
+		$add_array = $this->input->post();
133
+		$data['page_title'] = 'Resand Email';
134
+			$where = array('id' => $add_array['id']);
135
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
136
+			foreach ($account->result_array() as $key => $value) {
137
+				$edit_data = $value;
138
+			}
139
+		$add_array=array('accountid'=>$edit_data['accountid'],
140
+				 'subject'=>$add_array['subject'],
141
+				 'body'=>$add_array['body'],
142
+				 'from'=>$edit_data['from'],
143
+				 'to'=>$edit_data['to'],
144
+				 'status'=>$edit_data['status'],
145
+				 'template'=>$edit_data['template'],
146
+				 'attachment'=>$edit_data['attachment'],
147
+				);
148
+			$this->email_model->add_email($add_array);
149
+			$this->email_lib->send_email('',$add_array,'','',1);
150 150
 
151
-            $this->load->module('accounts/accounts');
152
-	    $this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
153
-            redirect(base_url() . 'accounts/customer_edit/'.$value["accountid"]);
154
-    }
155
-    function email_add($type = "") {
151
+			$this->load->module('accounts/accounts');
152
+		$this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
153
+			redirect(base_url() . 'accounts/customer_edit/'.$value["accountid"]);
154
+	}
155
+	function email_add($type = "") {
156 156
 
157
-        $data['username'] = $this->session->userdata('user_name');
158
-        $data['flag'] = 'create';
159
-        $data['page_title'] = 'Create Commission Rate';
160
-        $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), '');
157
+		$data['username'] = $this->session->userdata('user_name');
158
+		$data['flag'] = 'create';
159
+		$data['page_title'] = 'Create Commission Rate';
160
+		$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), '');
161 161
 
162
-        $this->load->view('view_email_add_edit', $data);
163
-    }
164
-    function email_save() {
165
-        $add_array = $this->input->post();
166
-        $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), $add_array);
167
-        if ($add_array['id'] != '') {
168
-            $data['page_title'] = 'Edit email List';
169
-            if ($this->form_validation->run() == FALSE) {
170
-                $data['validation_errors'] = validation_errors();
171
-                echo $data['validation_errors'];
172
-                exit;
173
-            } else {
174
-                $this->email_model->edit_email($add_array, $add_array['id']);
175
-                echo json_encode(array("SUCCESS"=> "Email list updated successfully!"));
176
-                exit;
177
-            }
178
-        } else {
179
-            $data['page_title'] = 'Create Email List';
180
-            if ($this->form_validation->run() == FALSE) {
181
-                $data['validation_errors'] = validation_errors();
182
-                echo $data['validation_errors'];
183
-                exit;
184
-            } else {
185
-                $this->email_model->add_email($add_array);
186
-                echo json_encode(array("SUCCESS"=> "Email list added successfully!"));
187
-                exit;
188
-            }
189
-        }
190
-    }
191
-    function email_re_send($edit_data) {
162
+		$this->load->view('view_email_add_edit', $data);
163
+	}
164
+	function email_save() {
165
+		$add_array = $this->input->post();
166
+		$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), $add_array);
167
+		if ($add_array['id'] != '') {
168
+			$data['page_title'] = 'Edit email List';
169
+			if ($this->form_validation->run() == FALSE) {
170
+				$data['validation_errors'] = validation_errors();
171
+				echo $data['validation_errors'];
172
+				exit;
173
+			} else {
174
+				$this->email_model->edit_email($add_array, $add_array['id']);
175
+				echo json_encode(array("SUCCESS"=> "Email list updated successfully!"));
176
+				exit;
177
+			}
178
+		} else {
179
+			$data['page_title'] = 'Create Email List';
180
+			if ($this->form_validation->run() == FALSE) {
181
+				$data['validation_errors'] = validation_errors();
182
+				echo $data['validation_errors'];
183
+				exit;
184
+			} else {
185
+				$this->email_model->add_email($add_array);
186
+				echo json_encode(array("SUCCESS"=> "Email list added successfully!"));
187
+				exit;
188
+			}
189
+		}
190
+	}
191
+	function email_re_send($edit_data) {
192 192
 	$this->email_lib->send_email('',$edit_data,'',$edit_data['attachment'],1);
193 193
 	$this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
194
-        redirect(base_url() . '/email/email_history_list/');
195
-    }
196
-    function email_view($edit_id = '') {
194
+		redirect(base_url() . '/email/email_history_list/');
195
+	}
196
+	function email_view($edit_id = '') {
197 197
 	$data['page_title'] = 'View Email';
198
-        $where = array('id' => $edit_id);
199
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
200
-      if ($account->num_rows > 0) {
201
-            foreach ($account->result_array() as $key => $value) {
202
-                $edit_data = $value;
203
-            }  
198
+		$where = array('id' => $edit_id);
199
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
200
+	  if ($account->num_rows > 0) {
201
+			foreach ($account->result_array() as $key => $value) {
202
+				$edit_data = $value;
203
+			}  
204 204
 			if($edit_data['status'] == 1){
205 205
 				$edit_data['status']='Not Sent';
206 206
 			}else{
207 207
 				$edit_data['status']='Sent';
208 208
 			}
209
-            $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view(), $edit_data);
209
+			$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view(), $edit_data);
210 210
 
211
-            $this->load->view('view_email_add_edit', $data);
212
-        } else {
213
-            redirect(base_url() . 'email/email_history_list/');
214
-        }
215
-    }
216
-    function email_view_customer($edit_id = '') {
211
+			$this->load->view('view_email_add_edit', $data);
212
+		} else {
213
+			redirect(base_url() . 'email/email_history_list/');
214
+		}
215
+	}
216
+	function email_view_customer($edit_id = '') {
217 217
 	$data['page_title'] = 'View Email';
218
-        $where = array('id' => $edit_id);
219
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
220
-      if ($account->num_rows > 0) {
221
-            foreach ($account->result_array() as $key => $value) {
222
-                $edit_data = $value;
223
-            }
224
-            $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view_cus(), $edit_data);
225
-            $this->load->view('view_email_add_edit', $data);
226
-        } else {
227
-            redirect(base_url() . 'email/email_history_list/'.$edit_id);
228
-        }
229
-    }
230
-    function email_delete($id) {
231
-        $this->email_model->remove_email($id);
232
-        $this->session->set_flashdata('astpp_notification', 'Email removed successfully!');
233
-        redirect(base_url() . '/email/email_history_list/');
234
-    }
235
-    function email_delete_customer($accounttype,$accountid,$id) {
236
-        $this->email_model->remove_email($id);
237
-        $where = array('id' => $id);
238
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
218
+		$where = array('id' => $edit_id);
219
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
220
+	  if ($account->num_rows > 0) {
221
+			foreach ($account->result_array() as $key => $value) {
222
+				$edit_data = $value;
223
+			}
224
+			$data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view_cus(), $edit_data);
225
+			$this->load->view('view_email_add_edit', $data);
226
+		} else {
227
+			redirect(base_url() . 'email/email_history_list/'.$edit_id);
228
+		}
229
+	}
230
+	function email_delete($id) {
231
+		$this->email_model->remove_email($id);
232
+		$this->session->set_flashdata('astpp_notification', 'Email removed successfully!');
233
+		redirect(base_url() . '/email/email_history_list/');
234
+	}
235
+	function email_delete_customer($accounttype,$accountid,$id) {
236
+		$this->email_model->remove_email($id);
237
+		$where = array('id' => $id);
238
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
239 239
 	foreach ($account->result_array() as $key => $value) {
240
-	    $edit_data = $value;
240
+		$edit_data = $value;
241 241
 	}
242
-        $url ="accounts/".$accounttype."_emailhistory/$accountid/";
243
-        $this->session->set_flashdata('astpp_notification', 'Email removed successfully!');
242
+		$url ="accounts/".$accounttype."_emailhistory/$accountid/";
243
+		$this->session->set_flashdata('astpp_notification', 'Email removed successfully!');
244 244
 	$this->load->module('accounts/accounts');
245
-        redirect(base_url() . $url);
246
-    }
247
-    function email_mass() {
248
-        $account_data = $this->session->userdata("accountinfo");
249
-        if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3)
250
-            redirect(base_url() . '/astpp/dashboard/');
245
+		redirect(base_url() . $url);
246
+	}
247
+	function email_mass() {
248
+		$account_data = $this->session->userdata("accountinfo");
249
+		if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3)
250
+			redirect(base_url() . '/astpp/dashboard/');
251 251
 	$data['username'] = $this->session->userdata('user_name');	
252
-        $data['page_title'] = 'Email Mass';
253
-        $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), '');
252
+		$data['page_title'] = 'Email Mass';
253
+		$data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), '');
254 254
 	$this->load->view('view_email_client_area',$data); 
255
-    }
255
+	}
256 256
  /*Mass Email*/
257 257
    function attachment_icons($select = "", $table = "", $attachement="") {
258 258
 	if($attachement!="")
@@ -268,65 +268,65 @@  discard block
 block discarded – undo
268 268
 	else{
269 269
 		return "";
270 270
 	}
271
-    }
272
-    function email_client_get()
273
-      {
274
-	       $files=$_FILES;
275
-	       $add_array = $this->input->post();
276
-	       $add_array['page_title'] = 'Compose email';
277
-	       $nooffile= $files['file']['name'];
278
-	       $count=count($nooffile);
279
-	       $add_array['attachment']='';
280
-	       $add_array['file']='';
281
-	       for($i=0;$i<$count;$i++){
282
-		       $tmp_name[]= $files['file']['tmp_name'][$i];
283
-		       if($files['file']['error'][$i]==0){
284
-			       $cur_name = $files['file']['name'][$i];
285
-			       $parts = explode(".", $cur_name);
286
-			       $add_array['attachment'].=date('ymdhis').$i.'.'.$parts[1].',';
287
-			       $add_array['file'].=date('ymdhis').$i.'.'.$parts[1].',';
288
-		     	       $uploadedFile1 = $files['file']['tmp_name'][$i];
289
-			       $user_name='inextrix';
290
-			       $actual_file_name=date('ymdhis').$i.'.'.$parts[1];
291
-			       $dir_path=  getcwd()."/attachments/";
292
-			       $path =$dir_path.$actual_file_name;
293
-			       if (move_uploaded_file($uploadedFile1,$path)) {
271
+	}
272
+	function email_client_get()
273
+	  {
274
+		   $files=$_FILES;
275
+		   $add_array = $this->input->post();
276
+		   $add_array['page_title'] = 'Compose email';
277
+		   $nooffile= $files['file']['name'];
278
+		   $count=count($nooffile);
279
+		   $add_array['attachment']='';
280
+		   $add_array['file']='';
281
+		   for($i=0;$i<$count;$i++){
282
+			   $tmp_name[]= $files['file']['tmp_name'][$i];
283
+			   if($files['file']['error'][$i]==0){
284
+				   $cur_name = $files['file']['name'][$i];
285
+				   $parts = explode(".", $cur_name);
286
+				   $add_array['attachment'].=date('ymdhis').$i.'.'.$parts[1].',';
287
+				   $add_array['file'].=date('ymdhis').$i.'.'.$parts[1].',';
288
+			 		   $uploadedFile1 = $files['file']['tmp_name'][$i];
289
+				   $user_name='inextrix';
290
+				   $actual_file_name=date('ymdhis').$i.'.'.$parts[1];
291
+				   $dir_path=  getcwd()."/attachments/";
292
+				   $path =$dir_path.$actual_file_name;
293
+				   if (move_uploaded_file($uploadedFile1,$path)) {
294 294
 				   $this->session->set_flashdata('astpp_errormsg', 'files added successfully!');
295
-			       }
296
-			       else{
297
-				    $this->session->set_flashdata('astpp_errormsg', 'Please try again   !');
298
-			       }
299
-		       }
300
-	       }
301
-	       $add_array['attachment']=trim($add_array['attachment'],',');
302
-	       $add_array['file']=trim($add_array['file'],',');
303
-               $add_array['email']= explode(",",$add_array['to']);   
304
-               $this->email_model->multipal_email($add_array);
305
-               $screen_path = getcwd()."/cron";
306
-               $screen_filename = "Email_Broadcast_".strtotime('now');
307
-               $command = "cd ".$screen_path." && /usr/bin/screen -d -m -S  $screen_filename php cron.php BroadcastEmail";
308
-               exec($command);
309
-               $this->session->set_flashdata('astpp_errormsg', 'Email broad cast successfully!');
310
-               redirect(base_url() . 'email/email_history_list/');
311
-               exit; 
312
-        }
295
+				   }
296
+				   else{
297
+					$this->session->set_flashdata('astpp_errormsg', 'Please try again   !');
298
+				   }
299
+			   }
300
+		   }
301
+		   $add_array['attachment']=trim($add_array['attachment'],',');
302
+		   $add_array['file']=trim($add_array['file'],',');
303
+			   $add_array['email']= explode(",",$add_array['to']);   
304
+			   $this->email_model->multipal_email($add_array);
305
+			   $screen_path = getcwd()."/cron";
306
+			   $screen_filename = "Email_Broadcast_".strtotime('now');
307
+			   $command = "cd ".$screen_path." && /usr/bin/screen -d -m -S  $screen_filename php cron.php BroadcastEmail";
308
+			   exec($command);
309
+			   $this->session->set_flashdata('astpp_errormsg', 'Email broad cast successfully!');
310
+			   redirect(base_url() . 'email/email_history_list/');
311
+			   exit; 
312
+		}
313 313
     
314
-       function email_client_area() {
315
-        $add_array = $this->input->post();
316
-        if($add_array['temp'] == ''){
314
+	   function email_client_area() {
315
+		$add_array = $this->input->post();
316
+		if($add_array['temp'] == ''){
317 317
 	 	$subject = '';
318 318
 		$body ='';	
319
-             }
319
+			 }
320 320
 		else{
321
-                $where = array('id' => $add_array['temp']);
321
+				$where = array('id' => $add_array['temp']);
322 322
 		$account = $this->db_model->getSelect("subject,template", "default_templates", $where);
323 323
 		$account_data =$account->result_array();
324
-                $subject = isset($account_data[0]['subject'])?$account_data[0]['subject']:'';
324
+				$subject = isset($account_data[0]['subject'])?$account_data[0]['subject']:'';
325 325
 		$body = isset($account_data[0]['template'])?$account_data[0]['template']:'';	
326 326
 	
327 327
             
328
-        }
329
-       	$count_all = $this->email_model->get_email_client_data($add_array);
328
+		}
329
+	   	$count_all = $this->email_model->get_email_client_data($add_array);
330 330
 	$email_arr = array();
331 331
 	$id_arr = array();
332 332
 	foreach($count_all as $key=>$value){
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 	} 
338 338
 	if (empty($email_arr))
339 339
 	{
340
-        	$this->session->set_flashdata('astpp_notification', 'No record found! ');
341
-	        redirect(base_url() . 'email/email_mass/');
340
+			$this->session->set_flashdata('astpp_notification', 'No record found! ');
341
+			redirect(base_url() . 'email/email_mass/');
342 342
 	}
343 343
 	$to_email = $email_arr;
344 344
 	
@@ -354,104 +354,104 @@  discard block
 block discarded – undo
354 354
 	$send_id =$send_id[0]['emailaddress'];
355 355
 	$add_arr['template'] = $body;
356 356
 	$add_arr['subject'] = $subject;
357
-        $add_arr['accountid'] = $id_arr;
357
+		$add_arr['accountid'] = $id_arr;
358 358
 	$add_arr['from'] = $send_id;
359 359
 	$add_arr['temp'] = $add_array['temp'];
360 360
 	$add_arr['to']=$to_send_mail;
361 361
 	$add_arr['temp']=$add_array['temp'];
362
-        $this->load->view('view_email_brod', $add_arr);
363
-    }
362
+		$this->load->view('view_email_brod', $add_arr);
363
+	}
364 364
 
365 365
 /********************************************************/
366
-    function email_history_list_customer() {
366
+	function email_history_list_customer() {
367 367
 	$add_array = $this->input->post();
368
-            $where = array('id' => $add_array['id']);
369
-        $account = $this->db_model->getSelect("*", "mail_details", $where);
370
-            foreach ($account->result_array() as $key => $value) {
371
-                $edit_data = $value;
372
-            }
373
-	    $this->load->module('accounts/accounts');
374
-            redirect(base_url() . 'accounts/customer_edit/'.$value['accountid']);
375
-    }
376
-    function email_history_list() {
368
+			$where = array('id' => $add_array['id']);
369
+		$account = $this->db_model->getSelect("*", "mail_details", $where);
370
+			foreach ($account->result_array() as $key => $value) {
371
+				$edit_data = $value;
372
+			}
373
+		$this->load->module('accounts/accounts');
374
+			redirect(base_url() . 'accounts/customer_edit/'.$value['accountid']);
375
+	}
376
+	function email_history_list() {
377 377
 	$data['logintype']=$this->session->userdata('logintype');
378
-        $data['username'] = $this->session->userdata('user_name');
379
-        $data['search_flag'] = true;
380
-        $this->session->set_userdata('advance_search', 0);
378
+		$data['username'] = $this->session->userdata('user_name');
379
+		$data['search_flag'] = true;
380
+		$this->session->set_userdata('advance_search', 0);
381 381
 	$data['page_title'] = 'Email History List';
382 382
 	$data['grid_fields'] = $this->email_form->build_list_for_email();
383 383
 	$data["grid_buttons"] = $this->email_form->build_grid_buttons_email();
384
-        $data['form_search'] = $this->form->build_serach_form($this->email_form->get_email_history_search_form());
384
+		$data['form_search'] = $this->form->build_serach_form($this->email_form->get_email_history_search_form());
385 385
 	$this->load->view('view_email_list', $data);
386
-    }
387
-    function email_history_list_json() {
386
+	}
387
+	function email_history_list_json() {
388 388
 	$data['logintype']=$this->session->userdata('logintype');
389
-        $json_data = array();
390
-        $count_all = $this->email_model->get_email_list(false);
391
-        $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
392
-        $json_data = $paging_data["json_paging"];
393
-        $query = $this->email_model->get_email_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
389
+		$json_data = array();
390
+		$count_all = $this->email_model->get_email_list(false);
391
+		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
392
+		$json_data = $paging_data["json_paging"];
393
+		$query = $this->email_model->get_email_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
394 394
 	$grid_fields = json_decode($this->email_form->build_list_for_email());
395
-        $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
396
-        echo json_encode($json_data);
397
-    }
395
+		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
396
+		echo json_encode($json_data);
397
+	}
398 398
 
399
-    function customer_mail_record($accountid,$accounttype){
400
-        $json_data = array();
401
-        $count_all = $this->email_model->customer_get_email_list(false,$accountid,"","");
402
-        $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
403
-        $json_data = $paging_data["json_paging"];
404
-        $query = $this->email_model->customer_get_email_list(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
399
+	function customer_mail_record($accountid,$accounttype){
400
+		$json_data = array();
401
+		$count_all = $this->email_model->customer_get_email_list(false,$accountid,"","");
402
+		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
403
+		$json_data = $paging_data["json_paging"];
404
+		$query = $this->email_model->customer_get_email_list(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
405 405
 	$grid_fields = json_decode($this->email_form->build_list_for_email_customer($accountid,$accounttype));
406
-        $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
407
-        echo json_encode($json_data);
408
-    }    
409
-    function email_delete_multiple() {
410
-        $ids = $this->input->post("selected_ids", true);
411
-        $where = "id IN ($ids)";
412
-        $this->db->where($where);
413
-        echo $this->db->delete("email");
414
-    }
406
+		$json_data['rows'] = $this->form->build_grid($query, $grid_fields);
407
+		echo json_encode($json_data);
408
+	}    
409
+	function email_delete_multiple() {
410
+		$ids = $this->input->post("selected_ids", true);
411
+		$where = "id IN ($ids)";
412
+		$this->db->where($where);
413
+		echo $this->db->delete("email");
414
+	}
415 415
 
416
-    function email_send_multipal(){
416
+	function email_send_multipal(){
417 417
 	$add_array = $this->input->post();
418 418
 	if($add_array['email'] == '' || $add_array['subject'] == '' || $add_array['template'] == ''){
419 419
 		$this->session->set_flashdata('astpp_notification', 'Email address not found!');
420
-	        redirect(base_url() . '/email/email_client_area/');
420
+			redirect(base_url() . '/email/email_client_area/');
421 421
 	}
422
-        $this->email_model->multipal_email($add_array);
422
+		$this->email_model->multipal_email($add_array);
423 423
 	$screen_path = "/var/www/html/ITPLATP/cron";
424 424
 	$screen_filename = "Email_Broadcast_".strtotime('now');
425 425
 	$command = "cd ".$screen_path." && /usr/bin/screen -d -m -S  $screen_filename php cron.php BroadcastEmail";
426
-        exec($command);
426
+		exec($command);
427 427
 	$this->session->set_flashdata('astpp_errormsg', 'Email broad cast successfully!');
428
-    	redirect(base_url() . 'email/email_history_list/');
428
+		redirect(base_url() . 'email/email_history_list/');
429 429
 
430
-    }
431
-    function email_history_list_search() {
432
-        $ajax_search = $this->input->post('ajax_search', 0);
430
+	}
431
+	function email_history_list_search() {
432
+		$ajax_search = $this->input->post('ajax_search', 0);
433 433
 
434
-        if ($this->input->post('advance_search', TRUE) == 1) {
435
-            $this->session->set_userdata('advance_search', $this->input->post('advance_search'));
436
-            $action = $this->input->post();
437
-            unset($action['action']);
438
-            unset($action['advance_search']);
439
-            $this->session->set_userdata('email_search_list', $action);
440
-        }
441
-        if (@$ajax_search != 1) {
442
-            redirect(base_url() . 'email/email_history_list/');
443
-        }
444
-    }
434
+		if ($this->input->post('advance_search', TRUE) == 1) {
435
+			$this->session->set_userdata('advance_search', $this->input->post('advance_search'));
436
+			$action = $this->input->post();
437
+			unset($action['action']);
438
+			unset($action['advance_search']);
439
+			$this->session->set_userdata('email_search_list', $action);
440
+		}
441
+		if (@$ajax_search != 1) {
442
+			redirect(base_url() . 'email/email_history_list/');
443
+		}
444
+	}
445 445
 
446
-    function email_history_list_clearsearchfilter() {
447
-        $this->session->set_userdata('advance_search', 0);
448
-        $this->session->set_userdata('email_search', "");
449
-    }
450
-    /*
446
+	function email_history_list_clearsearchfilter() {
447
+		$this->session->set_userdata('advance_search', 0);
448
+		$this->session->set_userdata('email_search', "");
449
+	}
450
+	/*
451 451
 	* Purpose : Add following code for download attached file
452 452
 	* Version 2.1
453 453
     */
454
-    function email_history_list_attachment($file_name) {
454
+	function email_history_list_attachment($file_name) {
455 455
 	if(file_exists(getcwd().'/attachments/'.$file_name)){
456 456
 		header('Content-Type: application/octet-stream');
457 457
 		header('Content-Disposition: attachment; filename='.$file_name);
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 		flush();
460 460
 		readfile(getcwd().'/attachments/'.$file_name);
461 461
 	}
462
-    }
462
+	}
463 463
 
464 464
 }
465 465
 ?>
Please login to merge, or discard this patch.
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $this->load->library('csvreader');
37 37
 	$this->load->library('astpp/email_lib');
38 38
         if ($this->session->userdata('user_login') == FALSE)
39
-            redirect(base_url() . '/astpp/login');
39
+            redirect(base_url().'/astpp/login');
40 40
     }
41 41
 
42 42
     function email_edit($edit_id = '') {
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
             $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email(), $edit_data);
57 57
             $this->load->view('view_email_add_edit', $data);
58 58
         } else {
59
-            redirect(base_url() . 'email/email_history_list/');
59
+            redirect(base_url().'email/email_history_list/');
60 60
         }
61
-            redirect(base_url() . 'email/email_history_list/');
61
+            redirect(base_url().'email/email_history_list/');
62 62
     }
63 63
 
64 64
     function email_resend() {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             foreach ($account->result_array() as $key => $value) {
79 79
                 $edit_data = $value;
80 80
             }
81
-	    $add_array=array('accountid'=>$edit_data['accountid'],
81
+	    $add_array = array('accountid'=>$edit_data['accountid'],
82 82
 			     'subject'=>$add_array['subject'],
83 83
 			     'body'=>$add_array['body'],
84 84
 			     'from'=>$edit_data['from'],
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                 $this->email_re_send($add_array);		
92 92
         
93 93
 	    $this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
94
-            redirect(base_url() . 'email/email_history_list/');
94
+            redirect(base_url().'email/email_history_list/');
95 95
     }
96 96
     function email_resend_edit($edit_id = '') {
97 97
 	$data['page_title'] = 'Resend Email';
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
             $this->load->view('view_email_add_edit', $data);
108 108
         } else {
109
-            redirect(base_url() . 'email/email_history_list/');
109
+            redirect(base_url().'email/email_history_list/');
110 110
         }
111 111
 
112 112
     }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
             $this->load->view('view_email_add_edit', $data);
125 125
         } else {
126
-            redirect(base_url() . 'email/email_history_list/');
126
+            redirect(base_url().'email/email_history_list/');
127 127
         }
128 128
 
129 129
     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             foreach ($account->result_array() as $key => $value) {
137 137
                 $edit_data = $value;
138 138
             }
139
-	    $add_array=array('accountid'=>$edit_data['accountid'],
139
+	    $add_array = array('accountid'=>$edit_data['accountid'],
140 140
 			     'subject'=>$add_array['subject'],
141 141
 			     'body'=>$add_array['body'],
142 142
 			     'from'=>$edit_data['from'],
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
 			     'attachment'=>$edit_data['attachment'],
147 147
 			    );
148 148
             $this->email_model->add_email($add_array);
149
-	        $this->email_lib->send_email('',$add_array,'','',1);
149
+	        $this->email_lib->send_email('', $add_array, '', '', 1);
150 150
 
151 151
             $this->load->module('accounts/accounts');
152 152
 	    $this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
153
-            redirect(base_url() . 'accounts/customer_edit/'.$value["accountid"]);
153
+            redirect(base_url().'accounts/customer_edit/'.$value["accountid"]);
154 154
     }
155 155
     function email_add($type = "") {
156 156
 
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
         }
190 190
     }
191 191
     function email_re_send($edit_data) {
192
-	$this->email_lib->send_email('',$edit_data,'',$edit_data['attachment'],1);
192
+	$this->email_lib->send_email('', $edit_data, '', $edit_data['attachment'], 1);
193 193
 	$this->session->set_flashdata('astpp_errormsg', 'Email resend successfully!');
194
-        redirect(base_url() . '/email/email_history_list/');
194
+        redirect(base_url().'/email/email_history_list/');
195 195
     }
196 196
     function email_view($edit_id = '') {
197 197
 	$data['page_title'] = 'View Email';
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
             foreach ($account->result_array() as $key => $value) {
202 202
                 $edit_data = $value;
203 203
             }  
204
-			if($edit_data['status'] == 1){
205
-				$edit_data['status']='Not Sent';
206
-			}else{
207
-				$edit_data['status']='Sent';
204
+			if ($edit_data['status'] == 1) {
205
+				$edit_data['status'] = 'Not Sent';
206
+			} else {
207
+				$edit_data['status'] = 'Sent';
208 208
 			}
209 209
             $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view(), $edit_data);
210 210
 
211 211
             $this->load->view('view_email_add_edit', $data);
212 212
         } else {
213
-            redirect(base_url() . 'email/email_history_list/');
213
+            redirect(base_url().'email/email_history_list/');
214 214
         }
215 215
     }
216 216
     function email_view_customer($edit_id = '') {
@@ -224,141 +224,141 @@  discard block
 block discarded – undo
224 224
             $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view_cus(), $edit_data);
225 225
             $this->load->view('view_email_add_edit', $data);
226 226
         } else {
227
-            redirect(base_url() . 'email/email_history_list/'.$edit_id);
227
+            redirect(base_url().'email/email_history_list/'.$edit_id);
228 228
         }
229 229
     }
230 230
     function email_delete($id) {
231 231
         $this->email_model->remove_email($id);
232 232
         $this->session->set_flashdata('astpp_notification', 'Email removed successfully!');
233
-        redirect(base_url() . '/email/email_history_list/');
233
+        redirect(base_url().'/email/email_history_list/');
234 234
     }
235
-    function email_delete_customer($accounttype,$accountid,$id) {
235
+    function email_delete_customer($accounttype, $accountid, $id) {
236 236
         $this->email_model->remove_email($id);
237 237
         $where = array('id' => $id);
238 238
         $account = $this->db_model->getSelect("*", "mail_details", $where);
239 239
 	foreach ($account->result_array() as $key => $value) {
240 240
 	    $edit_data = $value;
241 241
 	}
242
-        $url ="accounts/".$accounttype."_emailhistory/$accountid/";
242
+        $url = "accounts/".$accounttype."_emailhistory/$accountid/";
243 243
         $this->session->set_flashdata('astpp_notification', 'Email removed successfully!');
244 244
 	$this->load->module('accounts/accounts');
245
-        redirect(base_url() . $url);
245
+        redirect(base_url().$url);
246 246
     }
247 247
     function email_mass() {
248 248
         $account_data = $this->session->userdata("accountinfo");
249
-        if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3)
250
-            redirect(base_url() . '/astpp/dashboard/');
249
+        if ($account_data['type'] == '1' || $account_data['type'] == 0 || $account_data['type'] == 3)
250
+            redirect(base_url().'/astpp/dashboard/');
251 251
 	$data['username'] = $this->session->userdata('user_name');	
252 252
         $data['page_title'] = 'Email Mass';
253 253
         $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), '');
254
-	$this->load->view('view_email_client_area',$data); 
254
+	$this->load->view('view_email_client_area', $data); 
255 255
     }
256 256
  /*Mass Email*/
257
-   function attachment_icons($select = "", $table = "", $attachement="") {
258
-	if($attachement!="")
257
+   function attachment_icons($select = "", $table = "", $attachement = "") {
258
+	if ($attachement != "")
259 259
 	{
260
-		$array=explode(",", $attachement);
261
-		$str='';
262
-		foreach($array as $key =>$val){
263
-			$link = base_url() . "email/email_history_list_attachment/".$val;
264
-			$str.="<a href='".$link."' title='".$val."' class='btn btn-royelblue btn-sm'><i class='fa fa-paperclip fa-fw'></i></a>&nbsp;&nbsp;";
260
+		$array = explode(",", $attachement);
261
+		$str = '';
262
+		foreach ($array as $key =>$val) {
263
+			$link = base_url()."email/email_history_list_attachment/".$val;
264
+			$str .= "<a href='".$link."' title='".$val."' class='btn btn-royelblue btn-sm'><i class='fa fa-paperclip fa-fw'></i></a>&nbsp;&nbsp;";
265 265
 		}
266 266
 		return $str;
267 267
 	}
268
-	else{
268
+	else {
269 269
 		return "";
270 270
 	}
271 271
     }
272 272
     function email_client_get()
273 273
       {
274
-	       $files=$_FILES;
274
+	       $files = $_FILES;
275 275
 	       $add_array = $this->input->post();
276 276
 	       $add_array['page_title'] = 'Compose email';
277
-	       $nooffile= $files['file']['name'];
278
-	       $count=count($nooffile);
279
-	       $add_array['attachment']='';
280
-	       $add_array['file']='';
281
-	       for($i=0;$i<$count;$i++){
282
-		       $tmp_name[]= $files['file']['tmp_name'][$i];
283
-		       if($files['file']['error'][$i]==0){
277
+	       $nooffile = $files['file']['name'];
278
+	       $count = count($nooffile);
279
+	       $add_array['attachment'] = '';
280
+	       $add_array['file'] = '';
281
+	       for ($i = 0; $i < $count; $i++) {
282
+		       $tmp_name[] = $files['file']['tmp_name'][$i];
283
+		       if ($files['file']['error'][$i] == 0) {
284 284
 			       $cur_name = $files['file']['name'][$i];
285 285
 			       $parts = explode(".", $cur_name);
286
-			       $add_array['attachment'].=date('ymdhis').$i.'.'.$parts[1].',';
287
-			       $add_array['file'].=date('ymdhis').$i.'.'.$parts[1].',';
286
+			       $add_array['attachment'] .= date('ymdhis').$i.'.'.$parts[1].',';
287
+			       $add_array['file'] .= date('ymdhis').$i.'.'.$parts[1].',';
288 288
 		     	       $uploadedFile1 = $files['file']['tmp_name'][$i];
289
-			       $user_name='inextrix';
290
-			       $actual_file_name=date('ymdhis').$i.'.'.$parts[1];
291
-			       $dir_path=  getcwd()."/attachments/";
292
-			       $path =$dir_path.$actual_file_name;
293
-			       if (move_uploaded_file($uploadedFile1,$path)) {
289
+			       $user_name = 'inextrix';
290
+			       $actual_file_name = date('ymdhis').$i.'.'.$parts[1];
291
+			       $dir_path = getcwd()."/attachments/";
292
+			       $path = $dir_path.$actual_file_name;
293
+			       if (move_uploaded_file($uploadedFile1, $path)) {
294 294
 				   $this->session->set_flashdata('astpp_errormsg', 'files added successfully!');
295 295
 			       }
296
-			       else{
296
+			       else {
297 297
 				    $this->session->set_flashdata('astpp_errormsg', 'Please try again   !');
298 298
 			       }
299 299
 		       }
300 300
 	       }
301
-	       $add_array['attachment']=trim($add_array['attachment'],',');
302
-	       $add_array['file']=trim($add_array['file'],',');
303
-               $add_array['email']= explode(",",$add_array['to']);   
301
+	       $add_array['attachment'] = trim($add_array['attachment'], ',');
302
+	       $add_array['file'] = trim($add_array['file'], ',');
303
+               $add_array['email'] = explode(",", $add_array['to']);   
304 304
                $this->email_model->multipal_email($add_array);
305 305
                $screen_path = getcwd()."/cron";
306 306
                $screen_filename = "Email_Broadcast_".strtotime('now');
307 307
                $command = "cd ".$screen_path." && /usr/bin/screen -d -m -S  $screen_filename php cron.php BroadcastEmail";
308 308
                exec($command);
309 309
                $this->session->set_flashdata('astpp_errormsg', 'Email broad cast successfully!');
310
-               redirect(base_url() . 'email/email_history_list/');
310
+               redirect(base_url().'email/email_history_list/');
311 311
                exit; 
312 312
         }
313 313
     
314 314
        function email_client_area() {
315 315
         $add_array = $this->input->post();
316
-        if($add_array['temp'] == ''){
316
+        if ($add_array['temp'] == '') {
317 317
 	 	$subject = '';
318
-		$body ='';	
318
+		$body = '';	
319 319
              }
320
-		else{
320
+		else {
321 321
                 $where = array('id' => $add_array['temp']);
322 322
 		$account = $this->db_model->getSelect("subject,template", "default_templates", $where);
323
-		$account_data =$account->result_array();
324
-                $subject = isset($account_data[0]['subject'])?$account_data[0]['subject']:'';
325
-		$body = isset($account_data[0]['template'])?$account_data[0]['template']:'';	
323
+		$account_data = $account->result_array();
324
+                $subject = isset($account_data[0]['subject']) ? $account_data[0]['subject'] : '';
325
+		$body = isset($account_data[0]['template']) ? $account_data[0]['template'] : '';	
326 326
 	
327 327
             
328 328
         }
329 329
        	$count_all = $this->email_model->get_email_client_data($add_array);
330 330
 	$email_arr = array();
331 331
 	$id_arr = array();
332
-	foreach($count_all as $key=>$value){
332
+	foreach ($count_all as $key=>$value) {
333 333
 		$value = $value;
334
-		if($value['email']!=''){
335
-		$email_arr[$value['email']]= $value['email'];
336
-		$id_arr[]= $value['id'];}
334
+		if ($value['email'] != '') {
335
+		$email_arr[$value['email']] = $value['email'];
336
+		$id_arr[] = $value['id']; }
337 337
 	} 
338 338
 	if (empty($email_arr))
339 339
 	{
340 340
         	$this->session->set_flashdata('astpp_notification', 'No record found! ');
341
-	        redirect(base_url() . 'email/email_mass/');
341
+	        redirect(base_url().'email/email_mass/');
342 342
 	}
343 343
 	$to_email = $email_arr;
344 344
 	
345 345
 	$to_id = $id_arr;
346
-	$to_send_mail = implode(",",$to_email);
347
-	if($to_send_mail != ''){
348
-		$add_arr['email']= $email_arr;
346
+	$to_send_mail = implode(",", $to_email);
347
+	if ($to_send_mail != '') {
348
+		$add_arr['email'] = $email_arr;
349 349
 	}
350 350
 	$data['username'] = $this->session->userdata('user_name');	
351 351
 	$data['page_title'] = 'Compose Email';
352 352
 	$send_id = $this->db_model->getSelect("emailaddress", "invoice_conf", array());
353
-	$send_id =$send_id->result_array();
354
-	$send_id =$send_id[0]['emailaddress'];
353
+	$send_id = $send_id->result_array();
354
+	$send_id = $send_id[0]['emailaddress'];
355 355
 	$add_arr['template'] = $body;
356 356
 	$add_arr['subject'] = $subject;
357 357
         $add_arr['accountid'] = $id_arr;
358 358
 	$add_arr['from'] = $send_id;
359 359
 	$add_arr['temp'] = $add_array['temp'];
360
-	$add_arr['to']=$to_send_mail;
361
-	$add_arr['temp']=$add_array['temp'];
360
+	$add_arr['to'] = $to_send_mail;
361
+	$add_arr['temp'] = $add_array['temp'];
362 362
         $this->load->view('view_email_brod', $add_arr);
363 363
     }
364 364
 
@@ -371,10 +371,10 @@  discard block
 block discarded – undo
371 371
                 $edit_data = $value;
372 372
             }
373 373
 	    $this->load->module('accounts/accounts');
374
-            redirect(base_url() . 'accounts/customer_edit/'.$value['accountid']);
374
+            redirect(base_url().'accounts/customer_edit/'.$value['accountid']);
375 375
     }
376 376
     function email_history_list() {
377
-	$data['logintype']=$this->session->userdata('logintype');
377
+	$data['logintype'] = $this->session->userdata('logintype');
378 378
         $data['username'] = $this->session->userdata('user_name');
379 379
         $data['search_flag'] = true;
380 380
         $this->session->set_userdata('advance_search', 0);
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	$this->load->view('view_email_list', $data);
386 386
     }
387 387
     function email_history_list_json() {
388
-	$data['logintype']=$this->session->userdata('logintype');
388
+	$data['logintype'] = $this->session->userdata('logintype');
389 389
         $json_data = array();
390 390
         $count_all = $this->email_model->get_email_list(false);
391 391
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
@@ -396,13 +396,13 @@  discard block
 block discarded – undo
396 396
         echo json_encode($json_data);
397 397
     }
398 398
 
399
-    function customer_mail_record($accountid,$accounttype){
399
+    function customer_mail_record($accountid, $accounttype) {
400 400
         $json_data = array();
401
-        $count_all = $this->email_model->customer_get_email_list(false,$accountid,"","");
401
+        $count_all = $this->email_model->customer_get_email_list(false, $accountid, "", "");
402 402
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
403 403
         $json_data = $paging_data["json_paging"];
404
-        $query = $this->email_model->customer_get_email_list(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
405
-	$grid_fields = json_decode($this->email_form->build_list_for_email_customer($accountid,$accounttype));
404
+        $query = $this->email_model->customer_get_email_list(true, $accountid, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
405
+	$grid_fields = json_decode($this->email_form->build_list_for_email_customer($accountid, $accounttype));
406 406
         $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
407 407
         echo json_encode($json_data);
408 408
     }    
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
         echo $this->db->delete("email");
414 414
     }
415 415
 
416
-    function email_send_multipal(){
416
+    function email_send_multipal() {
417 417
 	$add_array = $this->input->post();
418
-	if($add_array['email'] == '' || $add_array['subject'] == '' || $add_array['template'] == ''){
418
+	if ($add_array['email'] == '' || $add_array['subject'] == '' || $add_array['template'] == '') {
419 419
 		$this->session->set_flashdata('astpp_notification', 'Email address not found!');
420
-	        redirect(base_url() . '/email/email_client_area/');
420
+	        redirect(base_url().'/email/email_client_area/');
421 421
 	}
422 422
         $this->email_model->multipal_email($add_array);
423 423
 	$screen_path = "/var/www/html/ITPLATP/cron";
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	$command = "cd ".$screen_path." && /usr/bin/screen -d -m -S  $screen_filename php cron.php BroadcastEmail";
426 426
         exec($command);
427 427
 	$this->session->set_flashdata('astpp_errormsg', 'Email broad cast successfully!');
428
-    	redirect(base_url() . 'email/email_history_list/');
428
+    	redirect(base_url().'email/email_history_list/');
429 429
 
430 430
     }
431 431
     function email_history_list_search() {
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
             $this->session->set_userdata('email_search_list', $action);
440 440
         }
441 441
         if (@$ajax_search != 1) {
442
-            redirect(base_url() . 'email/email_history_list/');
442
+            redirect(base_url().'email/email_history_list/');
443 443
         }
444 444
     }
445 445
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 	* Version 2.1
453 453
     */
454 454
     function email_history_list_attachment($file_name) {
455
-	if(file_exists(getcwd().'/attachments/'.$file_name)){
455
+	if (file_exists(getcwd().'/attachments/'.$file_name)) {
456 456
 		header('Content-Type: application/octet-stream');
457 457
 		header('Content-Disposition: attachment; filename='.$file_name);
458 458
 		ob_clean();
Please login to merge, or discard this patch.
Braces   +10 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
         $this->load->model('email_model');
36 36
         $this->load->library('csvreader');
37 37
 	$this->load->library('astpp/email_lib');
38
-        if ($this->session->userdata('user_login') == FALSE)
39
-            redirect(base_url() . '/astpp/login');
38
+        if ($this->session->userdata('user_login') == FALSE) {
39
+                    redirect(base_url() . '/astpp/login');
40
+        }
40 41
     }
41 42
 
42 43
     function email_edit($edit_id = '') {
@@ -203,7 +204,7 @@  discard block
 block discarded – undo
203 204
             }  
204 205
 			if($edit_data['status'] == 1){
205 206
 				$edit_data['status']='Not Sent';
206
-			}else{
207
+			} else{
207 208
 				$edit_data['status']='Sent';
208 209
 			}
209 210
             $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view(), $edit_data);
@@ -246,8 +247,9 @@  discard block
 block discarded – undo
246 247
     }
247 248
     function email_mass() {
248 249
         $account_data = $this->session->userdata("accountinfo");
249
-        if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3)
250
-            redirect(base_url() . '/astpp/dashboard/');
250
+        if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) {
251
+                    redirect(base_url() . '/astpp/dashboard/');
252
+        }
251 253
 	$data['username'] = $this->session->userdata('user_name');	
252 254
         $data['page_title'] = 'Email Mass';
253 255
         $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), '');
@@ -264,8 +266,7 @@  discard block
 block discarded – undo
264 266
 			$str.="<a href='".$link."' title='".$val."' class='btn btn-royelblue btn-sm'><i class='fa fa-paperclip fa-fw'></i></a>&nbsp;&nbsp;";
265 267
 		}
266 268
 		return $str;
267
-	}
268
-	else{
269
+	} else{
269 270
 		return "";
270 271
 	}
271 272
     }
@@ -292,8 +293,7 @@  discard block
 block discarded – undo
292 293
 			       $path =$dir_path.$actual_file_name;
293 294
 			       if (move_uploaded_file($uploadedFile1,$path)) {
294 295
 				   $this->session->set_flashdata('astpp_errormsg', 'files added successfully!');
295
-			       }
296
-			       else{
296
+			       } else{
297 297
 				    $this->session->set_flashdata('astpp_errormsg', 'Please try again   !');
298 298
 			       }
299 299
 		       }
@@ -316,8 +316,7 @@  discard block
 block discarded – undo
316 316
         if($add_array['temp'] == ''){
317 317
 	 	$subject = '';
318 318
 		$body ='';	
319
-             }
320
-		else{
319
+             } else{
321 320
                 $where = array('id' => $add_array['temp']);
322 321
 		$account = $this->db_model->getSelect("subject,template", "default_templates", $where);
323 322
 		$account_data =$account->result_array();
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/libraries/email_form.php 3 patches
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -23,144 +23,144 @@  discard block
 block discarded – undo
23 23
 ###############################################################################
24 24
 
25 25
 if (!defined('BASEPATH'))
26
-    exit('No direct script access allowed');
26
+	exit('No direct script access allowed');
27 27
 
28 28
 class Email_form {
29
-    function __construct($library_name = '') {
30
-        $this->CI = & get_instance();
31
-    }
29
+	function __construct($library_name = '') {
30
+		$this->CI = & get_instance();
31
+	}
32 32
 
33 33
   function get_form_fields_email() {
34
-         $form['forms'] = array(base_url() . 'email/email_re_send/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
35
-        $form['Resend Email'] = array(
36
-            array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
37
-            array('To', 'INPUT', array('name' => 'to', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
38
-            array('From', 'INPUT', array('name' => 'from', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
39
-            array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
40
-            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
34
+		 $form['forms'] = array(base_url() . 'email/email_re_send/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
35
+		$form['Resend Email'] = array(
36
+			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
37
+			array('To', 'INPUT', array('name' => 'to', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
38
+			array('From', 'INPUT', array('name' => 'from', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
39
+			array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
40
+			array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
41 41
             
42 42
 			array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''),
43 43
 	           
44 44
 );
45
-        $form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
46
-        $form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
45
+		$form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
46
+		$form['button_save'] = array('name' => 'action', 'content' => 'Save', 'value' => 'save', 'id' => 'submit', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
47 47
 
48
-        return $form;
49
-    }
48
+		return $form;
49
+	}
50 50
 
51
-    function get_form_fields_email_edit() {
51
+	function get_form_fields_email_edit() {
52 52
 	 $readable='disabled';
53
-         $form['forms'] = array(base_url() . 'email/email_resend/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
53
+		 $form['forms'] = array(base_url() . 'email/email_resend/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
54 54
 	 $form['Resent Email'] = array(
55
-           array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
56
-           array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
57
-           array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
58
-           array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
55
+		   array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
56
+		   array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
57
+		   array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
58
+		   array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
59 59
 		   array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1,  'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
60
-           array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15,  'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
60
+		   array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15,  'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
61 61
 	           
62 62
 	 );
63 63
 	 $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
64
-         $form['button_save'] = array('name' => 'action', 'content' => 'Sent', 'value' => 'save', 'id' => 'button', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
65
-         return $form;
66
-    }
64
+		 $form['button_save'] = array('name' => 'action', 'content' => 'Sent', 'value' => 'save', 'id' => 'button', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
65
+		 return $form;
66
+	}
67 67
     
68
-    function get_form_fields_email_view() {
69
-	    $readable='disabled';
70
-         $form['forms'] = array(base_url() . 'email/email_history_list/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
71
-        $form['View Email'] = array(
72
-            array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
73
-            array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
68
+	function get_form_fields_email_view() {
69
+		$readable='disabled';
70
+		 $form['forms'] = array(base_url() . 'email/email_history_list/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
71
+		$form['View Email'] = array(
72
+			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
73
+			array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
74 74
 			array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
75 75
 			array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,'style'=>'margin-top: 3px;' ,'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
76 76
 			array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
77
-            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
77
+			array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
78 78
 			array('Status', 'INPUT', array('name' => 'status', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'style'=>'width: 18% !important;margin-top: 3px;' , 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),   
79 79
 	           
80 80
 );
81
-        $form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
82
-        return $form;
83
-    }
84
-    function get_form_fields_email_view_cus() {
81
+		$form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
82
+		return $form;
83
+	}
84
+	function get_form_fields_email_view_cus() {
85 85
 	 $readable='disabled';
86
-         $form['forms'] = array(base_url() . 'email/email_history_list_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
87
-         $form['View Email'] = array(
88
-           array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
89
-           array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
90
-           array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
91
-           array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
86
+		 $form['forms'] = array(base_url() . 'email/email_history_list_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
87
+		 $form['View Email'] = array(
88
+		   array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
89
+		   array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
90
+		   array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
91
+		   array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
92 92
 	   array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
93
-           array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
93
+		   array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
94 94
             
95
-	    array('Status', array('name' => 'status', 'disabled' => $readable, 'style' => 'width:20% !important;','class' => "text field medium"), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''),
95
+		array('Status', array('name' => 'status', 'disabled' => $readable, 'style' => 'width:20% !important;','class' => "text field medium"), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''),
96 96
 	           
97 97
 );
98
-        $form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
99
-        return $form;
100
-    }
101
-    function get_form_fields_email_view_cus_edit() {
102
-	    $readable='disabled';
103
-         $form['forms'] = array(base_url() . 'email/email_resend_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
104
-        $form['Resent Email'] = array(
105
-            array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
106
-            array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
98
+		$form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
99
+		return $form;
100
+	}
101
+	function get_form_fields_email_view_cus_edit() {
102
+		$readable='disabled';
103
+		 $form['forms'] = array(base_url() . 'email/email_resend_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
104
+		$form['Resent Email'] = array(
105
+			array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
106
+			array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
107 107
 			array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
108 108
 			array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
109 109
 			array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
110
-            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),           
110
+			array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),           
111 111
 );
112
-        $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
113
-         $form['button_save'] = array('name' => 'action', 'content' => 'Sent', 'value' => 'save', 'id' => 'button', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
114
-        return $form;
115
-    }
112
+		$form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
113
+		 $form['button_save'] = array('name' => 'action', 'content' => 'Sent', 'value' => 'save', 'id' => 'button', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
114
+		return $form;
115
+	}
116 116
 
117
-    function build_list_for_email() {
118
-        // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
119
-        $grid_field_arr = json_encode(array(
120
-            array("Date", "100", "date", "", "", "","","true","center"),
121
-            array("Account", "99", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new","","true","center"),
122
-            array("From", "145", "from", "", "", "","","true","center"),
123
-            array("To", "140", "to", "", "", "","","true","center"),
124
-            array("Subject", "180", "subject", "", "", "","","true","center"),
125
-            array("Body", "320", "body", "", "", "","","true","center"),
126
-            array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"),
127
-            array("Status", "70", "status", "status", "status", "email_status","","true","center"),
128
-            array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit/", "mode" => "popup"),
129
-		    "VIEW" => array("url" => "email/email_view/", "mode" => "popup","layout"=>"medium"),
130
-                    "DELETE" => array("url" => "/email/email_delete/", "mode" => "single")))
131
-                ));
132
-        return $grid_field_arr;
133
-    }
117
+	function build_list_for_email() {
118
+		// array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
119
+		$grid_field_arr = json_encode(array(
120
+			array("Date", "100", "date", "", "", "","","true","center"),
121
+			array("Account", "99", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new","","true","center"),
122
+			array("From", "145", "from", "", "", "","","true","center"),
123
+			array("To", "140", "to", "", "", "","","true","center"),
124
+			array("Subject", "180", "subject", "", "", "","","true","center"),
125
+			array("Body", "320", "body", "", "", "","","true","center"),
126
+			array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"),
127
+			array("Status", "70", "status", "status", "status", "email_status","","true","center"),
128
+			array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit/", "mode" => "popup"),
129
+			"VIEW" => array("url" => "email/email_view/", "mode" => "popup","layout"=>"medium"),
130
+					"DELETE" => array("url" => "/email/email_delete/", "mode" => "single")))
131
+				));
132
+		return $grid_field_arr;
133
+	}
134 134
 
135
-    function build_list_for_email_customer($accountid,$accounttype) {
136
-        // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
137
-               $grid_field_arr = json_encode(array(
138
-                    array("Date", "140", "date", "", "", "","","true","center"),
139
-                    array("Subject", "230", "subject", "", "", "","","true","center"),
140
-                    array("Body", "350", "body", "", "", "","","true","center"),
141
-                    array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"),
142
-                    array("Status", "100", "status", "status", "status", "email_status","","true","center"),
143
-                    array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit_customer/", "mode" => "popup"),
144
-                            "VIEW" => array("url" => "email/email_view_customer/", "mode" => "popup","layout"=>"medium"),
145
-                            "DELETE" => array("url" => "email/email_delete_customer/".$accounttype."/".$accountid."/", "mode" => "single")))
146
-                    ));
147
-        return $grid_field_arr;
148
-    }
135
+	function build_list_for_email_customer($accountid,$accounttype) {
136
+		// array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
137
+			   $grid_field_arr = json_encode(array(
138
+					array("Date", "140", "date", "", "", "","","true","center"),
139
+					array("Subject", "230", "subject", "", "", "","","true","center"),
140
+					array("Body", "350", "body", "", "", "","","true","center"),
141
+					array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"),
142
+					array("Status", "100", "status", "status", "status", "email_status","","true","center"),
143
+					array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit_customer/", "mode" => "popup"),
144
+							"VIEW" => array("url" => "email/email_view_customer/", "mode" => "popup","layout"=>"medium"),
145
+							"DELETE" => array("url" => "email/email_delete_customer/".$accounttype."/".$accountid."/", "mode" => "single")))
146
+					));
147
+		return $grid_field_arr;
148
+	}
149 149
 
150
-    function build_list_for_email_client_area(){
151
-        $logintype = $this->CI->session->userdata('logintype');
150
+	function build_list_for_email_client_area(){
151
+		$logintype = $this->CI->session->userdata('logintype');
152 152
 	if ($logintype == 1 || $logintype == 5) {
153
-            $account_data = $this->CI->session->userdata("accountinfo");
154
-            $loginid = $account_data['id'];
153
+			$account_data = $this->CI->session->userdata("accountinfo");
154
+			$loginid = $account_data['id'];
155 155
 
156
-        }else{
157
-            $loginid = "0";
158
-        }
159
-         $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
160
-        $form['Filter'] = array(
161
-          array('Rate Group', 'pricelist_id', 'SELECT', '',array("name"=>"pricelist_id","rules"=>"required"), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id" => $loginid)),
162
-          array('Account Type',array('name' => 'posttoexternal','class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'),
163
-          array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
156
+		}else{
157
+			$loginid = "0";
158
+		}
159
+		 $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
160
+		$form['Filter'] = array(
161
+		  array('Rate Group', 'pricelist_id', 'SELECT', '',array("name"=>"pricelist_id","rules"=>"required"), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id" => $loginid)),
162
+		  array('Account Type',array('name' => 'posttoexternal','class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'),
163
+		  array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
164 164
 	  array('Entity Type', 'type', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_entity_type_email_mass'),
165 165
 	);
166 166
 	$form['Email Template'] = array(
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 
172 172
 	
173 173
        
174
-        return $form;
175
-    } 
176
-    function get_form_fields_email_view_client($add_arr) {
174
+		return $form;
175
+	} 
176
+	function get_form_fields_email_view_client($add_arr) {
177 177
 	if($add_arr['type'] == ''){
178 178
 	   $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id']), 'multi');
179 179
 	}
@@ -181,42 +181,42 @@  discard block
 block discarded – undo
181 181
 	 $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id'],'type'=>$add_arr['type']), 'multi');
182 182
 	}
183 183
 
184
-         $form['forms'] = array(base_url() . 'email/email_send_multipal/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
185
-        $form['Compose Email'] = array(
186
-            array('', 'HIDDEN', array('name' => 'accountid'), '', '', '', ''),
187
-            array('', 'HIDDEN', array('name' => 'temp'), '', '', '', ''),
184
+		 $form['forms'] = array(base_url() . 'email/email_send_multipal/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
185
+		$form['Compose Email'] = array(
186
+			array('', 'HIDDEN', array('name' => 'accountid'), '', '', '', ''),
187
+			array('', 'HIDDEN', array('name' => 'temp'), '', '', '', ''),
188 188
 			array('From', 'INPUT', array('name' => 'from', 'size' => '20','readonly'=>true,'value'=>'',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
189 189
 			$email_add,
190
-            array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required', 'tOOL TIP', ''),
191
-            array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20', 'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''),
190
+			array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required', 'tOOL TIP', ''),
191
+			array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20', 'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''),
192 192
 );
193 193
 	$form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10',  'onclick' => 'return redirect_page(\'/email/email_mass/\')');
194
-        $form['button_save'] = array('name' => 'action', 'content' => 'Send', 'value' => 'save', 'id' => 'submit', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
195
-        return $form;
196
-    }
197
-    function build_grid_buttons_email(){
194
+		$form['button_save'] = array('name' => 'action', 'content' => 'Send', 'value' => 'save', 'id' => 'submit', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
195
+		return $form;
196
+	}
197
+	function build_grid_buttons_email(){
198 198
 	$buttons_json = json_encode(array(
199
-				    ));
199
+					));
200 200
 	return $buttons_json;
201
-    }
202
-    function get_email_history_search_form() {
203
-        $form['forms'] = array("", array('id' => "email_search"));
204
-        $form['Search'] = array(
201
+	}
202
+	function get_email_history_search_form() {
203
+		$form['forms'] = array("", array('id' => "email_search"));
204
+		$form['Search'] = array(
205 205
 			array('From Date', 'INPUT', array('name' => 'date[]', 'id' => 'customer_cdr_from_date', 'size' => '20',
206 206
  'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'),
207
-            array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'),
208
-            array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "deleted" => "0")),
209
-            array('From', 'INPUT', array('name' => 'from[from]', '','id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''),
207
+			array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'),
208
+			array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "deleted" => "0")),
209
+			array('From', 'INPUT', array('name' => 'from[from]', '','id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''),
210 210
 			array('To', 'INPUT', array('name' => 'to[to]', '','id'=>'to', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'to[to-string]', '', '', '', 'search_string_type', ''),			
211 211
 			array('Subject', 'INPUT', array('name' => 'subject[subject]', '','id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''),  
212 212
 			array('Body', 'INPUT', array('name' => 'body[body]', '','id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'body[body-string]', '', '', '', 'search_string_type', ''),  
213 213
 			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),         
214
-            array('', 'HIDDEN', 'advance_search', '1', '', '', '')
215
-        );
216
-        $form['button_search'] = array('name' => 'action', 'id' => "email_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
217
-        $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
218
-        return $form;
219
-    }
214
+			array('', 'HIDDEN', 'advance_search', '1', '', '', '')
215
+		);
216
+		$form['button_search'] = array('name' => 'action', 'id' => "email_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
217
+		$form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
218
+		return $form;
219
+	}
220 220
 
221 221
 }
222 222
 
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
25
+if ( ! defined('BASEPATH'))
26 26
     exit('No direct script access allowed');
27 27
 
28 28
 class Email_form {
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
     }
32 32
 
33 33
   function get_form_fields_email() {
34
-         $form['forms'] = array(base_url() . 'email/email_re_send/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
34
+         $form['forms'] = array(base_url().'email/email_re_send/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
35 35
         $form['Resend Email'] = array(
36 36
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
37
-            array('To', 'INPUT', array('name' => 'to', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
38
-            array('From', 'INPUT', array('name' => 'from', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
39
-            array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
40
-            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
37
+            array('To', 'INPUT', array('name' => 'to', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
38
+            array('From', 'INPUT', array('name' => 'from', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
39
+            array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
40
+            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
41 41
             
42 42
 			array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''),
43 43
 	           
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
     }
50 50
 
51 51
     function get_form_fields_email_edit() {
52
-	 $readable='disabled';
53
-         $form['forms'] = array(base_url() . 'email/email_resend/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
52
+	 $readable = 'disabled';
53
+         $form['forms'] = array(base_url().'email/email_resend/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
54 54
 	 $form['Resent Email'] = array(
55 55
            array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
56 56
            array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
57
-           array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
58
-           array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
59
-		   array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1,  'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
60
-           array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15,  'class' => "margin-t-10 text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
57
+           array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
58
+           array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "margin-t-10 text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
59
+		   array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'class' => "margin-t-10 text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
60
+           array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'class' => "margin-t-10 text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
61 61
 	           
62 62
 	 );
63 63
 	 $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
@@ -66,48 +66,48 @@  discard block
 block discarded – undo
66 66
     }
67 67
     
68 68
     function get_form_fields_email_view() {
69
-	    $readable='disabled';
70
-         $form['forms'] = array(base_url() . 'email/email_history_list/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
69
+	    $readable = 'disabled';
70
+         $form['forms'] = array(base_url().'email/email_history_list/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
71 71
         $form['View Email'] = array(
72 72
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
73 73
             array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
74
-			array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
75
-			array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,'style'=>'margin-top: 3px;' ,'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
76
-			array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
77
-            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"),'trim|required|xss_clean', 'tOOL TIP', ''),
78
-			array('Status', 'INPUT', array('name' => 'status', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'style'=>'width: 18% !important;margin-top: 3px;' , 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),   
74
+			array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''),
75
+			array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''),
76
+			array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''),
77
+            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'readonly' => true, 'style'=>'margin-top: 3px;', 'class' => "text field medium col-md-5"), 'trim|required|xss_clean', 'tOOL TIP', ''),
78
+			array('Status', 'INPUT', array('name' => 'status', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'style'=>'width: 18% !important;margin-top: 3px;', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),   
79 79
 	           
80 80
 );
81 81
         $form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
82 82
         return $form;
83 83
     }
84 84
     function get_form_fields_email_view_cus() {
85
-	 $readable='disabled';
86
-         $form['forms'] = array(base_url() . 'email/email_history_list_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
85
+	 $readable = 'disabled';
86
+         $form['forms'] = array(base_url().'email/email_history_list_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
87 87
          $form['View Email'] = array(
88 88
            array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
89 89
            array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
90
-           array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
91
-           array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
92
-	   array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
93
-           array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
90
+           array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
91
+           array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
92
+	   array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
93
+           array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
94 94
             
95
-	    array('Status', array('name' => 'status', 'disabled' => $readable, 'style' => 'width:20% !important;','class' => "text field medium"), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''),
95
+	    array('Status', array('name' => 'status', 'disabled' => $readable, 'style' => 'width:20% !important;', 'class' => "text field medium"), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'email_search_status', '', ''),
96 96
 	           
97 97
 );
98 98
         $form['button_save'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
99 99
         return $form;
100 100
     }
101 101
     function get_form_fields_email_view_cus_edit() {
102
-	    $readable='disabled';
103
-         $form['forms'] = array(base_url() . 'email/email_resend_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
102
+	    $readable = 'disabled';
103
+         $form['forms'] = array(base_url().'email/email_resend_customer/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
104 104
         $form['Resent Email'] = array(
105 105
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
106 106
             array('', 'HIDDEN', array('name' => 'status'), '', '', '', ''),
107
-			array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true,  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
108
-			array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20','cols'=>50,'rows'=>1, 'readonly' => true, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
109
-			array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20','cols'=>50,'rows'=>1, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
110
-            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20','cols'=>50,'rows'=>15, 'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),           
107
+			array('From', 'TEXTAREA', array('name' => 'from', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
108
+			array('To', 'TEXTAREA', array('name' => 'to', 'size' => '20', 'cols'=>50, 'rows'=>1, 'readonly' => true, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
109
+			array('Subject', 'TEXTAREA', array('name' => 'subject', 'size' => '20', 'cols'=>50, 'rows'=>1, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
110
+            array('Body', 'TEXTAREA', array('name' => 'body', 'size' => '20', 'cols'=>50, 'rows'=>15, 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),           
111 111
 );
112 112
         $form['button_cancel'] = array('name' => 'action', 'content' => 'Close', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'NULL\')');
113 113
          $form['button_save'] = array('name' => 'action', 'content' => 'Sent', 'value' => 'save', 'id' => 'button', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
@@ -117,49 +117,49 @@  discard block
 block discarded – undo
117 117
     function build_list_for_email() {
118 118
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
119 119
         $grid_field_arr = json_encode(array(
120
-            array("Date", "100", "date", "", "", "","","true","center"),
121
-            array("Account", "99", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new","","true","center"),
122
-            array("From", "145", "from", "", "", "","","true","center"),
123
-            array("To", "140", "to", "", "", "","","true","center"),
124
-            array("Subject", "180", "subject", "", "", "","","true","center"),
125
-            array("Body", "320", "body", "", "", "","","true","center"),
126
-            array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"),
127
-            array("Status", "70", "status", "status", "status", "email_status","","true","center"),
120
+            array("Date", "100", "date", "", "", "", "", "true", "center"),
121
+            array("Account", "99", "accountid", "first_name,last_name,number", "accounts", "get_field_name_coma_new", "", "true", "center"),
122
+            array("From", "145", "from", "", "", "", "", "true", "center"),
123
+            array("To", "140", "to", "", "", "", "", "true", "center"),
124
+            array("Subject", "180", "subject", "", "", "", "", "true", "center"),
125
+            array("Body", "320", "body", "", "", "", "", "true", "center"),
126
+            array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons", "", "true", "center"),
127
+            array("Status", "70", "status", "status", "status", "email_status", "", "true", "center"),
128 128
             array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit/", "mode" => "popup"),
129
-		    "VIEW" => array("url" => "email/email_view/", "mode" => "popup","layout"=>"medium"),
129
+		    "VIEW" => array("url" => "email/email_view/", "mode" => "popup", "layout"=>"medium"),
130 130
                     "DELETE" => array("url" => "/email/email_delete/", "mode" => "single")))
131 131
                 ));
132 132
         return $grid_field_arr;
133 133
     }
134 134
 
135
-    function build_list_for_email_customer($accountid,$accounttype) {
135
+    function build_list_for_email_customer($accountid, $accounttype) {
136 136
         // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
137 137
                $grid_field_arr = json_encode(array(
138
-                    array("Date", "140", "date", "", "", "","","true","center"),
139
-                    array("Subject", "230", "subject", "", "", "","","true","center"),
140
-                    array("Body", "350", "body", "", "", "","","true","center"),
141
-                    array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons","","true","center"),
142
-                    array("Status", "100", "status", "status", "status", "email_status","","true","center"),
138
+                    array("Date", "140", "date", "", "", "", "", "true", "center"),
139
+                    array("Subject", "230", "subject", "", "", "", "", "true", "center"),
140
+                    array("Body", "350", "body", "", "", "", "", "true", "center"),
141
+                    array("Attachement", "120", "attachment", "attachment", "attachment", "attachment_icons", "", "true", "center"),
142
+                    array("Status", "100", "status", "status", "status", "email_status", "", "true", "center"),
143 143
                     array("Action", "100", "", "", "", array("RESEND" => array("url" => "email/email_resend_edit_customer/", "mode" => "popup"),
144
-                            "VIEW" => array("url" => "email/email_view_customer/", "mode" => "popup","layout"=>"medium"),
144
+                            "VIEW" => array("url" => "email/email_view_customer/", "mode" => "popup", "layout"=>"medium"),
145 145
                             "DELETE" => array("url" => "email/email_delete_customer/".$accounttype."/".$accountid."/", "mode" => "single")))
146 146
                     ));
147 147
         return $grid_field_arr;
148 148
     }
149 149
 
150
-    function build_list_for_email_client_area(){
150
+    function build_list_for_email_client_area() {
151 151
         $logintype = $this->CI->session->userdata('logintype');
152 152
 	if ($logintype == 1 || $logintype == 5) {
153 153
             $account_data = $this->CI->session->userdata("accountinfo");
154 154
             $loginid = $account_data['id'];
155 155
 
156
-        }else{
156
+        } else {
157 157
             $loginid = "0";
158 158
         }
159
-         $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
159
+         $form['forms'] = array(base_url().'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
160 160
         $form['Filter'] = array(
161
-          array('Rate Group', 'pricelist_id', 'SELECT', '',array("name"=>"pricelist_id","rules"=>"required"), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0","reseller_id" => $loginid)),
162
-          array('Account Type',array('name' => 'posttoexternal','class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'),
161
+          array('Rate Group', 'pricelist_id', 'SELECT', '', array("name"=>"pricelist_id", "rules"=>"required"), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => $loginid)),
162
+          array('Account Type', array('name' => 'posttoexternal', 'class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'),
163 163
           array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'),
164 164
 	  array('Entity Type', 'type', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_entity_type_email_mass'),
165 165
 	);
@@ -174,27 +174,27 @@  discard block
 block discarded – undo
174 174
         return $form;
175 175
     } 
176 176
     function get_form_fields_email_view_client($add_arr) {
177
-	if($add_arr['type'] == ''){
178
-	   $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id']), 'multi');
177
+	if ($add_arr['type'] == '') {
178
+	   $email_add = array('To', 'email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr', array('status'=>$add_arr['status'], 'posttoexternal'=>$add_arr['posttoexternal'], 'pricelist_id'=>$add_arr['pricelist_id']), 'multi');
179 179
 	}
180
-	else{
181
-	 $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id'],'type'=>$add_arr['type']), 'multi');
180
+	else {
181
+	 $email_add = array('To', 'email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr', array('status'=>$add_arr['status'], 'posttoexternal'=>$add_arr['posttoexternal'], 'pricelist_id'=>$add_arr['pricelist_id'], 'type'=>$add_arr['type']), 'multi');
182 182
 	}
183 183
 
184
-         $form['forms'] = array(base_url() . 'email/email_send_multipal/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
184
+         $form['forms'] = array(base_url().'email/email_send_multipal/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
185 185
         $form['Compose Email'] = array(
186 186
             array('', 'HIDDEN', array('name' => 'accountid'), '', '', '', ''),
187 187
             array('', 'HIDDEN', array('name' => 'temp'), '', '', '', ''),
188
-			array('From', 'INPUT', array('name' => 'from', 'size' => '20','readonly'=>true,'value'=>'',  'class' => "text field medium"),'trim|required|xss_clean', 'tOOL TIP', ''),
188
+			array('From', 'INPUT', array('name' => 'from', 'size' => '20', 'readonly'=>true, 'value'=>'', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''),
189 189
 			$email_add,
190 190
             array('Subject', 'INPUT', array('name' => 'subject', 'size' => '20', 'class' => "text field medium"), 'trim|required', 'tOOL TIP', ''),
191 191
             array('Body', 'TEXTAREA', array('name' => 'template', 'id' => 'template', 'size' => '20', 'class' => "textarea medium"), 'trim|required', 'tOOL TIP', ''),
192 192
 );
193
-	$form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10',  'onclick' => 'return redirect_page(\'/email/email_mass/\')');
193
+	$form['button_cancel'] = array('name' => 'action', 'content' => 'Cancel', 'value' => 'cancel', 'type' => 'button', 'class' => 'btn btn-line-sky margin-x-10', 'onclick' => 'return redirect_page(\'/email/email_mass/\')');
194 194
         $form['button_save'] = array('name' => 'action', 'content' => 'Send', 'value' => 'save', 'id' => 'submit', 'type' => 'submit', 'class' => 'btn btn-line-parrot');
195 195
         return $form;
196 196
     }
197
-    function build_grid_buttons_email(){
197
+    function build_grid_buttons_email() {
198 198
 	$buttons_json = json_encode(array(
199 199
 				    ));
200 200
 	return $buttons_json;
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
  'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'),
207 207
             array('To Date', 'INPUT', array('name' => 'date[]', 'id' => 'customer_cdr_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'date[date-date]'),
208 208
             array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "deleted" => "0")),
209
-            array('From', 'INPUT', array('name' => 'from[from]', '','id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''),
210
-			array('To', 'INPUT', array('name' => 'to[to]', '','id'=>'to', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'to[to-string]', '', '', '', 'search_string_type', ''),			
211
-			array('Subject', 'INPUT', array('name' => 'subject[subject]', '','id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''),  
212
-			array('Body', 'INPUT', array('name' => 'body[body]', '','id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'body[body-string]', '', '', '', 'search_string_type', ''),  
209
+            array('From', 'INPUT', array('name' => 'from[from]', '', 'id'=>'from', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'from[from-string]', '', '', '', 'search_string_type', ''),
210
+			array('To', 'INPUT', array('name' => 'to[to]', '', 'id'=>'to', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'to[to-string]', '', '', '', 'search_string_type', ''),			
211
+			array('Subject', 'INPUT', array('name' => 'subject[subject]', '', 'id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'subject[subject-string]', '', '', '', 'search_string_type', ''),  
212
+			array('Body', 'INPUT', array('name' => 'body[body]', '', 'id'=>'body', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'body[body-string]', '', '', '', 'search_string_type', ''),  
213 213
 			array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),         
214 214
             array('', 'HIDDEN', 'advance_search', '1', '', '', '')
215 215
         );
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
26
-    exit('No direct script access allowed');
25
+if (!defined('BASEPATH')) {
26
+    exit('No direct script access allowed');
27
+}
27 28
 
28 29
 class Email_form {
29 30
     function __construct($library_name = '') {
@@ -153,7 +154,7 @@  discard block
 block discarded – undo
153 154
             $account_data = $this->CI->session->userdata("accountinfo");
154 155
             $loginid = $account_data['id'];
155 156
 
156
-        }else{
157
+        } else{
157 158
             $loginid = "0";
158 159
         }
159 160
          $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
@@ -176,8 +177,7 @@  discard block
 block discarded – undo
176 177
     function get_form_fields_email_view_client($add_arr) {
177 178
 	if($add_arr['type'] == ''){
178 179
 	   $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id']), 'multi');
179
-	}
180
-	else{
180
+	} else{
181 181
 	 $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id'],'type'=>$add_arr['type']), 'multi');
182 182
 	}
183 183
 
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/views/view_email_brod.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -237,8 +237,8 @@
 block discarded – undo
237 237
  <form method="post" action="<?= base_url()?>email/email_client_get/" enctype="multipart/form-data" name="myform" id="myform" onsubmit="return(regvalidate())">
238 238
      <span  style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;">
239 239
                     <? if(isset($error) && !empty($error)) {
240
-                        echo $error;
241
-                    }?>
240
+						echo $error;
241
+					}?>
242 242
                  </span>
243 243
  
244 244
    <div class="col-md-12 no-padding margin-t-15 margin-b-10">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 <!--***************************************************************-->
47 47
 
48 48
 
49
-	<script type="text/javascript" src="<?php echo base_url();?>assets/markup/markitup/sets/default/set.js"></script>
49
+	<script type="text/javascript" src="<?php echo base_url(); ?>assets/markup/markitup/sets/default/set.js"></script>
50 50
 <script type="text/javascript">
51 51
 $(function() {
52 52
 	$('#template').markItUp(mySettings);
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
  <div class="container">
237 237
  <form method="post" action="<?= base_url()?>email/email_client_get/" enctype="multipart/form-data" name="myform" id="myform" onsubmit="return(regvalidate())">
238 238
      <span  style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;">
239
-                    <? if(isset($error) && !empty($error)) {
239
+                    <? if (isset($error) && ! empty($error)) {
240 240
                         echo $error;
241 241
                     }?>
242 242
                  </span>
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/views/view_email_add_edit.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@
 block discarded – undo
27 27
             <?php echo $form; ?>
28 28
         </div>    
29 29
         <?php if(isset($maildata) && $maildata != ''){
30
-          echo "<div class='col-md-12 no-padding'>Attachments :</div>";
31
-          $imgArr = explode(",",$maildata);
32
-          foreach($imgArr as $key => $imgname){
33
-            $imgpath = base_url()."email/email_history_list_attachment/".$imgname;
34
-            echo "<div class='col-md-4 no-padding'>
30
+		  echo "<div class='col-md-12 no-padding'>Attachments :</div>";
31
+		  $imgArr = explode(",",$maildata);
32
+		  foreach($imgArr as $key => $imgname){
33
+			$imgpath = base_url()."email/email_history_list_attachment/".$imgname;
34
+			echo "<div class='col-md-4 no-padding'>
35 35
                   <a href='".$imgpath."'>".$imgname."</a>
36 36
                 </div>";
37
-          }
38
-        } ?>          
37
+		  }
38
+		} ?>          
39 39
     </section>
40 40
   </div>
41 41
 </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@
 block discarded – undo
26 26
             </div>
27 27
             <?php echo $form; ?>
28 28
         </div>    
29
-        <?php if(isset($maildata) && $maildata != ''){
29
+        <?php if (isset($maildata) && $maildata != '') {
30 30
           echo "<div class='col-md-12 no-padding'>Attachments :</div>";
31
-          $imgArr = explode(",",$maildata);
32
-          foreach($imgArr as $key => $imgname){
31
+          $imgArr = explode(",", $maildata);
32
+          foreach ($imgArr as $key => $imgname) {
33 33
             $imgpath = base_url()."email/email_history_list_attachment/".$imgname;
34 34
             echo "<div class='col-md-4 no-padding'>
35 35
                   <a href='".$imgpath."'>".$imgname."</a>
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,10 @@
 block discarded – undo
20 20
     <section class="slice color-three no-margin">
21 21
 	<div class="w-section inverse no-padding">
22 22
             <div style="color:red;margin-left: 60px;">
23
-                <?php if (isset($validation_errors)) echo $validation_errors; ?> 
23
+                <?php if (isset($validation_errors)) {
24
+	echo $validation_errors;
25
+}
26
+?> 
24 27
             </div>
25 28
             <?php echo $form; ?>
26 29
         </div>      
Please login to merge, or discard this patch.
astpp/application/modules/email/views/view_email_client_area.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
    $(".country_id").val(<?=$country_id?>);
7 7
    $(".timezone_id").val(<?=$timezone_id?>);
8 8
    $(".currency_id").val(<?=$currency_id?>);
9
-   <?php if($entity_name != 'admin' && $entity_name !='subadmin'){ ?>
9
+   <?php if ($entity_name != 'admin' && $entity_name != 'subadmin') { ?>
10 10
    document.getElementsByName("sweep_id")[0].selectedIndex = <?=1?>;
11 11
 
12 12
 	 $(".sweep_id").change(function(e){
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			<div class="w-section inverse no-padding">
43 43
 				     <?php echo $form; ?>
44 44
 				     <?php
45
-					if(isset($validation_errors) && $validation_errors != ''){ ?>
45
+					if (isset($validation_errors) && $validation_errors != '') { ?>
46 46
 					    <script>
47 47
 						var ERR_STR = '<?php echo $validation_errors; ?>';
48 48
 						print_error(ERR_STR);
Please login to merge, or discard this patch.
astpp/application/modules/email/views/view_template_add_edit.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <? extend('master.php') ?>
2
-<?php error_reporting(E_ERROR);?>
2
+<?php error_reporting(E_ERROR); ?>
3 3
 <? startblock('extra_head') ?>
4 4
 
5 5
 <!--
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,10 @@
 block discarded – undo
20 20
     <section class="slice color-three no-margin">
21 21
 	<div class="w-section inverse no-padding">
22 22
             <div style="color:red;margin-left: 60px;">
23
-                <?php if (isset($validation_errors)) echo $validation_errors; ?> 
23
+                <?php if (isset($validation_errors)) {
24
+	echo $validation_errors;
25
+}
26
+?> 
24 27
             </div>
25 28
             <?php echo $form; ?>
26 29
         </div>      
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/models/email_model.php 3 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
 
25 25
 class Email_model extends CI_Model {
26 26
 
27
-    function Email_model() {
28
-        parent::__construct();
29
-    }
27
+	function Email_model() {
28
+		parent::__construct();
29
+	}
30 30
 
31 31
 /**
32 32
 For Email History show in Reseller login    
33 33
 **/
34
-    function get_email_list($flag, $start = 0, $limit = 0) {
34
+	function get_email_list($flag, $start = 0, $limit = 0) {
35 35
 	$account_data = $this->session->userdata("accountinfo");
36 36
 
37 37
 	$account_id = $account_data['id'];
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 	if($account_type == 1){
45 45
 	  $this->db->where_in('reseller_id');
46
-          $this->db->select('id');
47
-          $email_address=$this->db->get('accounts');
46
+		  $this->db->select('id');
47
+		  $email_address=$this->db->get('accounts');
48 48
 
49
-          $email_address=$email_address->result_array();
49
+		  $email_address=$email_address->result_array();
50 50
 
51 51
 	  if(empty($email_address)){
52 52
 		$this->db->or_where('accountid',0);
@@ -54,43 +54,43 @@  discard block
 block discarded – undo
54 54
 		$this->db->where('reseller_id',$account_id);
55 55
 	  }
56 56
 	  }
57
-          $this->db_model->build_search('email_search_list');
58
-          if ($flag) {
59
-	       $query = $this->db_model->select("*", "mail_details", '', "id", "DESC", $limit, $start);
60
-          } else {
61
-            $query = $this->db_model->countQuery("*", "mail_details",'');
62
-          }
63
-        return $query;
64
-    }
65
-    function add_email($add_array) {
66
-        $this->db->insert("mail_details", $add_array);
67
-        return true;
68
-    }
57
+		  $this->db_model->build_search('email_search_list');
58
+		  if ($flag) {
59
+		   $query = $this->db_model->select("*", "mail_details", '', "id", "DESC", $limit, $start);
60
+		  } else {
61
+			$query = $this->db_model->countQuery("*", "mail_details",'');
62
+		  }
63
+		return $query;
64
+	}
65
+	function add_email($add_array) {
66
+		$this->db->insert("mail_details", $add_array);
67
+		return true;
68
+	}
69 69
 
70
-    function remove_email($id) {
71
-        $this->db->where("id", $id);
72
-        $this->db->delete("mail_details");
73
-        return true;
74
-    }
70
+	function remove_email($id) {
71
+		$this->db->where("id", $id);
72
+		$this->db->delete("mail_details");
73
+		return true;
74
+	}
75 75
 
76 76
 
77
-    function edit_email($data, $id) {
78
-        $this->db->where("id", $id);
79
-        $this->db->update("mail_details", $data);
80
-    }
77
+	function edit_email($data, $id) {
78
+		$this->db->where("id", $id);
79
+		$this->db->update("mail_details", $data);
80
+	}
81 81
    function customer_get_email_list($flag,$accountid, $start = 0, $limit = 0) {
82 82
 
83 83
 	  $this->db->where('accountid',$accountid);
84
-       	    if ($flag) {
85
-            $query = $this->db_model->select("*", "mail_details", '', "id", "desc", $limit, $start);
86
-        } else {
87
-            $query = $this->db_model->countQuery("*", "mail_details", '');
88
-        }
84
+	   		if ($flag) {
85
+			$query = $this->db_model->select("*", "mail_details", '', "id", "desc", $limit, $start);
86
+		} else {
87
+			$query = $this->db_model->countQuery("*", "mail_details", '');
88
+		}
89 89
 
90 90
 
91
-        return $query;
92
-    }
93
-    function get_email_client_data($data, $start = 0, $limit = 0){
91
+		return $query;
92
+	}
93
+	function get_email_client_data($data, $start = 0, $limit = 0){
94 94
 	if($data['type'] == ''){
95 95
 		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'deleted'=>'0');
96 96
 	}
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'type'=>$data['type'],'deleted'=>'0');
99 99
 	}
100 100
 	
101
-        $query = $this->db_model->getSelect("email,id", "accounts", $where);
102
-        $query = $query->result_array();
101
+		$query = $this->db_model->getSelect("email,id", "accounts", $where);
102
+		$query = $query->result_array();
103 103
 	return $query;	
104
-    }
105
-    /*Mass mail*/
106
-    function multipal_email($data){
107
-       $mail_ids=explode(',',$data['to']);
104
+	}
105
+	/*Mass mail*/
106
+	function multipal_email($data){
107
+	   $mail_ids=explode(',',$data['to']);
108 108
 	foreach($mail_ids as $key=>$val)
109 109
 	{
110 110
 		if($val!='')
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 				$account_info=$res_data[0];
125 125
 				$account_info['accountid']=$account_info['id'];
126 126
 			}
127
-		    $account_info['password'] = $this->common->decode($account_info['password']);	
128
-		    $this->email_lib->send_email($template_type,$account_info,'',$data['file'],0,1);
127
+			$account_info['password'] = $this->common->decode($account_info['password']);	
128
+			$this->email_lib->send_email($template_type,$account_info,'',$data['file'],0,1);
129 129
 		}
130 130
 	}
131
-        return true;
131
+		return true;
132 132
    }
133 133
 	/*************************************************************/
134 134
 }
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -38,27 +38,27 @@  discard block
 block discarded – undo
38 38
 	$account_email = $account_data['email'];
39 39
 	$account_type = $account_data['type'];
40 40
 	
41
-	if($account_type == 0){
42
-		$this->db->where('accountid',$account_id);	
41
+	if ($account_type == 0) {
42
+		$this->db->where('accountid', $account_id);	
43 43
 	}
44
-	if($account_type == 1){
44
+	if ($account_type == 1) {
45 45
 	  $this->db->where_in('reseller_id');
46 46
           $this->db->select('id');
47
-          $email_address=$this->db->get('accounts');
47
+          $email_address = $this->db->get('accounts');
48 48
 
49
-          $email_address=$email_address->result_array();
49
+          $email_address = $email_address->result_array();
50 50
 
51
-	  if(empty($email_address)){
52
-		$this->db->or_where('accountid',0);
53
-	  }else{
54
-		$this->db->where('reseller_id',$account_id);
51
+	  if (empty($email_address)) {
52
+		$this->db->or_where('accountid', 0);
53
+	  } else {
54
+		$this->db->where('reseller_id', $account_id);
55 55
 	  }
56 56
 	  }
57 57
           $this->db_model->build_search('email_search_list');
58 58
           if ($flag) {
59 59
 	       $query = $this->db_model->select("*", "mail_details", '', "id", "DESC", $limit, $start);
60 60
           } else {
61
-            $query = $this->db_model->countQuery("*", "mail_details",'');
61
+            $query = $this->db_model->countQuery("*", "mail_details", '');
62 62
           }
63 63
         return $query;
64 64
     }
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         $this->db->where("id", $id);
79 79
         $this->db->update("mail_details", $data);
80 80
     }
81
-   function customer_get_email_list($flag,$accountid, $start = 0, $limit = 0) {
81
+   function customer_get_email_list($flag, $accountid, $start = 0, $limit = 0) {
82 82
 
83
-	  $this->db->where('accountid',$accountid);
83
+	  $this->db->where('accountid', $accountid);
84 84
        	    if ($flag) {
85 85
             $query = $this->db_model->select("*", "mail_details", '', "id", "desc", $limit, $start);
86 86
         } else {
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 
91 91
         return $query;
92 92
     }
93
-    function get_email_client_data($data, $start = 0, $limit = 0){
94
-	if($data['type'] == ''){
95
-		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'deleted'=>'0');
93
+    function get_email_client_data($data, $start = 0, $limit = 0) {
94
+	if ($data['type'] == '') {
95
+		$where = array('pricelist_id'=>$data['pricelist_id'], 'posttoexternal'=>$data['posttoexternal'], 'status'=>$data['status'], 'deleted'=>'0');
96 96
 	}
97
-	else{
98
-		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'type'=>$data['type'],'deleted'=>'0');
97
+	else {
98
+		$where = array('pricelist_id'=>$data['pricelist_id'], 'posttoexternal'=>$data['posttoexternal'], 'status'=>$data['status'], 'type'=>$data['type'], 'deleted'=>'0');
99 99
 	}
100 100
 	
101 101
         $query = $this->db_model->getSelect("email,id", "accounts", $where);
@@ -103,29 +103,29 @@  discard block
 block discarded – undo
103 103
 	return $query;	
104 104
     }
105 105
     /*Mass mail*/
106
-    function multipal_email($data){
107
-       $mail_ids=explode(',',$data['to']);
108
-	foreach($mail_ids as $key=>$val)
106
+    function multipal_email($data) {
107
+       $mail_ids = explode(',', $data['to']);
108
+	foreach ($mail_ids as $key=>$val)
109 109
 	{
110
-		if($val!='')
110
+		if ($val != '')
111 111
 		{
112
-			$template_type['message']=$data['template'];
113
-			$template_type['subject']=$data['subject'];
114
-			$act_details = $this->db_model->getSelect("*", "accounts", array('email'=>$val,"deleted"=>0));
115
-			$count=$act_details->num_rows();
116
-			$account_info=array();
117
-			if($count<=0)
112
+			$template_type['message'] = $data['template'];
113
+			$template_type['subject'] = $data['subject'];
114
+			$act_details = $this->db_model->getSelect("*", "accounts", array('email'=>$val, "deleted"=>0));
115
+			$count = $act_details->num_rows();
116
+			$account_info = array();
117
+			if ($count <= 0)
118 118
 			{
119
-				$account_info['email']=$val;
120
-				$account_info['accountid']='0';
119
+				$account_info['email'] = $val;
120
+				$account_info['accountid'] = '0';
121 121
 			}
122
-			else{
122
+			else {
123 123
 				$res_data = $act_details->result_array();
124
-				$account_info=$res_data[0];
125
-				$account_info['accountid']=$account_info['id'];
124
+				$account_info = $res_data[0];
125
+				$account_info['accountid'] = $account_info['id'];
126 126
 			}
127 127
 		    $account_info['password'] = $this->common->decode($account_info['password']);	
128
-		    $this->email_lib->send_email($template_type,$account_info,'',$data['file'],0,1);
128
+		    $this->email_lib->send_email($template_type, $account_info, '', $data['file'], 0, 1);
129 129
 		}
130 130
 	}
131 131
         return true;
Please login to merge, or discard this patch.
Braces   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 	  if(empty($email_address)){
52 52
 		$this->db->or_where('accountid',0);
53
-	  }else{
53
+	  } else{
54 54
 		$this->db->where('reseller_id',$account_id);
55 55
 	  }
56 56
 	  }
@@ -93,8 +93,7 @@  discard block
 block discarded – undo
93 93
     function get_email_client_data($data, $start = 0, $limit = 0){
94 94
 	if($data['type'] == ''){
95 95
 		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'deleted'=>'0');
96
-	}
97
-	else{
96
+	} else{
98 97
 		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'type'=>$data['type'],'deleted'=>'0');
99 98
 	}
100 99
 	
@@ -118,8 +117,7 @@  discard block
 block discarded – undo
118 117
 			{
119 118
 				$account_info['email']=$val;
120 119
 				$account_info['accountid']='0';
121
-			}
122
-			else{
120
+			} else{
123 121
 				$res_data = $act_details->result_array();
124 122
 				$account_info=$res_data[0];
125 123
 				$account_info['accountid']=$account_info['id'];
Please login to merge, or discard this patch.