public function index() { $this->data['clients'] = dd2menu('clients', ['client_id' => 'name']); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = 1; $this->load->library('form_validation'); $this->form_validation->set_rules('serial', lang('device_orders_serial'), "trim|required"); $this->form_validation->set_rules('device_id', lang('device_orders_device_id'), "trim|required"); $this->form_validation->set_rules('mobile', lang('device_orders_mobile'), "trim|required"); // $this->form_validation->set_rules('social_id', lang('device_orders_social_id'), "trim|required"); // $this->form_validation->set_rules('invoice_id', lang('device_orders_invoice_id'), "trim|required"); $this->form_validation->set_rules('client_id', lang('device_orders_client_id'), "trim|required"); // $this->form_validation->set_rules('branch_id', lang('device_orders_branch_id'), "trim|required"); $this->form_validation->set_rules('social_id', lang('device_orders_social_id'), "callback_file[social_id," . $required . "]"); if ($this->form_validation->run() == false) { $this->twiggy->set($this->data)->template('device_orders')->display(); } else { // TODO: CREATE INVOICE AND ORDER PROCESS $this->load->library('order'); $vars = ['serial' => $this->input->post('serial'), 'device_id' => $this->input->post('device_id'), 'mobile' => $this->input->post('mobile'), 'social_id' => $this->{$this->model}->social_id, 'client_id' => $this->input->post('client_id'), 'paid' => $this->input->post('paid'), 'user_id' => $this->user->user_id, 'branch_id' => $this->user->branch_id, 'status' => 1, 'created_at' => now()]; $this->order->deviceOrder($vars); die(json_encode(['invoice_id' => $this->order->invoice_id])); } }
protected function onValidationEvent($op, $id = false) { $this->data['device_types'] = dd2menu('device_types', ['device_type_id' => name()]); $this->data['device_status'] = dd2menu('device_status', ['device_status_id' => name()]); $this->data['warranties'] = dd2menu('warranties', ['warranty_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '0'; $this->form_validation->set_rules('device_type_id', lang('devices_device_type_id'), "trim|required"); $this->form_validation->set_rules('name_en', lang('devices_name_en'), "trim|required"); $this->form_validation->set_rules('name_ar', lang('devices_name_ar'), "trim|required"); $this->form_validation->set_rules('device_status_id', lang('devices_device_status_id'), "trim|required"); $this->form_validation->set_rules('free_sim', lang('devices_free_sim'), "trim|required"); $this->form_validation->set_rules('warranty_id', lang('devices_warranty_id'), "trim|required"); $this->form_validation->set_rules('warranty_days', lang('devices_warranty_days'), "trim|required"); $this->form_validation->set_rules('partner', lang('devices_partner'), "trim|required"); $this->form_validation->set_rules('cost', lang('devices_cost'), "trim|required"); $this->form_validation->set_rules('commision', lang('devices_commision'), "trim|required"); $this->form_validation->set_rules('price', lang('devices_price'), "trim|required"); $this->form_validation->set_rules('discount', lang('devices_discount'), "trim|required"); $this->form_validation->set_rules('desc', lang('devices_desc'), "trim|required"); $this->form_validation->set_rules('points', lang('devices_points'), "trim|required"); $this->form_validation->set_rules('barcode', lang('devices_barcode'), "trim|required"); // $this->form_validation->set_rules('logo', lang('branches_logo'), "callback_file[logo," . $required . "]"); }
protected function onValidationEvent($op, $id = false) { $this->data['branches'] = dd2menu('branches', ['branch_id' => 'name']); $this->data['usergroups'] = dd2menu('usergroups', ['usergroup_id' => 'name']); $this->data['user_status'] = dd2menu('user_status', ['user_status_id' => name()]); $this->data['languages'] = ddlanguages(); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '0'; $this->form_validation->set_rules('branch_id', lang('users_branch_id'), "trim|required"); $this->form_validation->set_rules('usergroup_id', lang('users_usergroup_id'), "trim|required"); $this->form_validation->set_rules('language', lang('users_language'), "trim|required"); $this->form_validation->set_rules('username', lang('users_username'), "trim|required"); $this->form_validation->set_rules('full_name', lang('users_full_name'), "trim|required"); $this->form_validation->set_rules('email', lang('users_email'), "trim|required|valid_email"); $this->form_validation->set_rules('phone', lang('users_phone'), "trim|numeric"); $this->form_validation->set_rules('mobile', lang('users_mobile'), "trim|required|numeric"); $this->form_validation->set_rules('password', lang('users_password'), "trim" . $op == 'add' ? '|required' : null); $this->form_validation->set_rules('address', lang('users_address'), "trim"); $this->form_validation->set_rules('notes', lang('users_notes'), "trim"); $this->form_validation->set_rules('salary', lang('users_salary'), "trim|numeric"); $this->form_validation->set_rules('commision', lang('users_commision'), "trim|required"); $this->form_validation->set_rules('id_no', lang('users_id_no'), "trim|required"); $this->form_validation->set_rules('id_expiredate', lang('users_id_expiredate'), "trim|required"); $this->form_validation->set_rules('passport_no', lang('users_passport_no'), "trim|required"); $this->form_validation->set_rules('passport_expiredate', lang('users_passport_expiredate'), "trim|required"); $this->form_validation->set_rules('status', lang('users_status'), "trim|required"); $this->form_validation->set_rules('image', lang('users_image'), "callback_file[image," . $required . "]"); }
protected function onValidationEvent($op, $id = false) { $this->data['invoice_types'] = dd2menu('invoice_types', ['invoice_type_id' => name()]); $this->form_validation->set_rules('name_en', lang('departments_name_en'), "trim|required"); $this->form_validation->set_rules('name_ar', lang('departments_name_ar'), "trim|required"); $this->form_validation->set_rules('desc', lang('departments_desc'), "trim|required"); }
protected function onValidationEvent($op, $id = false) { $this->data['prepaid_card_types'] = dd2menu('prepaid_card_types', ['prepaid_card_type_id' => name()]); $this->form_validation->set_rules('prepaid_card_type_id', lang('prepaid_cards_prepaid_card_type_id'), "trim|required"); $this->form_validation->set_rules('number[]', lang('prepaid_cards_number'), "trim|required"); $this->form_validation->set_rules('serial[]', lang('prepaid_cards_serial'), "trim"); $this->form_validation->set_rules('expire_date[]', lang('prepaid_cards_expire_date'), "trim"); }
protected function onValidationEvent($op, $id = false) { $this->data['fee_types'] = dd2menu('fee_types', ['fee_type_id' => name()]); $this->form_validation->set_rules('branch_id', lang('fees_branch_id'), "trim|required"); $this->form_validation->set_rules('fee_type_id', lang('fees_fee_type_id'), "trim|required"); $this->form_validation->set_rules('amount', lang('fees_amount'), "trim|required"); $this->form_validation->set_rules('month', lang('fees_month'), "trim|required"); $this->form_validation->set_rules('year', lang('fees_year'), "trim|required"); }
protected function onValidationEvent($op, $id = false) { $this->data['invoice_types'] = dd2menu('invoice_types', ['invoice_type_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '1'; $this->form_validation->set_rules('name_ar', lang('cash_types_name_ar'), "trim|required"); $this->form_validation->set_rules('name_en', lang('cash_types_name_en'), "trim|required"); // $this->form_validation->set_rules('logo', lang('branches_logo'), "callback_file[logo," . $required ."]"); }
protected function onValidationEvent($op, $id = false) { $this->data['invoice_types'] = dd2menu('invoice_types', ['invoice_type_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '1'; $this->form_validation->set_rules('ticket_id', lang('tickets_ticket_id'), "trim|required"); $this->form_validation->set_rules('title', lang('tickets_title'), "trim|required"); $this->form_validation->set_rules('department_id', lang('tickets_department_id'), "trim|required"); $this->form_validation->set_rules('ticket_status_id', lang('tickets_ticket_status_id'), "trim|required"); $this->form_validation->set_rules('client_id', lang('tickets_client_id'), "trim|required"); $this->form_validation->set_rules('content', lang('tickets_content'), "trim|required"); $this->form_validation->set_rules('datetime', lang('tickets_datetime'), "trim|required"); $this->form_validation->set_rules('logo', lang('branches_logo'), "callback_file[logo," . $required . "]"); }
protected function onValidationEvent($op, $id = false) { $this->data['categories'] = dd2menu('categories', ['category_id' => name()], ['parent_id' => 0], ['0' => lang('categories_main')]); // $config['upload_path'] = './cdn/' . $this->_table; // $config['allowed_types'] = 'gif|jpg|png|jpeg'; // $this->load->library('upload', $config); // $required = ($op == 'add') ? '1' : '1'; $this->form_validation->set_rules('parent_id', lang('categories_parent_id'), "trim|required"); $this->form_validation->set_rules('name_en', lang('categories_name_en'), "trim|required"); $this->form_validation->set_rules('name_ar', lang('categories_name_ar'), "trim|required"); $this->form_validation->set_rules('desc_en', lang('categories_desc_en'), "trim"); $this->form_validation->set_rules('desc_ar', lang('categories_desc_ar'), "trim"); $this->form_validation->set_rules('display_order', lang('categories_display_order'), "trim"); $this->form_validation->set_rules('status', lang('categories_status'), "trim|required"); // $this->form_validation->set_rules('logo', lang('branches_logo'), "callback_file[logo," . $required . "]"); }
protected function onValidationEvent($op, $id = false) { $this->data['invoice_types'] = dd2menu('invoice_types', ['invoice_type_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '0'; $this->form_validation->set_rules('name', lang('branches_name'), "trim|required"); $this->form_validation->set_rules('place', lang('branches_place'), "trim|required"); $this->form_validation->set_rules('notes', lang('branches_notes'), "trim"); $this->form_validation->set_rules('phone', lang('branches_phone'), "trim|required|numeric"); $this->form_validation->set_rules('sales_invoice_type_id', lang('branches_sales_invoice_type_id'), "trim|required"); $this->form_validation->set_rules('format_invoice_type_id', lang('branches_format_invoice_type_id'), "trim|required"); $this->form_validation->set_rules('services_invoice_type_id', lang('branches_services_invoice_type_id'), "trim|required"); $this->form_validation->set_rules('accept_cc', lang('branches_accept_cc'), "trim|required"); $this->form_validation->set_rules('logo', lang('branches_logo'), "callback_file[logo," . $required . "]"); $this->form_validation->set_rules('header', lang('branches_header'), "trim"); $this->form_validation->set_rules('footer', lang('branches_footer'), "trim"); }
protected function onValidationEvent($op, $id = false) { $this->data['invoice_types'] = dd2menu('invoice_types', ['invoice_type_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '1'; $this->form_validation->set_rules('service_order_id', lang('service_orders_service_order_id'), "trim|required"); $this->form_validation->set_rules('serial', lang('service_orders_serial'), "trim|required"); $this->form_validation->set_rules('barcode', lang('service_orders_barcode'), "trim|required"); $this->form_validation->set_rules('mobile', lang('service_orders_mobile'), "trim|required"); $this->form_validation->set_rules('social_id', lang('service_orders_social_id'), "trim|required"); $this->form_validation->set_rules('invoice_id', lang('service_orders_invoice_id'), "trim|required"); $this->form_validation->set_rules('client_id', lang('service_orders_client_id'), "trim|required"); $this->form_validation->set_rules('branch_id', lang('service_orders_branch_id'), "trim|required"); $this->form_validation->set_rules('status', lang('service_orders_status'), "trim|required"); $this->form_validation->set_rules('timestamp', lang('service_orders_timestamp'), "trim|required"); $this->form_validation->set_rules('created_at', lang('service_orders_created_at'), "trim|required"); $this->form_validation->set_rules('logo', lang('branches_logo'), "callback_file[logo," . $required . "]"); }
protected function onValidationEvent($op, $id = false) { $this->data['service_providers'] = dd2menu('service_providers', ['service_provider_id' => name()]); $this->data['card_types'] = dd2menu('card_types', ['card_type_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '0'; $this->form_validation->set_rules('service_provider_id', lang('prepaid_card_types_service_provider_id'), "trim|required"); $this->form_validation->set_rules('card_type_id', lang('prepaid_card_types_card_type_id'), "trim|required"); $this->form_validation->set_rules('image', lang('prepaid_card_types_image'), "callback_file[image," . $required . "]"); $this->form_validation->set_rules('name_ar', lang('prepaid_card_types_name_ar'), "trim|required"); $this->form_validation->set_rules('name_en', lang('prepaid_card_types_name_en'), "trim|required"); $this->form_validation->set_rules('cost', lang('prepaid_card_types_cost'), "trim|required"); $this->form_validation->set_rules('price', lang('prepaid_card_types_price'), "trim|required"); $this->form_validation->set_rules('discount', lang('prepaid_card_types_discount'), "trim|required"); $this->form_validation->set_rules('employee_commission', lang('prepaid_card_types_employee_commission'), "trim|required"); $this->form_validation->set_rules('desc_ar', lang('prepaid_card_types_desc_ar'), "trim|required"); $this->form_validation->set_rules('desc_en', lang('prepaid_card_types_desc_en'), "trim|required"); $this->form_validation->set_rules('notes', lang('prepaid_card_types_notes'), "trim"); }
protected function onValidationEvent($op, $id = false) { $this->data['invoice_types'] = dd2menu('invoice_types', ['invoice_type_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '0'; $this->form_validation->set_rules('barcode', lang('services_barcode'), "trim|required"); $this->form_validation->set_rules('service_provider_id', lang('services_service_provider_id'), "trim|required"); $this->form_validation->set_rules('sim_type_id', lang('services_sim_type_id'), "trim|required"); $this->form_validation->set_rules('register', lang('services_register'), "trim|required"); $this->form_validation->set_rules('register_code', lang('services_register_code'), "trim|required"); $this->form_validation->set_rules('required', lang('services_required'), "trim|required"); $this->form_validation->set_rules('commision', lang('services_commision'), "trim|required"); $this->form_validation->set_rules('price', lang('services_price'), "trim|required"); $this->form_validation->set_rules('cost', lang('services_cost'), "trim|required"); $this->form_validation->set_rules('discount', lang('services_discount'), "trim|required"); $this->form_validation->set_rules('desc', lang('services_desc'), "trim|required"); $this->form_validation->set_rules('points', lang('services_points'), "trim|required"); // $this->form_validation->set_rules('logo', lang('branches_logo'), "callback_file[logo," . $required . "]"); }
public function index() { $this->load->library('order'); $this->load->library('form_validation'); $this->data['clients'] = dd2menu('clients', ['client_id' => 'name']); $this->form_validation->set_rules('save_data', lang('format_orders_save_data'), "trim|required"); $this->form_validation->set_rules('original_software', lang('format_orders_original_software'), "trim|required"); $this->form_validation->set_rules('mobile', lang('format_orders_mobile'), "trim|required"); $this->form_validation->set_rules('client_id', lang('format_orders_client_id'), "trim"); $this->form_validation->set_rules('password', lang('format_orders_password'), "trim"); $this->form_validation->set_rules('notes', lang('format_orders_notes'), "trim"); $this->form_validation->set_rules('paid', lang('format_orders_paid'), "trim|required"); if ($this->form_validation->run() == false) { $this->twiggy->set($this->data)->template('format_orders')->display(); } else { $invoice_code = $this->order->invoice_code(); $invoice_id = $this->order->createInvoice(['user_id' => $this->user->user_id, 'code' => $invoice_code, 'client_id' => 0, 'due' => config('format_price'), 'paid' => $this->input->post('paid'), 'branch_id' => $this->user->branch_id, 'invoice_status_id' => 1, 'created_at' => date("Y-m-d H:i:s")]); $vars = ['save_data' => $this->input->post('save_data'), 'original_software' => $this->input->post('original_software'), 'mobile' => $this->input->post('mobile'), 'client_id' => $this->input->post('client_id'), 'password' => $this->input->post('password'), 'notes' => $this->input->post('notes'), 'f_step_user_id' => $this->user->user_id, 'invoice_id' => $invoice_id, 'status' => 'in_progress', 'created_at' => now(), 'branch_id' => $this->user->branch_id, 'format_price' => config('format_price')]; $this->db->insert('format_orders', $vars); redirect(ADMIN . '/invoices/view/' . $invoice_id); // format_commission_first // format_commission_second } }
protected function onValidationEvent($op, $id = false) { $this->data['categories'] = dd2menu('categories', ['category_id' => name()]); $this->data['marks'] = dd2menu('marks', ['mark_id' => name()]); $config['upload_path'] = './cdn/' . $this->_table; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $this->load->library('upload', $config); $required = $op == 'add' ? '1' : '0'; $this->form_validation->set_rules('barcode', lang('products_barcode'), "trim|required"); $this->form_validation->set_rules('name_ar', lang('products_name_ar'), "trim|required"); $this->form_validation->set_rules('name_en', lang('products_name_en'), "trim|required"); $this->form_validation->set_rules('category_id', lang('products_category_id'), "trim|required"); $this->form_validation->set_rules('mark_id', lang('products_mark_id'), "trim|required"); $this->form_validation->set_rules('commission', lang('products_commission'), "trim|required"); $this->form_validation->set_rules('cost', lang('products_cost'), "trim|required"); $this->form_validation->set_rules('price', lang('products_price'), "trim|required"); $this->form_validation->set_rules('discount', lang('products_discount'), "trim|required"); $this->form_validation->set_rules('featured', lang('products_featured'), "trim|required"); $this->form_validation->set_rules('image', lang('products_image'), "callback_file[logo," . $required . "]"); $this->form_validation->set_rules('amount', lang('products_amount'), "trim|required"); $this->form_validation->set_rules('desc_en', lang('products_desc_en'), "trim|required"); $this->form_validation->set_rules('desc_ar', lang('products_desc_ar'), "trim|required"); $this->form_validation->set_rules('points', lang('products_points'), "trim|required"); }
'<td class="col-sm-9"><input type="text" name="file_comment[]"></td>' + '</tr>'); }); }); </script> </div> </div> <div class="form-group-separator"></div> <div class="form-group"> <label class="col-sm-2 control-label" for="field-1">Status</label> <div class="col-sm-10"> <?php foreach (dd2menu('status', array('status_id' => 'name'), FALSE, TRUE, array('status.name' => 'ASC')) as $key => $value) { ?> <label> <?php echo form_radio("status_id", $key, set_radio('status_id', $key, $item->status_id == $key ? TRUE : FALSE)); ?> <?php echo $value; ?> <br/> </label> <br> <?php } ?>
public function get_crops($id = null, $file_id = null) { $this->layout = 'ajax'; $arr = array(); if (json_decode($this->input->post('arr'))) { $arr = json_decode($this->input->post('arr')); } else { if ($file_id) { $arr = dd2menu('file_crops', array('file_crop_id' => 'crop_id'), array('file_id' => $file_id), TRUE); } } $this->db->order_by('crops.name'); foreach ($this->db->where('certificate_crops.certificate_id', $id)->join('certificate_crops', 'certificate_crops.crop_id = crops.crop_id')->get('crops')->result() as $item) { if (in_array($item->crop_id, $arr)) { echo '<input type="checkbox" name="crop_id[]" value="' . $item->crop_id . '" class="_crops" checked="checked"> ' . $item->name . '<br />'; } else { echo '<input type="checkbox" name="crop_id[]" value="' . $item->crop_id . '" class="_crops"> ' . $item->name . '<br />'; } } }
public function get_clients() { echo json_encode(['clients' => dd2menu('clients', ['client_id' => 'name'], false, ['' => lang('orders_select_client')])]); }
protected function onValidationEvent($op, $id = false) { $this->data['invoice_types'] = dd2menu('invoice_types', ['invoice_type_id' => name()]); $this->form_validation->set_rules('name', lang('usergroups_name'), "trim|required"); }
public function prepaid_cards($id = false) { echo json_encode(dd2menu('prepaid_card_types', ['prepaid_card_type_id' => name()], ['card_type_id' => $id])); }
<div class="col-sm-2"> Country </div> <div class="col-sm-4"> <?php echo form_dropdown('country', dd2menu('countries', array('country_id' => 'name')), set_value('country', $this->input->get('country')), 'class="form-control"'); ?> </div> <div class="col-sm-2"> Status </div> <div class="col-sm-4"> <?php echo form_dropdown('status', dd2menu('status', array('status_id' => 'name')), set_value('status', $this->input->get('status')), 'class="form-control"'); ?> </div> </div> <div class="form-group-separator"></div> <div class="form-group"> <div class="col-sm-2"> Serial </div> <div class="col-sm-4"> <?php echo form_input('serial', set_value('serial', $this->input->get('serial')), 'class="form-control" id="autocomplete"'); ?> </div>