コード例 #1
0
 public function init()
 {
     //Generate WareHouses Combo
     $warehouse = new Model_Warehouses();
     $result1 = $warehouse->getSupplierWarehouses();
     foreach ($result1 as $wh) {
         $this->_list["from_warehouse_id"][$wh['pk_id']] = $wh['warehouse_name'];
     }
     //Generate Item Combo
     $item_pack_size = new Model_ItemPackSizes();
     $result = $item_pack_size->getItemsAll();
     $this->_childlist["item_pack_size_id"][''] = "Select";
     if ($result) {
         $item_id = $result[0]->getPkId();
         foreach ($result as $row) {
             $this->_childlist["item_pack_size_id"][$row->getPkId()] = $row->getItemName();
         }
     }
     //Generate VVM Type Combo
     $vvmtypes = new Model_VvmTypes();
     $result3 = $vvmtypes->getAll();
     $this->_childlist["vvm_type_id"][''] = 'Select';
     foreach ($result3 as $vvmtype) {
         $this->_childlist["vvm_type_id"][$vvmtype['pk_id']] = $vvmtype['vvm_type_name'];
     }
     //Generate Purpose(activity_id) combo
     $stk_activities = new Model_StakeholderActivities();
     $result4 = $stk_activities->getAllStakeholderActivitiesIssues();
     if ($result4) {
         $stakeholder_id = $result4[0]['pkId'];
         foreach ($result4 as $stk_activity) {
             $this->_list["stakeholder_activity_id"][$stk_activity['pkId']] = $stk_activity['activity'];
         }
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "reference_number":
             case "description":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "expected_arrival_date":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "transaction_number":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option"))))));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }
コード例 #2
0
 /**
  * @name $getWarehousesByLevel
  * @param int $level
  * 
  * This service will return warehouses by level
  * 
  * @author Ajmal Hussain <*****@*****.**>
  */
 public function getWarehousesByLevelAction()
 {
     $level = $this->_request->getParam('level', '');
     if (!empty($level)) {
         $wh = new Model_Warehouses();
         $result = $wh->getWarehousesByLevel($level);
     } else {
         $result = array("error" => "Please provide level param. e.g. (?level=2)");
     }
     echo Zend_Json::encode($result);
 }
コード例 #3
0
 public function init()
 {
     //Generate Products(items) Combo
     $item_pack_sizes = new Model_ItemPackSizes();
     $result2 = $item_pack_sizes->getAllItems();
     $this->_list["product"][''] = "Select";
     foreach ($result2 as $item) {
         $this->_list["product"][$item['pkId']] = $item['itemName'];
     }
     $warehouses = new Model_Warehouses();
     $result3 = $warehouses->getUserReceiveFromWarehouse();
     foreach ($result3 as $whs) {
         $this->_list["warehouses"][''] = "Select";
         $this->_list["warehouses"][$whs['pkId']] = $whs['warehouseName'];
     }
     $date_from = date('01/m/Y');
     $date_to = date('d/m/Y');
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "number":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "date_from":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $date_from));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "date_to":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $date_to));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
         //Generate Purpose(activity_id) combo
         $stk_activities = new Model_StakeholderActivities();
         $result4 = $stk_activities->getAllStakeholderActivitiesIssues();
         if ($result4) {
             $stakeholder_id = $result4[0]['pkId'];
             foreach ($result4 as $stk_activity) {
                 $this->_list["activity_id"][''] = "Select";
                 $this->_list["activity_id"][$stk_activity['pkId']] = $stk_activity['activity'];
             }
         }
     }
 }
