@@ -180,25 +180,25 @@ |
||
180 | 180 | <?php $count=ceil(sizeof($details)/2); $i=0; $class="tleft";?> |
181 | 181 | <?php foreach($details as$key=>$val){ ?> |
182 | 182 | <?php if($count==$i){ |
183 | - echo '</div><div style="width:50%;float:left;">'; |
|
184 | - $class="tright"; |
|
185 | - } ?> |
|
183 | + echo '</div><div style="width:50%;float:left;">'; |
|
184 | + $class="tright"; |
|
185 | + } ?> |
|
186 | 186 | <div class="col-md-12"> |
187 | 187 | <div class="<?=$class?>" href='#'> |
188 | 188 | <label class="col-md-5 no-padding"><?php echo $val['display_name'];?> * </label> |
189 | 189 | <?php if(method_exists($this->common,$val['field_type'])){ |
190 | - $option_array = $this->common->$val['field_type'](); |
|
191 | - $drpstr = '<select name="'.$val['name'].'" class="col-md-5 form-control selectpicker" data-live-search="true">'; |
|
192 | - foreach($option_array as $option_key=>$option_val){ |
|
193 | - $selected = ($val['value'] == $option_key)? "selected='selected'":""; |
|
194 | - $drpstr .= '<option value="'.$option_key.'"'.$selected.'>'.$option_val.'</option>'; |
|
195 | - } |
|
196 | - $drpstr .= '</select>'; |
|
197 | - echo $drpstr; |
|
198 | - unset($drpstr); |
|
199 | - } else{ |
|
200 | - echo '<input name="'.$val["name"].'" value="'.$val['value'].'" size="20" maxlength="100" class="col-md-5 form-control" type="text">'; |
|
201 | - }?> |
|
190 | + $option_array = $this->common->$val['field_type'](); |
|
191 | + $drpstr = '<select name="'.$val['name'].'" class="col-md-5 form-control selectpicker" data-live-search="true">'; |
|
192 | + foreach($option_array as $option_key=>$option_val){ |
|
193 | + $selected = ($val['value'] == $option_key)? "selected='selected'":""; |
|
194 | + $drpstr .= '<option value="'.$option_key.'"'.$selected.'>'.$option_val.'</option>'; |
|
195 | + } |
|
196 | + $drpstr .= '</select>'; |
|
197 | + echo $drpstr; |
|
198 | + unset($drpstr); |
|
199 | + } else{ |
|
200 | + echo '<input name="'.$val["name"].'" value="'.$val['value'].'" size="20" maxlength="100" class="col-md-5 form-control" type="text">'; |
|
201 | + }?> |
|
202 | 202 | <span class="demo"><?php echo str_replace('smtp',"SMTP",$val['comment']);?></span> |
203 | 203 | |
204 | 204 | </div> |
@@ -22,33 +22,33 @@ discard block |
||
22 | 22 | ############################################################################### |
23 | 23 | class System_model extends CI_Model { |
24 | 24 | |
25 | - function System_model() { |
|
26 | - parent::__construct(); |
|
27 | - } |
|
25 | + function System_model() { |
|
26 | + parent::__construct(); |
|
27 | + } |
|
28 | 28 | |
29 | - function getsystem_list($flag, $start, $limit) { |
|
29 | + function getsystem_list($flag, $start, $limit) { |
|
30 | 30 | |
31 | - $this->db_model->build_search('configuration_search'); |
|
32 | - $where = "group_title NOT IN ('asterisk','osc','freepbx')"; |
|
33 | - $this->db->where($where); |
|
34 | - if ($flag) { |
|
35 | - $query = $this->db_model->select("*", "system", "", "group_title,name", "ASC", $limit, $start); |
|
36 | - } else { |
|
37 | - $query = $this->db_model->countQuery("*", "system", ""); |
|
38 | - } |
|
39 | - return $query; |
|
40 | - } |
|
31 | + $this->db_model->build_search('configuration_search'); |
|
32 | + $where = "group_title NOT IN ('asterisk','osc','freepbx')"; |
|
33 | + $this->db->where($where); |
|
34 | + if ($flag) { |
|
35 | + $query = $this->db_model->select("*", "system", "", "group_title,name", "ASC", $limit, $start); |
|
36 | + } else { |
|
37 | + $query = $this->db_model->countQuery("*", "system", ""); |
|
38 | + } |
|
39 | + return $query; |
|
40 | + } |
|
41 | 41 | |
42 | - function gettemplate_list($flag="", $start, $limit="") { |
|
42 | + function gettemplate_list($flag="", $start, $limit="") { |
|
43 | 43 | |
44 | 44 | |
45 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
46 | - $account_data = $this->session->userdata("accountinfo"); |
|
47 | - $reseller = $account_data['id']; |
|
48 | - $this->db->where('reseller_id',$reseller); |
|
49 | - $query = $this->db_model->select("*", "default_templates","","","","",""); |
|
45 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
46 | + $account_data = $this->session->userdata("accountinfo"); |
|
47 | + $reseller = $account_data['id']; |
|
48 | + $this->db->where('reseller_id',$reseller); |
|
49 | + $query = $this->db_model->select("*", "default_templates","","","","",""); |
|
50 | 50 | |
51 | - if($query->num_rows() >0){ |
|
51 | + if($query->num_rows() >0){ |
|
52 | 52 | $result =$query->result_array(); |
53 | 53 | $match_array =array(); |
54 | 54 | $unmatch_array= array(); |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | $str=0; |
57 | 57 | foreach($result as $value) |
58 | 58 | { |
59 | - $this->db->where('name',$value['name']); |
|
60 | - $this->db->where('reseller_id',0); |
|
61 | - $query = $this->db_model->select("id", "default_templates","", "id", "ASC", $limit, $start); |
|
62 | - $innerresult =$query->result_array(); |
|
63 | - foreach($innerresult as $value) |
|
64 | - { |
|
65 | - $str.=$value['id'].","; |
|
66 | - } |
|
59 | + $this->db->where('name',$value['name']); |
|
60 | + $this->db->where('reseller_id',0); |
|
61 | + $query = $this->db_model->select("id", "default_templates","", "id", "ASC", $limit, $start); |
|
62 | + $innerresult =$query->result_array(); |
|
63 | + foreach($innerresult as $value) |
|
64 | + { |
|
65 | + $str.=$value['id'].","; |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | $str= rtrim($str,','); |
69 | 69 | |
@@ -71,164 +71,164 @@ discard block |
||
71 | 71 | $this->db->where('reseller_id',$reseller); |
72 | 72 | $this->db->or_where('reseller_id',0); |
73 | 73 | $this->db->where($where); |
74 | - } |
|
75 | - else |
|
76 | - { |
|
77 | - $this->db->where('reseller_id',0); |
|
78 | - } |
|
74 | + } |
|
75 | + else |
|
76 | + { |
|
77 | + $this->db->where('reseller_id',0); |
|
78 | + } |
|
79 | 79 | |
80 | - if($flag) { |
|
80 | + if($flag) { |
|
81 | 81 | |
82 | 82 | $query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start); |
83 | - }else { |
|
83 | + }else { |
|
84 | 84 | |
85 | 85 | $query = $this->db_model->countQuery("*", "default_templates",""); |
86 | 86 | |
87 | - } |
|
87 | + } |
|
88 | 88 | } |
89 | 89 | else { |
90 | 90 | |
91 | - $where = array('reseller_id' => 0); |
|
92 | - $this->db->where($where); |
|
93 | - $this->db_model->build_search('template_search'); |
|
91 | + $where = array('reseller_id' => 0); |
|
92 | + $this->db->where($where); |
|
93 | + $this->db_model->build_search('template_search'); |
|
94 | 94 | if ($flag) { |
95 | - $query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start); |
|
95 | + $query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start); |
|
96 | 96 | } else { |
97 | - $query = $this->db_model->countQuery("*", "default_templates",""); |
|
97 | + $query = $this->db_model->countQuery("*", "default_templates",""); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | 101 | return $query; |
102 | - } |
|
102 | + } |
|
103 | 103 | |
104 | - function edit_configuration($add_array, $name) { |
|
105 | - unset($add_array["action"]); |
|
104 | + function edit_configuration($add_array, $name) { |
|
105 | + unset($add_array["action"]); |
|
106 | 106 | |
107 | - $this->db->where("name", $name); |
|
108 | - $this->db->update("system", $add_array); |
|
109 | - if($name == 'base_currency'){ |
|
107 | + $this->db->where("name", $name); |
|
108 | + $this->db->update("system", $add_array); |
|
109 | + if($name == 'base_currency'){ |
|
110 | 110 | |
111 | - $screen_path = getcwd() . "/cron"; |
|
112 | - $screen_filename = "CurrencyUpdate" . strtotime('now'); |
|
113 | - $command = "cd " . $screen_path . " && /usr/bin/screen -d -m -S $screen_filename php cron.php CurrencyUpdate"; |
|
114 | - exec($command); |
|
115 | - $this->db->update("currency",array("currencyrate"=>'1'),array("currency"=>"INR")); |
|
116 | - } |
|
117 | - } |
|
118 | - |
|
119 | - function edit_template($data, $id) { |
|
120 | - unset($data["action"]); |
|
121 | - $data["last_modified_date"] = date("Y-m-d H:i:s"); |
|
122 | - $this->db->where("id", $id); |
|
123 | - $this->db->update("default_templates", $data); |
|
124 | - } |
|
125 | - function edit_resellertemplate($data, $id) { |
|
126 | - $arraydata = $data; |
|
127 | - if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
128 | - $account_data = $this->session->userdata("accountinfo"); |
|
129 | - $reseller = $account_data['id']; |
|
130 | - $array = $data; |
|
131 | - $data = array('reseller_id' => $reseller); |
|
132 | - $this->db->where("id", $id); |
|
133 | - } |
|
134 | - unset($arraydata["action"]); |
|
135 | - unset($arraydata["form"]); |
|
136 | - unset($arraydata["page_title"]); |
|
137 | - $this->db->update("default_templates", $arraydata); |
|
138 | - } |
|
139 | - function remove_template($id) { |
|
140 | - $this->db->where("id", $id); |
|
141 | - $this->db->update("default_templates", array("status" => 2)); |
|
142 | - return true; |
|
143 | - } |
|
144 | - function add_resellertemplate($data) |
|
145 | - { |
|
146 | - unset($data["action"]); |
|
147 | - unset($data['id']); |
|
148 | - $this->db->insert('default_templates', $data); |
|
149 | - return true; |
|
150 | - } |
|
151 | - function getcountry_list($flag, $start = 0, $limit = 0) { |
|
152 | - $this->db_model->build_search('country_list_search'); |
|
153 | - if ($flag) { |
|
154 | - $query = $this->db_model->select("*", "countrycode", '', "id", "ASC", $limit, $start); |
|
155 | - } else { |
|
156 | - $query = $this->db_model->countQuery("*", "countrycode", ''); |
|
157 | - } |
|
158 | - return $query; |
|
159 | - } |
|
160 | - |
|
161 | - function add_country($add_array) { |
|
162 | - unset($add_array["action"]); |
|
163 | - $this->db->insert("countrycode", $add_array); |
|
164 | - return true; |
|
165 | - } |
|
166 | - |
|
167 | - function edit_country($data, $id) { |
|
168 | - unset($data["action"]); |
|
169 | - $this->db->where("id", $id); |
|
170 | - $this->db->update("countrycode", $data); |
|
171 | - } |
|
172 | - |
|
173 | - function remove_country($id) { |
|
174 | - $this->db->where("id", $id); |
|
175 | - $this->db->delete("countrycode"); |
|
176 | - return true; |
|
177 | - } |
|
178 | - |
|
179 | - function getcurrency_list($flag, $start = 0, $limit = 0) { |
|
180 | - $this->db_model->build_search('currency_list_search'); |
|
111 | + $screen_path = getcwd() . "/cron"; |
|
112 | + $screen_filename = "CurrencyUpdate" . strtotime('now'); |
|
113 | + $command = "cd " . $screen_path . " && /usr/bin/screen -d -m -S $screen_filename php cron.php CurrencyUpdate"; |
|
114 | + exec($command); |
|
115 | + $this->db->update("currency",array("currencyrate"=>'1'),array("currency"=>"INR")); |
|
116 | + } |
|
117 | + } |
|
118 | + |
|
119 | + function edit_template($data, $id) { |
|
120 | + unset($data["action"]); |
|
121 | + $data["last_modified_date"] = date("Y-m-d H:i:s"); |
|
122 | + $this->db->where("id", $id); |
|
123 | + $this->db->update("default_templates", $data); |
|
124 | + } |
|
125 | + function edit_resellertemplate($data, $id) { |
|
126 | + $arraydata = $data; |
|
127 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
128 | + $account_data = $this->session->userdata("accountinfo"); |
|
129 | + $reseller = $account_data['id']; |
|
130 | + $array = $data; |
|
131 | + $data = array('reseller_id' => $reseller); |
|
132 | + $this->db->where("id", $id); |
|
133 | + } |
|
134 | + unset($arraydata["action"]); |
|
135 | + unset($arraydata["form"]); |
|
136 | + unset($arraydata["page_title"]); |
|
137 | + $this->db->update("default_templates", $arraydata); |
|
138 | + } |
|
139 | + function remove_template($id) { |
|
140 | + $this->db->where("id", $id); |
|
141 | + $this->db->update("default_templates", array("status" => 2)); |
|
142 | + return true; |
|
143 | + } |
|
144 | + function add_resellertemplate($data) |
|
145 | + { |
|
146 | + unset($data["action"]); |
|
147 | + unset($data['id']); |
|
148 | + $this->db->insert('default_templates', $data); |
|
149 | + return true; |
|
150 | + } |
|
151 | + function getcountry_list($flag, $start = 0, $limit = 0) { |
|
152 | + $this->db_model->build_search('country_list_search'); |
|
153 | + if ($flag) { |
|
154 | + $query = $this->db_model->select("*", "countrycode", '', "id", "ASC", $limit, $start); |
|
155 | + } else { |
|
156 | + $query = $this->db_model->countQuery("*", "countrycode", ''); |
|
157 | + } |
|
158 | + return $query; |
|
159 | + } |
|
160 | + |
|
161 | + function add_country($add_array) { |
|
162 | + unset($add_array["action"]); |
|
163 | + $this->db->insert("countrycode", $add_array); |
|
164 | + return true; |
|
165 | + } |
|
166 | + |
|
167 | + function edit_country($data, $id) { |
|
168 | + unset($data["action"]); |
|
169 | + $this->db->where("id", $id); |
|
170 | + $this->db->update("countrycode", $data); |
|
171 | + } |
|
172 | + |
|
173 | + function remove_country($id) { |
|
174 | + $this->db->where("id", $id); |
|
175 | + $this->db->delete("countrycode"); |
|
176 | + return true; |
|
177 | + } |
|
178 | + |
|
179 | + function getcurrency_list($flag, $start = 0, $limit = 0) { |
|
180 | + $this->db_model->build_search('currency_list_search'); |
|
181 | 181 | |
182 | 182 | $where=array('currency <>' =>Common_model::$global_config['system_config']['base_currency']); |
183 | - if ($flag) { |
|
184 | - $query = $this->db_model->select("*", "currency", $where, "id", "ASC", $limit, $start); |
|
185 | - } else { |
|
186 | - $query = $this->db_model->countQuery("*", "currency", $where); |
|
187 | - } |
|
188 | - return $query; |
|
189 | - } |
|
190 | - |
|
191 | - function add_currency($add_array) { |
|
192 | - unset($add_array["action"]); |
|
193 | - $this->db->insert("currency", $add_array); |
|
194 | - return true; |
|
195 | - } |
|
196 | - |
|
197 | - function edit_currency($data, $id) { |
|
198 | - unset($data["action"]); |
|
199 | - $this->db->where("id", $id); |
|
200 | - $this->db->update("currency", $data); |
|
201 | - } |
|
202 | - |
|
203 | - function remove_currency($id) { |
|
204 | - $this->db->where("id", $id); |
|
205 | - $this->db->delete("currency"); |
|
206 | - return true; |
|
207 | - } |
|
208 | - function backup_insert($add_array='') |
|
209 | - { |
|
183 | + if ($flag) { |
|
184 | + $query = $this->db_model->select("*", "currency", $where, "id", "ASC", $limit, $start); |
|
185 | + } else { |
|
186 | + $query = $this->db_model->countQuery("*", "currency", $where); |
|
187 | + } |
|
188 | + return $query; |
|
189 | + } |
|
190 | + |
|
191 | + function add_currency($add_array) { |
|
192 | + unset($add_array["action"]); |
|
193 | + $this->db->insert("currency", $add_array); |
|
194 | + return true; |
|
195 | + } |
|
196 | + |
|
197 | + function edit_currency($data, $id) { |
|
198 | + unset($data["action"]); |
|
199 | + $this->db->where("id", $id); |
|
200 | + $this->db->update("currency", $data); |
|
201 | + } |
|
202 | + |
|
203 | + function remove_currency($id) { |
|
204 | + $this->db->where("id", $id); |
|
205 | + $this->db->delete("currency"); |
|
206 | + return true; |
|
207 | + } |
|
208 | + function backup_insert($add_array='') |
|
209 | + { |
|
210 | 210 | unset($add_array["action"]); |
211 | - $this->db->insert("backup_database", $add_array); |
|
212 | - return true; |
|
213 | - } |
|
214 | - function getbackup_list($flag, $start, $limit) { |
|
215 | - |
|
216 | - if ($flag) { |
|
217 | - $query = $this->db_model->select("*", "backup_database", "", "date", "DESC", $limit, $start); |
|
218 | - } else { |
|
219 | - $query = $this->db_model->countQuery("*", "backup_database", ""); |
|
220 | - } |
|
221 | - return $query; |
|
222 | - } |
|
223 | - function get_backup_data($id) |
|
224 | - { |
|
225 | - $where=array('id'=>$id); |
|
226 | - $query = $this->db_model->getSelect("*", "backup_database", $where); |
|
227 | - return $query; |
|
228 | - } |
|
211 | + $this->db->insert("backup_database", $add_array); |
|
212 | + return true; |
|
213 | + } |
|
214 | + function getbackup_list($flag, $start, $limit) { |
|
215 | + |
|
216 | + if ($flag) { |
|
217 | + $query = $this->db_model->select("*", "backup_database", "", "date", "DESC", $limit, $start); |
|
218 | + } else { |
|
219 | + $query = $this->db_model->countQuery("*", "backup_database", ""); |
|
220 | + } |
|
221 | + return $query; |
|
222 | + } |
|
223 | + function get_backup_data($id) |
|
224 | + { |
|
225 | + $where=array('id'=>$id); |
|
226 | + $query = $this->db_model->getSelect("*", "backup_database", $where); |
|
227 | + return $query; |
|
228 | + } |
|
229 | 229 | function import_database($filename,$target_path) |
230 | - { |
|
230 | + { |
|
231 | 231 | $this->db->insert("backup_database", array('backup_name'=>$filename , 'path'=>$target_path)); |
232 | - return true; |
|
233 | - } |
|
232 | + return true; |
|
233 | + } |
|
234 | 234 | } |
@@ -22,133 +22,133 @@ |
||
22 | 22 | ############################################################################### |
23 | 23 | class Taxes extends CI_Controller { |
24 | 24 | |
25 | - function Taxes() { |
|
26 | - parent::__construct(); |
|
27 | - |
|
28 | - $this->load->helper('template_inheritance'); |
|
29 | - |
|
30 | - $this->load->library('session'); |
|
31 | - $this->load->library("taxes_form"); |
|
32 | - $this->load->library('astpp/form'); |
|
33 | - $this->load->model('taxes_model'); |
|
34 | - |
|
35 | - if ($this->session->userdata('user_login') == FALSE) |
|
36 | - redirect(base_url() . '/astpp/login'); |
|
37 | - } |
|
38 | - |
|
39 | - function taxes_add() { |
|
40 | - $data['username'] = $this->session->userdata('user_name'); |
|
41 | - $data['flag'] = 'create'; |
|
42 | - $data['page_title'] = 'Create Tax'; |
|
43 | - $data['form'] = $this->form->build_form($this->taxes_form->get_taxes_form_fields(), ''); |
|
44 | - |
|
45 | - $this->load->view('view_taxes_add_edit', $data); |
|
46 | - } |
|
47 | - |
|
48 | - function taxes_edit($edit_id = '') { |
|
49 | - $data['page_title'] = 'Edit Tax '; |
|
50 | - $where = array('id' => $edit_id); |
|
51 | - $account = $this->db_model->getSelect("*", "taxes", $where); |
|
52 | - foreach ($account->result_array() as $key => $value) { |
|
53 | - $edit_data = $value; |
|
54 | - } |
|
55 | - $edit_data['taxes_amount'] = $this->common_model->to_calculate_currency($edit_data['taxes_amount'], '', '', true, false); |
|
56 | - $data['form'] = $this->form->build_form($this->taxes_form->get_taxes_form_fields(), $edit_data); |
|
57 | - $this->load->view('view_taxes_add_edit', $data); |
|
58 | - } |
|
59 | - |
|
60 | - function taxes_save() { |
|
61 | - $add_array = $this->input->post(); |
|
62 | - $data['form'] = $this->form->build_form($this->taxes_form->get_taxes_form_fields(), $add_array); |
|
63 | - if ($add_array['id'] != '') { |
|
64 | - $data['page_title'] = 'Edit Tax'; |
|
65 | - if ($this->form_validation->run() == FALSE) { |
|
66 | - $data['validation_errors'] = validation_errors(); |
|
67 | - echo $data['validation_errors']; |
|
68 | - exit; |
|
69 | - } else { |
|
70 | - $add_array['taxes_amount'] = $this->common_model->add_calculate_currency($add_array['taxes_amount'], '', '', false, false); |
|
71 | - $this->taxes_model->edit_tax($add_array, $add_array['id']); |
|
72 | - echo json_encode(array("SUCCESS"=> $add_array["taxes_description"]." Tax updated successfully!")); |
|
73 | - exit; |
|
74 | - } |
|
75 | - } else { |
|
76 | - $data['page_title'] = 'Add Tax'; |
|
77 | - if ($this->form_validation->run() == FALSE) { |
|
78 | - $data['validation_errors'] = validation_errors(); |
|
79 | - echo $data['validation_errors']; |
|
80 | - exit; |
|
81 | - } else { |
|
82 | - $add_array['taxes_amount'] = $this->common_model->add_calculate_currency($add_array['taxes_amount'], '', '', false, false); |
|
83 | - $this->taxes_model->add_tax($add_array); |
|
84 | - echo json_encode(array("SUCCESS"=> $add_array["taxes_description"]." Tax added successfully!")); |
|
85 | - exit; |
|
86 | - } |
|
87 | - } |
|
88 | - } |
|
89 | - |
|
90 | - function taxes_delete($id) { |
|
25 | + function Taxes() { |
|
26 | + parent::__construct(); |
|
27 | + |
|
28 | + $this->load->helper('template_inheritance'); |
|
29 | + |
|
30 | + $this->load->library('session'); |
|
31 | + $this->load->library("taxes_form"); |
|
32 | + $this->load->library('astpp/form'); |
|
33 | + $this->load->model('taxes_model'); |
|
34 | + |
|
35 | + if ($this->session->userdata('user_login') == FALSE) |
|
36 | + redirect(base_url() . '/astpp/login'); |
|
37 | + } |
|
38 | + |
|
39 | + function taxes_add() { |
|
40 | + $data['username'] = $this->session->userdata('user_name'); |
|
41 | + $data['flag'] = 'create'; |
|
42 | + $data['page_title'] = 'Create Tax'; |
|
43 | + $data['form'] = $this->form->build_form($this->taxes_form->get_taxes_form_fields(), ''); |
|
44 | + |
|
45 | + $this->load->view('view_taxes_add_edit', $data); |
|
46 | + } |
|
47 | + |
|
48 | + function taxes_edit($edit_id = '') { |
|
49 | + $data['page_title'] = 'Edit Tax '; |
|
50 | + $where = array('id' => $edit_id); |
|
51 | + $account = $this->db_model->getSelect("*", "taxes", $where); |
|
52 | + foreach ($account->result_array() as $key => $value) { |
|
53 | + $edit_data = $value; |
|
54 | + } |
|
55 | + $edit_data['taxes_amount'] = $this->common_model->to_calculate_currency($edit_data['taxes_amount'], '', '', true, false); |
|
56 | + $data['form'] = $this->form->build_form($this->taxes_form->get_taxes_form_fields(), $edit_data); |
|
57 | + $this->load->view('view_taxes_add_edit', $data); |
|
58 | + } |
|
59 | + |
|
60 | + function taxes_save() { |
|
61 | + $add_array = $this->input->post(); |
|
62 | + $data['form'] = $this->form->build_form($this->taxes_form->get_taxes_form_fields(), $add_array); |
|
63 | + if ($add_array['id'] != '') { |
|
64 | + $data['page_title'] = 'Edit Tax'; |
|
65 | + if ($this->form_validation->run() == FALSE) { |
|
66 | + $data['validation_errors'] = validation_errors(); |
|
67 | + echo $data['validation_errors']; |
|
68 | + exit; |
|
69 | + } else { |
|
70 | + $add_array['taxes_amount'] = $this->common_model->add_calculate_currency($add_array['taxes_amount'], '', '', false, false); |
|
71 | + $this->taxes_model->edit_tax($add_array, $add_array['id']); |
|
72 | + echo json_encode(array("SUCCESS"=> $add_array["taxes_description"]." Tax updated successfully!")); |
|
73 | + exit; |
|
74 | + } |
|
75 | + } else { |
|
76 | + $data['page_title'] = 'Add Tax'; |
|
77 | + if ($this->form_validation->run() == FALSE) { |
|
78 | + $data['validation_errors'] = validation_errors(); |
|
79 | + echo $data['validation_errors']; |
|
80 | + exit; |
|
81 | + } else { |
|
82 | + $add_array['taxes_amount'] = $this->common_model->add_calculate_currency($add_array['taxes_amount'], '', '', false, false); |
|
83 | + $this->taxes_model->add_tax($add_array); |
|
84 | + echo json_encode(array("SUCCESS"=> $add_array["taxes_description"]." Tax added successfully!")); |
|
85 | + exit; |
|
86 | + } |
|
87 | + } |
|
88 | + } |
|
89 | + |
|
90 | + function taxes_delete($id) { |
|
91 | 91 | $this->db->select('taxes_description'); |
92 | 92 | $this->db->where('id',$id); |
93 | 93 | $taxes_name=(array)$this->db->get('taxes')->first_row(); |
94 | - $this->taxes_model->remove_taxes($id); |
|
95 | - $this->session->set_flashdata('astpp_notification', $taxes_name["taxes_description"].' Tax removed successfully!'); |
|
96 | - redirect(base_url() . 'taxes/taxes_list/'); |
|
97 | - } |
|
98 | - |
|
99 | - function taxes_list() { |
|
100 | - $data['page_title'] = 'Taxes'; |
|
101 | - $data['search_flag'] = true; |
|
102 | - $this->session->set_userdata('advance_search', 0); |
|
103 | - $data['grid_fields'] = $this->taxes_form->build_taxes_list_for_admin(); |
|
104 | - $data["grid_buttons"] = $this->taxes_form->build_grid_buttons(); |
|
105 | - $data['form_search'] = $this->form->build_serach_form($this->taxes_form->get_search_taxes_form()); |
|
106 | - $this->load->view('view_taxes_list', $data); |
|
107 | - } |
|
108 | - |
|
109 | - function taxes_list_json() { |
|
110 | - $json_data = array(); |
|
111 | - $count_all = $this->taxes_model->get_taxes_list(false); |
|
112 | - $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
|
113 | - $json_data = $paging_data["json_paging"]; |
|
114 | - |
|
115 | - $query = $this->taxes_model->get_taxes_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
|
116 | - $grid_fields = json_decode($this->taxes_form->build_taxes_list_for_admin()); |
|
117 | - $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
|
118 | - |
|
119 | - echo json_encode($json_data); |
|
120 | - } |
|
121 | - |
|
122 | - function taxes_list_search() { |
|
123 | - $ajax_search = $this->input->post('ajax_search', 0); |
|
124 | - if ($this->input->post('advance_search', TRUE) == 1) { |
|
125 | - $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
126 | - unset($_POST['action']); |
|
127 | - unset($_POST['advance_search']); |
|
128 | - if (isset($action['taxes_amount']['taxes_amount']) && $action['taxes_amount']['taxes_amount'] != '') { |
|
129 | - $action['taxes_amount']['taxes_amount'] = $this->common_model->add_calculate_currency($action['taxes_amount']['taxes_amount'], "", '', true, false); |
|
130 | - } |
|
131 | - $this->session->set_userdata('taxes_list_search', $this->input->post()); |
|
132 | - } |
|
133 | - if (@$ajax_search != 1) { |
|
134 | - redirect(base_url() . 'taxes/taxes_list/'); |
|
135 | - } |
|
136 | - } |
|
137 | - |
|
138 | - function taxes_list_clearsearchfilter() { |
|
139 | - $this->session->set_userdata('advance_search', 0); |
|
140 | - $this->session->set_userdata('taxes_list_search', ""); |
|
141 | - } |
|
142 | - |
|
143 | - function taxes_delete_multiple() { |
|
144 | - $ids = $this->input->post("selected_ids", true); |
|
145 | - $where = "id IN ($ids)"; |
|
146 | - $taxes_where="taxes_id IN(".$ids.")"; |
|
147 | - $this->db->where($taxes_where); |
|
148 | - $this->db->delete('taxes_to_accounts'); |
|
149 | - $this->db->where($where); |
|
150 | - echo $this->db->delete("taxes"); |
|
151 | - } |
|
94 | + $this->taxes_model->remove_taxes($id); |
|
95 | + $this->session->set_flashdata('astpp_notification', $taxes_name["taxes_description"].' Tax removed successfully!'); |
|
96 | + redirect(base_url() . 'taxes/taxes_list/'); |
|
97 | + } |
|
98 | + |
|
99 | + function taxes_list() { |
|
100 | + $data['page_title'] = 'Taxes'; |
|
101 | + $data['search_flag'] = true; |
|
102 | + $this->session->set_userdata('advance_search', 0); |
|
103 | + $data['grid_fields'] = $this->taxes_form->build_taxes_list_for_admin(); |
|
104 | + $data["grid_buttons"] = $this->taxes_form->build_grid_buttons(); |
|
105 | + $data['form_search'] = $this->form->build_serach_form($this->taxes_form->get_search_taxes_form()); |
|
106 | + $this->load->view('view_taxes_list', $data); |
|
107 | + } |
|
108 | + |
|
109 | + function taxes_list_json() { |
|
110 | + $json_data = array(); |
|
111 | + $count_all = $this->taxes_model->get_taxes_list(false); |
|
112 | + $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
|
113 | + $json_data = $paging_data["json_paging"]; |
|
114 | + |
|
115 | + $query = $this->taxes_model->get_taxes_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
|
116 | + $grid_fields = json_decode($this->taxes_form->build_taxes_list_for_admin()); |
|
117 | + $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
|
118 | + |
|
119 | + echo json_encode($json_data); |
|
120 | + } |
|
121 | + |
|
122 | + function taxes_list_search() { |
|
123 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
124 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
125 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
126 | + unset($_POST['action']); |
|
127 | + unset($_POST['advance_search']); |
|
128 | + if (isset($action['taxes_amount']['taxes_amount']) && $action['taxes_amount']['taxes_amount'] != '') { |
|
129 | + $action['taxes_amount']['taxes_amount'] = $this->common_model->add_calculate_currency($action['taxes_amount']['taxes_amount'], "", '', true, false); |
|
130 | + } |
|
131 | + $this->session->set_userdata('taxes_list_search', $this->input->post()); |
|
132 | + } |
|
133 | + if (@$ajax_search != 1) { |
|
134 | + redirect(base_url() . 'taxes/taxes_list/'); |
|
135 | + } |
|
136 | + } |
|
137 | + |
|
138 | + function taxes_list_clearsearchfilter() { |
|
139 | + $this->session->set_userdata('advance_search', 0); |
|
140 | + $this->session->set_userdata('taxes_list_search', ""); |
|
141 | + } |
|
142 | + |
|
143 | + function taxes_delete_multiple() { |
|
144 | + $ids = $this->input->post("selected_ids", true); |
|
145 | + $where = "id IN ($ids)"; |
|
146 | + $taxes_where="taxes_id IN(".$ids.")"; |
|
147 | + $this->db->where($taxes_where); |
|
148 | + $this->db->delete('taxes_to_accounts'); |
|
149 | + $this->db->where($where); |
|
150 | + echo $this->db->delete("taxes"); |
|
151 | + } |
|
152 | 152 | |
153 | 153 | } |
154 | 154 |
@@ -21,62 +21,62 @@ |
||
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 |
@@ -22,46 +22,46 @@ |
||
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 | } |
@@ -24,45 +24,45 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
459 | 459 | flush(); |
460 | 460 | readfile(getcwd().'/attachments/'.$file_name); |
461 | 461 | } |
462 | - } |
|
462 | + } |
|
463 | 463 | |
464 | 464 | } |
465 | 465 | ?> |
@@ -23,144 +23,144 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -237,8 +237,8 @@ |
||
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"> |
@@ -27,15 +27,15 @@ |
||
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> |