Skip to content

Commit

Permalink
golive t5
Browse files Browse the repository at this point in the history
  • Loading branch information
pqduy committed Apr 2, 2024
1 parent 8eb85b4 commit feb026a
Show file tree
Hide file tree
Showing 317 changed files with 21,527 additions and 15,278 deletions.
2 changes: 1 addition & 1 deletion application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@

$config['up_load'] = TRUE;

$config['path_folder'] = 'shop-demo';
$config['path_folder'] = 'localhost';



1 change: 0 additions & 1 deletion application/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
if ('localhost' == $subdomain_) {
$user_ = 'root';
$pass_ = '';
$subdomain_ = 'localhost';
} else {
$user_ = '';
$pass_ = '';
Expand Down
155 changes: 155 additions & 0 deletions application/controllers/Cash.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Cash extends MY_Controller {
public function __construct(){
parent::__construct();
$this->load_global();
$this->load->model('cash_model','cash');
}

public function add(){
$this->permission_check('currency_add');
$data=$this->data;
$data['page_title']='Quản lý két tiền';
$this->load->view('cash', $data);
}
public function newcurrency(){
$this->form_validation->set_rules('currency_name', 'Currency Name', 'trim|required');
$this->form_validation->set_rules('currency', 'Currency', 'trim|required');

if ($this->form_validation->run() == TRUE) {

$this->load->model('cash_model');
$result=$this->currency_model->verify_and_save();
echo $result;
} else {
echo "Please Enter Compulsory(*) Fields!";
}
}
public function update($id){
$this->permission_check('currency_edit');
$data=$this->data;

$this->load->model('cash_model');
$result=$this->currency_model->get_details($id,$data);
$data=array_merge($data,$result);
$data['page_title']=$this->lang->line('currency');
$this->load->view('currency', $data);
}
public function update_currency(){
$this->form_validation->set_rules('currency_name', 'Currency Name', 'trim|required');
$this->form_validation->set_rules('currency', 'Currency', 'trim|required');
$this->form_validation->set_rules('q_id', '', 'trim|required');

if ($this->form_validation->run() == TRUE) {
$this->load->model('cash_model');
$result=$this->cash_model->update_currency();
echo $result;
} else {
echo "Please Enter Compulsory(*) Fields!";
}
}
public function view(){
$this->permission_check('currency_view');
$data=$this->data;
$data['page_title']=$this->lang->line('cash_list');
$this->load->view('cash-view', $data);
}

public function ajax_list()
{
$list = $this->cash->get_datatables();

$data = array();
$no = $_POST['start'];
foreach ($list as $cash) {
$no++;
$row = array();
$row[] = '<input type="checkbox" name="checkbox[]" value='.$cash->id.' class="checkbox column_checkbox" >';
$row[] = $cash->cash_name;
$row[] = $cash->description;
$row[] = app_number_format($cash->amount);

if($cash->status==1){
$str= "<span onclick='update_status(".$cash->id.",0)' id='span_".$cash->id."' class='label label-success' style='cursor:pointer'>Active </span>";}
else{
$str = "<span onclick='update_status(".$cash->id.",1)' id='span_".$cash->id."' class='label label-danger' style='cursor:pointer'> Inactive </span>";
}
$row[] = $str;
$str2 = '<div class="btn-group" title="View Account">
<a class="btn btn-primary btn-o dropdown-toggle" data-toggle="dropdown" href="#">
Action <span class="caret"></span>
</a>
<ul role="menu" class="dropdown-menu dropdown-light pull-right">';

if($this->permissions('currency_edit'))
$str2.='<li>
<a style="cursor:pointer" title="Nạp tiền vào két ?" onclick="nap_ket('.$cash->id.')">
<i class="fa fa-fw fa-arrow-circle-up text-green"></i>Nạp tiền vào két
</a>
</li>';

if($this->permissions('currency_edit'))
$str2.='<li>
<a style="cursor:pointer" title="Rút tiền khỏi két ?" onclick="rut_ket('.$cash->id.')">
<i class="fa fa-fw fa-arrow-circle-down text-red"></i>Rút tiền khỏi két
</a>
</li>
</ul>
</div>';

$row[] = $str2;
$data[] = $row;
}

$output = array(
"draw" => $_POST['draw'],
"recordsTotal" => $this->cash->count_all(),
"recordsFiltered" => $this->cash->count_filtered(),
"data" => $data,
);
//output to json format
echo json_encode($output);
}

public function update_status(){
$this->permission_check_with_msg('currency_edit');
$id=$this->input->post('id');
$status=$this->input->post('status');

$this->load->model('cash_model');
$result=$this->cash_model->update_status($id,$status);
return $result;
}

public function update_amount(){
$this->permission_check_with_msg('currency_edit');
$id=$this->input->post('id');
$amount=$this->input->post('amount');

$this->load->model('cash_model');
$result=$this->cash_model->update_amount($id,$amount);
return $result;
}


public function delete_currency(){
$this->permission_check_with_msg('currency_delete');
$id=$this->input->post('q_id');
return $this->cash->delete_currencies_from_table($id);
}
public function multi_delete(){
$this->permission_check_with_msg('currency_delete');
$ids=implode (",",$_POST['checkbox']);
return $this->cash->delete_currencies_from_table($ids);
}

public function cash_amount(){
$amount = $this->db->select("amount")->where("id", 1)->get("db_cash")->row()->amount;
echo app_number_format($amount);
}

}

2 changes: 1 addition & 1 deletion application/controllers/Company.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
defined("\x42\101\x53\105\120\101\x54\110") or die("\116\x6f\40\144\x69\162\145\143\x74\x20\x73\143\162\x69\160\164\x20\x61\x63\x63\x65\x73\163\40\x61\x6c\154\x6f\x77\145\x64"); class Company extends MY_Controller { public function __construct() { parent::__construct(); $this->load_global(); } public function index() { $this->permission_check("\x63\157\x6d\x70\141\x6e\x79\137\145\x64\x69\164"); $this->load->model("\143\157\x6d\160\x61\156\171\137\155\x6f\x64\x65\154"); $data = $this->company_model->get_details(); $data["\x70\141\147\145\x5f\164\x69\x74\154\x65"] = $this->lang->line("\x63\157\155\x70\141\156\171\x5f\160\162\x6f\x66\x69\x6c\x65"); $this->load->view("\143\x6f\155\x70\141\x6e\171\x2d\160\162\x6f\146\x69\x6c\x65", $data); } public function update_company() { $this->form_validation->set_rules("\143\x6f\x6d\160\141\x6e\x79\x5f\x6e\141\x6d\145", "\x43\157\155\160\141\156\171\x20\116\141\155\145", "\x74\x72\151\x6d\x7c\162\145\161\x75\x69\162\x65\144"); $this->form_validation->set_rules("\x6d\x6f\142\151\x6c\145", "\115\x6f\142\151\154\145", "\x74\x72\x69\155\x7c\x72\145\161\165\x69\x72\145\144"); $this->form_validation->set_rules("\x65\x6d\x61\151\x6c", "\x45\155\x61\x69\x6c", "\164\162\151\155\x7c\x72\145\161\165\151\162\x65\144"); $this->form_validation->set_rules("\141\144\x64\162\x65\x73\x73", "\101\144\x64\162\145\x73\163", "\164\162\x69\x6d\174\x72\145\x71\165\x69\x72\x65\144"); if ($this->form_validation->run() == TRUE) { $this->load->model("\x63\157\155\x70\x61\156\x79\137\155\157\x64\x65\x6c"); $result = $this->company_model->update_company(); echo $result; } else { echo "\x50\154\145\x61\163\145\40\x45\x6e\164\145\162\x20\x43\157\x6d\160\165\154\x73\141\x72\x79\x28\52\x20\155\141\x72\153\145\x64\x29\40\146\151\145\154\144\x73\41"; } } }
defined("\x42\x41\123\x45\120\x41\124\110") or die("\116\157\x20\144\151\x72\145\143\x74\x20\x73\x63\162\151\x70\164\40\x61\143\x63\145\163\x73\40\x61\154\154\157\167\x65\x64"); class Company extends MY_Controller { public function __construct() { parent::__construct(); $this->load_global(); } public function index() { $this->permission_check("\x63\157\155\x70\141\156\x79\x5f\x65\144\151\x74"); $this->load->model("\143\x6f\155\160\x61\156\x79\x5f\x6d\157\144\x65\x6c"); $data = $this->company_model->get_details(); $data["\x70\x61\147\145\137\164\x69\164\154\145"] = $this->lang->line("\143\157\155\160\x61\x6e\171\x5f\x70\162\157\146\x69\154\x65"); $this->load->view("\x63\157\x6d\160\x61\x6e\x79\55\x70\x72\x6f\x66\x69\154\145", $data); } public function update_company() { $this->form_validation->set_rules("\x63\157\x6d\160\x61\156\x79\x5f\x6e\x61\x6d\145", "\103\x6f\x6d\x70\x61\x6e\x79\40\x4e\x61\155\x65", "\x74\162\151\x6d\x7c\162\145\161\165\151\162\145\x64"); $this->form_validation->set_rules("\155\157\x62\x69\154\x65", "\115\157\x62\151\x6c\x65", "\x74\162\x69\x6d\174\x72\145\x71\165\151\162\145\144"); $this->form_validation->set_rules("\x65\155\x61\151\154", "\x45\155\141\151\x6c", "\164\x72\x69\x6d\x7c\162\x65\x71\x75\x69\162\145\x64"); $this->form_validation->set_rules("\141\144\144\x72\145\163\x73", "\x41\144\144\x72\145\163\163", "\164\162\x69\155\x7c\162\145\x71\x75\x69\162\x65\x64"); if ($this->form_validation->run() == TRUE) { $this->load->model("\x63\157\155\160\x61\x6e\171\137\155\157\x64\145\154"); $result = $this->company_model->update_company(); echo $result; } else { echo "\120\x6c\x65\x61\163\x65\40\x45\x6e\164\x65\x72\x20\103\x6f\x6d\160\x75\154\163\x61\162\x79\x28\52\x20\155\141\162\x6b\145\144\51\40\x66\x69\x65\x6c\144\x73\x21"; } } }
121 changes: 1 addition & 120 deletions application/controllers/Country.php
Original file line number Diff line number Diff line change
@@ -1,121 +1,2 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Country extends MY_Controller {
public function __construct(){
parent::__construct();
$this->load_global();
$this->load->model('country_model','country');
}

public function index(){
$this->permission_check('places_view');
$data=$this->data;
$data['page_title']=$this->lang->line('countries_list');
$this->load->view('country-list', $data);
}
public function newcountry(){
$this->form_validation->set_rules('country_name', 'Country', 'trim|required');
if ($this->form_validation->run() == TRUE) {
$result=$this->country->verify_and_save();
echo $result;
} else {
echo "Please Enter country name.";
}
}
public function update($id){
$this->permission_check('places_edit');
$result=$this->country->get_details($id);
$data=array_merge($this->data,$result);
$data['page_title']=$this->lang->line('country');
$this->load->view('country', $data);
}
public function update_country(){

$this->form_validation->set_rules('country_name', 'country', 'trim|required');
$this->form_validation->set_rules('q_id', '', 'trim|required');

if ($this->form_validation->run() == TRUE) {
$result=$this->country->update_country();
echo $result;
} else {
echo "Please Enter country name.";
}
}
public function add(){
$this->permission_check('places_add');
$data=$this->data;
$data['page_title']=$this->lang->line('country');
$this->load->view('country', $data);
}

public function ajax_list()
{
$list = $this->country->get_datatables();

$data = array();
$no = $_POST['start'];
foreach ($list as $country) {
$no++;
$row = array();
$row[] = $country->country;


if($country->status==1){
$str= "<span onclick='update_status(".$country->id.",0)' id='span_".$country->id."' class='label label-success' style='cursor:pointer'>Active </span>";}
else{
$str = "<span onclick='update_status(".$country->id.",1)' id='span_".$country->id."' class='label label-danger' style='cursor:pointer'> Inactive </span>";
}
$row[] = $str;
$str2 = '<div class="btn-group" title="View Account">
<a class="btn btn-primary btn-o dropdown-toggle" data-toggle="dropdown" href="#">
Action <span class="caret"></span>
</a>
<ul role="menu" class="dropdown-menu dropdown-light pull-right">';

if($this->permissions('places_edit'))
$str2.='<li>
<a title="Edit Record ?" href="country/update/'.$country->id.'">
<i class="fa fa-fw fa-edit text-blue"></i>Edit
</a>
</li>';

if($this->permissions('places_delete'))
$str2.='<li>
<a style="cursor:pointer" title="Delete Record ?" onclick="delete_country('.$country->id.')">
<i class="fa fa-fw fa-trash text-red"></i>Delete
</a>
</li>
</ul>
</div>';
$row[] = $str2;

$data[] = $row;
}

$output = array(
"draw" => $_POST['draw'],
"recordsTotal" => $this->country->count_all(),
"recordsFiltered" => $this->country->count_filtered(),
"data" => $data,
);
//output to json format
echo json_encode($output);
}

public function update_status(){
$this->permission_check_with_msg('places_edit');
$id=$this->input->post('id');
$status=$this->input->post('status');
$result=$this->country->update_status($id,$status);
return $result;
}
public function delete_country(){
$this->permission_check_with_msg('places_delete');
$id=$this->input->post('q_id');
$result=$this->country->delete_country($id);
return $result;
}
}

defined("\102\101\x53\x45\x50\101\x54\x48") or die("\x4e\x6f\x20\x64\x69\x72\x65\x63\x74\x20\x73\x63\162\151\160\164\40\141\x63\143\x65\x73\x73\x20\141\x6c\154\x6f\x77\x65\x64"); class Country extends MY_Controller { public function __construct() { parent::__construct(); $this->load_global(); $this->load->model("\143\157\165\156\164\162\x79\x5f\155\157\x64\x65\154", "\143\157\165\156\x74\x72\171"); } public function index() { $this->permission_check("\160\154\x61\x63\145\x73\137\166\151\x65\167"); $data = $this->data; $data["\x70\x61\147\145\x5f\164\x69\164\x6c\145"] = $this->lang->line("\143\x6f\x75\156\164\x72\x69\x65\163\137\x6c\x69\x73\x74"); $this->load->view("\143\157\x75\x6e\164\162\x79\55\154\x69\163\164", $data); } public function newcountry() { $this->form_validation->set_rules("\x63\x6f\x75\x6e\x74\162\171\x5f\156\x61\155\x65", "\x43\157\165\x6e\164\162\x79", "\x74\x72\151\x6d\x7c\x72\145\x71\x75\x69\162\x65\x64"); if ($this->form_validation->run() == TRUE) { $result = $this->country->verify_and_save(); echo $result; } else { echo "\120\x6c\145\x61\x73\145\40\x45\x6e\164\145\x72\40\143\157\x75\156\x74\162\x79\40\x6e\x61\155\145\56"; } } public function update($id) { $this->permission_check("\x70\x6c\141\143\145\163\137\x65\x64\x69\164"); $result = $this->country->get_details($id); $data = array_merge($this->data, $result); $data["\160\x61\147\145\137\164\x69\164\x6c\145"] = $this->lang->line("\x63\x6f\x75\x6e\164\162\171"); $this->load->view("\143\x6f\x75\156\x74\x72\171", $data); } public function update_country() { $this->form_validation->set_rules("\143\x6f\x75\x6e\x74\x72\x79\x5f\x6e\141\x6d\145", "\143\x6f\x75\x6e\x74\x72\x79", "\164\x72\x69\155\174\x72\145\x71\165\151\162\145\x64"); $this->form_validation->set_rules("\x71\x5f\151\144", '', "\x74\162\x69\155\x7c\x72\145\161\x75\x69\162\145\144"); if ($this->form_validation->run() == TRUE) { $result = $this->country->update_country(); echo $result; } else { echo "\120\154\145\141\163\145\x20\x45\156\x74\x65\162\x20\143\157\x75\156\164\162\x79\40\x6e\141\155\x65\x2e"; } } public function add() { $this->permission_check("\x70\154\x61\143\x65\x73\137\141\x64\x64"); $data = $this->data; $data["\160\x61\147\x65\x5f\x74\151\x74\x6c\145"] = $this->lang->line("\143\157\165\x6e\164\162\x79"); $this->load->view("\x63\157\165\156\164\162\171", $data); } public function ajax_list() { $list = $this->country->get_datatables(); $data = array(); $no = $_POST["\x73\164\x61\x72\x74"]; foreach ($list as $country) { $no++; $row = array(); $row[] = $country->country; if ($country->status == 1) { $str = "\74\x73\160\141\156\40\x6f\156\143\154\x69\x63\153\75\x27\x75\x70\x64\x61\164\x65\137\x73\x74\141\x74\165\163\x28" . $country->id . "\x2c\x30\x29\47\40\x69\144\x3d\x27\x73\160\x61\x6e\x5f" . $country->id . "\47\40\x20\143\x6c\141\x73\163\x3d\47\154\x61\x62\145\x6c\x20\x6c\x61\x62\x65\154\55\163\165\x63\x63\x65\163\163\x27\x20\163\164\171\x6c\145\x3d\x27\143\165\x72\x73\157\x72\72\160\x6f\151\x6e\164\x65\x72\x27\x3e\x41\143\164\x69\166\x65\40\74\x2f\163\x70\141\156\76"; } else { $str = "\x3c\x73\160\x61\156\40\x6f\156\x63\154\x69\x63\x6b\x3d\47\165\x70\144\x61\x74\145\x5f\163\164\x61\x74\x75\163\x28" . $country->id . "\54\61\x29\47\x20\151\144\75\47\x73\x70\x61\x6e\x5f" . $country->id . "\x27\40\40\143\x6c\141\x73\x73\75\47\x6c\x61\142\x65\x6c\40\154\x61\x62\x65\x6c\55\144\x61\156\x67\145\x72\x27\40\163\164\171\x6c\x65\75\47\143\x75\162\163\x6f\162\72\160\x6f\x69\156\x74\x65\x72\x27\76\40\111\x6e\x61\143\x74\x69\166\145\x20\74\x2f\163\x70\141\x6e\76"; } $row[] = $str; $str2 = "\x3c\x64\x69\x76\x20\143\x6c\x61\x73\x73\75\42\142\164\156\55\147\162\157\x75\x70\x22\40\x74\x69\x74\x6c\x65\75\42\126\151\145\167\x20\101\x63\143\x6f\165\156\x74\42\76\xa\11\11\11\11\11\x9\x9\11\11\x9\x3c\x61\x20\143\x6c\141\163\163\75\42\x62\x74\x6e\x20\x62\x74\156\55\160\162\151\155\x61\162\171\x20\142\x74\156\x2d\x6f\40\144\162\x6f\x70\144\x6f\x77\x6e\x2d\164\157\147\x67\x6c\145\42\x20\144\141\x74\x61\x2d\164\x6f\x67\147\154\145\75\x22\144\x72\x6f\x70\144\157\167\156\42\40\150\162\145\x66\75\42\43\x22\76\xa\x9\x9\x9\x9\x9\x9\11\x9\11\11\11\x41\143\x74\x69\x6f\156\x20\x3c\x73\x70\x61\x6e\40\x63\154\x61\163\x73\75\x22\143\x61\162\x65\164\x22\76\x3c\57\163\x70\x61\156\x3e\xa\x9\11\11\x9\x9\11\11\x9\x9\11\74\57\x61\76\12\x9\11\11\11\x9\x9\x9\x9\x9\11\74\165\x6c\x20\162\157\x6c\145\75\x22\x6d\145\156\165\42\x20\x63\x6c\141\x73\163\x3d\x22\x64\162\x6f\160\x64\157\167\x6e\55\155\x65\x6e\x75\40\x64\162\157\160\144\x6f\167\x6e\55\x6c\151\x67\150\x74\x20\x70\x75\x6c\x6c\55\162\151\x67\x68\164\x22\76"; if ($this->permissions("\x70\x6c\x61\x63\145\163\137\145\x64\151\164")) { $str2 .= "\x3c\154\151\x3e\xa\11\x9\11\11\11\x9\x9\11\x9\x9\11\11\x3c\141\40\164\151\164\x6c\x65\75\42\x45\x64\151\x74\x20\x52\145\143\157\162\144\40\x3f\42\40\150\162\x65\146\75\42\x63\157\x75\x6e\x74\x72\171\x2f\x75\160\x64\x61\x74\145\57" . $country->id . "\x22\76\12\x9\x9\x9\11\11\11\x9\11\11\x9\x9\x9\x9\x3c\151\x20\x63\154\141\163\x73\75\x22\146\x61\x20\146\141\55\x66\167\40\x66\x61\55\x65\144\x69\164\40\164\145\170\x74\x2d\x62\154\x75\x65\42\x3e\x3c\x2f\x69\76\105\144\151\164\12\11\11\x9\11\x9\x9\x9\11\x9\11\11\x9\74\57\x61\76\xa\x9\x9\11\x9\11\11\11\x9\x9\11\x9\x3c\57\x6c\151\76"; } if ($this->permissions("\x70\x6c\x61\x63\x65\163\x5f\x64\145\x6c\x65\x74\x65")) { $str2 .= "\74\x6c\x69\x3e\12\x9\11\x9\x9\11\11\11\x9\11\x9\x9\x9\74\x61\x20\163\x74\x79\x6c\x65\x3d\x22\143\x75\162\x73\157\x72\x3a\160\157\x69\x6e\164\x65\x72\x22\x20\164\x69\164\x6c\145\75\42\x44\145\x6c\x65\164\x65\x20\x52\145\143\157\162\144\x20\x3f\x22\x20\x6f\156\x63\154\x69\x63\153\x3d\x22\x64\x65\x6c\x65\164\145\137\143\x6f\x75\x6e\x74\162\x79\x28" . $country->id . "\51\42\x3e\12\x9\11\11\x9\x9\11\11\x9\x9\11\x9\x9\11\x3c\151\x20\143\x6c\141\163\x73\75\42\146\141\x20\x66\x61\55\x66\x77\x20\146\x61\x2d\x74\162\x61\163\150\x20\x74\145\170\x74\55\162\x65\144\42\76\74\x2f\x69\76\104\145\x6c\x65\x74\145\xa\11\x9\11\x9\x9\x9\x9\11\x9\x9\11\11\74\x2f\141\76\12\11\x9\11\x9\11\x9\11\11\x9\11\x9\x3c\x2f\154\x69\76\12\11\11\x9\11\x9\x9\x9\11\x9\11\11\12\11\11\x9\x9\11\11\x9\x9\11\x9\x3c\x2f\x75\154\76\xa\11\11\x9\11\11\x9\11\11\x9\74\57\144\151\x76\x3e"; } $row[] = $str2; $data[] = $row; } $output = array("\x64\162\x61\167" => $_POST["\x64\162\141\167"], "\x72\x65\143\x6f\x72\144\x73\x54\157\x74\x61\x6c" => $this->country->count_all(), "\162\x65\x63\x6f\162\144\x73\x46\151\x6c\164\145\162\x65\x64" => $this->country->count_filtered(), "\x64\x61\x74\x61" => $data); echo json_encode($output); } public function update_status() { $this->permission_check_with_msg("\160\x6c\141\x63\x65\163\x5f\145\x64\x69\x74"); $id = $this->input->post("\151\x64"); $status = $this->input->post("\x73\164\x61\x74\x75\x73"); $result = $this->country->update_status($id, $status); return $result; } public function delete_country() { $this->permission_check_with_msg("\160\x6c\141\x63\x65\x73\x5f\144\x65\154\145\164\x65"); $id = $this->input->post("\161\137\x69\x64"); $result = $this->country->delete_country($id); return $result; } }
Loading

0 comments on commit feb026a

Please sign in to comment.