function transfer_feedback() { $id = F3::get("PARAMS.id"); $vehicle = new Axon("vehicle"); $vehicle->load(array('id=:id', array(':id' => $id))); $zone_id = $vehicle->zone_id; $wheeler = $vehicle->wheeler; $dates = $vehicle->date; $date = DB::sql("SELECT DATE_ADD( date, INTERVAL 15 DAY ) AS ds FROM vehicle WHERE id='{$id}' and date='{$dates}'"); $dt = new Form_elements(); $nepDate = $dt->dateConvertEn($date[0]["ds"]); // var_dump($date[0]["ds"]);die; //echo $nepDate;die; $zone = Admin::getZone($vehicle->zone_id); $symbol = Admin::getSymbolType($vehicle->vehicle_symbol_type); $vehicleNo = $zone . $vehicle->lot_number . $symbol . $vehicle->number; $zone = new Axon("zonal_office"); if ($zone->found(array('zone_id=:id and wheeler=:vid', array(':id' => $zone_id, ':vid' => $wheeler))) > 0) { $zone->load(array('zone_id=:id and wheeler=:vid', array(':id' => $zone_id, ':vid' => $wheeler))); $photos = new Axon("owner_photo"); if ($photos->found(array('vehicle_id =:id', array(':id' => $id)))) { $photos->load(array('vehicle_id =:id', array(':id' => $id))); F3::set('pic', $photos); } else { F3::set('pic', 'no photo available'); } F3::set('date', $nepDate); F3::set('refer', $id); F3::set('vehicle', $vehicleNo); F3::set('value', $zone->name); F3::set('navUser', 'userNav'); F3::set('template', 'feedbacktransfer'); echo Template::serve("template/layout.html"); } else { $photos = new Axon("owner_photo"); if ($photos->found(array('vehicle_id =:id', array(':id' => $id)))) { $photos->load(array('vehicle_id =:id', array(':id' => $id))); F3::set('pic', $photos); } else { F3::set('pic', 'no photo available'); } F3::set('date', $nepDate); F3::set('refer', $id); F3::set('navUser', 'userNav'); F3::set('value', 'no office available'); F3::set('template', 'feedbacktransfer'); echo Template::serve("template/layout.html"); } }
function transfer() { if (!F3::get('SESSION.onlineUser')) { F3::reroute("/"); } $dateNep = new Form_elements(); //transfer information of the vehicle $id = date('siGjnty') . rand(1, 100); $ip_address = $_SERVER['REMOTE_ADDR']; $wheeler = F3::get("POST.wheeler"); $zone_id = F3::get("POST.zone_id"); $lot_number = F3::get("POST.lot_number"); $vehicle_symbol_type = $wheeler == 21 ? F3::get("POST.vehicle_symbol_type_two") : F3::get("POST.vehicle_symbol_type_four"); $number = F3::get("POST.number"); $vehicleid = $this->vehicleid($wheeler, $zone_id, $lot_number, $vehicle_symbol_type, $number); $reason = F3::get("POST.reason"); $dates = F3::get("POST.date"); $date = $dateNep->dateConvertEn($dates); $remarks = F3::get("POST.remarks"); $witness_name = F3::get("POST.witness_name"); $witness_address = F3::get("POST.witness_address"); $citizenship_no = F3::get("POST.citizenship_no"); //owner information $owner_type = F3::get("POST.owner_type"); $first_name = F3::get("POST.first_name"); $last_name = F3::get("POST.last_name"); $father_name = F3::get("POST.father_name"); $grandfather_name = F3::get("POST.grandfather_name"); $dob = F3::get("POST.dob"); $reg_num = F3::get("POST.reg_num"); $email = F3::get("POST.email"); $mobile = F3::get("POST.mobileno"); $p_zone_id = F3::get("POST.p_zone_id"); $p_district_id = F3::get("POST.p_district_id"); $p_metropolitan = F3::get("POST.p_metropolitan"); $p_ward_no = F3::get("POST.p_ward_no"); $p_address = F3::get("POST.p_address"); $p_house_no = F3::get("POST.p_house_no"); $p_phone = F3::get("POST.p_phone"); $temp_zone_id = F3::get("POST.temp_zone_id"); $temp_district_id = F3::get("POST.temp_district_id"); $temp_metropolitan = F3::get("POST.temp_metropolitan"); $temp_ward_no = F3::get("POST.temp_ward_no"); $temp_address = F3::get("POST.temp_address"); $temp_house_no = F3::get("POST.temp_house_no"); $temp_phone = F3::get("POST.temp_phone"); $nabalik_guardian_name = F3::get("POST.nabalik_guardian_name"); $nabalik_relation = F3::get("POST.nabalik_relation"); $nabalik_identity_no = F3::get("POST.nabalik_identity_no"); $nabalik_district = F3::get("POST.nabalik_district"); $nabalik_year = F3::get("POST.nabalik_year"); $nabalik_address = F3::get("POST.nabalik_address"); $bank_name = F3::get("POST.bank_name"); $creditor_name = F3::get("POST.creditor_name"); $creditor_district = F3::get("POST.creditor_district"); $creditor_year = F3::get("POST.creditor_year"); $creditor_address = F3::get("POST.creditor_address"); $per_nagarikta = F3::get("POST.per_nagarikta"); $per_identificationno = F3::get("POST.per_identificationno"); $per_district = F3::get("POST.per_district"); $per_year = F3::get("POST.per_year"); $indian_identificationno = F3::get("POST.indian_identificationno"); $other_identificationno = F3::get("POST.other_identificationno"); $captcha = F3::get("POST.code"); if ($captcha == F3::get("SESSION.captcha")) { $this->pictureFolder($id); $sqls[] = "INSERT INTO vehicle (id,wheeler,vehicleid,zone_id,lot_number,vehicle_symbol_type,number,ip_address,form_type) VALUES('{$id}','{$wheeler}','{$vehicleid}','{$zone_id}',' {$lot_number}','{$vehicle_symbol_type} ','{$number}','{$ip_address}','namsari')"; $sqls[] = "INSERT INTO owner (vehicleid,owner_type,first_name,last_name, father_name,grandfather_name,\n dob,reg_num,email,mobileno,p_zone_id,p_district_id, p_metropolitan,p_ward_no,\n p_address, p_house_no, p_phone, temp_zone_id,temp_district_id, temp_metropolitan,\n temp_ward_no, temp_address,temp_house_no, temp_phone, nabalik_guardian_name,nabalik_relation,\n nabalik_identity_no, nabalik_district, nabalik_year, nabalik_address, bank_name, creditor_name,\n creditor_district, creditor_year, creditor_address,per_nagarikta,per_identificationno,per_district,per_year,indian_identificationno,other_identificationno)\n VALUES( '{$id}','{$owner_type}','{$first_name}','{$last_name}','{$father_name}','{$grandfather_name}',\n '{$dob}','{$reg_num}','{$email}','{$mobile}','{$p_zone_id}','{$p_district_id}','{$p_metropolitan}','{$p_ward_no}','{$p_address}',\n '{$p_house_no}', '{$p_phone}','{$temp_zone_id}','{$temp_district_id}','{$temp_metropolitan}','{$temp_ward_no}',\n '{$temp_address}',' {$temp_house_no}',' {$temp_phone}', '{$nabalik_guardian_name}',' {$nabalik_relation}',\n '{$nabalik_identity_no}','{$nabalik_district}','{$nabalik_year}','{$nabalik_address}','{$bank_name}',\n '{$creditor_name}','{$creditor_district}','{$creditor_year}','{$creditor_address}','{$per_nagarikta}',\n '{$per_identificationno}','{$per_district}','{$per_year}','{$indian_identificationno}' ,'{$other_identificationno}')"; $sqls[] = "INSERT INTO namsari (vehicle_id,reason,date,remarks,witness_name,witness_address,citizenship_no) VALUES('{$id}','{$reason}','{$date}','{$remarks}','{$witness_name}','{$witness_address}','{$citizenship_no}')"; DB::sql($sqls); F3::reroute("/feedbackt/{$id}"); } else { F3::set('error', 'The captcha you have entered is wrong'); $this->transfer_ownership(); } }
function approveRegistration() { if (!F3::get('SESSION.asid')) { F3::reroute("/admin"); } $dateNep = new Form_elements(); $vehicle = F3::get("PARAMS.id"); $wheeler = F3::get("POST.wheeler"); $model = F3::get("POST.model"); $manufacture_id = F3::get("POST.manufacture_id"); $manufacture_date = F3::get("POST.manufacture_date"); $fuel_type_id = F3::get("POST.fuel_type_id"); $engine_num = F3::get("POST.engine_num"); $chessis_num = F3::get("POST.chessis_num"); $cylinder_num = F3::get("POST.cylinder_num"); $horse_power = F3::get("POST.horse_power"); $horse_power_type = F3::get("POST.horse_power_type"); $electronic_device = F3::get("POST.electronic_device"); $registration_dates = F3::get("POST.registration_date"); //registration date $registration_date = $dateNep->dateConvertEn($registration_dates); $certificate_num = F3::get("POST.certificate_num"); $purpose_id = F3::get("POST.purpose_id"); $hood = F3::get("POST.hood"); $type = F3::get("POST.type"); $remarks = F3::get("POST.remarks"); $weight = F3::get("POST.weight"); $weight_type = F3::get("POST.weight_type"); $weight_capacity = F3::get("POST.weight_capacity"); $weight_capacity_type = F3::get("POST.weight_capacity_type"); $seat_num = F3::get("POST.seat_num"); $color_id = F3::get("POST.color_id"); $glass_color_id = F3::get("POST.glass_color_id"); $zone_id = F3::get("POST.zone_id"); $lot_number = F3::get("POST.lot_number"); $vehicle_symbol_type = $wheeler == 21 ? F3::get("POST.vehicle_symbol_type_two") : F3::get("POST.vehicle_symbol_type_four"); $number = F3::get("POST.number"); $tax = F3::get("POST.tax"); $technical_inspector = F3::get("POST.technical_inspector"); $inspection_date = F3::get("POST.inspection_date"); $custom_office_id = F3::get("POST.custom_office_id"); $pragyapan_patra_no = F3::get("POST.pragyapan_patra_no"); $custom_Date = F3::get("POST.custom_Date"); $receipt_num = F3::get("POST.receipt"); $custom_remarks = F3::get("POST.custom_remarks"); $police_office = F3::get("POST.police_office"); $registration_num = F3::get("POST.registration_num"); $entry_date = F3::get("POST.entry_date"); $status = F3::get("POST.status"); $vid = new User(); $vehicleid = $vid->vehicleid($wheeler, $zone_id, $lot_number, $vehicle_symbol_type, $number); //custom information $custom_receive_type = F3::get("POST.custom_receive_type"); $custom_office_type = F3::get("POST.custom_office_type"); $custom_office_name = F3::get("POST.custom_office_name"); $lilami_date = F3::get("POST.lilami_date"); $jafat_decision_date = F3::get("POST.jafat_decision_date"); $jafat_decision_maker = F3::get("POST.jafat_decision_maker"); $jafat_chalani_number = F3::get("POST.jafat_chalani_number"); $jafat_chalani_date = F3::get("POST.jafat_chalani_date"); //owner table // $vehicle_id = $id; $owner_type = F3::get("POST.owner_type"); $first_name = F3::get("POST.first_name"); $last_name = F3::get("POST.last_name"); $father_name = F3::get("POST.father_name"); $grandfather_name = F3::get("POST.grandfather_name"); $dob = F3::get("POST.dob"); $reg_num = F3::get("POST.reg_num"); $email = F3::get("POST.email"); $mobile = F3::get("POST.mobileno"); $p_zone_id = F3::get("POST.p_zone_id"); $p_district_id = F3::get("POST.p_district_id"); $p_metropolitan = F3::get("POST.p_metropolitan"); $p_ward_no = F3::get("POST.p_ward_no"); $p_address = F3::get("POST.p_address"); $p_house_no = F3::get("POST.p_house_no"); $p_phone = F3::get("POST.p_phone"); $temp_zone_id = F3::get("POST.temp_zone_id"); $temp_district_id = F3::get("POST.temp_district_id"); $temp_metropolitan = F3::get("POST.temp_metropolitan"); $temp_ward_no = F3::get("POST.temp_ward_no"); $temp_address = F3::get("POST.temp_address"); $temp_house_no = F3::get("POST.temp_house_no"); $temp_phone = F3::get("POST.temp_phone"); $nabalik_guardian_name = F3::get("POST.nabalik_guardian_name"); $nabalik_relation = F3::get("POST.nabalik_relation"); $nabalik_identity_no = F3::get("POST.nabalik_identity_no"); $nabalik_district = F3::get("POST.nabalik_district"); $nabalik_year = F3::get("POST.nabalik_year"); $nabalik_address = F3::get("POST.nabalik_address"); $bank_name = F3::get("POST.bank_name"); $creditor_name = F3::get("POST.creditor_name"); $creditor_district = F3::get("POST.creditor_district"); $creditor_year = F3::get("POST.creditor_year"); $creditor_address = F3::get("POST.creditor_address"); $per_nagarikta = F3::get("POST.per_nagarikta"); $per_identificationno = F3::get("POST.per_identificationno"); $per_district = F3::get("POST.per_district"); $per_year = F3::get("POST.per_year"); $indian_identificationno = F3::get("POST.indian_identificationno"); $other_identificationno = F3::get("POST.other_identificationno"); //update internal db //update vehicle data $onlineSql[] = "update vehicle set wheeler='{$wheeler}',vehicleid='{$vehicleid}', model='{$model}',\n manufacture_id='{$manufacture_id}',manufacture_date='{$manufacture_date}',fuel_type_id='{$fuel_type_id}', engine_num='{$engine_num}',\n chessis_num='{$chessis_num}',cylinder_num='{$cylinder_num}', horse_power='{$horse_power}',horse_power_type='{$horse_power_type}',\n electronic_device='{$electronic_device}',registration_date='{$registration_date}',certificate_num='{$certificate_num}',\n purpose_id='{$purpose_id}', hood='{$hood}', type='{$type}',remarks='{$remarks}', weight='{$weight}',weight_type='{$weight_type}',\n weight_capacity='{$weight_capacity}',weight_capacity_type='{$weight_capacity_type}',\n seat_num='{$seat_num}', color_id='{$color_id}', glass_color_id='{$glass_color_id}',zone_id='{$zone_id}',lot_number='{$lot_number}',\n vehicle_symbol_type='{$vehicle_symbol_type}', number='{$number}',tax='{$tax}',technical_inspector='{$technical_inspector}',\n inspection_date='{$inspection_date}', custom_office_id='{$custom_office_id}', pragyapan_patra_no='{$pragyapan_patra_no}',\n custom_Date='{$custom_Date}',custom_receive_type= '{$custom_receive_type} ',custom_office_type='{$custom_office_type}',\n custom_office_name='{$custom_office_name}' ,lilami_date='{$lilami_date} ' ,jafat_decision_date= ' {$jafat_decision_date}',\n jafat_decision_maker='{$jafat_decision_maker}',jafat_chalani_number='{$jafat_chalani_number}',jafat_chalani_date='{$jafat_chalani_date} ' ,\n receipt_num='{$receipt_num}',custom_remarks='{$custom_remarks}',police_office='{$police_office}',\n registration_num='{$registration_num}', status='approved' where id='" . $vehicle . "'"; //echo 123; //update owner data $onlineSql[] = "update owner set owner_type='{$owner_type}',first_name='{$first_name}',last_name='{$last_name}', father_name='{$father_name}',\n grandfather_name='{$grandfather_name}',dob='{$dob}',reg_num='{$reg_num}',email='{$email}',mobileno='{$mobile}',p_zone_id='{$p_zone_id}',p_district_id='{$p_district_id}',\n p_metropolitan='{$p_metropolitan}',p_ward_no='{$p_ward_no}',p_address='{$p_address}', p_house_no='{$p_house_no}', p_phone='{$p_phone}',\n temp_zone_id='{$temp_zone_id}',temp_district_id='{$temp_district_id}', temp_metropolitan='{$temp_metropolitan}', temp_ward_no='{$temp_ward_no}', temp_address='{$temp_address}',temp_house_no='{$temp_house_no}',\n temp_phone='{$temp_phone}', nabalik_guardian_name='{$nabalik_guardian_name}',nabalik_relation='{$nabalik_relation}',\n nabalik_identity_no='{$nabalik_identity_no}', nabalik_district='{$nabalik_district}', nabalik_year='{$nabalik_year}', nabalik_address='{$nabalik_address}',\n bank_name='{$bank_name}', creditor_name='{$creditor_name}',\n creditor_district='{$creditor_district}', creditor_year='{$creditor_year}', creditor_address='{$creditor_address}',per_nagarikta='{$per_nagarikta}',\n per_identificationno='{$per_identificationno}',per_district='{$per_district}',per_year='{$per_year}',indian_identificationno='{$indian_identificationno}' ,other_identificationno='{$other_identificationno}' where vehicleid='" . $vehicle . "'"; // DB::SQL($onlineSql);echo 123;die; $zone = Admin::getZone($zone_id); $symbol = Admin::getSymbolType($vehicle_symbol_type); $vehicleNo = $zone . $lot_number . $symbol . $number; // var_dump(DB::SQL($onlineSql));die; //live vrs ko data $sqls[] = "INSERT INTO owner\n (name,caste,dob,email,owner_type_id,father_name,g_father_name,mobileno,p_district,p_zone_id,\n p_nagarpalika,p_wardno, p_tole,p_gharno,p_phone,t_district,t_zone_id,t_nagarpalika,t_wardno,t_tole,\n t_gharno,t_phone,nab_guardian_name,nab_relation,nab_identificationno,nab_district,nab_year,nab_address,per_nagarikta, per_identificationno,\n per_district,per_year,bank_name,bank_identificationno,bank_district, bank_year,bank_address) VALUES\n ('{$first_name}', '{$last_name}','{$dob}','{$email}','{$owner_type}','{$father_name}','{$grandfather_name}', '{$mobile}',' {$p_district_id}',' {$p_zone_id}',\n '{$p_metropolitan}', '{$p_ward_no}','{$p_address}', '{$p_house_no}', '{$p_phone}', ' {$temp_district_id}','{$temp_zone_id}', '{$temp_metropolitan}',' {$temp_ward_no}','{$temp_address}',\n ' {$temp_house_no}',' {$temp_phone}', '{$nabalik_guardian_name}',' {$nabalik_relation}', '{$nabalik_identity_no}', '{$nabalik_district}', '{$nabalik_year}', '{$nabalik_address}','{$per_nagarikta}','{$per_identificationno}',\n '{$per_district}', '{$per_year}', '{$bank_name}', '{$creditor_name}',' {$creditor_district}', '{$creditor_year}','{$creditor_address}')"; $sqls[] = " insert into vehicle\n (id, owner_id, model,manufacturer_id, manufacturer_year, fueltype_id, engineno, chassisno, cylinderno, hpcc,\n hpcc_type, electronic_use,register_date, bluebook, usepurpose_id, hood, vehicle_type_id, comments, weight, weight_type,\n capacity, capacity_type, seatno, color_id, glass_color, zone_id, lotno, vehicle_type_symbol,licenceno, tax,\n custom_id, custom_pragyapanno, custom_date, custom_receiptno, custom_comments, entry_office_name, entryno,entry_date,\n inspector_name, inspector_date, status)\n values \n ('{$vehicleid}',(select last_insert_id()),'{$model}','{$manufacture_id}','{$manufacture_date}','{$fuel_type_id}',' {$engine_num}',' {$chessis_num}','{$cylinder_num}', '{$horse_power}',\n '{$horse_power_type}','{$electronic_device}','{$registration_date}', '{$certificate_num}', '{$purpose_id}', '{$hood}', '{$type}','{$remarks}', '{$weight}','{$weight_type}',\n '{$weight_capacity}','{$weight_capacity_type}', '{$seat_num}', '{$color_id}','{$glass_color_id}','{$zone_id}','{$lot_number}','{$vehicle_symbol_type}','{$number}','{$tax}',\n ' {$custom_office_id}', '{$pragyapan_patra_no}','{$custom_Date}', '{$receipt_num}','{$custom_remarks}', '{$police_office}', '{$registration_num}',now() ,'{$technical_inspector}', '{$inspection_date}','initial' )"; //set db to remote F3::set('DB', new DB(F3::get("db_param.live_host"), F3::get("db_param.live_user"), F3::get("db_param.live_password"))); DB::sql($sqls); //local F3::set('DB', new DB(F3::get("local_param.local_host"), F3::get("local_param.local_user"), F3::get("local_param.local_password"))); DB::SQL($onlineSql); //admin log AdminLog::add($vehicleNo, "registration", "approved"); //success message F3::set('nav', 'navigation'); F3::set('message', 'The data has been approved'); F3::set('templateAdmin', 'approve'); echo Template::serve("template/layout.html"); }