本文整理汇总了PHP中pmb_mysql_affected_rows函数的典型用法代码示例。如果您正苦于以下问题:PHP pmb_mysql_affected_rows函数的具体用法?PHP pmb_mysql_affected_rows怎么用?PHP pmb_mysql_affected_rows使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmb_mysql_affected_rows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: desaffecte_cb
function desaffecte_cb($cb, $id_resa = 0)
{
global $dbh;
if ($id_resa != 0) {
$rqt = "UPDATE resa SET resa_cb='', resa_date_debut='0000-00-00', resa_date_fin='0000-00-00' WHERE resa_cb='" . $cb . "' AND id_resa='" . $id_resa . "'";
} else {
$rqt = "UPDATE resa SET resa_cb='', resa_date_debut='0000-00-00', resa_date_fin='0000-00-00' WHERE resa_cb='" . $cb . "' ";
}
$res = pmb_mysql_query($rqt, $dbh);
return pmb_mysql_affected_rows($dbh);
}
示例2: pmb_mysql_field_name
$fieldname = pmb_mysql_field_name($res, $i);
$sortasc = "<a href='{$urlbase}&sortfield=" . ($i + 1) . "&desc=0'>asc</a>";
$sortdesc = "<a href='{$urlbase}&sortfield=" . ($i + 1) . "&desc=1'>desc</a>";
print "<th>{$fieldname}</th>";
}
for ($i = 0; $i < $nbr_lignes; $i++) {
$row = pmb_mysql_fetch_row($res);
echo "<tr>";
foreach ($row as $dummykey => $col) {
if (!$col) {
$col = " ";
}
print pmb_bidi("<td>{$col}</td>");
}
echo "</tr>";
}
echo "</table><hr />";
} else {
print "<br /><font color='#ff0000'>" . $msg['admin_misc_lignes'] . " " . pmb_mysql_affected_rows($dbh);
$err = pmb_mysql_error($dbh);
if ($err) {
print "<br />{$err}";
}
echo "</font><hr />";
}
}
}
// fin while
} else {
print $msg["proc_param_query_failed"];
}
示例3: pmb_mysql_query
$result = pmb_mysql_query($query, $dbh);
if (!pmb_mysql_num_rows($result)) {
// exemplaire inconnu
$aff_a_ranger .= "<strong>{$form_cb_expl} : {$msg[367]}</strong><br />";
} else {
$expl_lu = pmb_mysql_fetch_object($result);
if ($stuff = get_expl_info($expl_lu->expl_id)) {
$stuff = check_pret($stuff);
$aff_a_ranger .= print_info($stuff, 1, 0, 0) . "<br />";
} else {
$aff_a_ranger .= "<strong>{$form_cb_expl} : {$msg[395]}</strong><br />";
}
}
$rqt = "delete from resa_ranger where resa_cb='" . $form_cb_expl . "' ";
$res = pmb_mysql_query($rqt, $dbh);
if (pmb_mysql_affected_rows()) {
$msg_a_ranger .= $msg[resa_docrange];
} else {
$msg_a_ranger .= $msg[resa_docrange_non];
}
$msg_a_ranger = str_replace('!!cb!!', $form_cb_expl, $msg_a_ranger);
$msg_a_ranger .= "</div>";
break;
}
switch ($sub) {
case 'docranger':
echo window_title($database_window_title . $msg["5"] . " : " . $msg["resa_menu"] . " " . $msg["resa_menu_liste_docranger"]);
print "<h1>{$msg['resa_menu']} > " . $msg["resa_menu_liste_" . $sub] . "</h1>";
get_cb_expl("", $msg[661], $msg[resa_suppr_doc], "./circ.php?categ=listeresa&sub={$sub}&action=suppr_cb", 1);
print $msg_a_ranger . $aff_a_ranger;
print "<h3>" . $msg['resa_liste_docranger'] . "</h3>";
示例4: delete
function delete()
{
global $dbh;
$requete = "DELETE FROM groupe WHERE id_groupe=" . $this->id;
$res = pmb_mysql_query($requete, $dbh);
$nb = pmb_mysql_affected_rows($dbh);
$requete = "DELETE FROM empr_groupe WHERE groupe_id=" . $this->id;
$res = pmb_mysql_query($requete, $dbh);
return $nb;
}
示例5: import_new_notice_suite
//.........这里部分代码省略.........
}
}
//Date de saisie
if ($info_902[0]) {
$no_champ = trouve_champ_perso("ds");
if ($no_champ > 0) {
$requete = "INSERT INTO notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_date) VALUES({$no_champ},{$notice_id},'" . str_replace(".", "-", $info_902[0]) . "')";
pmb_mysql_query($requete);
}
}
//N° de lot
if ($info_903[0]) {
$requete = "UPDATE notices SET commentaire_gestion='" . addslashes($info_903[0]) . "' WHERE notice_id={$notice_id}";
pmb_mysql_query($requete);
}
//Cas de la mise à jour des périodiques ou du champ bord (notices chapeau)
if ($bl == "s") {
//Si c'est un périodique
if ($dt == "a") {
//Passage de la notice en notice chapeau
$requete = "UPDATE notices SET niveau_biblio='s', niveau_hierar='1' WHERE notice_id={$notice_id}";
pmb_mysql_query($requete);
//Recherche si la notice existe déjà par rapport au titre
$requete = "select notice_id FROM notices WHERE ucase(tit1)='" . addslashes(strtoupper($info_200[0])) . "' AND niveau_biblio='s' AND niveau_hierar='1' AND notice_id!={$notice_id}";
$resultat = pmb_mysql_query($requete);
$update = false;
if (pmb_mysql_num_rows($resultat)) {
$update = true;
$n_update = pmb_mysql_result($resultat, 0, 0);
//Mise à jour de tous les bulletins
$requete = "UPDATE bulletins SET bulletin_notice=" . $notice_id . " WHERE bulletin_notice=" . $n_update;
pmb_mysql_query($requete);
//Suppression de l'ancienne notice
$requete = "DELETE FROM notices WHERE notice_id={$n_update}";
pmb_mysql_query($requete);
$requete = "DELETE FROM notices_categories WHERE notcateg_notice=" . $n_update;
pmb_mysql_query($requete);
$requete = "DELETE FROM notices_custom_values WHERE notices_custom_origine=" . $n_update;
pmb_mysql_query($requete);
$requete = "DELETE FROM responsability WHERE responsability_author=" . $n_update;
pmb_mysql_query($requete);
}
if (!$update && $rs != "n") {
//Si il n'y a pas de création, on supprime la notice
$requete = "DELETE FROM notices WHERE notice_id={$notice_id}";
pmb_mysql_query($requete);
$requete = "DELETE FROM notices_categories WHERE notcateg_notice=" . $notice_id;
pmb_mysql_query($requete);
$requete = "DELETE FROM notices_custom_values WHERE notices_custom_origine=" . $notice_id;
pmb_mysql_query($requete);
$requete = "DELETE FROM responsability WHERE responsability_author=" . $notice_id;
pmb_mysql_query($requete);
}
} else {
if ($dt == "l") {
//Recherche si la notice existe déjà par rapport au titre
$requete = "select notice_id FROM notices WHERE ucase(tit1)='" . addslashes(strtoupper($info_200[0])) . "' AND typdoc='l' AND notice_id!={$notice_id}";
$resultat = pmb_mysql_query($requete);
$update = false;
if (pmb_mysql_num_rows($resultat)) {
$update = true;
$n_update = pmb_mysql_result($resultat, 0, 0);
//Suppression de l'ancienne notice
$requete = "DELETE FROM notices WHERE notice_id={$n_update}";
pmb_mysql_query($requete);
$requete = "DELETE FROM notices_categories WHERE notcateg_notice=" . $n_update;
pmb_mysql_query($requete);
$requete = "DELETE FROM notices_custom_values WHERE notices_custom_origine=" . $n_update;
pmb_mysql_query($requete);
$requete = "DELETE FROM responsability WHERE responsability_author=" . $n_update;
pmb_mysql_query($requete);
}
} else {
if ($dt == "r") {
//Mise à jour du champ bord
if ($info_910[0]) {
$no_champ = trouve_champ_perso("bord");
if ($no_champ > 0) {
//Recherche si la notice existe déjà par rapport au titre
$requete = "SELECT notice_id FROM notices WHERE ucase(tit1)='" . addslashes(strtoupper($info_200[0])) . "' AND niveau_biblio='s' AND niveau_hierar='1' AND notice_id!={$notice_id}";
$resultat = pmb_mysql_query($requete);
if (pmb_mysql_num_rows($resultat)) {
$notice_update = pmb_mysql_result($resultat, 0, 0);
$requete = "UPDATE notices_custom_values SET notices_custom_text='" . addslashes(str_replace("##", "\n", $info_910[0])) . "' WHERE notices_custom_champ={$no_champ} AND notices_custom_origine=" . $notice_update;
pmb_mysql_query($requete);
if (!pmb_mysql_affected_rows()) {
$requete = "INSERT INTO notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_text) VALUES({$no_champ},{$notice_update},'" . addslashes(str_replace("##", "\n", $info_910[0])) . "')";
pmb_mysql_query($requete);
}
}
}
}
//Suppression de la nouvelle notice
$requete = "DELETE FROM notices WHERE notice_id=" . $notice_id;
pmb_mysql_query($requete);
}
}
}
}
}
示例6: import_empr
function import_empr($dbh)
{
global $lect_cree, $lect_erreur, $lect_modif, $type_import, $type_modif, $lect_supprime, $lect_interdit;
$lect_tot = 0;
$lect_supprime = 0;
$lect_cree = 0;
$lect_erreur = 0;
$lect_modif = 0;
$lect_interdit = 0;
//La structure du fichier texte doit être la suivante avec ceci comme première ligne:
// Etudiant
// "MatriculeHenam","empr_cb","empr_nom","empr_prenom","empr_adr1","empr_cp","empr_ville","empr_pays","empr_tel1","empr_tel2","empr_mail","empr_sexe","empr_year","EmailPerso","localisation","groupe"
//Professeur
// "MatriculeHenam","empr_cb","empr_nom","empr_prenom","empr_adr1","empr_cp","empr_ville","empr_pays","empr_tel1","empr_tel2","empr_mail","empr_sexe","empr_year"
//Upload du fichier
if (!$_FILES['import_lec']['tmp_name']) {
print "Cliquez sur Précédent et choisissez un fichier";
return;
} elseif (!move_uploaded_file($_FILES['import_lec']['tmp_name'], "./temp/" . basename($_FILES['import_lec']['tmp_name']))) {
print "Le fichier n'a pas pu être téléchargé. Voici plus d'informations :<br />";
print_r($_FILES) . "<p>";
return;
}
$fichier = @fopen("./temp/" . basename($_FILES['import_lec']['tmp_name']), "r");
if ($fichier) {
$lect = decoup_fic_lect($fichier);
for ($i = 0; $i < count($lect); $i++) {
$statut = "";
if ($type_modif == "modif_statut") {
$statut = "Importé";
}
if (count($lect[$i]) == 1 or $lect[$i][0] == "MatriculeHenam") {
//Passe ici pour l'entête et les ligne vide (la dernière)
} elseif (count($lect[$i]) != 18 && count($lect[$i]) != 14) {
$lect_tot++;
$lect_erreur++;
print "<b>Erreur : Personne non prise en compte car le nombre de champ n'est pas valide : </b><br />";
echo "<pre>";
print_r($lect[$i]);
echo "</pre>";
} elseif (trim($lect[$i][0]) == "" or trim($lect[$i][1]) == "" or trim($lect[$i][2]) === "") {
$lect_tot++;
$lect_erreur++;
print "<b>Erreur : Personne non prise en compte car elle n'a pas de nom, de code barres ou de matricule : </b><br />";
echo "<pre>";
print_r($lect[$i]);
echo "</pre>";
} else {
$lect_tot++;
if ($type_import == "nouveau_lect") {
//Tout les lecteurs à traiter
//On regarde si le lecteur existe déja en le recherchant par son badge
$requete = "select id_empr from empr join empr_custom_values on empr_custom_origine=id_empr where empr_cb LIKE '" . addslashes($lect[$i][1]) . "%' and empr_custom_champ='2' and empr_custom_small_text='" . addslashes($lect[$i][0]) . "' ";
$select = pmb_mysql_query($requete, $dbh);
$nb_enreg = pmb_mysql_num_rows($select);
if ($nb_enreg == 1) {
maj_lect_par_lect($lect[$i], $dbh, $statut, pmb_mysql_result($select, 0, 0));
} elseif ($nb_enreg > 1) {
$lect_erreur++;
echo "<b>Erreur : Attention le code barre " . $lect[$i][0] . " est en double dans la base veuillez le modifier pour l'un des deux lecteurs<b><br />";
return;
} else {
import_lect_par_lect($lect[$i], $dbh);
}
} else {
supp_lect_par_lect($lect[$i], $dbh);
$group_supp = 0;
if ($i + 1 == count($lect)) {
$requete = "delete groupe from groupe left join empr_groupe on id_groupe=groupe_id where empr_id is null";
$res = pmb_mysql_query($requete, $dbh);
$group_supp = pmb_mysql_affected_rows();
}
}
}
}
print "<br />_____________________<br />";
if ($lect_erreur) {
echo "<b> Attention " . $lect_erreur . " lecteur(s) n'a(ont) pas été traité(s) : voir erreur(s) ci-dessus </b><br />";
}
echo "Nombre total de lecteurs dans le fichier : " . $lect_tot . "<br />";
if ($type_import == "nouveau_lect") {
echo "Nombre de lecteurs créés : " . $lect_cree . "<br />";
echo "Nombre de lecteurs modifiés : " . $lect_modif . "<br />";
} else {
echo "Nombre d'anciens lecteurs supprimés : " . $lect_supprime . "<br />";
echo "Nombre d'anciens lecteurs avec un statut Interdit (non supprimés car ils ont au moins un prêt en cours) : " . $lect_interdit . "<br />";
echo "Nombre de groupes inutilisés supprimés : " . $group_supp . "<br />";
}
fclose($fichier);
}
}
示例7: accept_ret
public function accept_ret()
{
global $charset, $msg;
global $ret_accepted_mail;
$subject = $msg['serialcirc_ret_accepted'];
$content = $ret_accepted_mail;
$mail = $this->_get_users_mails();
if ($mail != "") {
$dest = array('mail' => $mail, 'name' => $opac_biblio_email);
$from = serialcirc_empr_circ::get_mail_infos($this->empr_id);
$content = str_replace("!!empr!!", $from['name'], $content);
$this->_send_mail($dest, "", $subject, $content, $from['name'], $from['mail']);
}
$query = "update serialcirc_expl set serialcirc_expl_ret_asked = " . SERIALCIRC_EXPL_TRANS_DOC_accepted;
$result = pmb_mysql_query($query);
if (!pmb_mysql_affected_rows($result)) {
return false;
}
return true;
}
示例8: str_replace
// procédure insert
for ($icount = 0; $icount < count($liste_no_flag); $icount++) {
$final_query = str_replace("CADDIE(EMPR)", $liste_no_flag[$icount], $hp->final_query);
$result_selection_no_flag = @pmb_mysql_query($final_query, $dbh);
$nb_elts_traites = pmb_mysql_affected_rows($dbh);
if ($nb_elts_traites > 0) {
$nb_elements_no_flag += $nb_elts_traites;
}
}
// fin for
} else {
// autre procédure
$final_query = preg_replace("/CADDIE\\(.*[^\\)]\\)/i", implode(",", $liste_no_flag), $hp->final_query);
$result_selection_no_flag = pmb_mysql_query($final_query, $dbh);
if ($result_selection_no_flag) {
$nb_elts_traites = pmb_mysql_affected_rows($dbh);
if ($nb_elts_traites > 0) {
$nb_elements_no_flag += $nb_elts_traites;
}
} else {
$error_message_no_flag = pmb_mysql_error();
}
}
// fin if autre procédure
}
}
$error_message = "";
print sprintf($msg["caddie_action_flag_processed"], $nb_elements_flag) . "<br />";
print sprintf($msg["caddie_action_no_flag_processed"], $nb_elements_no_flag) . "<br />";
print "<b>" . sprintf($msg["caddie_action_total_processed"], $nb_elements_no_flag + $nb_elements_flag) . "</b><br /><br />";
if ($error_message_flag) {
示例9: str_replace
$final_query = str_replace("CADDIE(NOTI)", $liste_no_flag[$icount], $hp->final_query);
$final_query = str_replace("CADDIE(EXPL)", $liste_no_flag[$icount], $final_query);
$final_query = str_replace("CADDIE(BULL)", $liste_no_flag[$icount], $final_query);
$result_selection_no_flag = @pmb_mysql_query($final_query, $dbh);
$nb_elts_traites = pmb_mysql_affected_rows($dbh);
if ($nb_elts_traites > 0) {
$nb_elements_no_flag += $nb_elts_traites;
}
}
// fin for
} else {
// autre procédure
$final_query = preg_replace("/CADDIE\\(.*[^\\)]\\)/i", implode(",", $liste_no_flag), $hp->final_query);
$result_selection_no_flag = @pmb_mysql_query($final_query, $dbh);
if ($result_selection_no_flag) {
$nb_elements_no_flag = pmb_mysql_affected_rows($dbh);
} else {
$error_message_no_flag = pmb_mysql_error();
}
}
// fin if autre procédure
}
}
$error_message = "";
print sprintf($msg["caddie_action_flag_processed"], $nb_elements_flag) . "<br />";
print sprintf($msg["caddie_action_no_flag_processed"], $nb_elements_no_flag) . "<br />";
print "<b>" . sprintf($msg["caddie_action_total_processed"], $nb_elements_no_flag + $nb_elements_flag) . "</b><br /><br />";
if ($error_message_flag) {
$error_message .= sprintf($msg["caddie_action_error"], $error_message_flag) . "<br />";
}
if ($error_message_no_flag) {
示例10: cleanNotices
function cleanNotices()
{
global $msg, $dbh, $charset, $PMBusername;
if (SESSrights & ADMINISTRATION_AUTH) {
$result .= "<h3>" . htmlentities($msg["nettoyage_suppr_notices"], ENT_QUOTES, $charset) . "</h3>";
pmb_mysql_query("set wait_timeout=3600");
// La routine ne nettoie pour l'instant que les monographies
$query = pmb_mysql_query("delete notices \n\t\t\t\tFROM notices left join exemplaires on expl_notice=notice_id \n\t\t\t\t\tleft join explnum on explnum_notice=notice_id \n\t\t\t\t\tleft join notices_relations NRN on NRN.num_notice=notice_id \n\t\t\t\t\tleft join notices_relations NRL on NRL.linked_notice=notice_id \n\t\t\t\tWHERE niveau_biblio='m' AND niveau_hierar='0' and explnum_notice is null and expl_notice is null and NRN.num_notice is null and NRL.linked_notice is null");
$affected = pmb_mysql_affected_rows();
$result .= "" . $affected . " " . htmlentities($msg["nettoyage_res_suppr_notices"], ENT_QUOTES, $charset) . "";
$opt = pmb_mysql_query('OPTIMIZE TABLE notices');
} else {
$result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
}
return $result;
}
示例11: pmb_mysql_query
$recup_id_resa .= " AND resa_idnotice = {$id_notice}";
} else {
$recup_id_resa .= " AND resa_idbulletin = {$id_bulletin}";
}
$resrecup_id_resa = pmb_mysql_query($recup_id_resa, $dbh);
$obj_recupidresa = pmb_mysql_fetch_object($resrecup_id_resa);
$suppr_id_resa = $obj_recupidresa->id_resa;
// récup éventuelle du cb
$cb_recup = $obj_recupidresa->resa_cb;
// archivage resa
$rqt_arch = "UPDATE resa_archive, resa SET resarc_anulee = 1 WHERE id_resa = '" . $suppr_id_resa . "' AND resa_arc = resarc_id ";
pmb_mysql_query($rqt_arch, $dbh);
// suppression
$rqt = "delete from resa where id_resa='" . $suppr_id_resa . "' ";
$res = pmb_mysql_query($rqt, $dbh);
$nb_resa_suppr = pmb_mysql_affected_rows();
if ($pmb_transferts_actif) {
/*
// si transferts validé (en attente d'envoi), il faut restaurer le statut
$rqt = "SELECT id_transfert FROM transferts,transferts_demande
where
num_transfert=id_transfert and
etat_demande=1 and resa_trans='".$suppr_id_resa."' and etat_transfert=0";
$res = pmb_mysql_query( $rqt );
if (pmb_mysql_num_rows($res)){
$obj = pmb_mysql_fetch_object($res);
$idTrans=$obj->id_transfert;
//Récupération des informations d'origine
$rqt = "SELECT statut_origine, num_expl FROM transferts INNER JOIN transferts_demande ON id_transfert=num_transfert
WHERE id_transfert=".$idTrans." AND sens_transfert=0";
$res = pmb_mysql_query($rqt);
示例12: pmb_mysql_field_name
$fieldname = pmb_mysql_field_name($res, $i);
$sortasc = "<a href='{$urlbase}&sortfield=" . ($i + 1) . "&desc=0'>asc</a>";
$sortdesc = "<a href='{$urlbase}&sortfield=" . ($i + 1) . "&desc=1'>desc</a>";
print "<th>{$fieldname}</th>";
}
for ($i = 0; $i < $nbr_lignes; $i++) {
$row = pmb_mysql_fetch_row($res);
echo "<tr>";
foreach ($row as $dummykey => $col) {
if (!$col) {
$col = " ";
}
print pmb_bidi("<td>{$col}</td>");
}
echo "</tr>";
}
echo "</table><hr />";
} else {
print "<font color='#ff0000'>{$msg['admin_procs_lignes_affectees']} : " . pmb_mysql_affected_rows($dbh);
$err = pmb_mysql_error($dbh);
if ($err) {
print "<br />{$err}";
}
}
print "</font><hr />";
}
}
// fin while
} else {
print $msg["proc_param_query_failed"];
}
示例13: executeProc
function executeProc($procedure, $idProc, $tparams)
{
global $msg, $dbh, $charset, $PMBuserid;
global $pmb_procedure_server_credentials, $pmb_procedure_server_address;
if (SESSrights & ADMINISTRATION_AUTH) {
$name = '';
$report = '';
if ($tparams['envt']) {
foreach ($tparams['envt'] as $aparam => $vparam) {
global ${$aparam};
${$aparam} = $vparam;
}
}
switch ($procedure) {
case INTERNAL:
$hp = new parameters($idProc, 'procs');
$hp->get_final_query();
$code_sql = $hp->final_query;
$autorisations = $hp->proc->autorisations;
break;
case EXTERNAL:
$pmb_procedure_server_credentials_exploded = explode("\n", $pmb_procedure_server_credentials);
if ($pmb_procedure_server_address && count($pmb_procedure_server_credentials_exploded) == 2) {
$aremote_procedure_client = new remote_procedure_client($pmb_procedure_server_address, trim($pmb_procedure_server_credentials_exploded[0]), trim($pmb_procedure_server_credentials_exploded[1]));
$procedure = $aremote_procedure_client->get_proc($idProc, "AP");
$the_procedure = $procedure['procedure'];
if ($procedure['error_message']) {
$report = htmlentities($msg['remote_procedures_error_server'], ENT_QUOTES, $charset) . ':<br /><i>' . $procedure['error_message'] . '</i>';
$result = array('name' => $the_procedure->name, 'report' => $report);
return $result;
} else {
if ($the_procedure->params && $the_procedure->params != 'NULL') {
$sql = 'CREATE TEMPORARY TABLE remote_proc LIKE procs';
pmb_mysql_query($sql, $dbh) or die(pmb_mysql_error());
$sql = "INSERT INTO remote_proc (idproc, name, requete, comment, autorisations, parameters, num_classement) VALUES (0, '" . pmb_mysql_escape_string($the_procedure->name) . "', '" . pmb_mysql_escape_string($the_procedure->sql) . "', '" . pmb_mysql_escape_string($the_procedure->comment) . "', '', '" . pmb_mysql_escape_string($the_procedure->params) . "', 0)";
pmb_mysql_query($sql, $dbh) or die(pmb_mysql_error());
$idproc = pmb_mysql_insert_id($dbh);
$hp = new parameters($idproc, 'remote_proc');
$hp->get_final_query();
$the_procedure->sql = $hp->final_query;
$name = $the_procedure->name;
$code_sql = $the_procedure->sql;
$commentaire = $the_procedure->comment;
}
}
}
break;
}
$linetemp = explode(';', $code_sql);
if ($autorisations) {
$temp_autorisation = explode(' ', $autorisations);
}
$allow = false;
if ($temp_autorisation) {
foreach ($temp_autorisation as $userid) {
if ($userid == $PMBuserid) {
$allow = true;
}
}
if (!$allow) {
$report = $msg[11];
// throw new Exception($message, $code);
$result = array('name' => $name, 'report' => $report);
return $result;
}
}
$line = array();
for ($i = 0; $i < count($linetemp); $i++) {
if (trim($linetemp[$i])) {
$line[] = trim($linetemp[$i]);
}
}
while (list($cle, $valeur) = each($line)) {
if ($valeur) {
$report .= "<strong>" . $msg['procs_ligne'] . " {$cle} </strong>: {$valeur}<br /><br />";
$er = explain_requete($valeur);
if ($er) {
$res = @pmb_mysql_query($valeur, $dbh);
$report .= pmb_mysql_error();
$nbr_lignes = @pmb_mysql_num_rows($res);
$nbr_champs = @pmb_mysql_num_fields($res);
if ($nbr_lignes) {
$report .= "<table >";
for ($i = 0; $i < $nbr_champs; $i++) {
$fieldname = pmb_mysql_field_name($res, $i);
$report .= "<th>{$fieldname}</th>";
}
for ($i = 0; $i < $nbr_lignes; $i++) {
$row = pmb_mysql_fetch_row($res);
$report .= "<tr>";
foreach ($row as $dummykey => $col) {
if (trim($col) == '') {
$col = ' ';
}
$report .= '<td >' . $col . '</td>';
}
$report .= "</tr>";
}
$report .= "</table><hr />";
$report .= "<font color='#ff0000'>" . $msg['admin_misc_lignes'] . " " . pmb_mysql_affected_rows($dbh) . "</font>";
//.........这里部分代码省略.........
示例14: delete_resa
function delete_resa($session_id, $resa_id)
{
global $dbh;
if (!$session_id) {
return FALSE;
}
$session_info = $this->retrieve_session_information($session_id);
$empr_id = $session_info["empr_id"];
if (!$empr_id) {
return FALSE;
}
$resa_id += 0;
if (!$resa_id) {
return FALSE;
}
// *** Traitement de la suppression d'une résa affectée
$recup_id_resa = "select id_resa, resa_cb FROM resa WHERE resa_idempr=" . $empr_id;
$recup_id_resa .= " AND id_resa = {$resa_id}";
$resrecup_id_resa = pmb_mysql_query($recup_id_resa, $dbh);
$obj_recupidresa = pmb_mysql_fetch_object($resrecup_id_resa);
$suppr_id_resa = $obj_recupidresa->id_resa;
// récup éventuelle du cb
$cb_recup = $obj_recupidresa->resa_cb;
// archivage resa
$rqt_arch = "UPDATE resa_archive, resa SET resarc_anulee = 1 WHERE id_resa = '" . $suppr_id_resa . "' AND resa_arc = resarc_id ";
pmb_mysql_query($rqt_arch, $dbh);
// suppression
$rqt = "delete from resa where id_resa='" . $suppr_id_resa . "' ";
$res = pmb_mysql_query($rqt, $dbh);
$nb_resa_suppr = pmb_mysql_affected_rows();
// réaffectation du doc éventuellement
if ($cb_recup) {
if (!affecte_cb($cb_recup) && $cb_recup) {
// cb non réaffecté, il faut transférer les infos de la résa dans la table des docs à ranger
$rqt = "insert into resa_ranger (resa_cb) values ('" . $cb_recup . "') ";
$res = pmb_mysql_query($rqt, $dbh);
}
}
return TRUE;
}
示例15: analysis_delete
function analysis_delete()
{
global $dbh;
global $pmb_synchro_rdf, $pmb_notice_img_folder_id;
//Suppression de la vignette de la notice si il y en a une d'uploadée
if ($pmb_notice_img_folder_id) {
$req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
$res = pmb_mysql_query($req, $dbh);
if (pmb_mysql_num_rows($res)) {
$rep = pmb_mysql_fetch_object($res);
$img = $rep->repertoire_path . "img_" . $this->analysis_id;
@unlink($img);
}
}
//synchro rdf
if ($pmb_synchro_rdf) {
$synchro_rdf = new synchro_rdf();
$synchro_rdf->delRdf($this->analysis_id, 0);
}
//elimination des docs numeriques
$req_explNum = "select explnum_id from explnum where explnum_notice=" . $this->analysis_id . " ";
$result_explNum = @pmb_mysql_query($req_explNum, $dbh);
while ($explNum = pmb_mysql_fetch_object($result_explNum)) {
$myExplNum = new explnum($explNum->explnum_id);
$myExplNum->delete();
}
// suppression des entrees dans les caddies
$query_caddie = "select caddie_id from caddie_content, caddie where type='NOTI' and object_id in ({$this->analysis_id}) and caddie_id=idcaddie ";
$result_caddie = @pmb_mysql_query($query_caddie, $dbh);
while ($cad = pmb_mysql_fetch_object($result_caddie)) {
$req_suppr_caddie = "delete from caddie_content where caddie_id = '{$cad->caddie_id}' and object_id in ({$this->analysis_id}) ";
@pmb_mysql_query($req_suppr_caddie, $dbh);
}
//elimination des champs persos
$p_perso = new parametres_perso("notices");
$p_perso->delete_values($this->analysis_id);
// on supprime l'entree dans la table 'analysis'
$requete = "DELETE FROM analysis WHERE analysis_notice=" . $this->analysis_id;
pmb_mysql_query($requete, $dbh);
$result = pmb_mysql_affected_rows($dbh);
// on supprime la notice du dépouillement
$requete = "DELETE FROM notices WHERE notice_id='" . $this->analysis_id . "' ";
pmb_mysql_query($requete, $dbh);
$result += pmb_mysql_affected_rows($dbh);
//suppression des droits d'acces user_notice
$requete = "delete from acces_res_1 where res_num=" . $this->analysis_id;
@pmb_mysql_query($requete, $dbh);
//suppression des droits d'acces empr_notice
$requete = "delete from acces_res_2 where res_num=" . $this->analysis_id;
@pmb_mysql_query($requete, $dbh);
// suppression des audits
audit::delete_audit(AUDIT_NOTICE, $this->analysis_id);
// suppression des categories
$rqt_del = "delete from notices_categories where notcateg_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($rqt_del, $dbh);
// suppression des responsabilités
$rqt_del = "delete from responsability where responsability_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($rqt_del, $dbh);
// suppression des liens
$rqt_del = "delete from notices_relations where num_notice='" . $this->analysis_id . "' OR linked_notice='" . $this->analysis_id . "'";
@pmb_mysql_query($rqt_del, $dbh);
// suppression des bannettes
$rqt_del = "delete from bannette_contenu where num_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($rqt_del, $dbh);
// suppression des tags
$rqt_del = "delete from tags where num_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($rqt_del, $dbh);
// suppression des avis
$rqt_del = "delete from avis where num_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($rqt_del, $dbh);
//suppression des langues
$query = "delete from notices_langues where num_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($query, $dbh);
// suppression index global
$query = "delete from notices_global_index where num_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($query, $dbh);
// suppression notices_mots_global_index
$query = "delete from notices_mots_global_index where id_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($query, $dbh);
// suppression notices_fields_global_index
$query = "delete from notices_fields_global_index where id_notice='" . $this->analysis_id . "' ";
@pmb_mysql_query($query, $dbh);
//Suppression de la reference a la notice dans la table suggestions
$query = "UPDATE suggestions set num_notice = 0 where num_notice=" . $this->analysis_id;
@pmb_mysql_query($query, $dbh);
//Suppression de la reference a la notice dans la table lignes_actes
$requete = "UPDATE lignes_actes set num_produit=0, type_ligne=0 where num_produit='" . $this->analysis_id . "' and type_ligne in ('1','5') ";
@pmb_mysql_query($requete, $dbh);
//Suppression de la référence de la source si exitante..
$query = "delete from notices_externes where num_notice=" . $this->analysis_id;
@pmb_mysql_query($query, $dbh);
//Suppression dans les listes de lecture partagées
$requete = "SELECT id_liste, notices_associees from opac_liste_lecture";
$res = pmb_mysql_query($requete, $dbh);
$id_tab = array();
while ($notices = pmb_mysql_fetch_object($res)) {
$id_tab = explode(',', $notices->notices_associees);
for ($i = 0; $i < sizeof($id_tab); $i++) {
if ($id_tab[$i] == $this->analysis_id) {
unset($id_tab[$i]);
//.........这里部分代码省略.........