コード例 #4
0
 public function addReportDatesAction()
 {
     $form = new Form_Iadmin_UpdateCluster();
     if ($this->_request->isPost()) {
         $form_values = $this->_request->getPost();
         if ($form_values['search'] == 'search') {
             $warehouses = new Model_Warehouses();
             $warehouses->form_values = $form_values;
             $form->province->setValue($form_values['province']);
             $form->province_hidden->setValue($form_values['province']);
             $form->district_hidden->setValue($form_values['district']);
             $form->user_hidden->setValue($form_values['user']);
             $warehouse_data = $warehouses->getAllWarehousesReportDate();
             $this->view->data = $warehouse_data;
         } else {
             $form_values_submit = $this->_request->getPost();
             if ($form_values_submit['check'] != "") {
                 foreach ($form_values_submit['check'] as $warehouse_id) {
                     $warehouses_db = $this->_em->getRepository('Warehouses')->find($warehouse_id);
                     if ($form_values_submit['from_edit'] != "") {
                         $warehouses_db->setFromEdit(new \DateTime(App_Controller_Functions::dateToDbFormat($form_values_submit['from_edit'])));
                     }
                     if ($form_values_submit['starting_on'] != "") {
                         $warehouses_db->setStartingOn(new \DateTime(App_Controller_Functions::dateToDbFormat($form_values_submit['starting_on'])));
                     }
                     if ($form_values_submit['working_uptil'] != "") {
                         $warehouses_db->setWorkingUptill(new \DateTime(App_Controller_Functions::dateToDbFormat($form_values_submit['working_uptil'])));
                     }
                 }
                 $created_by = $this->_em->find('Users', $this->_user_id);
                 $warehouses_db->setCreatedBy($created_by);
                 $warehouses_db->setCreatedDate(App_Tools_Time::now());
                 $warehouses_db->setModifiedBy($created_by);
                 $warehouses_db->setModifiedDate(App_Tools_Time::now());
                 $this->_em->persist($warehouses_db);
                 $this->_em->flush();
             }
         }
     }
     $this->view->form = $form;
 }
コード例 #5
0
 public function init()
 {
     //Generate WareHouses Combo
     $warehouse = new Model_Warehouses();
     $result1 = $warehouse->getSupplierWarehouses();
     $this->_list["from_warehouse_id"][""] = 'Select';
     foreach ($result1 as $wh) {
         $this->_list["from_warehouse_id"][$wh['pk_id']] = $wh['warehouse_name'];
     }
     //Generate Item Combo
     $item_pack_size = new Model_ItemPackSizes();
     $result = $item_pack_size->getItemsAll();
     $this->_list["item_pack_size_id"][''] = "Select";
     if ($result) {
         $item_id = $result[0]->getPkId();
         foreach ($result as $row) {
             $this->_list["item_pack_size_id"][$row->getPkId()] = $row->getItemName();
         }
     }
     $from_date = date('01/m/Y');
     $to_date = date('d/m/Y');
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "from_date":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $from_date));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "to_date":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $to_date));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option"))))));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }
コード例 #6
0
 public function targetIssuancePrintAction()
 {
     $this->_helper->layout->setLayout("print");
     $this->view->headTitle("Vaccine Balance");
     //$res = $this->_request->getPost();
     $stock_master = new Model_StockMaster();
     $stock_master->form_values['month'] = $this->_request->m;
     $stock_master->form_values['year'] = $this->_request->y;
     $stock_master->form_values['warehouse_id'] = $this->_request->w;
     $result = $stock_master->targetIssuanceSearch();
     $warehouses = new Model_Warehouses();
     $issue_warehouse_name = $warehouses->getWarehouseNameByWarehouseId($this->_request->w);
     $this->view->i_warehousename = $issue_warehouse_name;
     $this->view->m = $this->_request->m;
     $this->view->y = $this->_request->y;
     // Logged in Warehouse
     $this->view->warehousename = $this->_identity->getWarehouseName();
     $this->view->result = $result;
 }
