예제 #1
0
파일: Loader.php 프로젝트: padideIt/wall
 public function load_catFields()
 {
     $this->load->helper('wall_field');
     $cat = $this->input->post('cat');
     $using = $this->input->post('using');
     $fields = get_field_items($cat);
     switch ($using) {
         case 'adminManFields':
             if (isset($fields[0])) {
                 $ctr = 0;
                 foreach ($fields as $field) {
                     $ctr++;
                     echo "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>{$ctr}</td>\n\t\t\t\t\t\t\t<td>{$field['field_title']}</td>\n\t\t\t\t\t\t\t<td><a onclick=\"deleteField('{$field['id']}')\" style=\"cursor:pointer\">حذف</a></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t";
                 }
             } else {
                 echo "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>هیچ موردی ثبت نشده است.</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t";
             }
             break;
         case 'addAds':
             if (isset($fields[0])) {
                 $ctr = 0;
                 foreach ($fields as $field) {
                     $ctr++;
                     echo "\n\t\t\t\t\t\t\t<li class=\"cat_fields_{$cat}\">\n\t\t\t\t                <span class=\"spant\">{$field['field_title']}</span>\n\t\t\t\t                <div class=\"divsubject\">\n\t\t\t\t                \t<input type=\"text\" required name=\"custom_{$field['field_']}\" oninvalid=\"setCustomValidity('لطفا فیلد را پر کنید.')\"\n    onchange=\"try{setCustomValidity('')}catch(e){}\">\n\t\t\t\t                </div>\n\t\t\t\t            </li>\n\t\t\t\t\t\t";
                 }
             } else {
                 echo "\n\t\t\t\t\t\t\n\t\t\t\t\t\t";
             }
             break;
     }
 }
예제 #2
0
파일: Ads.php 프로젝트: padideIt/wall
 public function add($cat = false)
 {
     $user_state = $GLOBALS['user_state'];
     $data['user_state'] = $user_state;
     $this->load->helper('wall_type');
     $this->load->helper('wall_mapdb');
     $data['states'] = get_state();
     $data['state_id'] = $this->session->userdata('state');
     // get city if user state setted
     if ($user_state) {
         $data['cities'] = get_city(false, $user_state);
     } else {
         $data['cities'] = false;
     }
     $data['cats'] = get_slave_items(1, 0);
     if ($cat !== false) {
         $checkCat = get_type($cat);
         if (isset($checkCat['id']) && $checkCat['parent'] == 0) {
             $data['sub_cats'] = get_slave_items(1, $cat);
             $data['selected_cat'] = $cat;
             $this->load->helper('wall_field');
             $data['fields'] = get_field_items($cat);
         } else {
             $data['sub_cats'] = false;
             $data['selected_cat'] = '';
         }
     } else {
         $data['selected_cat'] = '';
     }
     $this->load->view('ads/add', $data);
 }