 
 (defn o6register-form-cancel [event]
   (accountant/navigate! "/o6register"))
-
-(defn o6num-sel-tag [id data data-set ]
-  [:select.form-control {:id id
-                         :value (@data-set id)
-                         :on-change #(swap! data-set assoc id  (-> % .-target .-value))}
-   [:option {:value 0} "--Select--"]
-   (for [d  data]
-     ^{:key  (.-id d)}
-     [:option {:value (.-o6number d)} (.-o6number d)])])
-
-
-(defn o6-form-o6num-sel [label id opt-data data-set]
-  [:div.form-group
-   [:label.col-sm-3.control-label label]
-   [:div.col-sm-6 [o6num-sel-tag id opt-data data-set]]
-   [:div.col-sm-3 [:div]]])
 
 (defn o6-subdiv-sel-tag [id data data-set ]
   [:select.form-control {:id id

     [:div.form-horizontal
      [:div.box-body
       [masavi-input-int-row :serialnumber "Serial Number" "text" data-set focus]
       [ms-form-sub-sel "Sub Division Name" :subdivisionid (:subdivisions @storage) data-set]
       [ms-form-villages-sel "Village Name" :villageid (:villages @storage) data-set]
       [masavi-input-int-row :year "Year" "text" data-set focus]
       [masavi-input-row :racknumber "Rack Number" "text" data-set focus]
       [masavi-input-row :description "Description" "text" data-set focus]
       [:div.box-footer
        [:div.col-sm-8.col-md-offset-5
         [button-tool-bar
          [button {:bs-style "success" :on-click save-function} "Save"]
          [button {:bs-style "danger" :on-click masavi-form-cancel } "Cancel"]]]
        ]]]]]])



(defn masavi-add-form-onclick [data-set focus]
  (if (= nil (revenue-form-validator @data-set))
    (let [onres (fn[json] (accountant/navigate! "/masavi"))]
      (http-post (str serverhost "masavis") onres  (.serialize (Serializer.) (clj->js @data-set)))))
  (reset! focus "on"))


(defn masavi-update-form-onclick [data-set focus]
  (if (= nil (masavi-form-validator @data-set))
    (let [onres (fn[data] (accountant/navigate! "/masavi"))]
      (http-put (str serverhost "masavis/" (:id @data-set)) onres (.serialize (Serializer.) (clj->js @data-set)))))
  (reset! focus "on"))



(defn masavi-on-change [event]
  (let [ele (.getElementById js/document "id")
        eval (.-value ele)
        onresp (fn [json]
                 (let [dt (getdata json)]
                   (set-key-value :villages dt)))]
    (set-key-value :villages [])
    (when-not ( >  1 (.-length eval))
      (http-get-auth (str serverhost "villages/search?name=" eval) onresp))))


(defn masavi-add-template []
  (let [add-data (r/atom {:isactive true})
        focus (r/atom nil)]
    (fn [] [masavi-template
           "Khasra Girdwani Add Form"
           add-data focus
           #(masavi-add-form-onclick add-data focus)])))


          (when (is-admin-or-super-admin)[:th " "])
          (when (is-admin-or-super-admin)[:th " "])
          [:th "S.No"]
          [:th "Name of the Village"]
          [:th "Sub Division Name"]
          ;; [:th "Tehsil"]
          [:th "Year"]
          [:th "Rack Number"]
          [:th "Description"]
         ]]
        [:tbody
         (doall (for [mt masavis]
                  ^{:key (.-id mt)}
