execQuery($sql) ) { $rsDelMst = $clsMySQL->result; while( $aryDel = $clsMySQL->fetchAry($rsDelMst) ) { // foreach ($aryFld as $key => $af) { // // print_r($af); if ( isset($debug) && $debug == 1 ) { fShowMsg($af['type']); } switch($af['type']) { // case 'file': case 'image': if ( isset($debug) && $debug == 1 ) { fShowMsg($af['Name']); } if ( isset($debug) && $debug == 1 ) { fShowMsg($af['resize']); } if ( isset($aryDel[$af['Name']]) && $aryDel[$af['Name']] != '' ) { // $aryLoc = explode('|' , $aryDel[$af['Name']]); if ( sizeof($aryLoc) == 1 ) { $delLoc = $aryLoc[0]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = '../'.$aryLoc[0]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } if ( isset($af['resize']) && $af['resize'] != '' ) { $aryDelResize = explode( ';' , $af['resize'] ); foreach( $aryDelResize as $strR ) { $aryR = explode(',' , $strR); if ( $aryR[1] != '' ) { $delLoc = img_path($aryLoc[0],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = img_path('../'.$aryLoc[0],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } } } } } else { $delLoc = $aryLoc[10]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = '../'.$aryLoc[1]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } if ( isset($af['resize']) && $af['resize'] != '' ) { $aryDelResize = explode( ';' , $af['resize'] ); foreach( $aryDelResize as $strR ) { $aryR = explode(',' , $strR); if ( $aryR[1] != '' ) { $delLoc = img_path($aryLoc[1],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = img_path('../'.$aryLoc[1],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } } } } } } break; // case 'multiupload': if ( isset($debug) && $debug == 1 ) { fShowMsg($af['Name']); } if ( isset($debug) && $debug == 1 ) { fShowMsg($af['ref_type']); } if ( isset($debug) && $debug == 1 ) { fShowMsg($af['resize']); } if ( $af['ref_type'] != '' ) { $sql = " SELECT * FROM attachment WHERE a_ref_id = '{$delete}' AND a_ref_type = '{$af['ref_type']}' "; if ( isset($debug) && $debug == 1 ) { fShowSQL($sql); } if ( $clsMySQL->execQuery($sql) ) { while( $aryA = $clsMySQL->fetchArray() ) { // if ( isset($debug) && $debug == 1 ) { fShowMsg($aryA['a_path']); } $delLoc = $aryA['a_path']; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = '../'.$aryA['a_path']; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } if ( isset($af['resize']) && $af['resize'] != '' ) { $aryDelResize = explode( ';' , $af['resize'] ); foreach( $aryDelResize as $strR ) { $aryR = explode(',' , $strR); if ( $aryR[1] != '' ) { $delLoc = img_path($aryA['a_path'],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = img_path('../'.$aryA['a_path'],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } } } } } } $sql = " DELETE FROM attachment WHERE a_ref_id = '{$delete}' AND a_ref_type = '{$af['ref_type']}' "; if ( isset($debug) && $debug == 1 ) { fShowSQL($sql); } $clsMySQL->execSQL($sql); } break; // } } } } // $db->query("DELETE FROM {$tbName} WHERE {$dbPrefix}_id='$delete'"); echo 'ok'; exit; } if($submit=='yes') { foreach($sortid as $id => $sort_id) { $db->query("UPDATE {$tbName} SET {$dbPrefix}_sort_id='$sort_id' WHERE {$dbPrefix}_id='$id'"); } header("LOCATION: m-{$index}"); exit; } $CATE = array(); $db->query("SELECT t.* $getMoreField FROM $tbName t ".($listWhere ? "WHERE $listWhere" : '')." ORDER BY {$dbPrefix}_sort_id"); while($data = $db->fetchArray()) { $data['name'] = $data['cate_name']; $CATE[$data[$dbPrefix.'_id']] = $data; } if(count($CATE)>0) { $i = 0; $cateOption = array(); foreach(_findChildren($CATE,0) as $c) { $i = 0; getCateArray($c,0); } } foreach($cateOption as $c) { $data = $CATE[$c['cate_id']]; for($i=1;$i<=$c['level'];$i++) { $c['s'] .= '   - '; } $data[$dbPrefix.'_name'] = $c[s].$c['name']; if(!$listHeader) { $getTr = true; } else { $getTr = false; } $thislist = ''; if(is_array($showFieldInList) && count($showFieldInList)>0) { foreach($showFieldInList as $sf) { $data['cacheShowField'][$sf[1]] = ''.$data[$sf[1]].''; if($getTr) { $data['listHeader'][$sf[1]] = ''.$sf[0].''; } } } foreach($aryFld as $af) { if($af['showInList']) { $data['cacheShowField'][$af['Name']] = ''.($af['option'] ? showOption($af['option'],$data[$af['Name']]) : $data[$af['Name'].($af['Lang'] ==1 ? '_tc' : "")]).''; if($getTr) { $data['listHeader'][$af['Name']] = ''.$af['lbl'].''; } } } if(is_array($showFieldOrder) && count($showFieldOrder)>0) { foreach($showFieldOrder as $sf) { $thislist .= $data['cacheShowField'][$sf]; if($getTr) { $listHeader .= $data['listHeader'][$sf]; } } } else { foreach($data['cacheShowField'] as $key => $sf) { $thislist .= $sf; if($getTr) { $listHeader .= $data['listHeader'][$key]; } } } if($allowSorting) { $thislist .= ''; if($getTr) { $listHeader .= 'Sort ID'; } } if($showView) { $thislist .= ''; } $thislist .= $noEdit ? '' : ''; $thislist .= $noDel ? '' : ''; $thislist .= ''; $list[] = $thislist; } ?>
Add New
Edit Delete
No '.($keyword ? 'Match ' : '').'Record was found.')?>