Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal do fórum
Preciso de um auxilie na criação de uma função de exclusão.Na datagrid daqui da empresa foi tem essa função que fica na linha 4072:
protected function DeleteRow($rid){
$req_operation_randomize_code = $this->GetVariable("_operation_randomize_code", true, "post");
if(!$this->CheckF5CaseValidation($req_operation_randomize_code)) return false;
if(!$this->CheckSecurityCaseValidation("delete", "delete", "deleting")) return false;
$this->rids = explode("-", $rid);
$sql = "DELETE FROM acesso WHERE id_acesso IN ('-1') ";
foreach ($this->rids as $key){
$sql .= ", '".$key."' ";
//$sql = "SELECT * FROM acesso_acao";
}
$sql .= ");";
//$sql = "SELECT * FROM acesso_acao";
if(!$this->isDemo){
$this->db_handler->query($sql);
}else{
$dSet = null;
}
$affectedRows = $this->db_handler->affectedRows();
if($affectedRows >= 0){
$this->act_msg = ($this->dg_messages['delete'] == $this->primary_key) ? $this->dg_messages['delete'] : $this->lang['deleting_operation_completed'];
if(isset($_SESSION)) { $_SESSION[$this->uniquePrefix.'_operation_randomize_code'] = $req_operation_randomize_code; }
$this->isOperationCompleted = true;
}else{
$this->is_warning = true;
$this->act_msg = $this->lang['deleting_operation_uncompleted'];
if(isset($_SESSION)) { $_SESSION[$this->uniquePrefix.'_operation_randomize_code'] = ""; }
$this->isOperationCompleted = false;
}
if($this->debug) echo "<table width='".$this->tblWidth[$this->mode]."'><tr><td align='left' class='".$this->css_class."_dg_error_message no_print' style='COLOR: #333333;'><b>delete sql (".$this->StrToLower($this->lang['total']).": ".$affectedRows.") </b>".$sql."</td></tr></table><br>";
if($this->debug) $this->act_msg .= " ".$this->lang['record_n']." ".$this->rid;
}
Que é chamada aqui,na linha 1494:
// DELETE mode processing
if(($req_mode == "delete") && ($this->rid != "")){ //|| (($req_mode="delete") && ($this->key != ""))){
///d1 $this->rid = $req_rid;
if($req_print != true){
($this->DeleteRow($this->rid));// && ($this->DeleteRow($this->key)));
//$this->DeleteRow($this->key);
//return acesso_acao;
}
$this->sql = $this->sql_view;
$this->GetDataSet($this->sql_sort);
$this->mode = "view";
}A imagem da base para você verificarem é essa:
/applications/core/interface/imageproxy/imageproxy.php?img=http://img269.imageshack.us/img269/7950/controledeacesso.jpg&key=3b0f5a5367d8d8c0e7542995dcf77ae2731eba900079d16a2f42b78a04e1a919" alt="Imagem Postada" />
Carregando comentários...