コード例 #7
0
 public function init()
 {
     //Generate Provinces Combo
     $locations = new Model_Locations();
     $provinces = $locations->getAllProvinces();
     $this->_list["combo1"][''] = "Select";
     $this->_list["combo1_add"][''] = "Select";
     if ($provinces) {
         foreach ($provinces as $row) {
             $this->_list["combo1"][$row['pkId']] = $row['locationName'];
             $this->_list["combo1_add"][$row['pkId']] = $row['locationName'];
         }
     }
     $this->_list["combo2_add"][''] = "Select Province";
     $this->_list["combo2"][''] = "Select Province";
     //Generate Facility Type Combo
     $warehouse = new Model_Warehouses();
     $warehouse->form_values['stakeholder_id'] = 1;
     $wh_types = $warehouse->getAllHealthFacilityTypesByStakeholder();
     $this->_list["facility_type"][''] = "Select";
     if ($wh_types) {
         foreach ($wh_types as $row) {
             $this->_list["facility_type"][$row['pkId']] = $row['warehouseTypeName'];
         }
     }
     $this->_list["year"][''] = "Select";
     $yy = date('Y');
     $end_year = 2014;
     for ($i = $yy; $i >= $end_year; $i = $i - 1) {
         $this->_list["year"][$i] = $i;
     }
     $campaign = new Model_Campaigns();
     $result1 = $campaign->allCampaigns();
     $this->_list["campaign_id"][''] = 'Select';
     foreach ($result1 as $row) {
         $this->_list["campaign_id"][$row['pkId']] = $row['campaignName'];
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             /* case "abc":
                $this->addElement("text", $col, array(
                "attribs" => array("class" => "form-control"),
                "allowEmpty" => true,
                "filters" => array("StringTrim", "StripTags"),
                "validators" => array()
                ));
                $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                break; */
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option"))))));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
     foreach ($this->_hidden as $col => $name) {
         switch ($col) {
             case "district_id_hidden":
                 $this->addElement("hidden", $col);
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
     }
 }
コード例 #8
0
 public function levelCombosFourAction()
 {
     $this->_helper->layout->disableLayout();
     if (isset($this->_request->combo3) && !empty($this->_request->combo3)) {
         $tehsil_id = $this->_request->combo3;
         $warehouse = new Model_Warehouses();
         $warehouse->form_values = array('parent_id' => $tehsil_id, 'geo_level_id' => 6);
         //$this->view->result = $location->getLocationsByLevelByTehsil();
         $this->view->result = $warehouse->getUCWarehousesofTehsil();
     }
 }
コード例 #9
0
 public function init()
 {
     //Generate WareHouses Combo
     $warehouse = new Model_Warehouses();
     $result1 = $warehouse->getSupplierWarehouses();
     foreach ($result1 as $wh) {
         $this->_list["from_warehouse_id"][$wh['pk_id']] = $wh['warehouse_name'];
     }
     //Generate Purpose(activity_id) combo
     $stk_activities = new Model_StakeholderActivities();
     $result4 = $stk_activities->getAllStakeholderActivitiesIssues();
     if ($result4) {
         $stakeholder_id = $result4[0]['pkId'];
         foreach ($result4 as $stk_activity) {
             $this->_list["activity_id"][$stk_activity['pkId']] = $stk_activity['activity'];
         }
     }
     // Generate Status Combo
     $this->_list["status"]['Received'] = 'Received';
     $this->_list["status"]['Pre Shipment Alert'] = 'Pre Shipment Alert';
     $this->_list["status"]['PO'] = 'PO';
     $this->_list["status"]['Tender'] = 'Tender';
     //Generate Products(items) Combo
     $sips = new Model_StakeholderItemPackSizes();
     $sips->form_values['stakeholder_id'] = $stakeholder_id;
     $result2 = $sips->getAllProductsByStakeholderType();
     $this->_list["item_id"][""] = "Select";
     if ($result2) {
         //$item_id = $result2[0]['item_pack_size_id'];
         foreach ($result2 as $item) {
             $this->_list["item_id"][$item['item_pack_size_id']] = $item['item_name'];
         }
     }
     $this->_list["vvm_stage"][""] = "NA";
     $this->_list["manufacturer_id"][""] = "Select";
     //Generate manufacturer Combo
     /* $stakeholder_items = new Model_Stakeholders();
        $stakeholder_items->form_values['item_id'] = $item_id;
        $associated = $stakeholder_items->getManufacturerByProduct();
        if ($associated) {
        foreach ($associated as $row) {
        $this->_list["manufacturer_id"][$row['pkId']] = $row['stakeholderName'];
        }
        } */
     //Generate VVM Type Combo
     $vvmtypes = new Model_VvmTypes();
     $result3 = $vvmtypes->getAll();
     $this->_list["vvm_type_id"][''] = 'Select';
     foreach ($result3 as $vvmtype) {
         $this->_list["vvm_type_id"][$vvmtype['pk_id']] = $vvmtype['vvm_type_name'];
     }
     //Generate Asset Sub Type Combo
     $cold_chain = new Model_ColdChain();
     $cold_chain->form_values = array('type_id' => '1,3');
     $result3 = $cold_chain->getColdchainByAssetType();
     $this->_list["cold_chain"][''] = "Select Cold Chain";
     foreach ($result3 as $assetsubtype) {
         $this->_list["cold_chain"][$assetsubtype['pk_id']] = $assetsubtype['asset_name'] . " - " . $assetsubtype['make_name'];
     }
     //Generate Campaigns Combo
     /*
               $campaigns = new Model_Campaigns();
               $result4 = $campaigns->allCampaignsFutureDate();
               $this->_list["campaign_id"][''] = "Select";
               foreach ($result4 as $campaign_one) {
               $this->_list["campaign_id"][$campaign_one['pkId']] = $campaign_one['campaignName'];
               } */
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "transaction_reference":
             case "number":
             case "unit_price":
             case "quantity":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "comments":
                 $this->addElement("textarea", $col, array("attribs" => array("class" => "form-control", "rows" => "2"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "shipment_date":
             case "production_date":
             case "expiry_date":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "transaction_number":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         //if ($col == "manufacturer_id") {
         //  $attribute_class = "col-md-2 form-control input-small";
         //} else {
         $attribute_class = "form-control";
         //}
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "{$attribute_class}"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option"))))));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
     foreach ($this->_hidden as $col => $name) {
         switch ($col) {
             case "hdn_transaction_date":
                 $this->addElement("hidden", $col);
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
     }
 }
コード例 #10
0
 public function ajaxGetServicesTypeAction()
 {
     $this->_helper->layout->disableLayout();
     $form_values = $this->_request->wh_id;
     $warehouses = new Model_Warehouses();
     $warehouses->form_values = $form_values;
     $result = $warehouses->getServicesTypes();
     $this->view->result = $result;
 }
コード例 #11
0
 public function getExplorerReport()
 {
     $warehouse_data = new Model_WarehousesData();
     $warehouses = new Model_Warehouses();
     $reports = new Model_Reports();
     $temp = $this->temp;
     $temp = base64_decode(substr($temp, 1, strlen($temp) - 1));
     $temp = explode("|", $temp);
     $wh_id = $temp[0];
     $loc_id = $temp[1];
     $report_date = $temp[2];
     $is_new_report = $temp[3];
     $tt = explode("-", $report_date);
     $yy = $tt[0];
     $mm = $tt[1];
     $dd = $tt[2];
     if ($mm == '1') {
         $month = "Jan";
     }
     if ($mm == '2') {
         $month = "Feb";
     }
     if ($mm == '3') {
         $month = "Mar";
     }
     if ($mm == '4') {
         $month = "Apr";
     }
     if ($mm == '5') {
         $month = "May";
     }
     if ($mm == '6') {
         $month = "Jun";
     }
     if ($mm == '7') {
         $month = "Jul";
     }
     if ($mm == '8') {
         $month = "Aug";
     }
     if ($mm == '9') {
         $month = "Sep";
     }
     if ($mm == '10') {
         $month = "Oct";
     }
     if ($mm == '11') {
         $month = "Nov";
     }
     if ($mm == '12') {
         $month = "Dec";
     }
     $warehouses->form_values['pk_id'] = $wh_id;
     $stakeholder_id = $warehouses->getStakeholderIdByWarehouseId();
     if ($is_new_report == 1) {
         $prev_month_date = $reports->getPreviousMonthReportDate($report_date);
     } else {
         $prev_month_date = $report_date;
     }
     $warehouses->form_values['location_id'] = $loc_id;
     $uc_centers = $warehouses->getAllUCCenters();
     $warehouse_data->form_values['warehouse_id'] = $wh_id;
     $reports = $warehouse_data->getMonthYearByWarehouseId();
     $warehouse_level = $warehouses->getWarehouseLevelById();
     $array_data = array('wh_id' => $wh_id, 'loc_id' => $loc_id, 'rpt_date' => $report_date, 'is_new_rpt' => $is_new_report, 'yy' => $yy, 'mm' => $mm, 'dd' => $dd, 'prev_month_date' => $prev_month_date, 'stakeholder_id' => $stakeholder_id, 'month' => $month, 'warehouse_level' => $warehouse_level);
     return $array_data;
 }
コード例 #12
0
 public function printStockReportAction()
 {
     $this->_helper->layout->setLayout('print');
     $wh = new Model_Warehouses();
     $stock_master = new Model_StockMaster();
     $stock_master->form_values = $this->_request->getParams();
     $this->view->headTitle("Stock Balance Report");
     $this->view->print_title = "Stock Balance Report";
     $this->view->month = $this->_request->getParam('month', date("m"));
     $this->view->year = $this->_request->getParam('year', date("Y"));
     $this->view->result = $stock_master->getStockReportByDate();
     $this->view->username = $this->_identity->getUserName();
     $this->view->warehousename = $wh->getWarehouseNameByWarehouseId($this->_request->getParam('warehouse'));
 }
コード例 #13
0
 public function init()
 {
     $list_detail = new Model_ListDetail();
     $list_detail->form_values['master_id'] = Model_ListMaster::GRID_ELECTRICITY_AVAL;
     $result = $list_detail->getListDetailByMasterId();
     foreach ($result as $list) {
         $this->_list["grid_electricity_availibility"][''] = 'Select';
         $this->_list["grid_electricity_availibility"][$list['pkId']] = $list['listValue'];
     }
     $warehouse = new Model_Warehouses();
     $res_warehouse = $warehouse->getHealthFacilityTypes();
     foreach ($res_warehouse as $row) {
         //  $this->_checkbox["vaccine_supply_mode"][$list12['pkId']] = $list12['listValue'];
         $this->_list["health_facility_type"][''] = 'Select';
         $this->_list["health_facility_type"][$row['pkId']] = $row['warehouseTypeName'];
     }
     $list_detail->form_values['master_id'] = Model_ListMaster::VACCINATION_STAFF;
     $result1 = $list_detail->getListDetailByMasterId();
     foreach ($result1 as $list1) {
         $this->_checkbox["epi_vaccination_staff"][$list1['pkId']] = $list1['listValue'];
     }
     $list_detail->form_values['master_id'] = Model_ListMaster::Service_Types;
     $result13 = $list_detail->getListDetailByMasterId();
     foreach ($result13 as $list13) {
         $this->_checkbox["services_type"][$list13['pkId']] = $list13['listValue'];
     }
     $list_detail->form_values['master_id'] = Model_ListMaster::Vaccine_Supply_Mode;
     $result12 = $list_detail->getListDetailByMasterId();
     foreach ($result12 as $list12) {
         //  $this->_checkbox["vaccine_supply_mode"][$list12['pkId']] = $list12['listValue'];
         $this->_list["vaccine_supply_mode"][''] = 'Select';
         $this->_list["vaccine_supply_mode"][$list12['pkId']] = $list12['listValue'];
     }
     $list_detail->form_values['master_id'] = Model_ListMaster::SOLAR_ENERGY;
     $result2 = $list_detail->getListDetailByMasterId();
     foreach ($result2 as $list2) {
         $this->_checkbox["solar_energy"][$list2['pkId']] = $list2['listValue'];
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "routine_immunization_ice_pack":
             case "snid_nid_ice_pack":
             case "vaccine_supply_mode":
             case "facility_total_population":
             case "live_birth_per_year":
             case "pregnant_women_per_year":
             case "women_of_child_bearing_age":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "estimation_year":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
         if (in_array($col, array_keys($this->_checkbox))) {
             $this->addElement("checkbox", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_checkbox[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
     foreach ($this->_hidden as $col => $name) {
         switch ($col) {
             case "old_warehouse_val":
             case "office_level":
                 $this->addElement("hidden", $col);
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
     }
 }
コード例 #14
0
 public function getTempStock()
 {
     $str_sql = $this->_em->createQueryBuilder()->select('sm.transactionNumber AS transaction_number,
                     sm.transactionReference AS transaction_reference,
                     sm.transactionDate AS transaction_date,
                     sm.pkId AS pk_id,
                     ws.pkId AS from_warehouse_id,
                     ws.warehouseName AS warehouse_name
                     ')->from("StockMaster", "sm")->join("sm.fromWarehouse", "ws")->where("sm.createdBy = " . $this->_user_id)->andWhere("ws.status = 1");
     if ($this->form_values['transaction_type_id'] == 1) {
         $str_sql->andWhere("sm.toWarehouse =  " . $this->_identity->getWarehouseId());
     } else {
         $str_sql->andWhere("sm.fromWarehouse = " . $this->_identity->getWarehouseId());
     }
     $str_sql->andWhere("sm.transactionType = " . $this->form_values['transaction_type_id'])->andWhere("sm.draft = 1 ");
     //echo $str_sql->getQuery()->getSql();
     //exit;
     $row = $str_sql->getQuery()->getResult();
     if (!empty($row) && count($row) > 0) {
         $warehouses = new Model_Warehouses();
         $arr_data['warehouse_name'] = $warehouses->getWarehouseNameByWarehouseId($row[0]['from_warehouse_id']);
         $arr_data['transaction_date'] = App_Controller_Functions::dateToUserFormat($row[0]['transaction_date']);
         $arr_data['transaction_number'] = $row[0]['transaction_number'];
         $arr_data['transaction_reference'] = $row[0]['transaction_reference'];
         $arr_data['stock_id'] = $row[0]['pk_id'];
         return $arr_data;
     } else {
         return false;
     }
 }
コード例 #15
0
    public function allLevelComboAllColdChainEquipment($office_term = "", $postfix = null, $data_array)
    {
        $identity = App_Auth::getInstance();
        $translate = Zend_Registry::get('Zend_Translate');
        $base_url = Zend_Registry::get('baseurl');
        $user_lvl = $identity->getUserLevel($identity->getIdentity());
        $stakeholder_id = $identity->getStakeholderId();
        $warehouse = new Model_Warehouses();
        $office = $data_array["level"];
        $province = $data_array["province"];
        $district = $data_array["district"];
        $warehouse_id = $data_array["warehouse"];
        if ($office == 1) {
            $warehouse->form_values = array('stakeholder_id' => $stakeholder_id);
            switch ($office) {
                case 1:
                    $warehouse_array = $warehouse->getFederalWarehouses();
                    break;
            }
        }
        if (!empty($province)) {
            $locations = new Model_Locations();
            $locations->form_values = array('parent_id' => 10, 'geo_level_id' => 2);
            $provinces_array = $locations->getLocationsByLevel();
            if (empty($district)) {
                $warehouse->form_values = array('province_id' => $province, 'stakeholder_id' => $stakeholder_id);
                switch ($office) {
                    case 1:
                        $warehouse_array = $warehouse->getFederalWarehouses();
                        break;
                    case 2:
                        $warehouse_array = $warehouse->getProvincialWarehouses();
                        break;
                    case 4:
                        $warehouse_array = $warehouse->getDistrictWarehousesofProvince();
                        break;
                }
            }
        }
        if (!empty($district)) {
            $location = new Model_Locations();
            $location->form_values = array('province_id' => $province, 'geo_level_id' => 4);
            $districts_array = $location->getLocationsByLevelByProvince();
            $warehouse->form_values = array('district_id' => $district, 'stakeholder_id' => $stakeholder_id);
            switch ($office) {
                case 5:
                    $warehouse_array = $warehouse->getTehsilWarehousesofDistrict();
                    break;
                case 6:
                    $warehouse_array = $warehouse->getUCWarehousesofDistrict();
                    break;
                case 8:
                    $warehouse_array = $warehouse->getTehsilWarehousesofDistrict();
                    break;
                case 9:
                    $warehouse_array = $warehouse->getUCWarehousesofDistrict();
                    break;
            }
        }
        switch ($user_lvl) {
            case 1:
            case 2:
            case 3:
                $arr_levels = array('1' => $translate->translate('National'), '2' => $translate->translate('Province'), '4' => $translate->translate('District'), '8' => $translate->translate('Tehsil-Taluka'), '9' => $translate->translate('UC'));
                break;
            case 4:
                $arr_levels = array('1' => $translate->translate('National'), '2' => $translate->translate('Province'), '4' => $translate->translate('District'), '8' => $translate->translate('Tehsil-Taluka'), '9' => $translate->translate('UC'));
                break;
            case 5:
                $arr_levels = array('2' => $translate->translate('National'), '4' => $translate->translate('District'));
                break;
            case 6:
                $arr_levels = array('2' => $translate->translate('Province'), '5' => $translate->translate('Tehsil-Taluka'), '6' => $translate->translate('Union Council'));
                break;
            case 7:
                $arr_levels = array('7' => $translate->translate('District'), '6' => $translate->translate('Union Council'));
            case 8:
                $arr_levels = array('7' => $translate->translate('District'), '5' => $translate->translate('Tehsil-Taluka'), '6' => $translate->translate('Union Council'));
                break;
            default:
                $arr_levels = array('1' => $translate->translate('National'), '2' => $translate->translate('Province'), '4' => $translate->translate('District'), '5' => $translate->translate('Tehsil-Taluka'), '6' => $translate->translate('Union Council'));
                break;
        }
        ?>
        <div class="row">
            <div class="col-md-12" id="all_level_combo">
                <div class="col-md-3">
                    <div class="control-group">
                        <label class="control-label" for="office" class="col-md-7"><?php 
        echo $translate->translate("Level");
        ?>
</label>
                        <div class="controls">
                            <select name="office" id="office<?php 
        echo $postfix;
        ?>
" class="form-control">
                                <option value=""><?php 
        echo $translate->translate("Select");
        ?>
</option>
                                <?php 
        foreach ($arr_levels as $key => $value) {
            ?>
                                    <option value="<?php 
            echo $key;
            ?>
" <?php 
            if (!empty($office) && $key == $office) {
                echo 'selected';
            }
            ?>
><?php 
            echo $value;
            ?>
</option>
                                <?php 
        }
        ?>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-md-3" id="div_combo1<?php 
        echo $postfix;
        ?>
" <?php 
        if ($office == 2 || !empty($province)) {
            ?>
 style="display:block;" <?php 
        } else {
            ?>
 style="display:none;"<?php 
        }
        ?>
>
                    <label class="control-label" id="lblcombo1"><?php 
        echo $translate->translate("Province");
        ?>
 </label>
                    <div class="controls">
                        <select name="combo1" id="combo1<?php 
        echo $postfix;
        ?>
" class="form-control">
                            <?php 
        if ($provinces_array != false) {
            ?>
                                <option value=""><?php 
            echo $translate->translate("Select");
            ?>
</option>
                                <?php 
            foreach ($provinces_array as $row) {
                ?>
                                    <option value="<?php 
                echo $row['key'];
                ?>
" <?php 
                if (!empty($province) && $row['key'] == $province) {
                    echo 'selected';
                }
                ?>
>
                                        <?php 
                echo $row['value'];
                ?>
</option>
                                    <?php 
            }
        }
        ?>
                        </select>
                    </div>
                </div>	
                <div class="col-md-3" id="div_combo2<?php 
        echo $postfix;
        ?>
" <?php 
        if ($office == 5 || !empty($district)) {
            ?>
 style="display:block;" <?php 
        } else {
            ?>
 style="display:none;"<?php 
        }
        ?>
>
                    <label class="control-label" id="lblcombo2"><?php 
        echo $translate->translate("District");
        ?>
 </label>
                    <div class="controls">
                        <select name="combo2" id="combo2<?php 
        echo $postfix;
        ?>
" class="form-control">
                            <?php 
        if ($districts_array != false) {
            ?>
                                <option value=""><?php 
            echo $translate->translate("Select");
            ?>
</option>
                                <?php 
            foreach ($districts_array as $row) {
                ?>
                                    <option value="<?php 
                echo $row['key'];
                ?>
" <?php 
                if (!empty($district) && $row['key'] == $district) {
                    echo 'selected';
                }
                ?>
>
                                        <?php 
                echo $row['value'];
                ?>
</option>
                                    <?php 
            }
        }
        ?>
                        </select>
                    </div>
                </div>
                <div class="col-md-3" id="wh_combo<?php 
        echo $postfix;
        ?>
" <?php 
        /*if (!empty($warehouse_id)) { ?> style="display:block;" <?php } else { ?> style="display:none;"<?php } */
        ?>
>
                    <label class="control-label" id="wh_l"><?php 
        echo $translate->translate("Warehouse");
        ?>
 <span class="red">*</span></label>
                    <div class="controls">
                        <select name="warehouse<?php 
        echo $postfix;
        ?>
" id="warehouse<?php 
        echo $postfix;
        ?>
" class="form-control">
                            <?php 
        if ($warehouse_array != false) {
            ?>
                                <option value=""><?php 
            echo $translate->translate("Select");
            ?>
</option>
                                <?php 
            foreach ($warehouse_array as $row) {
                ?>
                                    <option value="<?php 
                echo $row['key'];
                ?>
" <?php 
                if (!empty($warehouse_id) && $row['key'] == $warehouse_id) {
                    echo 'selected';
                }
                ?>
>
                                        <?php 
                echo $row['value'];
                ?>
</option>
                                    <?php 
            }
        }
        ?>

                        </select>
                    </div>
                </div>
                <div class="col-md-1" id="loader<?php 
        echo $postfix;
        ?>
" style="display:none;"><img src="<?php 
        echo $base_url;
        ?>
/images/loader.gif" style="margin-top:8px; float:left" alt="" /></div>
            </div>
        </div>
        <?php 
        return true;
    }
コード例 #16
0
 public function getDefaultWarehouseByLevelAction()
 {
     $this->_helper->layout->disableLayout();
     $form_values = $this->_request->getPost();
     $warehouse = new Model_Warehouses();
     $warehouse->form_values = $form_values;
     $result = $warehouse->getDefaultWarehouseByLevel();
     $this->view->data = $result;
 }
コード例 #17
0
 public function distributionRefrigeratorByModelByFTypeAction()
 {
     ini_set('memory_limit', '128M');
     $this->_helper->layout->setLayout('reports');
     $header = '';
     $header .= 'Model';
     //$header1 = '#rspan';
     $cspan = '#cspan';
     $width = '60';
     $ro = 'ro';
     $align = "left";
     $data_arr = array();
     $search_form = new Form_ReportsSearch();
     $cold_chain = new Model_ColdChain();
     $form_values['facility_type'] = $this->_request->getParam('facility_type', '');
     $form_values['office'] = $this->_request->getParam('office', '');
     $form_values['combo1'] = $this->_request->getParam('combo1', '');
     $form_values['combo2'] = $this->_request->getParam('combo2', '');
     if ($this->_request->isPost()) {
         if ($search_form->isValid($this->_request->getPost())) {
             $form_values = array_merge($form_values, $search_form->getValues());
             $cold_chain->form_values = $form_values;
             $qry_res = $cold_chain->getColdchainModelsByFacilityType();
             $warehouse = new Model_Warehouses();
             $warehouse_asset_types = $warehouse->getWarehouseByAssetType();
             foreach ($qry_res as $row) {
                 $data_arr[$row['pk_id']][] = $row['ccm_model_name'];
                 $count = 1;
                 foreach ($warehouse_asset_types as $warehouse_asset_type) {
                     $data_arr[$row['pk_id']][$warehouse_asset_type['warehouse_type_id']] = 0;
                 }
             }
             foreach ($warehouse_asset_types as $row2) {
                 $header .= ',' . $row2['warehouse_type_name'];
                 //$header1 .= ',#rspan';
                 $cspan .= ',#cspan';
                 $width .= ',*';
                 $ro .= ',ro';
                 $align .= ',right';
                 $warehouse_warehouse_types = $cold_chain->getColdChainByWarehouseType($row2['warehouse_type_id']);
                 $count = 1;
                 foreach ($warehouse_warehouse_types as $warehouse_warehouse_type) {
                     if ($data_arr[$warehouse_warehouse_type['pk_id']][0] && $data_arr[$warehouse_warehouse_type['pk_id']][0] != "") {
                         $data_arr[$warehouse_warehouse_type['pk_id']][$row2['warehouse_type_id']] = $warehouse_warehouse_type['TotalAssets'];
                     }
                 }
             }
         }
     }
     if ($data_arr && count($data_arr) > 0) {
         $xmlstore = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
         $xmlstore .= "<rows>";
         foreach ($data_arr as $item => $sub_arr) {
             $xmlstore .= "<row>";
             if (array_key_exists('0', $sub_arr)) {
                 $xmlstore .= "<cell>" . $sub_arr[0] . "</cell>";
             } else {
                 $xmlstore .= "<cell> - </cell>";
             }
             foreach ($sub_arr as $key => $value) {
                 if ($key > 0) {
                     $xmlstore .= "<cell style=\"text-align:right\">" . number_format($value) . "</cell>";
                 }
             }
             $xmlstore .= "</row>";
         }
         $xmlstore .= "</rows>";
     } else {
         $xmlstore = "";
     }
     $this->view->main_heading = "CCEM Reports";
     $this->view->report_title = "Distribution of Refrigerators/Freezers by Model and Facility Type";
     $this->view->data = $data_arr;
     $this->view->headers = $header;
     $this->view->width = $width;
     $this->view->ro = $ro;
     $this->view->cspan = $cspan;
     $this->view->xmlstore = $xmlstore;
     $this->view->search_form = $search_form;
     $this->view->form_values = $form_values;
     $this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo_report_graph.js');
 }
コード例 #18
0
 public function checkCcmWarehouseUpdateAction()
 {
     $this->_helper->layout->disableLayout();
     $form_values = $this->_request->getPost();
     $warehouse = new Model_Warehouses();
     $warehouse->form_values = $form_values;
     $result = $warehouse->checkCcmWarehouseIdUpdate();
     $this->view->result = $result;
 }
コード例 #19
0
 public function dsStockPlacementComparisonPrintAction()
 {
     $this->_helper->layout->setLayout('print');
     $this->view->headTitle("Dry Store Stock Placement Comparison");
     $this->view->print_title = "Dry Store Stock Placement Comparison";
     $wh_id = $this->_request->getParam('id');
     $stock_batch = new Model_StockBatch();
     $stock_batch->form_values['wh_id'] = $wh_id;
     $batch_total = $stock_batch->dsBatchProductTotal();
     $this->view->batch_total = $batch_total;
     $stakeholder_total = $stock_batch->dsStakeholderProductTotal();
     $this->view->stakeholder_total = $stakeholder_total;
     $priority_total = $stock_batch->dsPlacementProductTotal();
     $this->view->priority_total = $priority_total;
     $warehouse = new Model_Warehouses();
     $wh_name = $warehouse->getWarehouseNameByWarehouseId($wh_id);
     $this->view->warehousename = $wh_name;
     $this->view->warehouseid = $wh_id;
 }